Viewing file: processSendDocSR.php (12.31 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/clsDepartment.php";
include_once "../class/clsPerson.php";
include_once "../link/function.php";
include_once "../link/functionshow.php";
include_once "../class/clsDocLinePosition.php";
include_once "../class/clsDocLineConfig.php";
include_once "../class/clsReceiveSendType.php";
include_once "../class/clsDocType.php";
include_once "../class/clsDocSpeedLevel.php";
include_once "../class/clsDocSecreLevel.php";
include_once "../class/clsDocattatchesTmp.php";
include_once "../class/clsDocuments.php";
include_once "../class/clsDocattatches.php";
include_once "../class/clsDocReceiveSend.php";
include_once "../class/clsRunningDoc.php";
include_once "funct.php";
include_once "../class/clspsdept.php";
include_once "../class/clsDocSendtoPsTmp.php";
include_once "../class/clsCollegeDetail.php";
include_once "../class/clsSendReceive.php";
include_once "programTSR.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);
$oDP4 = new Department($oC);
$oDP5 = new Department($oC);
$oDPt = new Department($oC);
$oDPt2 = new Department($oC);
$oDPt3 = new Department($oC);
$oDPt4 = new Department($oC);
$oDPt = new Department($oC);
$oDPt2 = new Department($oC);
$oDPt3 = new Department($oC);
$oDPt4 = new Department($oC);
$oPS = new person($oC);
$oPS2 = new person($oC);
$oPS3 = new person($oC);
$oPS4 = new person($oC);
$oDlc = new DocLineConfig($oC);
$oDlc2 = new DocLineConfig($oC);
$oDlc3 = new DocLineConfig($oC);
$oDlp = new docLinePosition($oC);
$oDlp1 = new docLinePosition($oC);
$oRSt = new receiveSendType($oC);
$oDt = new doctype($oC);
$oDsl = new DocSpeedLevel($oC);
$oDcl = new DocSecretLevel($oC);
$oDtmp = new DocattatchesTmp($oC);
$oDoc = new Documents($oC);
$oDoc2 = new Documents($oC);
$oDoc3 = new Documents($oC);
$oDoc4 = new Documents($oC);
$oDoc5 = new Documents($oC);
$oDatt = new Docattatches($oC);
$oDatt2 = new Docattatches($oC);
$oRs = new DocReceiveSend($oC);
$oRs1 = new DocReceiveSend($oC);
$oRs2 = new DocReceiveSend($oC);
$oRs3 = new DocReceiveSend($oC);
$oRs4 = new DocReceiveSend($oC);
$oRs5 = new DocReceiveSend($oC);
$oRd = new runningdoc($oC);
$oStmp=new DocSendToPsTmp($oC);
$oPSd = new psdept($oC);
$oCd = new collegedetail($oC);
$oTsr = new sendreceive($oC);
$oTsre = new sendreceive($oC);
$MaxDocGroup=$oDP->SearchMaxDocGroup();
if($method=="addsend"){
$flagCommit = true;
$checkflagCommit= true;
$oC->BeginTrans();
$DocIDParent=GetParentDoc($DocID);
$oDoc2->SearchByKey($DocID);
$oDoc2->GetRecord();
$oRs4->SearchByKey($DrsID);
$oRs4->GetRecord();
//----------documents and chksum
$oDatt->SearchByDocID($DocIDParent);
$oDatt->GetRecord();
$tsr_doc_url=$docpath.$oDatt->DaUpFileName;
$chksum_doc=md5_file($tsr_doc_url);
$timesend=getNowDateTh()." ".date('H:i:s');
$checkupdate=0;
$checkupdate2=0;
if($checkAll=="1"){ //----send All College----------------------------------------------------------------
$oCd->RScollegeSR($COLLEGEID);
while($oCd->GetRecord()){
$oTsr->AddNew();
echo '<br><br>-------------insert TSR '.$oCd->collegeName.'['.$oCd->collegeID.']----------------<br>';
echo '<b>tsr_fr_node=</b>'.$oTsr->tsr_fr_node=$COLLEGEID;
echo '<br><b>tsr_fr_node_date=</b>'.$oTsr->tsr_fr_node_date=$timesend;
echo '<br><b>tsr_to_node=</b>'.$oTsr->tsr_to_node=$oCd->collegeID;
echo '<br><b>tsr_docid=</b>'.$oTsr->tsr_docid=$DocID;
echo '<br><b>tsr_doc_url=</b>'.$oTsr->tsr_doc_url=$tsr_doc_url;
echo '<br><b>tsr_doc_chksum=</b>'.$oTsr->tsr_doc_chksum=$chksum_doc;
echo '<br><b>tsr_status=</b>'.$oTsr->tsr_status='s1';
echo '<br><b>tsr_docgroup=</b>'.$oTsr->tsr_docgroup=$oDoc2->DocGroup;
echo '<br><b>tsr_DrsID=</b>'.$oTsr->tsr_DrsID=$DrsID;
echo '<br><b>tsr_DlcID=</b>'.$oTsr->tsr_DlcID=$DlcIDlogin;
echo '<br><b>tsr_DocSubject=</b>'.$oTsr->tsr_DocSubject=$oDoc2->DocSubject;
echo '<br>';
$checkflagCommit = $oTsr->Save();
if(!$checkflagCommit){ $flagCommit=$checkflagCommit; }
$oTsre->SearchBytsr_docid_tsr_to_node_tsr_fr_node_date($DocID,$oCd->collegeID,$timesend);
$oTsre->GetRecord();
senddocSR($oTsre->tsr_id);
$checkupdate++;
} //while CollegeDetail
}else{ //----not send All College----------------------------------------------------------------
$oCd->RScollegeSR($COLLEGEID);
while($oCd->GetRecord()){
if($collegeSR[$oCd->collegeID]!=""){
$oTsr->AddNew();
echo '<br><br>-------------insert TSR '.$oCd->collegeName.'['.$oCd->collegeID.']----------------<br>';
echo '<b>tsr_fr_node=</b>'.$oTsr->tsr_fr_node=$COLLEGEID;
echo '<br><b>tsr_fr_node_date=</b>'.$oTsr->tsr_fr_node_date=$timesend;
echo '<br><b>tsr_to_node=</b>'.$oTsr->tsr_to_node=$collegeSR[$oCd->collegeID];
echo '<br><b>tsr_docid=</b>'.$oTsr->tsr_docid=$DocID;
echo '<br><b>tsr_doc_url=</b>'.$oTsr->tsr_doc_url=$tsr_doc_url;
echo '<br><b>tsr_doc_chksum=</b>'.$oTsr->tsr_doc_chksum=$chksum_doc;
echo '<br><b>tsr_status=</b>'.$oTsr->tsr_status='s1';
echo '<br><b>tsr_docgroup=</b>'.$oTsr->tsr_docgroup=$oDoc2->DocGroup;
echo '<br><b>tsr_DrsID=</b>'.$oTsr->tsr_DrsID=$DrsID;
echo '<br><b>tsr_DlcID=</b>'.$oTsr->tsr_DlcID=$DlcIDlogin;
echo '<br><b>tsr_DocSubject=</b>'.$oTsr->tsr_DocSubject=$oDoc2->DocSubject;
echo '<br>';
$checkflagCommit = $oTsr->Save();
if(!$checkflagCommit){ $flagCommit=$checkflagCommit; }
$oTsre->SearchBytsr_docid_tsr_to_node_tsr_fr_node_date($DocID,$collegeSR[$oCd->collegeID],$timesend);
$oTsre->GetRecord();
senddocSR($oTsre->tsr_id);
$checkupdate++;
}
} //while CollegeDetail
}
if($checkupdate!="0"){
//------------------update RSdoc status=3
echo '<br>-------------update RSdoc status=3----------------<br>';
$oRs->SearchByKey($DrsID);
echo "DrsID_edit=".$DrsID."<br>";
$oRs->GetRecord();
$oRs->Edit();
$oRs->DrsID=$oRs->DrsID;
$oRs->DocID=$oRs->DocID;
$oRs->DlcID=$oRs->DlcID;
$oRs->DsID=$oRs->DsID;
$oRs->personId=$oRs->personId;
$oRs->PtID=$PtID;
$oRs->DrsDocTypeNo=$oRs->DrsDocTypeNo;
$oRs->DrsReceiveDate=$oRs->DrsReceiveDate;
$oRs->DrsReceivePersonId=$oRs->DrsReceivePersonId;
$oRs->DrsSendDate=$timesend;
echo "DrsSendDate=".$oRs->DrsSendDate."<br>";
$oRs->DrsSendPersonId=$oRs->DrsSendPersonId;
$oRs->DrsSendDlcID=$oRs->DrsSendDlcID;
if($checkDocSpeedDate=="Y"){ $speedDate=splitDateForm($DocSpeedLevelDueDate,"/"); }else{ $speedDate=$DrsDocDueDate; }
$oRs->DrsDocDueDate=$speedDate;
$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;
$oRs->DrsByPass=$oRs->DrsByPass;
$oRs->DrsSend=$oRs->DrsSend;
$oRs->DrsSendToPs=$oRs->DrsSendToPs;
$oRs->DrsDelete=$oRs->DrsDelete;
$oRs->DrsMainPs=$oRs->DrsMainPs;
$oRs->AnID=$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;
$checkflagCommit = $oRs->Save();
if(!$checkflagCommit){ $flagCommit=$checkflagCommit; }
} //checkupdate!=0
if($checkupdate!="0"){
//------------------echo "update RSdoc status=3<br>";
echo '<br>-------------update document status=3----------------<br>';
$oDoc3->SearchByKey($DocID);
$oDoc3->GetRecord();
$oDoc3->Edit();
$oDoc3->DocID=$oDoc3->DocID;
echo "DocID=".$oDoc3->DocID."<br>";
$oDoc3->DocPID=$oDoc3->DocPID;
echo "DocPID=".$oDoc3->DocPID."<br>";
$oDoc3->DlcID=$oDoc3->DlcID;
echo "DlcID=".$oDoc3->DlcID."<br>";
$oDoc3->PtID=$PtID;
echo "PtID=".$oDoc3->PtID."<br>";
$oDoc3->DtID=$oDoc3->DtID;
//echo "DtID=".$oDoc3->DtID."<br>";
$oDoc3->DslID=$oDoc3->DslID;
//echo "DslID=".$oDoc3->DslID."<br>";
$oDoc3->DclID=$oDoc3->DclID;
//echo "DclID=".$oDoc3->DclID."<br>";
$oDoc3->DsID=$oDoc3->DsID;
//echo "DsID=".$oDoc3->DsID."<br>";
$oDoc3->RsID=$oDoc3->RsID; //sendin
//echo "RsID=".$oDoc3->RsID."<br>";
$oDoc3->DocDateCreate=$oDoc3->DocDateCreate;
//echo "DocDateCreate=".$oDoc3->DocDateCreate."<br>";
$oDoc3->DocUserCreate=$oDoc3->DocUserCreate;
//echo "DocUserCreate=".$oDoc3->DocUserCreate."<br>";
$oDoc3->DocTypeNo=$oDoc3->DocTypeNo;
//echo "DocTypeNo=".$oDoc3->DocTypeNo."<br>";
$oDoc3->DocDate=$oDoc3->DocDate;
//echo "DocDate=".$oDoc3->DocDate."<br>";
$oDoc3->DocNo=$oDoc3->DocNo;
//echo "DocNo=".$oDoc3->DocNo."<br>";
$oDoc3->DocSubject=$oDoc3->DocSubject;
//echo "DocSubject=".$oDoc3->DocSubject."<br>";
$oDoc3->DocFrom=$oDoc3->DocFrom;
//echo "DocFrom=".$oDoc3->DocFrom."<br>";
$oDoc3->DocTo=$oDoc3->DocTo;
//echo "DocTo=".$oDoc3->DocTo."<br>";
$oDoc3->DocShortDesc=$oDoc3->DocShortDesc;
if($checkDocSpeedDate=="Y"){ $speedDate=splitDateForm($DocSpeedLevelDueDate,"/"); }else{ $speedDate=$oDoc3->DocSpeedLevelDueDate; }
$oDoc3->DocSpeedLevelDueDate=$speedDate;
echo "DocSpeedLevelDueDate=".$oDoc3->DocSpeedLevelDueDate."<br>";
$oDoc3->DocStart=$oDoc3->DocStart;
//echo "DocStart=".$oDoc3->DocStart."<br>";
$oDoc3->DocFinish=$oDoc3->DocFinish;
//echo "DocFinish=".$oDoc3->DocFinish."<br>";
$oDoc3->DocGroup=$oDoc3->DocGroup;
//echo "DocGroup=".$oDoc3->DocGroup."<br>";
$oDoc3->DocRef=$oDoc3->DocRef;
//echo "DocRef=".$oDoc3->DocRef."<br>";
$oDoc3->DocCircular=$oDoc3->DocCircular;
//echo "DocCircular=".$oDoc2->DocCircular."<br>";
$oDoc3->DocfCir=$oDoc3->DocfCir;
//echo "DocfCir=".$oDoc3->DocfCir."<br>";
$oDoc3->DocOther=$oDoc3->DocOther;
//echo "DocOther=".$oDoc3->DocOther."<br>";
$oDoc3->CertificatePs=$oDoc3->CertificatePs;
//echo "CertificatePs=".$oDoc3->CertificatePs."<br>";
$oDoc3->fDelete=$oDoc3->fDelete;
//echo "fDelete=".$oDoc3->fDelete."<br>";
$oDoc3->endDoc=$oDoc3->endDoc;
//echo "endDoc=".$oDoc3->endDoc."<br>";
$oDoc3->sendToPs=$oDoc3->sendToPs;
//echo "sendToPs=".$oDoc3->sendToPs."<br>";
$oDoc3->AnID=$AnID;
//echo "AnID=".$oDoc3->AnID."<br>";
$oDoc3->DocRefAns=$oDoc3->DocRefAns;
//echo "DocRefAns=".$oDoc3->DocRefAns."<br>";
$oDoc3->DocRefAnsID=$oDoc3->DocRefAnsID;
//echo "DocRefAnsID=".$oDoc3->DocRefAnsID."<br>";
$DocstartDatePost=$oDoc3->DocstartDatePost;
$DocendDatePost=$oDoc3->DocendDatePost;
$oDoc3->DocstartDatePost=$DocstartDatePost;
$oDoc3->DocendDatePost=$DocendDatePost;
$oDoc3->DocMainPost=$oDoc3->DocMainPost;
//echo "DocMainPost=".$oDoc3->DocMainPost."<br>";
$oDoc3->DocGetPost=$oDoc3->DocGetPost;
//echo "DocGetPost=".$oDoc3->DocGetPost."<br>";
$oDoc3->DocShowInOut=$addDocShowInOut;
//echo "DocShowInOut=".$oDoc3->DocShowInOut."<br>";
$oDoc3->DocDateGetPost=$oDoc3->DocDateGetPost;
//echo "DocDateGetPost=".$oDoc3->DocDateGetPost."<br>";
$oDoc3->useMainDocNo=$oDoc3->useMainDocNo;
$oDoc3->DocforSign=$oDoc3->DocforSign;
$checkflagCommit = $oDoc3->Save();
if(!$checkflagCommit){ $flagCommit=$checkflagCommit; }
}
if($flagCommit)
$oC->CommitTrans();
else
$oC->RollbackTrans();
if($cansend=="Y"){
//echo "<meta http-equiv='refresh' content='0; URL=signDoc.php'>";
?>
<script language="JavaScript">
parent.location.href ="signDoc.php";
</script>
<?
}else{
//echo "<meta http-equiv='refresh' content='0; URL=sendDoc.php'>";
?>
<script language="JavaScript">
parent.location.href ="sendDoc.php";
</script>
<?
}
}
?>
|