محاضرات |
|
$ii=0;
$i = $NowYear+1;
$result = mysql_query("SELECT Category,CatID FROM CoursesCats Order By CatID") or die(mysql_error());
echo"
|
";
if ($CatID)
{
?>
|
إجمالي محاضرة |
/*if ( $Crss )
{
$form_action = "courses.php";
if ( $pg != 1 )
{
echo "\n";
echo "\n";
}
if ( ($pg-5) >= 1 )
{
echo "\n";
}
if ( $pg != $pgs )
{
echo "\n";
echo "\n";
}
if ( ($pg+5) <= $pgs )
{
echo "\n";
}
?>
}
*/
if ( ($ReqAdmin!='Y') && ($LCrsFull=='Y' || $LCrsPart=='Y') )
{
?>
لديك سماحية إضافة دورة في هذه الصفحة
if ($LCrsFull=='Y') echo "دون مراجعة"; else echo "بعد مراجعته";?>
من إدارة الموقع
|
إضافة دورة |
|
|
}
?>
رقم |
اسم المحاضرة
|
المدة ( يوم ) |
تاريخ التنفيذ
|
$CrsCntr = 0;
//$SQLSTART = $start-1;
$result = mysql_query("SELECT * FROM Courses WHERE subCatID=$subCatID AND CatID=$CatID AND $where AND Accepted='Y' Order By $Order ") or die(mysql_error());
while ($row = mysql_fetch_row($result))
{
$CrsCntr++;
$CatID = stripslashes($row[0]);
$Type = stripslashes($row[1]);
$Title = stripslashes($row[2]);
$Details = stripslashes($row[3]);
$UID = intval($row[4]);
$SDate = stripslashes($row[5]);
$EDate = stripslashes($row[6]);
$AllowCmnts = stripslashes($row[7]);
$ShowCmnts = stripslashes($row[8]);
$PublicCmnts = stripslashes($row[9]);
$Hits = intval($row[10]);
$Rating = stripslashes($row[11]);
$Votes = stripslashes($row[12]);
$Accepted = stripslashes($row[13]);
$CrsID = stripslashes($row[14]);
$subCatID = stripslashes($row[15]);
$resultic = mysql_query("SELECT Category FROM CoursesCats WHERE CatID='$CatID'") or die(mysql_error());
$rowic = mysql_fetch_row($resultic);
$ThCategory = stripslashes($rowic[0]);
$NowDate = date("Y-m-d",time());
if ($NowDate >= $SDate )
$Started = 1;
else
$Started = 0;
if ($NowDate >= $EDate )
$Fineshed = 1;
else
$Fineshed = 1;
$result1 = mysql_query("SELECT CUID FROM CoursesUsers WHERE CrsID='$CrsID' AND UID='$LUID' AND Inst='N'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$CrsStd = intval($row1[0]);
$result1 = mysql_query("SELECT CUID FROM CoursesUsers WHERE CrsID='$CrsID' AND UID='$LUID' AND Inst='Y'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$CrsInst = intval($row1[0]);
$DetailsLines = explode("\n",$Details);
$Details = '';
for ($kk=0;$kk<4;$kk++)
$Details .= $DetailsLines[$kk];
//$Details = nl2br($Details);
//$Details = mb_substr($Details,0,100);
if (!$UID)
$Submitter="مدير الموقع";
else
{
$result1 = mysql_query("SELECT Username,FirstName,LastName FROM Users WHERE UID='$UID'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
//$Submitter= " ".stripslashes($row1[0])." (".stripslashes($row1[1])." ".stripslashes($row1[2]).")";
$Submitter= " ".stripslashes($row1[0]);
}
$result1 = mysql_query("SELECT To_days( EDate ) - TO_DAYS( SDAte ) FROM Courses WHERE CrsID='$CrsID'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$Duration = intval($row1[0]) + 1;
$DateArr = explode(" ", $SDate);
list($Y,$M,$D)= explode("-",$DateArr[0]);
$SFinalDate = $D.'-'.$M.'-'.$Y;
if ( !@checkdate($M,$D,$Y) )
{
$SFinalDate = "(يتم تحديده لاحقاً)";
$Duration = "-";
}
$DateArr = explode(" ", $EDate);
list($Y,$M,$D)= explode("-",$DateArr[0]);
$EFinalDate = $D.'-'.$M.'-'.$Y;
if ( !@checkdate($M,$D,$Y) )
{
$SFinalDate = "(يتم تحديده لاحقاً)";
$Duration = "-";
}
$result1 = mysql_query("SELECT MIN(PID) FROM CoursesImgs WHERE CrsID='$CrsID'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$PID = intval($row1[0]);
$result1 = mysql_query("SELECT COUNT(*) FROM CoursesCmnts WHERE CrsID='$CrsID' AND Accepted='Y'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$Comments = intval($row1[0]);
$result1 = mysql_query("SELECT MAX(CmntID) FROM CoursesCmnts WHERE CrsID='$CrsID' AND Accepted='Y'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$MAXCmntID = intval($row1[0]);
$result1 = mysql_query("SELECT UID,Date FROM CoursesCmnts WHERE CmntID='$MAXCmntID'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$MAXCmntUID = intval($row1[0]);
$MAXCmntDate = $row1[1];
if (!$MAXCmntUID)
$MAXCmntSub="مدير الموقع";
else
{
$result1 = mysql_query("SELECT Username,FirstName,LastName FROM Users WHERE UID='$MAXCmntUID'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$MAXCmntSub= " ".stripslashes($row1[0]);
}
$MAXCmntDateArr = explode(" ", $MAXCmntDate);
list($Y,$M,$D)= explode("-",$MAXCmntDateArr[0]);
$MAXCmntDate = $D.'-'.$M.'-'.$Y;
$result1 = mysql_query("SELECT COUNT(*) FROM CoursesUsers WHERE CrsID='$CrsID' AND Inst='Y' AND Accepted='Y'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$Insts = intval($row1[0]);
$result1 = mysql_query("SELECT COUNT(*) FROM CoursesUsers WHERE CrsID='$CrsID' AND Inst='N' AND Accepted='Y'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$Stds = intval($row1[0]);
$result1 = mysql_query("SELECT COUNT(*) FROM CoursesCmnts WHERE CrsID='$CrsID' AND Accepted='N'") or die(mysql_error());
$row1 = mysql_fetch_row($result1);
$Comments4V = intval($row1[0]);
if ( $SFinalDate == "(يتم تحديده لاحقاً)" OR $SDate >= $NowDate )
$tbl_rslt_nd .= "
$CrsCntr |
|
$Duration | $SFinalDate | ";
else
$tbl_rslt .= "
$CrsCntr |
|
$Duration | $SFinalDate | ";
}
$tbl_rslt = $tbl_rslt_nd.$tbl_rslt;
echo $tbl_rslt;
?>
|
|
}
?>
|