Viewing file: regisDoc.php (36.56 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 "funct.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);
$oDP4 = new Department($oC);
$oDP5 = new Department($oC);
$oPS = new person($oC);
$oDlc = new DocLineConfig($oC);
$oDlc2 = new DocLineConfig($oC);
$oDlc3 = new DocLineConfig($oC);
$oDlc4 = new DocLineConfig($oC);
$oDlc5 = new DocLineConfig($oC);
$oDlp = new docLinePosition($oC);
$oDlp2 = new docLinePosition($oC);
$oDlp3 = 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);
$oRs11 = new DocReceiveSend($oC);
$oRs2 = new DocReceiveSend($oC);
$oRs3 = new DocReceiveSend($oC);
$oRs4 = new DocReceiveSend($oC);
$oRs5 = new DocReceiveSend($oC);
$oRs6 = new DocReceiveSend($oC);
$MaxDocGroup=$oDP->SearchMaxDocGroup();
$InputThai=$oSys->SearchByInputThai();
if($DLCID && $one_position!="1"){ include_once "selectposition.php";
?>
<? //---clear doc in tmp
$oDtmp->SearchByDlcID($DLCID);
while($oDtmp->GetRecord()){
unlink("../tmp/$oDtmp->DaUpFileName");
$oDtmp->Delete();
}
$oDlc->SearchByKey($DLCID); $oDlc->GetRecord();
$oDlp->SearchByKey($oDlc->DlpID); $oDlp->GetRecord();
if($oDlp->DlpPID!="0"){
$DlcPS2=$DLCID;
}else{
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp->DlpPID,$oDlc->deptId);
}
$oDP->SearchByKey($oDlc->deptId);
$oDP->GetRecord();
/*
if($RsID=="" && $oDP->deptIsCenter=="Y" && $oDP->receiveOut=="Y"){
$RsID=1;
if($DtID==""){ $DtID=1; }
}else if($RsID=="" && $oDP->deptIsCenter=="Y" && $oDP->sendOut=="Y"){
$RsID=2;
if($DtID==""){ $DtID=1; }
}else if($RsID=="" && $oDP->deptIsCenter=="N" && $oDP->receiveIn=="Y" ){
$RsID=3;
if($DtID==""){ $DtID=3; }
}else if($RsID=="" && $oDP->deptIsCenter=="N" && $oDP->sendIn=="Y" ){
$RsID=4;
if($DtID==""){ $DtID=3; }
}else if($RsID==''){
if($oDP->sendOut=="Y"){ $RsID='1'; $DtID='1'; }
}*/
// if($oDlp->DlpID=="1" || $oDlp->DlpID=="2"){ //สารบรรณกลาง
if($RsID==""){
if($oDP->receiveOut=="Y"){
$RsID="1"; $DtID="1";
}else if($oDP->sendOut=="Y"){
$RsID="2"; $DtID="1";
}else{
if($oDP->receiveIn=="Y"){
$RsID="3"; $DtID="3";
}else if($oDP->sendIn=="Y"){
$RsID="4"; $DtID="3";
}
}
}
?>
<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="regisDoc.php">ลงทะเบียนใหม่/เสนอหนังสือ</a>
</font></legend>
<form name="ee" METHOD="POST" action="regisDoc.php">
<table align="center" width="98%" >
<tr>
<td width="81%" height="25"><img src="../picture/official_letter.gif" alt="" border="0" >
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong>
เลือกทะเบียนหนังสือ: </strong></font><select name="RsID" onChange='return showDoc();' >
<? echo 'RsID==='.$RsID.'<br>';
if($oDP->receiveOut=="Y"){ ?>
<option value="1" <? if($RsID==1){ echo "selected"; } ?>><? echo $oRSt->SearchShowRsName(1); ?></option>
<? }
if($oDP->sendOut=="Y"){ ?>
<option value="2" <? if($RsID==2){ echo "selected"; } ?>><? echo $oRSt->SearchShowRsName(2); ?></option>
<? }
if($oDP->receiveIn=="Y"){
if($oDlp->DlpID!="1" && $oDlp->DlpID!="2"){ //ไม่ใ่ช่สารบรรณกลาง ?>
<option value="3" <? if($RsID==3){ echo "selected"; } ?>><? echo $oRSt->SearchShowRsName(3); ?></option>
<? }
}
if($oDP->sendIn=="Y"){
if($oDlp->DlpID!="1" && $oDlp->DlpID!="2"){ //ไม่ใ่ช่สารบรรณกลาง ?>
<option value="4" <? if($RsID==4){ echo "selected"; } ?>><? echo $oRSt->SearchShowRsName(4); ?></option>
<? }
}?>
<option value="5" <? if($RsID==5){ echo "selected"; } ?>><? echo $oRSt->SearchShowRsName(5); ?></option>
</select>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="3"><strong>
ชนิดหนังสือ: </strong></font> <select name="DtID" onChange='return showDoc();' >
<? $oDt->RSdoctype();
while($oDt->GetRecord()){
if($oDt->DtP!="1"){
if($RsID=="1" || $RsID=="2"){
if($DtID=="3" || $DtID=="5" || $DtID=="6" || $DtID=="7" || $DtID=="9" || $DtID=="10" || $DtID=="11" || $DtID=="13"){ $DtID="1"; }
if($oDlp->DlpID=="1" || $oDlp->DlpID=="2"){ //สารบรรณกลาง
if($oDt->DtID=="1" || $oDt->DtID=="2" || $oDt->DtID=="14") {?>
<option value="<? echo $oDt->DtID;?>" <? if($DtID==""){ if($oDt->DtID=="1"){ echo "selected"; } }else{ if($DtID==$oDt->DtID){ echo "selected"; } }?>><? echo $oDt->DtName; ?></option>
<? }
}else{ //ไม่ใช่สารบรรณกลาง
if($oDt->DtID=="1" || $oDt->DtID=="2") {?>
<option value="<? echo $oDt->DtID;?>" <? if($DtID==""){ if($oDt->DtID=="1"){ echo "selected"; } }else{ if($DtID==$oDt->DtID){ echo "selected"; } }?>><? echo $oDt->DtName; ?></option>
<? }
}
}else if($RsID=="3" || $RsID=="4"){
//if($oDlp->DlpID!="1" && $oDlp->DlpID!="2"){ //ไม่ใ่ช่สารบรรณกลาง
if($DtID==""){ $DtID="3"; }
if($RsID=="4"){ $DtID="3"; }
if($DtID=="4" || $DtID=="5" || $DtID=="6" || $DtID=="7" || $DtID=="8" || $DtID=="9" || $DtID=="10" || $DtID=="11" || $DtID=="12" || $DtID=="13" || $DtID=="14"){ $DtID="1"; }
if($oDt->DtID==3){?>
<option value="<? echo $oDt->DtID;?>" <? if($DtID==""){ if($oDt->DtID=="3"){ echo "selected"; } }else{ if($DtID==$oDt->DtID){ echo "selected"; } }?>><? echo $oDt->DtName; ?></option>
<?
}
if($RsID=="3"){
if($oDt->DtID==1 || $oDt->DtID==2){
?>
<option value="<? echo $oDt->DtID;?>" <? if($DtID==""){ if($oDt->DtID=="1"){ echo "selected"; } }else{ if($DtID==$oDt->DtID){ echo "selected"; } }?>><? echo $oDt->DtName; ?></option>
<? }
}
//}
}else if($RsID=="5"){
if($DtID=="1" || $DtID=="2" || $DtID=="3" || $DtID=="14"){ $DtID="5"; }
if($oDt->DtID=="5" || $oDt->DtID=="6" || $oDt->DtID=="7" || $oDt->DtID=="9" || $oDt->DtID=="10" || $oDt->DtID=="11" || $oDt->DtID=="13") {?>
<option value="<? echo $oDt->DtID;?>" <? if($DtID==""){ if($oDt->DtID=="4"){ echo "selected"; } }else{ if($DtID==$oDt->DtID){ echo "selected"; } }?>><? echo $oDt->DtName; ?></option>
<? }
}?>
<? } //show doc
} //while doctype
?>
</select> </td>
<td width="19%" align="right" valign="bottom"><? if($oDlc->DlcActive!='Y'){ ?><img src="../picture/regist_tc2.jpg" alt="ลงทะเบียน" border="0" style="cursor:pointer;"><? }else{ ?><a href="addRegisDoc.php?RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>"><img src="../picture/regist_tc.jpg" alt="ลงทะเบียน" border="0" style="cursor:pointer;"></a><? } ?></td>
</tr>
<tr>
<td colspan="3"><hr color="#000099"></hr>
</td>
</tr>
</table><input type="hidden" name="flagshow" value="<? echo $flagshow; ?>">
</form>
<form name="gg" METHOD="POST" action="processEntryDoc.php">
<table width="99%" align="center">
<tr><td width="62%"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong>เสนอหนังสือ</strong></font></td>
<td width="38%" align="right"><? if($RsID==2 || $RsID==5){ ?><a onClick="return UnreadDoc();" style="cursor:pointer;"><img src="../picture/movedoc.gif" alt="ไม่ต้องการแสดงหนังสือที่อ่านแล้ว" border="0" style="cursor:pointer;" > ไม่ต้องการแสดงหนังสือที่อ่านแล้ว</a><? } ?></td>
</tr>
</table>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="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_bg2.gif"; }else{ echo "../picture/table_header_bg.gif"; }?>">
<tr height=22>
<td width="3%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong> </strong></font></td>
<td width="3%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong> </strong></font></td>
<td width="3%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong> </strong></font></td>
<td width="6%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เลข<? echo ShowNameRSDoc($RsID);?></strong></font></td>
<td width="17%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong><? echo ShowNameDocNo($DtID); ?></strong></font></td>
<td width="11%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong><? echo ShowNameDate($DtID); ?></strong></font></td>
<td width="34%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong><? echo ShowNameSubject($DtID); ?><? //if($DtID==13){ echo "ชื่อผู้ได้รับการรับรอง"; }?></strong></font></td>
<td width="14%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong><? if($RsID==3){ echo "วันที่ลงรับ"; }else{ echo "วันที่ลงทะเบียน"; }?></strong></font></td>
<td width="3%" align="center"><img src="../picture/rapid0.jpg" alt="" border="0" ></td>
<td width="3%" align="center"><img src="../picture/secret0.jpg" alt="" border="0" ></td>
<td width="3%" align="center"><? if($RsID==2 || $RsID==5){ ?><img src="../picture/movedoc.gif" alt="ไม่ต้องการแสดงหนังสือที่อ่านแล้ว" border="0" ><? } ?></td>
</tr>
<? //-------------------------other doc------------------------------------------------------------------------------------
if($RsID=="5" || $RsID=="2"){
if($oDlp->DlpID=="1"){
$viewallRsID5=1;
$oDoc->SearchByDocGroupRsIDDtIDDsID1or2flagread($MaxDocGroup,$RsID,$DtID);
}else{
$oDoc->SearchByDlcIDDocGroupRsIDDtIDDsID1or2DlcPS2flagread($DLCID,$MaxDocGroup,$RsID,$DtID,$DlcPS2);
}
}else{
$oDoc->SearchByDlcIDDocGroupRsIDDtIDDsID1or2DlcPS2flagread($DLCID,$MaxDocGroup,$RsID,$DtID,$DlcPS2);
}
$i=0;
while($oDoc->GetRecord()){
//echo "==".$oDoc->DocID."<br>";
if(($i%2) == 0)
echo "<tr bgcolor=\"#FFFFFF\" height=22 >";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22 align=\"left\">";
?>
<td align="center"><? if($oDoc->DsID=="1"){ ?><img src="../picture/completed_1.gif" border="0" alt="หนังสือลงทะเบียน"><? }else if($oDoc->DsID=="2"){ ?><img src="../picture/waiting_3.gif" alt="รอการพิจารณา/ลงนาม" border="0" ><? } ?></td>
<td align="center"><? if(($oDoc->DlcID!=$DLCID) && ($oDoc->DlcID!=$DlcPS2)){ echo " "; }else{ ?><? if($oDoc->DsID=="1"){ if($RsID!="3"){ ?><a href="editRegisDoc.php?DocID=<?php echo $oDoc->DocID;?>&RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>&DrsID=<? echo $oDoc->DrsID; ?>"><img src="../picture/incomplete_ico.gif" border="0" alt="แก้ไขข้อมูลลงทะเบียน" style="cursor:pointer;"><? } } } ?></a></td>
<td align="center"><? if(($oDoc->DlcID!=$DLCID) && ($oDoc->DlcID!=$DlcPS2)){ echo " "; }else{ ?><? if($oDoc->DsID=="1"){ if($RsID!="3"){ ?><a href="processRegisterDoc.php?DocID=<?php echo $oDoc->DocID;?>&RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>&method=deleteRegisterDoc" onClick='return checkDelete()'><img src="../picture/delete1.gif" alt="ลบหนังสือ" border="0"><? } } }?></a></td>
<td align="center"><? echo a2th($oDoc->DocTypeNo); ?></td>
<td > <? echo $oDoc->DocNo; ?></td>
<td align="center"><?php if($oDoc->DocDate =="0000-00-00"){ echo ""; }else{ echo abbreDate(splitDateDb2($oDoc->DocDate ,'/')); }?></td>
<td align="left">
<? if($oDoc->endDoc=="Y"){ $pathlink="showEndDoc.php"; }else{ $pathlink="showRegisDoc.php"; }
if(($oDoc->DlcID!=$DLCID) && ($oDoc->DlcID!=$DlcPS2)){ $caseother="&caseother=1"; }else{ $caseother=""; }
?>
<a href="<? echo $pathlink; ?>?DtID=<? echo $DtID;?>&RsID=<? echo $RsID; ?>&DocID=<?php echo $oDoc->DocID;?>&DrsID=<?php echo $oDoc->DrsID.$caseother;?>"><? echo $oDoc->DocSubject; ?></a>
<? if($RsID=="3"){
if($oDoc->DsID=="1"){
$oRs2->SearchByKey($oDoc->DrsFromDrsID);
$oRs2->GetRecord();
}else if($oDoc->DsID=="2"){
$oRs11->SearchByKey($oDoc->DrsFromDrsID);
$oRs11->GetRecord();
$oRs2->SearchByKey($oRs11->DrsFromDrsID);
$oRs2->GetRecord();
}
$oDlc3->SearchByKey($oRs2->DrsDlcIDCreate); $oDlc3->GetRecord();
$oDP3->SearchByKey($oDlc3->deptId); $oDP3->GetRecord();
echo " <font color=\"#015181\"><storng>(จาก";
echo $oDoc->DocFrom;
echo ")</strong></font>";
}
?>
<? if($oDlp->DlpPID!="0"){ if($DLCID==$oDoc->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<? if($oDlp->DlpPID=="0"){ if($DlcPS2==$oDoc->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<? if($oDoc->endDoc=="Y"){ echo " <font color=\"#FF0000\"><storng>[ยุติหนังสือ]</strong></font>"; }?>
<? if(($oDoc->DlcID!=$DLCID) && ($oDoc->DlcID!=$DlcPS2)){
$oDlc4->SearchByKey($oDoc->DlcID); $oDlc4->GetRecord();
$oDP4->SearchByKey($oDlc4->deptId); $oDP4->GetRecord();
echo " <storng>(จาก$oDP4->deptName)</strong>";
}
?>
</td>
<td align="center">
<?
list($DocD,$DocT) = split(' ',$oDoc->DocDateCreate);
echo abbreDate2($DocD,'/')."<br>".a2th($DocT);
?></td><? if($oDoc->DslID=="0"){ $rapid="../picture/rapid0.jpg"; $rapidname=$oDsl2->SearchName(0); }else if($oDoc->DslID=="1"){ $rapid="../picture/rapid1.jpg"; $rapidname=$oDsl2->SearchName(1); }else if($oDoc->DslID=="2"){ $rapid="../picture/rapid2.jpg"; $rapidname=$oDsl2->SearchName(2); }else if($oDoc->DslID=="3"){ $rapid="../picture/rapid3.jpg"; $rapidname=$oDsl2->SearchName(3); }else{ $rapid="../picture/blank.gif"; $rapidname=""; }?>
<td align="center"><img src="<? echo $rapid; ?>" alt="<? echo $rapidname; ?>" border="0" ></td>
<? if($oDoc->DclID=="0"){ $secret="../picture/secret0.jpg"; $secretname=$oDcl2->SearchName(0); }else if($oDoc->DclID=="1"){ $secret="../picture/secret1.jpg"; $secretname=$oDcl2->SearchName(1); }else if($oDoc->DclID=="2"){ $secret="../picture/secret2.jpg"; $secretname=$oDcl2->SearchName(2); }else if($oDoc->DclID=="3"){ $secret="../picture/secret3.jpg"; $secretname=$oDcl2->SearchName(3); }else if($oDoc->DclID=="4"){ $secret="../picture/secret4.jpg"; $secretname=$oDcl2->SearchName(4); }else{ $secret="../picture/blank.gif"; $secretname=""; }?>
<td align="center"><img src="<? echo $secret; ?>" alt="<? echo $secretname; ?>" border="0" ></td>
<td align="center"><? if($oDoc->endDoc=="Y"){ if(($oDoc->DlcID==$DLCID) || ($oDoc->DlcID==$DlcPS2)){ ?><input name="unread[<? echo $i; ?>]" type="checkbox" value="<?php echo $oDoc->DrsID;?>"><? }else{ echo " "; } }?></td>
</tr>
<? $i++; }
//-------------------------other doc------------------------------------------------------------------------------------
?>
</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=22><td align="right"> </td></tr>
<tr height=22 bgcolor="#FFFFFF">
<td colspan="3" 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="RsID" value="<? echo $RsID; ?>">
<input type="hidden" name="DtID" value="<? echo $DtID; ?>">
<input type="hidden" name="monthe" value="<? echo $monthe; ?>">
<input type="hidden" name="searchYear" value="<? echo $searchYear; ?>">
<input type="hidden" name="method">
</form>
<? if($monthe==""){ $monthe=Date('m'); } if($searchYear==""){ $searchYear=Date('Y')+543; } //echo "month=".$monthe." "."Year=".$searchYear;?>
<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" >
<form name="ff" METHOD="POST" action="regisDoc.php">
<? if(($RsID=="2" && ($DtID=="1" || $DtID=="2"))){ $showheader="รายการหนังสือที่ลงทะเบียนส่งแล้วทั้งหมด"; }else if($RsID=="5"){ $showheader="รายการหนังสือที่ลงทะเบียนคุมแล้วทั้งหมด"; }else{ $showheader="รายการหนังสือที่ลงทะเบียน เสนอหนังสือแล้วทั้งหมด"; } ?>
<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><? echo "แสดง".$showheader; ?></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><? echo "ซ่อน".$showheader; ?></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 width="70%" 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 color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">(เลขรับ) จาก</font> <input name="searchTypeNoF" type="text" value="<? echo a2th($searchTypeNoF); ?>" size="6">
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">ถึง</font> <input name="searchTypeNoT" type="text" value="<? echo a2th($searchTypeNoT); ?>" size="6"><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>
<input type="hidden" name="flagshow" value="<? echo $flagshow; ?>">
<input type="hidden" name="RsID" value="<? echo $RsID; ?>">
<input type="hidden" name="DtID" value="<? echo $DtID; ?>">
</form>
<form name="hh" METHOD="POST" action="processEntryDoc.php">
<? if($RsID=="2" || $RsID=="5"){ ?>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" id="showtable3" <? if($flagshow=="1"){ ?>style="display:''; cursor:pointer; border-collapse:collapse" <? }else{ ?>style="display:none; cursor:pointer; border-collapse:collapse" <? }?>>
<tr><td align="right"><a onClick="return UnreadDoc2();" ><img src="../picture/importdoc.gif" alt="ต้องการแสดงหนังสือที่อ่านแล้ว" border="0" style="cursor:pointer;"> ต้องการแสดงหนังสือที่อ่านแล้ว</a></td>
</tr>
</table>
<? } ?>
<table width="100%" 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="6%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">เลข<? echo ShowNameRSDoc($RsID);?></font></td>
<td width="17%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><? echo ShowNameDocNo($DtID); ?></font></td>
<td width="11%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><? echo ShowNameDate($DtID); ?></font></td>
<td width="32%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><? echo ShowNameSubject($DtID); ?><? //if($DtID==13){ echo "ชื่อผู้ได้รับการรับรอง"; }?></font></td>
<td width="14%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><? if($RsID==3){ echo "วันที่ลงรับ"; }else{ echo "วันที่ลงทะเบียน"; }?></font></td>
<td width="14%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">วันที่เสนอหนังสือ</font></td>
<td width="3%" align="center"><? if($RsID==2 || $RsID==5){ ?><img src="../picture/importdoc.gif" alt="ต้องการแสดงหนังสือที่อ่านแล้ว" border="0"><? } ?></td>
</tr>
<?
//--------------------------------find count
$numrow=0;
if($RsID=="5" || $RsID=="2"){
if($oDlp->DlpID=="1"){
$oDoc4->SearchByDocGroupDsID1DrsReceiveDatesearchNo($MaxDocGroup,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}else{
$oDoc4->SearchByDlcIDDocGroupDsID1DlcPS2DrsReceiveDatesearchNo($DLCID,$MaxDocGroup,$DlcPS2,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}
}else{
$oDoc4->SearchByDlcIDDocGroupDsID1DlcPS2DrsReceiveDatesearchNo($DLCID,$MaxDocGroup,$DlcPS2,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}
$numRow = $oDoc4->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;
}
//-------------------------------
if($RsID=="5" || $RsID=="2"){
if($oDlp->DlpID=="1"){
if($DtID=="13"){
$oDoc3->SearchByDocGroupDsID1LimitDrsReceiveDateforRegisDoc13searchNo($MaxDocGroup, $start, $page_size,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}else{
$oDoc3->SearchByDocGroupDsID1LimitDrsReceiveDatesearchNo($MaxDocGroup, $start, $page_size,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}
}else{
if($DtID=="13"){
$oDoc3->SearchByDlcIDDocGroupDsID1DlcPS2LimitDrsReceiveDateforregis13searchNo($DLCID,$MaxDocGroup,$DlcPS2, $start, $page_size,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}else{
$oDoc3->SearchByDlcIDDocGroupDsID1DlcPS2LimitDrsReceiveDatesearchNo($DLCID,$MaxDocGroup,$DlcPS2, $start, $page_size,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}
}
}else{
$oDoc3->SearchByDlcIDDocGroupDsID1DlcPS2LimitDrsReceiveDatesearchNo($DLCID,$MaxDocGroup,$DlcPS2, $start, $page_size,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo),th2a($searchTypeNoF),th2a($searchTypeNoT));
}
$z=0;
while($oDoc3->GetRecord()){
$oDoc5->SearchByKey($oDoc3->DocID);
$oDoc5->GetRecord();
$oRs4->SearchByDocIDStatus1($oDoc5->DocID);
$oRs4->GetRecord();
if(($z%2) == 0)
echo "<tr bgcolor=\"#FFFFFF\" height=22 >";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22>";
?>
<td align="center"><? echo a2th($oDoc5->DocTypeNo); ?></td>
<td > <? echo $oDoc5->DocNo; ?></td>
<td align="center"><?php if($oDoc5->DocDate =="0000-00-00"){ echo ""; }else{ echo abbreDate(splitDateDb2($oDoc5->DocDate ,'/')); }?></td>
<td >
<a href="showDetailRegisSignDoc.php?DocID=<?php echo $oDoc5->DocID;?>&RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>&DrsID=<? echo $oRs4->DrsID; ?>&flagshow=<? echo $flagshow; ?>&monthe=<? echo $monthe;?>&searchYear=<? echo $searchYear; ?>&searchName=<? echo $searchName; ?>&searchNo=<? echo $searchNo; ?>&searchTypeNoF=<? echo $searchTypeNoF; ?>&searchTypeNoT=<? echo $searchTypeNoT; ?>"><? echo $oDoc5->DocSubject; ?></a>
<? if($RsID=="3"){
$oRs6->SearchByKey($oRs4->DrsFromDrsID);
$oRs6->GetRecord();
$oDlc5->SearchByKey($oRs6->DrsDlcIDCreate); $oDlc5->GetRecord();
$oDP5->SearchByKey($oDlc5->deptId); $oDP5->GetRecord();
echo " <font color=\"#015181\"><storng>(จาก";
echo $oDoc5->DocFrom;
echo ")</strong></font>";
}
?>
<? if($oDlp->DlpPID!="0"){ if($DLCID==$oDoc5->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<? if($oDlp->DlpPID=="0"){ if($DlcPS2==$oDoc5->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<?
if($oDoc5->endDoc=="Y"){
echo "<font color=\"#FF0000\"><storng>[ยุติหนังสือ]</strong></font>";
}
?>
<? if(($oDoc5->DlcID!=$DLCID) && ($oDoc5->DlcID!=$DlcPS2)){
$oDlc4->SearchByKey($oDoc5->DlcID); $oDlc4->GetRecord();
$oDP4->SearchByKey($oDlc4->deptId); $oDP4->GetRecord();
echo " <storng>(จาก$oDP4->deptName)</strong>";
}
?>
</td>
<td align="center">
<?
list($DocD,$DocT) = split(' ',$oDoc5->DocDateCreate);
echo abbreDate2($DocD,'/')."<br>".a2th($DocT);
?></td>
<td align="center">
<? $oRs3->SearchByDocIDStatus1($oDoc5->DocID);
if($oRs3->GetRecord()==1){
if($oRs3->DrsByPass=="Y"){
echo "ส่งผ่าน";
}else{
$oRs5->SearchByDrsFromDrsID($oRs3->DrsID);
if($oRs5->GetRecord()=="1"){
list($DocD,$DocT) = split(' ',$oRs5->DrsReceiveDate);
echo abbreDate2($DocD,'/')."<br>".a2th($DocT);
}else{
echo " ";
}
}
}
?></td>
<td width="3%" align="center"><? if($oRs4->DrsflagRead=="N"){ ?><input name="unread2[<? echo $z; ?>]" type="checkbox" value="<?php echo $oRs4->DrsID;?>"><? }else{ echo " "; } ?></td>
</tr>
<?
$z++; } ?>
<? if($z=="0"){?>
<tr height=22><td align="center" bgcolor="#FFFFFF" colspan="7"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มี<? if(($RsID=="2" && ($DtID=="1" || $DtID=="2"))){ echo "รายการหนังสือที่ลงทะเบียนส่ง"; }else if($RsID=="5"){ echo "รายการหนังสือที่ลงทะเบียนคุม"; }else{ echo "รายการหนังสือที่ลงทะเบียน เสนอหนังสือ"; } ?> **</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="regisDoc.php?page_id=<?php echo $num;?>&RsID=<?php echo $RsID;?>&DtID=<?php echo $DtID;?>&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> <input type="hidden" name="flagshow" value="<? echo $flagshow; ?>">
<input type="hidden" name="z" value="<? echo $z; ?>">
<input type="hidden" name="RsID" value="<? echo $RsID; ?>">
<input type="hidden" name="DtID" value="<? echo $DtID; ?>">
<input type="hidden" name="monthe" value="<? echo $monthe; ?>">
<input type="hidden" name="searchYear" value="<? echo $searchYear; ?>">
<input type="hidden" name="method">
</table></form>
</td></tr>
</table><br>
</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 colspan="2" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">คลิกที่เรื่องหนังสือเพื่อเสนอเซ็น/ดูรายละเอียดหนังสือ</font></td>
</tr>
<tr>
<td width="134" align="left"> </td>
<td width="337" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"><img src="../picture/completed_1.gif" border="0" > หมายถึงหนังสือที่ลงทะเบียน</font></td>
<td width="739" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"><img src="../picture/waiting_3.gif" border="0" > หมายถึงหนังสือที่รอการพิจารณา/ลงนาม</font></td>
</tr>
<tr>
<td width="134" align="left"> </td>
<td align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"><img src="../picture/incomplete_ico.gif" border="0"> คลิกเพื่อแก้ไขข้อมูลลงทะเบียน</font></td>
<td align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"><img src="../picture/delete1.gif" alt="ลบหนังสือ" border="0"> คลิกเพื่อลบหนังสือ</font></td>
</tr>
<tr>
<td width="134" align="left"> </td>
<td colspan="2" align="left">
<font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">ชั้นความเร็ว
<? $oDsl->RSDocSpeedLevel(); $r=0; while($oDsl->GetRecord()){
if($oDsl->DslID=="0"){ $picsp="../picture/rapid0.jpg"; }else if($oDsl->DslID=="1"){ $picsp="../picture/rapid1.jpg"; }else if($oDsl->DslID=="2"){ $picsp="../picture/rapid2.jpg"; }else if($oDsl->DslID=="3"){ $picsp="../picture/rapid3.jpg"; } else if($oDsl->DslID=="4"){ $picsp="../picture/rapid4.jpg"; }
?> <img src="<? echo $picsp; ?>" alt="" border="0" > <? echo " ".$oDsl->DslName." "; $r++; }?>
</font></td>
</tr>
<tr>
<td width="134"> </td>
<td colspan="2" align="left">
<font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">ชั้นความลับ
<? $oDcl->RSDocSecretLevel(); $r=0; while($oDcl->GetRecord()){
if($oDcl->DclID=="0"){ $piccl="../picture/secret0.jpg"; }else if($oDcl->DclID=="1"){ $piccl="../picture/secret1.jpg"; }else if($oDcl->DclID=="2"){ $piccl="../picture/secret2.jpg"; }else if($oDcl->DclID=="3"){ $piccl="../picture/secret3.jpg"; } else if($oDcl->DclID=="4"){ $piccl="../picture/secret4.jpg"; }
?><img src="<? echo $piccl; ?>" alt="" border="0" > <? echo " ".$oDcl->DclName." "; $r++; }?>
</font></td>
</tr>
<tr>
<td width="134" align="left"> </td>
<td width="337" align="left"><img src="../picture/movedoc.gif" alt="" border="0" >
<font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">คลิกเมื่อไม่ต้องการแสดงหนังสือที่อ่านแล้ว
</font></td>
<td width="739" align="left"><img src="../picture/importdoc.gif" alt="" border="0" >
<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 showDoc(){
document.ee.flagshow.value="";
document.ee.submit();
}
function checkDelete(){
var agree=confirm("คุณต้องการลบข้อมูลหนังสือลงทะเบียนนี้แน่นอนใช่หรือไม่ ?");
if (agree){
return true;
}else{
return false ;
}
}
function up_downList(status){
if(status=='up'){
closeshow.style.display='';
openshow.style.display='none';
showtable.style.display='';
showtable2.style.display='';
showtable3.style.display='';
}else{
openshow.style.display='';
closeshow.style.display='none';
showtable.style.display='none';
showtable2.style.display='none';
showtable3.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 UnreadDoc(){
var agree=confirm("คุณต้องการจะไม่แสดงหนังสือนี้แน่นอนใช่หรือไม่ ?");
if (agree){
document.gg.method.value="setFlagreadAll2";
document.gg.submit();
return true;
}else{
return false ;
}
}
function UnreadDoc2(){
var agree=confirm("คุณต้องการจะแสดงหนังสือนี้แน่นอนใช่หรือไม่ ?");
if (agree){
document.hh.method.value="resetFlagreadAll2";
document.hh.submit();
return true;
}else{
return false ;
}
}
function changeS2(){
if(document.ff.searchName.value==""){
document.ff.searchName.value="";
}
if(document.ff.searchNo.value==""){
document.ff.searchNo.value="";
}
document.ff.flagshow.value=1;
document.ff.submit();
}
</script>
|