Viewing file: processSendDocNewSR.php (4.87 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=="AddSendNewSR"){
$flagCommit = true;
$checkflagCommit= true;
$oC->BeginTrans();
$DocIDParent=GetParentDoc($DocID);
//echo "DocID=".$DocID."<br>";
//echo "DocIDParent=".$DocIDParent."<br>";
//----------documents and chksum
$oDatt->SearchByDocID($DocIDParent);
$oDatt->GetRecord();
$tsr_doc_url=$docpath.$oDatt->DaUpFileName;
$chksum_doc=md5_file($tsr_doc_url);
$oDoc2->SearchByKey($DocID);
$oDoc2->GetRecord();
$oRs4->SearchByKey($DrsID);
$oRs4->GetRecord();
$timesend=getNowDateTh()." ".date('H:i:s');
$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_SendNew=</b>'.$oTsr->tsr_SendNew=$timesend;
echo '<br><b>tsr_DlcID=</b>'.$oTsr->tsr_DlcID=$DlcIDlogin;
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);
}
} //while CollegeDetail
if($flagCommit)
$oC->CommitTrans();
else
$oC->RollbackTrans();
if($sendback!="1"){
echo "<meta http-equiv='refresh' content='0; URL=sendDoc.php?flagshow=$flagshow&monthe=$monthe&searchYear=$searchYear'>";
}else{
echo "<meta http-equiv='refresh' content='0; URL=docSendBack.php?flagshow=$flagshow&monthe=$monthe&searchYear=$searchYear'>";
}
}
?>
|