Viewing file: processRunningDoc.php (7.17 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/clsTable.php";
include_once "../class/clsDepartment.php";
include_once "../class/clsPerson.php";
include_once "../link/function.php";
include_once "../class/clsRunningDoc.php";
include_once "../class/clsDocType.php";
include_once "../link/keyThai.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);
$oPS = new person($oC);
$oDt = new doctype($oC);
$oRd = new runningdoc($oC);
if($method=="setrunningDoc"){
$oDt->RSdoctypeDtRunAll();
while($oDt->GetRecord()){
$r1=''; $re1=''; $s1='';
if($oDt->DtP=="0"){
$oRd->SearchBydocGroupDtID($docGroup,$oDt->DtID);
if($oRd->GetRecord()=="0"){
$oRd->AddNew();
$oRd->rID=$oRd->GetNextCode();
echo "rID=".$oRd->rID."<br>";
$oRd->DtID=$oDt->DtID;
$oRd->deptId="";
if(th2a($receiveNoStart[$oDt->DtID])=='0' || th2a($receiveNoStart[$oDt->DtID])==''){ $r1=1; }else{ $r1=th2a($receiveNoStart[$oDt->DtID]); }
echo "receiveNoStart[]=".$receiveNoStart[$oDt->DtID]."<br>";
$oRd->receiveNoStart =$r1;
echo "receiveNoStart=".$oRd->receiveNoStart."<br>";
$oRd->receiveNo=$oRd->receiveNo;
//echo "receiveNo=".$oRd->receiveNo."<br>";
if(th2a($sendNoStart[$oDt->DtID])=='0' || th2a($sendNoStart[$oDt->DtID])==''){ $s1=1; }else{ $s1=th2a($sendNoStart[$oDt->DtID]); }
$oRd->sendNoStart =$s1;
echo "sendNoStart=".$oRd->sendNoStart."<br>";
$oRd->sendNo=$oRd->sendNo;
//echo "sendNo=".$oRd->sendNo."<br>";
if(th2a($regisNoStart[$oDt->DtID])=='0' || th2a($regisNoStart[$oDt->DtID])==''){ $re1=1; }else{ $re1=th2a($regisNoStart[$oDt->DtID]); }
$oRd->regisNoStart =$re1;
echo "regisNoStart=".$oRd->regisNoStart."<br>";
$oRd->regisNo=$oRd->regisNo;
//echo "regisNo=".$oRd->regisNo."<br>";
$oRd->docGroup=$docGroup;
//echo "docGroup=".$oRd->docGroup."<br>";
$oRd->confirm=$oRd->confirm;
//echo "confirm=".$oRd->confirm."<br>";
$oRd->Save();
}else{
//echo "edit";
$oRd->Edit();
$oRd->rID=$oRd->rID;
//echo "rID=".$oRd->rID."<br>";
$oRd->DtID=$oRd->DtID;
//echo "DtID=".$oRd->DtID."<br>";
$oRd->deptId=$oRd->deptId;
//echo "deptId=".$oRd->deptId."<br>";
if(th2a($receiveNoStart[$oDt->DtID])=='0' || th2a($receiveNoStart[$oDt->DtID])==''){ $r1=1; }else{ $r1=th2a($receiveNoStart[$oDt->DtID]); }
$oRd->receiveNoStart =$r1;
//echo "receiveNoStart=".$oRd->receiveNoStart."<br>";
$oRd->receiveNo=$oRd->receiveNo;
//echo "receiveNo=".$oRd->receiveNo."<br>";
if(th2a($sendNoStart[$oDt->DtID])=='0' || th2a($sendNoStart[$oDt->DtID])==''){ $s1=1; }else{ $s1=th2a($sendNoStart[$oDt->DtID]); }
$oRd->sendNoStart =$s1;
//echo "sendNoStart=".$oRd->sendNoStart."<br>";
$oRd->sendNo=$oRd->sendNo;
//echo "sendNo=".$oRd->sendNo."<br>";
if(th2a($regisNoStart[$oDt->DtID])=='0' || th2a($regisNoStart[$oDt->DtID])==''){ $re1=1; }else{ $re1=th2a($regisNoStart[$oDt->DtID]); }
$oRd->regisNoStart =$re1;
//echo "regisNoStart=".$oRd->regisNoStart."<br>";
$oRd->regisNo=$oRd->regisNo;
//echo "regisNo=".$oRd->regisNo."<br>";
$oRd->docGroup=$oRd->docGroup;
//echo "docGroup=".$oRd->docGroup."<br>";
$oRd->confirm=$oRd->confirm;
//echo "confirm=".$oRd->confirm."<br>";
$oRd->Save();
}
} //running doc
}
?>
<script language="JavaScript">
parent.location.href ="runningDoc.php?s=1";
</script>
<?
}else if($method=="confirm"){ //method = confirm
$oRd->SearchBydocGroupRunAll($docGroup);
while($oRd->GetRecord()){
//echo "confirm";
$oRd->Edit();
$oRd->rID=$oRd->rID;
//echo "rID=".$oRd->rID."<br>";
$oRd->DtID=$oRd->DtID;
//echo "DtID=".$oRd->DtID."<br>";
$oRd->deptId=$oRd->deptId;
//echo "deptId=".$oRd->deptId."<br>";
$oRd->receiveNoStart =$oRd->receiveNoStart;
//echo "receiveNoStart=".$oRd->receiveNoStart."<br>";
$oRd->receiveNo=$oRd->receiveNo;
//echo "receiveNo=".$oRd->receiveNo."<br>";
$oRd->sendNoStart =$oRd->sendNoStart;
//echo "sendNoStart=".$oRd->sendNoStart."<br>";
$oRd->sendNo=$oRd->sendNo;
//echo "sendNo=".$oRd->sendNo."<br>";
$oRd->regisNoStart =$oRd->regisNoStart;
//echo "regisNoStart=".$oRd->regisNoStart."<br>";
$oRd->regisNo=$oRd->regisNo;
//echo "regisNo=".$oRd->regisNo."<br>";
$oRd->docGroup=$oRd->docGroup;
//echo "docGroup=".$oRd->docGroup."<br>";
$oRd->confirm="Y";
//echo "confirm=".$oRd->confirm."<br>";
$oRd->Save();
}
?>
<script language="JavaScript">
parent.location.href ="runningDoc.php?c=1";
</script>
<?
}else if($method=="editsetrunningDoc"){
$oDt->RSdoctypeDtRunAll();
while($oDt->GetRecord()){
if($oDt->DtP=="0"){
$oRd->SearchBydocGroupDtID($docGroup,$oDt->DtID);
if($oRd->GetRecord()=="0"){
$oRd->AddNew();
$oRd->rID=$oRd->GetNextCode();
//echo "rID=".$oRd->rID."<br>";
$oRd->DtID=$oDt->DtID;
$oRd->deptId="";
$oRd->receiveNoStart =$receiveNoStart[$oDt->DtID];
//echo "receiveNoStart=".$oRd->receiveNoStart."<br>";
$oRd->receiveNo=$receiveNo[$oDt->DtID];
//echo "receiveNo=".$oRd->receiveNo."<br>";
$oRd->sendNoStart =$sendNoStart[$oDt->DtID];
//echo "sendNoStart=".$oRd->sendNoStart."<br>";
$oRd->sendNo=$sendNo[$oDt->DtID];
//echo "sendNo=".$oRd->sendNo."<br>";
$oRd->regisNoStart =$regisNoStart[$oDt->DtID];
//echo "regisNoStart=".$oRd->regisNoStart."<br>";
$oRd->regisNo=$regisNo[$oDt->DtID];
//echo "regisNo=".$oRd->regisNo."<br>";
$oRd->docGroup=$docGroup;
//echo "docGroup=".$oRd->docGroup."<br>";
$oRd->confirm=$oRd->confirm;
//echo "confirm=".$oRd->confirm."<br>";
$oRd->Save();
}else{
//echo "edit";
$oRd->Edit();
$oRd->rID=$oRd->rID;
//echo "rID=".$oRd->rID."<br>";
$oRd->DtID=$oRd->DtID;
//echo "DtID=".$oRd->DtID."<br>";
$oRd->deptId=$oRd->deptId;
//echo "deptId=".$oRd->deptId."<br>";
$oRd->receiveNoStart =$receiveNoStart[$oDt->DtID];
//echo "receiveNoStart=".$oRd->receiveNoStart."<br>";
$oRd->receiveNo=$receiveNo[$oDt->DtID];
//echo "receiveNo=".$oRd->receiveNo."<br>";
$oRd->sendNoStart =$sendNoStart[$oDt->DtID];
//echo "sendNoStart=".$oRd->sendNoStart."<br>";
$oRd->sendNo=$sendNo[$oDt->DtID];
//echo "sendNo=".$oRd->sendNo."<br>";
$oRd->regisNoStart =$regisNoStart[$oDt->DtID];
//echo "regisNoStart=".$oRd->regisNoStart."<br>";
$oRd->regisNo=$regisNo[$oDt->DtID];
//echo "regisNo=".$oRd->regisNo."<br>";
$oRd->docGroup=$oRd->docGroup;
//echo "docGroup=".$oRd->docGroup."<br>";
$oRd->confirm=$oRd->confirm;
//echo "confirm=".$oRd->confirm."<br>";
$oRd->Save();
}
} //running doc
}
?>
<script language="JavaScript">
parent.location.href ="runningDoc.php";
</script>
<?
}
?>
|