Viewing file: docSendBack.php (17.6 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
include_once "../class/clsTable.php";
include_once "../class/clsDepartment.php";
include_once "../class/clsPerson.php";
include_once "../link/function.php";
include_once "../class/clsDocLinePosition.php";
include_once "../class/clsDocLineConfig.php";
include_once "../class/clsReceiveSendType.php";
include_once "../class/clsDocType.php";
include_once "../link/functionshow.php";
include_once "../class/clsDocattatchesTmp.php";
include_once "../class/clsDocuments.php";
include_once "../class/clsDocSpeedLevel.php";
include_once "../class/clsDocSecreLevel.php";
include_once "../class/clsDocReceiveSend.php";
include_once "../class/clsDocSendtoPsTmp.php";
include_once "funct.php";
include_once "../link/keyThai.php";
include_once "getPrefix.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);
$oDlc = new DocLineConfig($oC);
$oDlc2 = new DocLineConfig($oC);
$oDlc3 = new DocLineConfig($oC);
$oDlc4 = new DocLineConfig($oC);
$oDlp = new docLinePosition($oC);
$oDlp1 = new docLinePosition($oC);
$oDlp2 = new docLinePosition($oC);
$oRSt = new receiveSendType($oC);
$oDt = new doctype($oC);
$oDtmp = new DocattatchesTmp($oC);
$oDoc = new Documents($oC);
$oDoc1 = new Documents($oC);
$oDoc2 = new Documents($oC);
$oDoc3 = new Documents($oC);
$oDoc4 = new Documents($oC);
$oDoc5 = new Documents($oC);
$oDsl = new DocSpeedLevel($oC);
$oDcl = new DocSecretLevel($oC);
$oDsl2 = new DocSpeedLevel($oC);
$oDcl2 = new DocSecretLevel($oC);
$oRs = new DocReceiveSend($oC);
$oRs1 = new DocReceiveSend($oC);
$oRs4 = new DocReceiveSend($oC);
$oRs5 = new DocReceiveSend($oC);
$oRs6 = new DocReceiveSend($oC);
$oRs7 = new DocReceiveSend($oC);
$oStmp=new DocSendToPsTmp($oC);
$MaxDocGroup=$oDP->SearchMaxDocGroup();
$InputThai=$oSys->SearchByInputThai();
if($DLCID && $one_position!="1"){ include_once "selectposition.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" align="center">
<tr><td >
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="docSendBack.php">แจ้งหนังสือส่งผิด</a>
</font></legend>
<form name="gg" METHOD="POST" action="processSendBack.php">
<table align="center" width="98%" >
<tr>
<td width="68%" height="25"><img src="../picture/official_letter.gif" alt="" border="0" >
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong>
แจ้งหนังสือส่งผิด</strong></font> </td>
<td width="23%" align="right"> </td>
<td width="9%" align="right" > </td>
</tr>
<tr>
<td colspan="3"><hr color="#000099"></hr>
</td>
</tr>
</table><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>
รายการหนังสือที่แจ้งการส่งผิด</strong></font>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse" background="<? echo "../picture/table_header_bg.gif"; ?>">
<tr height=22>
<td width="13%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ที่/ฉบับที่/ครั้งที่/เลขที่</strong></font></td>
<td width="23%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เรื่อง/ว่าด้วย (ชนิดหนังสือ)</strong></font></td>
<td width="23%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>แจ้งการส่งผิดจาก</strong></font></td>
<td width="2%" align="center"> </td>
</tr>
<? //-------------------------other doc------------------------------------------------------------------------------------
$oDlc->SearchByKey($DLCID); $oDlc->GetRecord();
$oDlp1->SearchByKey($oDlc->DlpID); $oDlp1->GetRecord();
if($oDlp1->DlpPID!="0"){
//$DlcPS2=$DLCID;
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
}else{
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
}
$oRs->SearchByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($DLCID,$MaxDocGroup,$DlcPS2);
$i=0;
while($oRs->GetRecord()){
if($oRs->DocuPID=="0" || $oRs->DocuPID==""){ $searchDoc=$oRs->DocuID; }else{ $searchDoc=$oRs->DocuPID; }
$oDoc->SearchByKey($searchDoc);
$oDoc->GetRecord();
$oRs4->SearchByDocIDDsID3($searchDoc);
$oRs4->GetRecord();
if(($i%2) == 0)
echo "<tr bgcolor=\"#FFFFFF\" height=22 >";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22 align=\"left\">";
?>
<td> <? echo $oDoc->DocNo; ?></td>
<td align="left"> <a href="showDocSendBack.php?DocID=<?php echo $oDoc->DocID;?>&DrsID=<? echo $oRs4->DrsID; ?>&flagshow=<? echo $flagshow; ?>"><? echo $oDoc->DocSubject; ?></a>
<font color="<?php echo $GLOBALS["COLOR_FONT_5"]; ?>" size="2"><? $oDt->SearchByKey($oDoc->DtID); $oDt->GetRecord(); echo "(".$oDt->DtName.")";?></font>
</td>
<td align="left">
<? if($oRs->DlcID==0){
$oPS->SearchByKey($oRs->personId); $oPS->GetRecord();
echo " ".GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName."<br>";
echo " <strong>คำชี้แจง :: </strong>".$oRs->DrsSendBack."<br>";
list($DocD,$DocT) = split(' ',$oRs->DrsReceiveDate);
echo " ".abbreDate2($DocD,'/')." ".a2th($DocT)." ";
}else{
$oDlc2->SearchByKey($oRs->DlcID); $oDlc2->GetRecord();
$oDlp->SearchByKey($oDlc2->DlpID); $oDlp->GetRecord();
$oPS->SearchByKey($oDlc2->personId); $oPS->GetRecord();
echo " ".GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName." (".$oDlp->DlpName.")<br>";
echo " <strong>คำชี้แจง :: </strong>".$oRs->DrsSendBack."<br>";
list($DocD,$DocT) = split(' ',$oRs->DrsReceiveDate);
echo " ".abbreDate2($DocD,'/')." ".a2th($DocT)." ";
}
?>
</td>
<td align="center"><input name="notshow[<? echo $i; ?>]" type="checkbox" value="<? echo $oRs->DrsID; ?>"></td>
</tr>
<? $i++; } ?>
</table>
<table width="99%" align="center" border=0 cellpadding="0" cellspacing="0" bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_13'];?>" height="22">
<? if($i=="0"){?>
<tr height=22><td align="center" bgcolor="#FFFFFF"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มีรายการหนังสือแจ้งการส่งผิด **</font></td></tr>
<? } ?>
<tr height=25>
<td align="right" height=25> ย้ายหนังสือที่ดำเนินการเสร็จแล้ว <input name="searchNamesub" type="submit" value=" ย้าย " onClick='return selectMethod();'> </td>
</tr>
<tr height=22 bgcolor="#FFFFFF">
<td colspan="4" valign="bottom"><br>
<hr color="#000099"></hr></td>
</tr>
</table>
<input type="hidden" name="flagshow" value="<? echo $flagshow; ?>">
<input type="hidden" name="i" value="<? echo $i; ?>">
<input type="hidden" name="method">
</form>
<br>
<? if($monthe==""){ $monthe=Date('m'); } if($searchYear==""){ $searchYear=Date('Y')+543; } //echo "month=".$monthe." "."Year=".$searchYear;?>
<form name="ff" METHOD="POST" action="docSendBack.php">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse">
<tr height=27 bgcolor="#FFFFFF" ><td align="left" >
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>
<a id="openshow" <? if($flagshow=="1"){ ?>style="display:none; cursor:pointer" <? }else{ ?> style="display:''; cursor:pointer" <? }?> onclick="up_downList('<? if($flagshow=="1"){ echo "up"; }else{ echo "up"; }?>')"><img src="../picture/downshow.gif" alt="แสดง" border="0" > <U>แสดงรายการหนังสือที่ดำเนินการเสร็จแล้ว</U></a>
<a id="closeshow" <? if($flagshow=="1"){ ?>style="display:''; cursor:pointer" <? }else{ ?>style="display:none; cursor:pointer" <? }?> alt="ซ่อน" onclick="up_downList('<? if($flagshow=="1"){ echo "down"; }else{ echo "down"; }?>')"><img src="../picture/downshow.gif" alt="ซ่อน" border="0" > <U>ซ่อนรายการหนังสือที่ดำเนินการเสร็จแล้ว</U></a>
</strong></font>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="showtable2" <? if($flagshow=="1"){ ?>style="display:''; border-collapse:collapse" <? }else{ ?>style="display:none; border-collapse:collapse" <? }?>>
<tr><td align="right"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">
ค้นหาหนังสือ (เรื่อง/ว่าด้วย)</font> <input name="searchName" type="text" size="25" value="<? echo a2th($searchName); ?>"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"> (ที่/ฉบับที่/ครั้งที่/เลขที่)</font> <input name="searchNo" type="text" size="20" value="<? echo a2th($searchNo); ?>"> <br>
ประจำเดือน</font>
<select name="monthe" onChange="On_Month()">
<option value="01" <? if($monthe=="01"){ echo "selected"; }?>>ม.ค.</option>
<option value="02" <? if($monthe=="02"){ echo "selected"; }?>>ก.พ.</option>
<option value="03" <? if($monthe=="03"){ echo "selected"; }?>>มี.ค.</option>
<option value="04" <? if($monthe=="04"){ echo "selected"; }?>>เม.ย.</option>
<option value="05" <? if($monthe=="05"){ echo "selected"; }?>>พ.ค.</option>
<option value="06" <? if($monthe=="06"){ echo "selected"; }?>>มิ.ย.</option>
<option value="07" <? if($monthe=="07"){ echo "selected"; }?>>ก.ค.</option>
<option value="08" <? if($monthe=="08"){ echo "selected"; }?>>ส.ค.</option>
<option value="09" <? if($monthe=="09"){ echo "selected"; }?>>ก.ย.</option>
<option value="10" <? if($monthe=="10"){ echo "selected"; }?>>ต.ค.</option>
<option value="11" <? if($monthe=="11"){ echo "selected"; }?>>พ.ย.</option>
<option value="12" <? if($monthe=="12"){ echo "selected"; }?>>ธ.ค.</option>
</select>
<input name="searchYear" type="text" size="5" maxlength="5" value=<? if($searchYear!=""){ echo a2th($searchYear); }else{ echo a2th(Date('Y')+543); } ?> onKeyUp="On_Year()" onKeyPress="event.keyCode=CheckInput(event.keyCode,'<? echo $InputThai; ?>'); return event.keyCode;">
<input name="searchNamesub" type="submit" value="ค้นหา" onClick="changeS2()"> </td></tr>
</table>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" id="showtable" <? if($flagshow=="1"){ ?>style="display:''; border-collapse:collapse" <? }else{ ?>style="display:none; border-collapse:collapse" <? }?> background="<? if($DtID=="5" || $DtID=="6" || $DtID=="7" || $DtID=="9" || $DtID=="10" || $DtID=="11" || $DtID=="12" || $DtID=="13"){ echo "../picture/table_header_bg6.gif"; }else{ echo "../picture/table_header_bg5.gif"; }?>">
<? $flagshow=1;?>
<tr height=22>
<td width="13%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ที่/ฉบับที่/ครั้งที่/เลขที่</strong></font></td>
<td width="25%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เรื่อง/ว่าด้วย (ชนิดหนังสือ)</strong></font></td>
<td width="23%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>แจ้งการส่งผิดจาก</strong></font></td>
</tr>
<?
//--------------------------------find count
$numrow=0;
$oRs4->SearchByDlcIDDocGroupDrsSendBackDrsSendBackDlcIDcountsearchNo($DLCID,$MaxDocGroup,$DlcPS2,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
$numRow = $oRs4->NumRow();
//echo "===========".$numRow;
$page_size = 10;
$total_page = (int)($numRow/$page_size);
if(($numRow%$page_size) != 0)
$total_page++;
if(isset($page_id))
$start = $page_size*($page_id-1);
else {
$page_id = 1;
$start = 0;
}
//-------------------------------
$numrow=0;
$oRs5->SearchByDlcIDDocGroupDrsSendBackDrsSendBackDlcIDlimitsearchNo($DLCID,$MaxDocGroup,$DlcPS2,$monthe,th2a($searchYear),th2a($searchName), $start, $page_size,th2a($searchNo));
$z=0;
while($oRs5->GetRecord()){
if($oRs5->DocuPID=="0" || $oRs5->DocuPID==""){ $searchDoc=$oRs5->DocuID; }else{ $searchDoc=$oRs5->DocuPID; }
$oDoc3->SearchByKey($searchDoc);
$oDoc3->GetRecord();
$oRs4->SearchByDocIDDsID3($searchDoc);
$oRs4->GetRecord();
if(($z%2) == 0)
echo "<tr bgcolor=\"#FFFFFF\" height=22 >";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22>";
?>
<td > <? echo $oDoc3->DocNo; ?></td>
<td align="left"><a href="showDocSendBack.php?DocID=<?php echo $oRs5->DocID;?>&DrsID=<? echo $oRs4->DrsID; ?>&flagshow=<? echo $flagshow; ?>">
<? echo $oDoc3->DocSubject; ?></a> <font color="<?php echo $GLOBALS["COLOR_FONT_5"]; ?>" size="2">
<? $oDt->SearchByKey($oDoc3->DtID); $oDt->GetRecord(); echo "(".$oDt->DtName.")";?>
</font> </td>
<td >
<? if($oRs5->DlcID==0){
$oPS->SearchByKey($oRs5->personId); $oPS->GetRecord();
echo " ".GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName."<br>";
echo " <strong>คำชี้แจง :: </strong>".$oRs5->DrsSendBack."<br>";
list($DocD,$DocT) = split(' ',$oRs5->DrsReceiveDate);
echo " ".abbreDate2($DocD,'/')." ".a2th($DocT)." ";
}else{
$oDlc2->SearchByKey($oRs5->DlcID); $oDlc2->GetRecord();
$oDlp->SearchByKey($oDlc2->DlpID); $oDlp->GetRecord();
$oPS->SearchByKey($oDlc2->personId); $oPS->GetRecord();
echo " ".GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName." (".$oDlp->DlpName.")<br>";
echo " <strong>คำชี้แจง :: </strong>".$oRs5->DrsSendBack."<br>";
list($DocD,$DocT) = split(' ',$oRs5->DrsReceiveDate);
echo " ".abbreDate2($DocD,'/')." ".a2th($DocT)." ";
}
?>
</td>
</tr>
<?
$z++; } ?>
<? if($z=="0"){?>
<tr height=22><td align="center" bgcolor="#FFFFFF" colspan="4"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มีรายการหนังสือแจ้งการส่งผิด **</font></td></tr>
<? } ?>
<tr height=22 bgcolor="#DADADA"><td align="right" colspan="7"><strong>หน้า-></strong>
<?php
for ($num=1; $num<=$total_page; $num++) {
if($num == $page_id)
echo a2th($num)." ";
else {
?>
<a href="sendDoc.php?page_id=<?php echo $num;?>&flagshow=<? echo $flagshow; ?>&monthe=<? echo $monthe;?>&searchYear=<? echo $searchYear; ?>&searchName=<? echo $searchName; ?>&searchNo=<? echo $searchNo; ?>"><?php echo '[ '. a2th($num).' ]'; if($num==14){echo "<br>";}?></a>
<?php
}
}
?> </td></tr>
</table>
</td></tr>
</table><input type="hidden" name="flagshow" value="<? echo $flagshow; ?>">
</form>
</fieldset>
<table width="99%" border="0" align="center">
<tr>
<td width="134" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"> <strong>หมายเหตุ
: </strong> </font></td>
<td width="1070" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">คลิกที่เรื่องหนังสือเพื่อส่งหนังสือถึงผู้รับผิดชอบเพิ่มเติม</font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<? }else{ include_once "unselectposition.php"; } ?>
<script language="javascript">
function up_downList(status){
if(status=='up'){
closeshow.style.display='';
openshow.style.display='none';
showtable.style.display='';
showtable2.style.display='';
}else{
openshow.style.display='';
closeshow.style.display='none';
showtable.style.display='none';
showtable2.style.display='none';
}
}
function On_Month(){
searchYear=document.ff.searchYear.value;
if (searchYear=="") {
alert('กรุณากรอกปี');
document.ff.searchYear.focus();
return false ;
}
document.ff.flagshow.value=1;
document.ff.submit();
}
function On_Year(){
searchYear=document.ff.searchYear.value;
if (searchYear.length == 4) {
document.ff.flagshow.value=1;
document.ff.submit();
}
}
function changeS2(){
if(document.ff.searchName.value==""){
document.ff.searchName.value="";
}
if(document.ff.searchNo.value==""){
document.ff.searchNo.value="";
}
document.ff.submit();
}
function selectMethod(){
var c = 0;
for (var i=0; i<gg.length; i++)
{
if(gg.elements[i].type == 'checkbox')
{
if(gg.elements[i].checked)
c = c+1;
}
}
if(c==0)
{
alert('เลือกอย่างน้อยหนึ่งรายการ');
return false ;
}
var agree=confirm("คุณต้องการจะย้ายหนังสือนี้\nเนื่องจากได้ดำเนินการเสร็จแล้ว\nแน่นอนใช่หรือไม่ ?");
if (agree){
document.gg.method.value="setFlag";
document.gg.submit();
return true;
}else{
return false ;
}
}
</script>
|