Viewing file: 2552-05-19-1.0.02-processDefine.php (1.94 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";
$oCA = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
$oDA = new DefineAssessment($oCA);
//echo "method = ".$method;
//echo "<br> assid = ".$assid;
//echo "<br> defineid = ".$defineid;
//echo "<br> acadYear = ".$acadYear;
//echo "<br> semester = ".$semester;
//echo "<br> noAss = ".$noAss;
//echo "<br> startDate = ".$startDate;
//echo "<br> endDate = ".$endDate;
$oDA = new DefineAssessment($oCA);
$maxNoAss = $oDA->getMaxNoAssByAcadSemFlag($acadYear,$semester,$flag);
if($method=="add"){
//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=$flag;
$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->SearchByAcadSemNo($acadYear,$semester,$noAss);
$oDA->SearchByKey($defineid, $acadYear, $semester, $noAss);
$oDA->GetRecord();
//echo "<br> search = ".$oDA->defineid;
$oDA->Delete();
}
echo "<meta http-equiv='refresh' content='0; URL=addDefineTeacher.php'>";
//$oDA->Close();
//$oCA->Disconnect();
?>
|