Viewing file: processProposeDoc.php (5.78 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 "../link/function.php"; include_once "../link/functionshow.php"; include_once "../class/clsDocType.php"; include_once "../class/clsDocattatchesTmp.php"; include_once "../class/clsDocuments.php"; include_once "../class/clsRunningDoc.php"; include_once "../class/clsDocattatches.php"; include_once "../class/clsDocReceiveSend.php"; include_once "../class/clsDocForSign.php"; include_once "../class/clsDocLineConfig.php"; include_once "../class/clsNoticeEditDoc.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDt = new doctype($oC); $oDt1 = new doctype($oC); $oDtmp = new DocattatchesTmp($oC); $oDatt = new Docattatches($oC); $oDoc = new Documents($oC); $oRd = new runningdoc($oC); $oRd1 = new runningdoc($oC); $oRs = new DocReceiveSend($oC); $oRs1 = new DocReceiveSend($oC); $oRs2 = new DocReceiveSend($oC); $oRs3 = new DocReceiveSend($oC); $oDfs = new DocForSign($oC); $oDlc = new DocLineConfig($oC); $oNe = new NoticeEditDoc($oC);
if($method=="addpropose"){ $flagCommit = true; $oC->BeginTrans(); $oDoc->SearchByKey($DocID); if($oDoc->GetRecord()=="1"){ if($oDoc->DsID=="1"){ //can propose case normal $oDoc->Edit(); $oDoc->DsID="2"; $flagCommit = $oDoc->Save(); $doit=1; } } if($doit=="1"){ //can propose case normal $oRs->SearchByKey($DrsID); $oRs->GetRecord(); $oRs->Edit(); $oRs->DrsSendDate=getNowDateTh()." ".date('H:i:s'); $oRs->DrsSendDlcID=$DlcPs; $flagCommit = $oRs->Save(); //---------------add DocReceiveSend $oRs1->AddNew(); $oRs1->DrsID=$oRs1->GetNextCode(); $oRs1->DocID=$DocID; $oRs1->DlcID=$DlcPs; $oRs1->DsID=2; $oRs1->PtID=$oRs->PtID; $oRs1->DrsDocTypeNo=$oRs->DrsDocTypeNo; $oRs1->DrsReceiveDate=$oRs->DrsSendDate; //$oRs1->DrsReceivePersonId=$DlcPsId; $oRs1->DrsDocDueDate=$oRs->DrsDocDueDate; $oRs1->DrsDlcIDCreate=$DlcIDlogin; $oRs1->DrsPsIDCreate=$personId; $oRs1->DrsPropose=$DrsPropose; $oRs1->DrsFromDrsID=$oRs->DrsID; //echo "DrsFromDrsID=".$oRs1->DrsFromDrsID; $oRs1->DocGroup=$oRs->DocGroup; $oRs1->AnID=$oRs->AnID; $oRs1->DrsstartDatePost=$oRs->DrsstartDatePost; $oRs1->DrsendDatePost=$oRs->DrsendDatePost; $flagCommit = $oRs1->Save(); if($flagCommit) $oC->CommitTrans(); else $oC->RollbackTrans(); } echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?page_id2=$page_id2&RsID=$RsID&DtID=$DtID&searchpredocdate=$searchpredocdate&selectpredocdatevalue=$selectpredocdatevalue&folderstaff2=$folderstaff2&forfolderstaff2=$forfolderstaff2&selectdocdatevalue=3'>"; }else if($method=="addByPass"){ $flagCommit = true; $oC->BeginTrans(); $oDoc->SearchByKey($DocID);
if($oDoc->GetRecord()=="1"){ if($oDoc->DsID=="1"){ //can propose case normal $oDoc->Edit(); $oDoc->DsID="3"; $flagCommit = $oDoc->Save(); $doit=1; } } if($doit==1){ $oRs->SearchByKey($DrsID); $oRs->GetRecord(); $oRs->Edit(); $oRs->DrsSendDate=getNowDateTh()." ".date('H:i:s'); //echo "DrsSendDate=".$oRs->DrsSendDate; $oRs->DrsSendPersonId=$DlcPsId; $oRs->DrsSendDlcID=$DlcPs; $oRs->DrsByPass="Y"; $oRs->DrsByPassPropose=$DrsPropose; $flagCommit = $oRs->Save();
//---------------add DocReceiveSend $oRs1->AddNew(); $oRs1->DrsID=$oRs1->GetNextCode(); $oRs1->DocID=$DocID; $oRs1->DlcID=$DlcIDlogin; $oRs1->DsID=3; $oRs1->PtID=$oRs->PtID; $oRs1->DrsDocTypeNo=$oRs->DrsDocTypeNo; $oRs1->DrsReceiveDate=$oRs->DrsSendDate; $oRs1->DrsReceivePersonId=$personId; $oRs1->DrsDocDueDate=$oRs->DrsDocDueDate; $oRs1->DrsDlcIDCreate=$DlcIDlogin; $oRs1->DrsPsIDCreate=$personId; $oRs1->DrsFromDrsID=$oRs->DrsID; $oRs1->DocGroup=$oRs->DocGroup; $oRs1->AnID=$oRs->AnID; $oRs1->DrsstartDatePost=$oRs->DrsstartDatePost; $oRs1->DrsendDatePost=$oRs->DrsendDatePost; $flagCommit = $oRs1->Save();
if($DocForSign==1 && $DocPID!="0"){ $oDlc->SearchByKey($DlcIDlogin); $oDlc->GetRecord(); $oRs2->SearchDeptSendDocforSign($oDoc->DocID); $oRs2->GetRecord(); $oRs3->SearchByKey($oRs2->DrsFromDrsID); $oRs3->GetRecord(); $oDfs->AddNew(); $oDfs->dfID=$oDfs->GetNextCode(); $oDfs->DocID=$oRs3->DocID; $oDfs->DlcID=$oRs2->DrsDlcIDCreate; $oDfs->DocGroup=$oRs3->DocGroup; $oDfs->DlcIDsign=$DlcIDlogin; $oDfs->DeptSign=$oDlc->deptId; $oDfs->Save(); } if($flagCommit){ $oC->CommitTrans(); if($DocForSign==1 && $DocPID!="0"){ echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?page_id2=$page_id2&DtID=$oDoc->DtID&RsID=$oDoc->RsID&selectdocdatevalue=3'>"; }else{ if($oDoc->RsID!='2'){ $fn="showSendDoc.php"; }else{ $fn="showSendDocSR.php"; } echo "<meta http-equiv='refresh' content='0; URL=$fn?DocID=$DocID&DrsID=$oRs1->DrsID'>"; } }else{ $oC->RollbackTrans(); echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?page_id2=$page_id2'>"; } }else{ echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?page_id2=$page_id2&DtID=$oDoc->DtID&RsID=$oDoc->RsID'>"; } }else if($method=="noticeEditDoc"){ $oNe->SearchNoticeEditDocStatusneID($DocID,$DrsID,$neID); $oNe->GetRecord(); if($oNe->statusDoc=="1"){ //can edited case normal $oNe->Edit(); $oNe->statusDoc="2"; $oNe->DocSendDate=getNowDateTh()." ".date('H:i:s'); $oNe->DlcIDSend=$dlcidsend; $oNe->PsSend=$pssend; $oNe->Save(); } echo "<meta http-equiv='refresh' content='0; URL=showRegisDoc.php?page_id2=$page_id2&DtID=$DtID&RsID=$RsID&DocID=$DocID&DrsID=$DrsID&searchpredocdate=$searchpredocdate&selectpredocdatevalue=$selectpredocdatevalue&folderstaff2=$folderstaff2&forfolderstaff2=$forfolderstaff2'>"; } ?>
|