Viewing file: 2553-06-29-1.1.02-processDefineAllCourse.php (1.73 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "../global1.php";
include_once "../../class/clsDB.php";
include_once "../../class/clsConnection.php";
include_once "../class/clsDefineAssessment.php";
include_once "../link/function.php";
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
$oDA = new DefineAssessment($oC);
if($method=="add"){
$maxNoAss0 = $oDA->getMaxNoAssByAcadSemFlag($acadYear,$semester,0);
$maxNoAss5 = $oDA->getMaxNoAssByAcadSemFlag($acadYear,$semester,5);
if($maxNoAss0 < $maxNoAss5){
$maxNoAss = $maxNoAss5;
}else if($maxNoAss0 > $maxNoAss5){
$maxNoAss = $maxNoAss0;
}
//echo "<br> maxNoAss = ".$maxNoAss;
$oDA->AddNew();
$oDA->defineid=$defineid;
$oDA->assid=$assid;
$oDA->startDate=splitDateForm($startDate,"/");
$oDA->endDate=splitDateForm($endDate,"/");
$oDA->acadYear=$acadYear;
$oDA->semester=$semester;
$oDA->noAss=$maxNoAss + 1;
$oDA->flag=$selectFlag;
$oDA->closeDate=splitDateForm($closeDate,"/");
$oDA->isPreAssess=0;
$oDA->Save();
}else if($method=="edit"){
$oDA->SearchByKey($defineid, $acadYear, $semester, $noAss);
$oDA->GetRecord();
$oDA->Edit();
$oDA->defineid=$defineid;
$oDA->assid=$assid;
$oDA->startDate=splitDateForm($startDate,"/");
$oDA->endDate=splitDateForm($endDate,"/");
$oDA->acadYear=$acadYear;
$oDA->semester=$semester;
$oDA->noAss=$noAss;
$oDA->flag=$flag;
$oDA->closeDate=splitDateForm($closeDate,"/");
$oDA->isPreAssess=0;
$oDA->Save();
}else if($method=="delete"){
$oDA->SearchByKey($defineid, $acadYear, $semester, $noAss);
$oDA->GetRecord();
$oDA->Delete();
}
echo "<meta http-equiv='refresh' content='0; URL=addDefineAllCourse.php'>";
//$oDA->Close();
//$oC->Disconnect();
?>
|