Viewing file: processRunningDeptDoc.php (8.01 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once("../../class/clsConnection.php"); include_once("../../class/clsDB.php"); include_once "../global.php"; include_once "../class/clsTable.php"; include_once "../class/clsDepartment.php"; include_once "../class/clsPerson.php"; include_once "../link/function.php"; include_once "../class/clsRunningDoc.php"; include_once "../class/clsDocType.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDP = new Department($oC); $oDP2 = new Department($oC); $oDP3 = new Department($oC); $oPS = new person($oC); $oDt = new doctype($oC); $oRd = new runningdoc($oC);
if($method=="setrunningDeptDoc"){
$oDt->RSdoctypeDtAll(); while($oDt->GetRecord()){ $r1=''; $re1=''; $s1=''; if($oDt->DtP=="0"){ $oDP->SearchBydeptDateDocGroup2($oDP->SearchMaxDocGroup()); while($oDP->GetRecord()){ $oRd->SearchBydocGroupDtIDDeptdocNoMixN($docGroup,$oDt->DtID,$oDP->deptId); //cho '--------------'.$oDt->DtID.'<br>'; if($oRd->GetRecord()=="0"){ $oRd->AddNew(); $oRd->rID=$oRd->GetNextCode(); //echo "rID=".$oRd->rID."<br>"; $oRd->DtID=$oDt->DtID; $oRd->deptId=$oDP->deptId; if(th2a($receiveNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($receiveNoStart[$oDt->DtID][$oDP->deptId])==''){ $r1=1; }else{ $r1=th2a($receiveNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->receiveNoStart =$r1; //echo "receiveNoStart=".$oRd->receiveNoStart."<br>"; $oRd->receiveNo=$oRd->receiveNo; //echo "receiveNo=".$oRd->receiveNo."<br>"; if(th2a($sendNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($sendNoStart[$oDt->DtID][$oDP->deptId])==''){ $s1=1; }else{ $s1=th2a($sendNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->sendNoStart =$s1; //echo "sendNoStart=".$oRd->sendNoStart."<br>"; $oRd->sendNo=$oRd->sendNo; //echo "sendNo=".$oRd->sendNo."<br>"; if(th2a($regisNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($regisNoStart[$oDt->DtID][$oDP->deptId])==''){ $re1=1; }else{ $re1=th2a($regisNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->regisNoStart =$re1; //echo "regisNoStart=".$oRd->regisNoStart."<br>"; $oRd->regisNo=$oRd->regisNo; $oRd->docGroup=$docGroup; //echo "docGroup=".$oRd->docGroup."<br>"; $oRd->confirm=$oRd->confirm; //echo "confirm=".$oRd->confirm."<br>"; $oRd->docNoMix='N'; //echo "docNoMix=".$oRd->docNoMix."<br>"; $oRd->Save(); }else{ //echo "edit"; $oRd->Edit(); $oRd->rID=$oRd->rID; //echo "rID=".$oRd->rID."<br>"; $oRd->DtID=$oRd->DtID; //echo "DtID=".$oRd->DtID."<br>"; $oRd->deptId=$oRd->deptId; //echo "deptId=".$oRd->deptId."<br>"; if(th2a($receiveNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($receiveNoStart[$oDt->DtID][$oDP->deptId])==''){ $r1=1; }else{ $r1=th2a($receiveNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->receiveNoStart =$r1; //echo "receiveNoStart=".$oRd->receiveNoStart."<br>"; $oRd->receiveNo=$oRd->receiveNo; //echo "receiveNo=".$oRd->receiveNo."<br>"; if(th2a($sendNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($sendNoStart[$oDt->DtID][$oDP->deptId])==''){ $s1=1; }else{ $s1=th2a($sendNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->sendNoStart =$s1; //echo "sendNoStart=".$oRd->sendNoStart."<br>"; $oRd->sendNo=$oRd->sendNo; //echo "sendNo=".$oRd->sendNo."<br>"; if(th2a($regisNoStart[$oDt->DtID][$oDP->deptId])=='0' || th2a($regisNoStart[$oDt->DtID][$oDP->deptId])==''){ $re1=1; }else{ $re1=th2a($regisNoStart[$oDt->DtID][$oDP->deptId]); } $oRd->regisNoStart =$re1; //echo "regisNoStart=".$oRd->regisNoStart."<br>"; $oRd->regisNo=$oRd->regisNo; $oRd->docGroup=$oRd->docGroup; //echo "docGroup=".$oRd->docGroup."<br>"; $oRd->confirm=$oRd->confirm; //echo "confirm=".$oRd->confirm."<br>"; $oRd->docNoMix='N'; //echo "docNoMix=".$oRd->docNoMix."<br>";
$oRd->Save(); } } //while dept } //running doc } ?> <script language="JavaScript"> parent.location.href ="runningDeptDoc.php?s=1"; </script> <? }else if($method=="confirm"){ //method = confirm $oRd->SearchBydocGroupNoRunAll($docGroup); while($oRd->GetRecord()){ //echo "confirm"; $oRd->Edit(); $oRd->rID=$oRd->rID; //echo "rID=".$oRd->rID."<br>"; $oRd->DtID=$oRd->DtID; //echo "DtID=".$oRd->DtID."<br>"; $oRd->deptId=$oRd->deptId; //echo "deptId=".$oRd->deptId."<br>"; $oRd->receiveNoStart =$oRd->receiveNoStart; //echo "receiveNoStart=".$oRd->receiveNoStart."<br>"; $oRd->receiveNo=$oRd->receiveNo; //echo "receiveNo=".$oRd->receiveNo."<br>"; $oRd->sendNoStart =$oRd->sendNoStart; //echo "sendNoStart=".$oRd->sendNoStart."<br>"; $oRd->sendNo=$oRd->sendNo; //echo "sendNo=".$oRd->sendNo."<br>"; $oRd->regisNoStart =$oRd->regisNoStart; //echo "regisNoStart=".$oRd->regisNoStart."<br>"; $oRd->regisNo=$oRd->regisNo; //echo "regisNo=".$oRd->regisNo."<br>"; $oRd->docGroup=$oRd->docGroup; //echo "docGroup=".$oRd->docGroup."<br>"; $oRd->confirm="Y"; //echo "confirm=".$oRd->confirm."<br>"; $oRd->docNoMix='N'; //echo "docNoMix=".$oRd->docNoMix."<br>"; $oRd->Save(); } ?> <script language="JavaScript"> parent.location.href ="runningDeptDoc.php?c=1"; </script> <? }else if($method=="editsetrunningDeptDoc"){ $oDt->RSdoctypeDtAll(); while($oDt->GetRecord()){ if($oDt->DtP=="0"){ $oDP->SearchBydeptDateDocGroup($oDP->SearchMaxDocGroup()); while($oDP->GetRecord()){ $oRd->SearchBydocGroupDtIDDeptdocNoMixN($docGroup,$oDt->DtID,$oDP->deptId); if($oRd->GetRecord()=="0"){ $oRd->AddNew(); $oRd->rID=$oRd->GetNextCode(); //echo "rID=".$oRd->rID."<br>"; $oRd->DtID=$oDt->DtID; $oRd->deptId=$oDP->deptId; $oRd->receiveNoStart =$receiveNoStart[$oDt->DtID][$oDP->deptId]; //echo "receiveNoStart=".$oRd->receiveNoStart."<br>"; $oRd->receiveNo=$receiveNo[$oDt->DtID][$oDP->deptId]; //echo "receiveNo=".$oRd->receiveNo."<br>"; $oRd->sendNoStart =$sendNoStart[$oDt->DtID][$oDP->deptId]; //echo "sendNoStart=".$oRd->sendNoStart."<br>"; $oRd->sendNo=$sendNo[$oDt->DtID][$oDP->deptId]; //echo "sendNo=".$oRd->sendNo."<br>"; $oRd->regisNoStart =$regisNoStart[$oDt->DtID][$oDP->deptId]; //echo "regisNoStart=".$oRd->regisNoStart."<br>"; $oRd->regisNo=$regisNo[$oDt->DtID][$oDP->deptId]; //echo "regisNo=".$oRd->regisNo."<br>"; $oRd->docGroup=$docGroup; //echo "docGroup=".$oRd->docGroup."<br>"; $oRd->confirm=$oRd->confirm; //echo "confirm=".$oRd->confirm."<br>"; $oRd->docNoMix='N'; //echo "docNoMix=".$oRd->docNoMix."<br>"; $oRd->Save(); }else{ //echo "edit"; $oRd->Edit(); $oRd->rID=$oRd->rID; //echo "rID=".$oRd->rID."<br>"; $oRd->DtID=$oRd->DtID; //echo "DtID=".$oRd->DtID."<br>"; $oRd->deptId=$oRd->deptId; //echo "deptId=".$oRd->deptId."<br>"; $oRd->receiveNoStart =$receiveNoStart[$oDt->DtID][$oDP->deptId]; //echo "receiveNoStart=".$oRd->receiveNoStart."<br>"; $oRd->receiveNo=$receiveNo[$oDt->DtID][$oDP->deptId]; //echo "receiveNo=".$oRd->receiveNo."<br>"; $oRd->sendNoStart =$sendNoStart[$oDt->DtID][$oDP->deptId]; //echo "sendNoStart=".$oRd->sendNoStart."<br>"; $oRd->sendNo=$sendNo[$oDt->DtID][$oDP->deptId]; //echo "sendNo=".$oRd->sendNo."<br>"; $oRd->regisNoStart =$regisNoStart[$oDt->DtID][$oDP->deptId]; //echo "regisNoStart=".$oRd->regisNoStart."<br>"; $oRd->regisNo=$regisNo[$oDt->DtID][$oDP->deptId]; //echo "regisNo=".$oRd->regisNo."<br>"; $oRd->docGroup=$oRd->docGroup; //echo "docGroup=".$oRd->docGroup."<br>"; $oRd->confirm=$oRd->confirm; //echo "confirm=".$oRd->confirm."<br>"; $oRd->docNoMix='N'; //echo "docNoMix=".$oRd->docNoMix."<br>"; $oRd->Save(); } } //while dept } //running doc }
?> <script language="JavaScript"> parent.location.href ="runningDeptDoc.php?s=1"; </script> <? }
?>
|