Viewing file: esa_processDefineProject.php (2.59 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
showHeader();
include_once "../global1.php";
include_once "../../class/clsConnection.php";
include_once "../../class/clsDB.php";
include_once "../class/clsDefineAssessment.php";
include_once "../link/function.php";
include_once "../class/clsEsa_HoldProject.php";
$oCA = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
$oDA = new DefineAssessment($oCA);
$oHPj = new HoldProject($oCA);
if($link==main){
if($menu == 'linkBackMenu'){
echo "<meta http-equiv='refresh' content='0; URL=index.php?mm=1'>";
}else{
echo "<meta http-equiv='refresh' content='0; URL=esa_addDefineProject.php'>";
}
}else{
$maxNoAss = $oDA->getMaxNoAssByAcadSemFlag($acadYear,$semester,10);
if($method=="add"){
$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=10;
$oDA->closeDate=splitDateForm($closeDate,"/");
$oDA->isPreAssess=0;
$oDA->Save();
foreach($pj as $v){
$oHPj->AddNew();
$oHPj->defineid = $oDA->defineid;
$oHPj->pjId = $v;
$oHPj->Save();
}
}elseif($method=='edit'){
$oDA->SearchByDefineid($defineid);
$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=$oDA->noAss;
$oDA->flag=$oDA->flag;
$oDA->closeDate=splitDateForm($closeDate,"/");
$oDA->isPreAssess=$oDA->isPreAssess;
$oDA->Save();
$oHPj->RSByDefineid($defineid);
while($oHPj->GetRecord()){
$oHPj->DeleteByDefineid();
}
foreach($pj as $v){
$oHPj->AddNew();
$oHPj->defineid = $defineid;
$oHPj->pjId = $v;
$oHPj->Save();
}
}else if($method=="delete"){
$oDA->SearchByDefineid($defineid);
$oDA->GetRecord();
$oDA->Delete();
$oHPj->RSByDefineid($defineid);
while($oHPj->GetRecord()){
$oHPj->DeleteByDefineid();
}
}
$oHPj->Close();
$oDA->Close();
echo "<meta http-equiv='refresh' content='0; URL=esa_addDefineProject.php'>";
}
$oDA->Close();
$oCA->Disconnect();
?>
|