Viewing file: processProposeDoc.php (11.41 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";
$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);
if($method=="addpropose"){
$flagCommit = true;
$oC->BeginTrans();
$oDoc->SearchByKey($DocID);
if($oDoc->GetRecord()=="1"){
$oDoc->Edit();
$oDoc->DocID=$oDoc->DocID;
$oDoc->DocPID=$oDoc->DocPID;
$oDoc->DlcID=$oDoc->DlcID;
$oDoc->PtID=$oDoc->PtID;
$oDoc->DtID=$oDoc->DtID;
$oDoc->DslID=$oDoc->DslID;
$oDoc->DclID=$oDoc->DclID;
$oDoc->DsID="2";
$oDoc->RsID=$oDoc->RsID;
$oDoc->DocDateCreate=$oDoc->DocDateCreate;
$oDoc->DocUserCreate=$oDoc->DocUserCreate;
$oDoc->DocTypeNo=$oDoc->DocTypeNo;
$oDoc->DocDate=$oDoc->DocDate;
$oDoc->DocNo=$oDoc->DocNo;
$oDoc->DocSubject=$oDoc->DocSubject;
$oDoc->DocFrom=$oDoc->DocFrom;
$oDoc->DocTo=$oDoc->DocTo;
$oDoc->DocShortDesc=$oDoc->DocShortDesc;
$oDoc->DocSpeedLevelDueDate=$oDoc->DocSpeedLevelDueDate;
$oDoc->DocStart=$oDoc->DocStart;
$oDoc->DocFinish=$oDoc->DocFinish;
$oDoc->DocGroup=$oDoc->DocGroup;
$oDoc->DocRef=$oDoc->DocRef;
$oDoc->DocCircular=$oDoc->DocCircular;
$oDoc->DocfCir=$oDoc->DocfCir;
$oDoc->DocOther=$oDoc->DocOther;
$oDoc->CertificatePs=$oDoc->CertificatePs;
$oDoc->fDelete=$oDoc->fDelete;
$oDoc->endDoc=$oDoc->endDoc;
$oDoc->sendToPs=$oDoc->sendToPs;
$oDoc->AnID=$oDoc->AnID;
$oDoc->DocRefAns=$oDoc->DocRefAns;
$oDoc->DocRefAnsID=$oDoc->DocRefAnsID;
$oDoc->DocstartDatePost=$oDoc->DocstartDatePost;
$oDoc->DocendDatePost=$oDoc->DocendDatePost;
$oDoc->DocMainPost=$oDoc->DocMainPost;
$oDoc->DocGetPost=$oDoc->DocGetPost;
$oDoc->DocShowInOut=$oDoc->DocShowInOut;
$oDoc->DocDateGetPost=$oDoc->DocDateGetPost;
$oDoc->useMainDocNo=$oDoc->useMainDocNo;
$oDoc->DocforSign=$oDoc->DocforSign;
$flagCommit = $oDoc->Save();
}
//$oRs->SearchByDlcIDDocGroupDocId($DlcID,$DocGroup,$DocID);
$oRs->SearchByKey($DrsID);
$oRs->GetRecord();
$oRs->Edit();
$oRs->DrsID=$oRs->DrsID;
//echo "DrsID=".$oRs->DrsID."<br>";
$oRs->DocID=$oRs->DocID;
$oRs->DlcID=$oRs->DlcID;
$oRs->DsID=$oRs->DsID;
$oRs->personId=$oRs->personId;
$oRs->PtID=$oRs->PtID;
$oRs->DrsDocTypeNo=$oRs->DrsDocTypeNo;
$oRs->DrsReceiveDate=$oRs->DrsReceiveDate;
$oRs->DrsReceivePersonId=$oRs->DrsReceivePersonId;
$oRs->DrsSendDate=getNowDateTh()." ".date('H:i:s');
//echo "DrsSendDate=".$oRs->DrsSendDate;
//$oRs->DrsSendPersonId=$DlcPsId;
$oRs->DrsSendPersonId=$oRs->DrsSendPersonId;
$oRs->DrsSendDlcID=$DlcPs;
$oRs->DrsDocDueDate=$oRs->DrsDocDueDate;
$oRs->DrsDlcIDCreate=$oRs->DrsDlcIDCreate;
$oRs->DrsPsIDCreate=$oRs->DrsPsIDCreate;
$oRs->DrsPropose=$oRs->DrsPropose;
$oRs->DrsSign=$oRs->DrsSign;
$oRs->DrsFromDrsID=$oRs->DrsFromDrsID;
$oRs->DocGroup=$oRs->DocGroup;
$oRs->DrsflagRead=$oRs->DrsflagRead;
//$DocGroup=$oRs->DocGroup;
$oRs->DrsByPass=$oRs->DrsByPass;
$oRs->DrsSend=$oRs->DrsSend;
$oRs->DrsSendToPs=$oRs->DrsSendToPs;
$oRs->DrsDelete=$oRs->DrsDelete;
$oRs->DrsMainPs=$oRs->DrsMainPs;
$oRs->AnID=$oRs->AnID;
$oRs->DrsDocReceiveDate=$oRs->DrsDocReceiveDate;
$oRs->DocRefAnsDate=$oRs->DocRefAnsDate;
$oRs->DrsSendDocNew=$oRs->DrsSendDocNew;
$oRs->DrsInboxID=$oRs->DrsInboxID;
$oRs->DrsstartDatePost=$oRs->DrsstartDatePost;
$oRs->DrsendDatePost=$oRs->DrsendDatePost;
$oRs->DrsSendBack=$oRs->DrsSendBack;
$oRs->DrsSendBackDlcID=$oRs->DrsSendBackDlcID;
$oRs->DrsfSendBack=$oRs->DrsfSendBack;
$flagCommit = $oRs->Save();
//---------------add DocReceiveSend
$oRs1->AddNew();
$oRs1->DrsID=$oRs1->GetNextCode();
$oRs1->DocID=$DocID;
$oRs1->DlcID=$DlcPs;
$oRs1->DsID=2;
$oRs1->personId=$oRs1->personId;
$oRs1->PtID=$oRs->PtID;
$oRs1->DrsDocTypeNo=$oRs->DrsDocTypeNo;
$oRs1->DrsReceiveDate=$oRs->DrsSendDate;
//$oRs1->DrsReceivePersonId=$DlcPsId;
$oRs1->DrsReceivePersonId=$oRs1->DrsReceivePersonId;
$oRs1->DrsSendDate=$oRs1->DrsSendDate;
$oRs1->DrsSendPersonId=$oRs1->DrsSendPersonId;
$oRs1->DrsSendDlcID=$oRs1->DrsSendDlcID;
$oRs1->DrsDocDueDate=$oRs->DrsDocDueDate;
$oRs1->DrsDlcIDCreate=$DlcIDlogin;
$oRs1->DrsPsIDCreate=$personId;
$oRs1->DrsPropose=$DrsPropose;
$oRs1->DrsSign=$oRs1->DrsSign;
$oRs1->DrsFromDrsID=$oRs->DrsID;
//echo "DrsFromDrsID=".$oRs1->DrsFromDrsID;
$oRs1->DocGroup=$oRs->DocGroup;
$oRs1->DrsflagRead=$oRs1->DrsflagRead;
$oRs1->DrsByPass=$oRs1->DrsByPass;
$oRs1->DrsSend=$oRs1->DrsSend;
$oRs1->DrsSendToPs=$oRs1->DrsSendToPs;
$oRs1->DrsDelete=$oRs1->DrsDelete;
$oRs1->DrsMainPs=$oRs1->DrsMainPs;
$oRs1->AnID=$oRs->AnID;
$oRs1->DrsDocReceiveDate=$oRs1->DrsDocReceiveDate;
$oRs1->DocRefAnsDate=$oRs1->DocRefAnsDate;
$oRs1->DrsSendDocNew=$oRs1->DrsSendDocNew;
$oRs1->DrsInboxID=$oRs1->DrsInboxID;
$oRs1->DrsstartDatePost=$oRs->DrsstartDatePost;
$oRs1->DrsendDatePost=$oRs->DrsendDatePost;
$oRs1->DrsSendBack=$oRs1->DrsSendBack;
$oRs1->DrsSendBackDlcID=$oRs1->DrsSendBackDlcID;
$oRs1->DrsfSendBack=$oRs1->DrsfSendBack;
$flagCommit = $oRs1->Save();
if($flagCommit)
$oC->CommitTrans();
else
$oC->RollbackTrans();
echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?RsID=$RsID&DtID=$DtID'>";
}else if($method=="addByPass"){
$flagCommit = true;
$oC->BeginTrans();
$oDoc->SearchByKey($DocID);
if($oDoc->GetRecord()=="1"){
$oDoc->Edit();
$oDoc->DocID=$oDoc->DocID;
$oDoc->DocPID=$oDoc->DocPID;
$oDoc->DlcID=$oDoc->DlcID;
$oDoc->PtID=$oDoc->PtID;
$oDoc->DtID=$oDoc->DtID;
$oDoc->DslID=$oDoc->DslID;
$oDoc->DclID=$oDoc->DclID;
$oDoc->DsID="3";
$oDoc->RsID=$oDoc->RsID;
$oDoc->DocDateCreate=$oDoc->DocDateCreate;
$oDoc->DocUserCreate=$oDoc->DocUserCreate;
$oDoc->DocTypeNo=$oDoc->DocTypeNo;
$oDoc->DocDate=$oDoc->DocDate;
$oDoc->DocNo=$oDoc->DocNo;
$oDoc->DocSubject=$oDoc->DocSubject;
$oDoc->DocFrom=$oDoc->DocFrom;
$oDoc->DocTo=$oDoc->DocTo;
$oDoc->DocShortDesc=$oDoc->DocShortDesc;
$oDoc->DocSpeedLevelDueDate=$oDoc->DocSpeedLevelDueDate;
$oDoc->DocStart=$oDoc->DocStart;
$oDoc->DocFinish=$oDoc->DocFinish;
$oDoc->DocGroup=$oDoc->DocGroup;
$oDoc->DocRef=$oDoc->DocRef;
$oDoc->DocCircular=$oDoc->DocCircular;
$oDoc->DocfCir=$oDoc->DocfCir;
$oDoc->DocOther=$oDoc->DocOther;
$oDoc->CertificatePs=$oDoc->CertificatePs;
$oDoc->fDelete=$oDoc->fDelete;
$oDoc->endDoc=$oDoc->endDoc;
$oDoc->sendToPs=$oDoc->sendToPs;
$oDoc->AnID=$oDoc->AnID;
$oDoc->DocRefAns=$oDoc->DocRefAns;
$oDoc->DocRefAnsID=$oDoc->DocRefAnsID;
$oDoc->DocstartDatePost=$oDoc->DocstartDatePost;
$oDoc->DocendDatePost=$oDoc->DocendDatePost;
$oDoc->DocMainPost=$oDoc->DocMainPost;
$oDoc->DocGetPost=$oDoc->DocGetPost;
$oDoc->DocShowInOut=$oDoc->DocShowInOut;
$oDoc->DocDateGetPost=$oDoc->DocDateGetPost;
$oDoc->useMainDocNo=$oDoc->useMainDocNo;
$oDoc->DocforSign=$oDoc->DocforSign;
$flagCommit = $oDoc->Save();
}
$oRs->SearchByKey($DrsID);
$oRs->GetRecord();
$oRs->Edit();
$oRs->DrsID=$oRs->DrsID;
//echo "DrsID=".$oRs->DrsID."<br>";
$oRs->DocID=$oRs->DocID;
$oRs->DlcID=$oRs->DlcID;
$oRs->DsID=$oRs->DsID;
$oRs->personId=$oRs->personId;
$oRs->PtID=$oRs->PtID;
$oRs->DrsDocTypeNo=$oRs->DrsDocTypeNo;
$oRs->DrsReceiveDate=$oRs->DrsReceiveDate;
$oRs->DrsReceivePersonId=$oRs->DrsReceivePersonId;
$oRs->DrsSendDate=getNowDateTh()." ".date('H:i:s');
//echo "DrsSendDate=".$oRs->DrsSendDate;
$oRs->DrsSendPersonId=$DlcPsId;
$oRs->DrsSendDlcID=$DlcPs;
$oRs->DrsDocDueDate=$oRs->DrsDocDueDate;
$oRs->DrsDlcIDCreate=$oRs->DrsDlcIDCreate;
$oRs->DrsPsIDCreate=$oRs->DrsPsIDCreate;
$oRs->DrsPropose=$oRs->DrsPropose;
$oRs->DrsSign=$oRs->DrsSign;
$oRs->DrsFromDrsID=$oRs->DrsFromDrsID;
$oRs->DocGroup=$oRs->DocGroup;
$oRs->DrsflagRead=$oRs->DrsflagRead;
//$DocGroup=$oRs->DocGroup;
$oRs->DrsByPass="Y";
$oRs->DrsSend=$oRs->DrsSend;
$oRs->DrsSendToPs=$oRs->DrsSendToPs;
$oRs->DrsDelete=$oRs->DrsDelete;
$oRs->DrsMainPs=$oRs->DrsMainPs;
$oRs->AnID=$oRs->AnID;
$oRs->DrsDocReceiveDate=$oRs->DrsDocReceiveDate;
$oRs->DocRefAnsDate=$oRs->DocRefAnsDate;
$oRs->DrsSendDocNew=$oRs->DrsSendDocNew;
$oRs->DrsInboxID=$oRs->DrsInboxID;
$oRs->DrsstartDatePost=$oRs->DrsstartDatePost;
$oRs->DrsendDatePost=$oRs->DrsendDatePost;
$oRs->DrsSendBack=$oRs->DrsSendBack;
$oRs->DrsSendBackDlcID=$oRs->DrsSendBackDlcID;
$oRs->DrsfSendBack=$oRs->DrsfSendBack;
$flagCommit = $oRs->Save();
//---------------add DocReceiveSend
$oRs1->AddNew();
$oRs1->DrsID=$oRs1->GetNextCode();
$oRs1->DocID=$DocID;
$oRs1->DlcID=$DlcIDlogin;
$oRs1->DsID=3;
$oRs1->personId=$oRs1->personId;
$oRs1->PtID=$oRs->PtID;
$oRs1->DrsDocTypeNo=$oRs->DrsDocTypeNo;
$oRs1->DrsReceiveDate=$oRs->DrsSendDate;
$oRs1->DrsReceivePersonId=$personId;
$oRs1->DrsSendDate=$oRs1->DrsSendDate;
$oRs1->DrsSendPersonId=$oRs1->DrsSendPersonId;
$oRs1->DrsSendDlcID=$oRs1->DrsSendDlcID;
$oRs1->DrsDocDueDate=$oRs->DrsDocDueDate;
$oRs1->DrsDlcIDCreate=$DlcIDlogin;
$oRs1->DrsPsIDCreate=$personId;
$oRs1->DrsPropose=$oRs1->DrsPropose;
$oRs1->DrsSign=$oRs1->DrsSign;
$oRs1->DrsFromDrsID=$oRs->DrsID;
//echo "DrsFromDrsID=".$oRs1->DrsFromDrsID;
$oRs1->DocGroup=$oRs->DocGroup;
$oRs1->DrsflagRead=$oRs1->DrsflagRead;
$oRs1->DrsByPass=$oRs1->DrsByPass;
$oRs1->DrsSend=$oRs1->DrsSend;
$oRs1->DrsSendToPs=$oRs1->DrsSendToPs;
$oRs1->DrsDelete=$oRs1->DrsDelete;
$oRs1->DrsMainPs=$oRs1->DrsMainPs;
$oRs1->AnID=$oRs->AnID;
$oRs1->DrsDocReceiveDate=$oRs1->DrsDocReceiveDate;
$oRs1->DocRefAnsDate=$oRs1->DocRefAnsDate;
$oRs1->DrsSendDocNew=$oRs1->DrsSendDocNew;
$oRs1->DrsInboxID=$oRs1->DrsInboxID;
$oRs1->DrsstartDatePost=$oRs->DrsstartDatePost;
$oRs1->DrsendDatePost=$oRs->DrsendDatePost;
$oRs1->DrsSendBack=$oRs1->DrsSendBack;
$oRs1->DrsSendBackDlcID=$oRs1->DrsSendBackDlcID;
$oRs1->DrsfSendBack=$oRs1->DrsfSendBack;
$flagCommit = $oRs1->Save();
if($flagCommit){
$oC->CommitTrans();
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'>";
}
//echo "<meta http-equiv='refresh' content='0; URL=regisDoc.php?RsID=$RsID&DtID=$DtID'>";
//echo "<meta http-equiv='refresh' content='0; URL=showSendDoc.php?DocID=$DocID&DrsID=$oRs1->DrsID'>";
}
?>
|