Viewing file: processSelectDocPost.php (5.82 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/clsDocuments.php";
include_once "funct.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDoc = new Documents($oC);
if($method=="selectdoc"){
for($k=0;$k<$i;$k++){
//echo "IDDOC=".$check[$k]."<br>";
//echo "SELECT=".$selectPost[$k]."<br>";
$oDoc->SearchByKey($check[$k]);
$oDoc->GetRecord();
$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=$oDoc->DsID;
$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;
if($AnIDselect[$k]!=$oDoc->AnID){
//echo "change AnID=$AnIDselect[$k]<br>";
$oDoc->AnID=$AnIDselect[$k];
$edit=1;
if($oDoc->DocPID=="0"){
updateAnIDdocumentDocPID0($oDoc->DocID,$AnIDselect[$k]);
}else{
updateAnIDdocumentDocPID0($oDoc->DocPID,$AnIDselect[$k]);
}
}else{
$oDoc->AnID=$oDoc->AnID;
}
$oDoc->DocRefAns=$oDoc->DocRefAns;
$oDoc->DocRefAnsID=$oDoc->DocRefAnsID;
$oDoc->DocstartDatePost=$oDoc->DocstartDatePost;
$oDoc->DocendDatePost=$oDoc->DocendDatePost;
$oDoc->DocMainPost=$oDoc->DocMainPost;
if($selectPost[$k]!=$oDoc->DocGetPost){
$oDoc->DocGetPost=$selectPost[$k];
$edit=1;
}else{
$oDoc->DocGetPost=$oDoc->DocGetPost;
}
//echo "DocShowInOut=".$DocShowInOut[$k]."and oDoc-DocShowInOut==".$oDoc->DocShowInOut."<br>";
if($DocShowInOut[$k]!=$oDoc->DocShowInOut){
$oDoc->DocShowInOut=$DocShowInOut[$k];
$edit=1;
}else{
$oDoc->DocShowInOut=$oDoc->DocShowInOut;
}
if($edit==1){
$oDoc->DocDateGetPost=getNowDateTh()." ".date('H:i:s');
}else{
$oDoc->DocDateGetPost=$oDoc->DocDateGetPost;
}
$oDoc->useMainDocNo=$oDoc->useMainDocNo;
$oDoc->DocforSign=$oDoc->DocforSign;
$oDoc->Save();
}
echo "<meta http-equiv='refresh' content='0; URL=selectDocPost.php?AnID=$AnID'>";
}else if($method=="changeSelectDoc"){
$oDoc->SearchByKey($DocID);
$oDoc->GetRecord();
$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=$oDoc->DsID;
$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;
if($AnIDselect[$DocID]!=$oDoc->AnID){
$oDoc->AnID=$AnIDselect[$DocID];
$edit=1;
if($oDoc->DocPID=="0"){
updateAnIDdocumentDocPID0($oDoc->DocID,$AnIDselect[$DocID]);
}else{
updateAnIDdocumentDocPID0($oDoc->DocPID,$AnIDselect[$DocID]);
}
}else{
$oDoc->AnID=$oDoc->AnID;
}
$oDoc->DocRefAns=$oDoc->DocRefAns;
$oDoc->DocRefAnsID=$oDoc->DocRefAnsID;
$oDoc->DocstartDatePost=$oDoc->DocstartDatePost;
$oDoc->DocendDatePost=$oDoc->DocendDatePost;
$oDoc->DocMainPost=$oDoc->DocMainPost;
if($selectPost[$DocID]!=$oDoc->DocGetPost){
$oDoc->DocGetPost=$selectPost[$DocID];
$edit=1;
}else{
$oDoc->DocGetPost=$oDoc->DocGetPost;
}
if($DocShowInOut[$DocID]!=$oDoc->DocShowInOut){
$oDoc->DocShowInOut=$DocShowInOut[$DocID];
$edit=1;
}else{
$oDoc->DocShowInOut=$oDoc->DocShowInOut;
}
if($edit==1){
$oDoc->DocDateGetPost=getNowDateTh()." ".date('H:i:s');
}else{
$oDoc->DocDateGetPost=$oDoc->DocDateGetPost;
}
$oDoc->useMainDocNo=$oDoc->useMainDocNo;
$oDoc->DocforSign=$oDoc->DocforSign;
$oDoc->Save();
//echo $selectPost[$DocID];
echo "<meta http-equiv='refresh' content='0; URL=editSelectDocPost.php?DocSubject=$DocSubject&DocNo=$DocNo&start=$start&end=$end&yearDoc=$yearDoc&AnID=$AnID'>";
}
?>
|