Viewing file: showSelectRegisDoc.php (13.09 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
header("content-type: application/x-javascript; charset=TIS-620");
?>
<script src="getinfo.js"></script>
<script>
function On_Year(DLCID,MaxDocGroup,DlcPS2,y){
searchYear=y;
if (searchYear.length == 4) {
ShowInfoReceive(DLCID,MaxDocGroup,DlcPS2);
}
}
</script>
<?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 "../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();
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="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="<?php echo a2th($searchName); ?>"> <font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">(ที่/ฉบับที่/ครั้งที่/เลขที่)</font> <input name="searchNo" type="text" size="20" value="<?php echo a2th($searchNo); ?>"> <br>
ประจำเดือน</font>
<select name="monthe" onChange="ShowInfoRegis('<?php echo $DLCID; ?>','<?php echo $MaxDocGroup; ?>','<?php echo $DlcPS2; ?>','<?php echo $RsID; ?>','<?php echo DtID; ?>')">
<option value="01" <?php if($monthe=="01"){ echo "selected"; }?>>ม.ค.</option>
<option value="02" <?php if($monthe=="02"){ echo "selected"; }?>>ก.พ.</option>
<option value="03" <?php if($monthe=="03"){ echo "selected"; }?>>มี.ค.</option>
<option value="04" <?php if($monthe=="04"){ echo "selected"; }?>>เม.ย.</option>
<option value="05" <?php if($monthe=="05"){ echo "selected"; }?>>พ.ค.</option>
<option value="06" <?php if($monthe=="06"){ echo "selected"; }?>>มิ.ย.</option>
<option value="07" <?php if($monthe=="07"){ echo "selected"; }?>>ก.ค.</option>
<option value="08" <?php if($monthe=="08"){ echo "selected"; }?>>ส.ค.</option>
<option value="09" <?php if($monthe=="09"){ echo "selected"; }?>>ก.ย.</option>
<option value="10" <?php if($monthe=="10"){ echo "selected"; }?>>ต.ค.</option>
<option value="11" <?php if($monthe=="11"){ echo "selected"; }?>>พ.ย.</option>
<option value="12" <?php if($monthe=="12"){ echo "selected"; }?>>ธ.ค.</option>
</select>
<input name="searchYear" type="text" size="5" maxlength="5" value=<?php if($searchYear!=""){ echo a2th($searchYear); }else{ echo a2th(Date('Y')+543); } ?> onKeyUp="On_Year()" onKeyPress="event.keyCode=CheckInput(event.keyCode,'<?php echo $InputThai; ?>'); return event.keyCode;">
<input name="searchNamesub" type="submit" value="ค้นหา" onClick="changeS2()"> </td>
</tr>
</table>
<input type="hidden" name="flagshow" value="<?php echo $flagshow; ?>">
<input type="hidden" name="RsID" value="<?php echo $RsID; ?>">
<input type="hidden" name="DtID" value="<?php echo $DtID; ?>">
<?php if($RsID=="2" || $RsID=="5"){ ?>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="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>
<?php } ?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse" background="<?php 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"; }?>">
<?php $flagshow=1;?>
<tr height=22>
<td width="6%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2">เลข<?php echo ShowNameRSDoc($RsID);?></font></td>
<td width="17%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><?php echo ShowNameDocNo($DtID); ?></font></td>
<td width="11%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><?php echo ShowNameDate($DtID); ?></font></td>
<td width="32%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><?php echo ShowNameSubject($DtID); ?><?php //if($DtID==13){ echo "ชื่อผู้ได้รับการรับรอง"; }?></font></td>
<td width="14%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><?php 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"><?php if($RsID==2 || $RsID==5){ ?><img src="../picture/importdoc.gif" alt="ต้องการแสดงหนังสือที่อ่านแล้ว" border="0"><?php } ?></td>
</tr>
<?php
//--------------------------------find count
$numrow=0;
if($RsID=="5" || $RsID=="2"){
if($oDlp->DlpID=="1"){
$oDoc4->SearchViewCountRegisDocMainDept($MaxDocGroup,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}else{
$oDoc4->SearchViewCountRegisDocNoMainDept($DLCID,$MaxDocGroup,$DlcPS2,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}
}else{
$oDoc4->SearchViewCountRegisDocNoMainDept($DLCID,$MaxDocGroup,$DlcPS2,$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}
$numRow = $oDoc4->NumRow();
$total_page = (int)($numRow/$GLOBALS['PAGE_SIZE']);
if(($numRow%$GLOBALS['PAGE_SIZE']) != 0)
$total_page++;
if(isset($page_id))
$start = $GLOBALS['PAGE_SIZE']*($page_id-1);
else {
$page_id = 1;
$start = 0;
}
//-------------------------------
if($RsID=="5" || $RsID=="2"){
if($oDlp->DlpID=="1"){
if($DtID=="13"){
$oDoc3->SearchViewRegisDocMainDeptLimit13($MaxDocGroup, $start, $GLOBALS['PAGE_SIZE'],$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}else{
$oDoc3->SearchViewRegisDocMainDeptLimit($MaxDocGroup, $start, $GLOBALS['PAGE_SIZE'],$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}
}else{
if($DtID=="13"){
$oDoc3->SearchViewRegisDocNoMainDeptLimit13($DLCID,$MaxDocGroup,$DlcPS2, $start, $GLOBALS['PAGE_SIZE'],$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}else{
$oDoc3->SearchViewRegisDocNoMainDeptLimit($DLCID,$MaxDocGroup,$DlcPS2, $start, $GLOBALS['PAGE_SIZE'],$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}
}
}else{
$oDoc3->SearchViewRegisDocNoMainDeptLimit($DLCID,$MaxDocGroup,$DlcPS2, $start, $GLOBALS['PAGE_SIZE'],$RsID,$DtID,$monthe,th2a($searchYear),th2a($searchName),th2a($searchNo));
}
$z=0;
while($oDoc3->GetRecord()){
$oDoc5->SearchByViewRegisDoc($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"><?php echo a2th($oDoc5->DocTypeNo); ?></td>
<td > <?php 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=<?php echo $RsID; ?>&DtID=<?php echo $DtID; ?>&DrsID=<?php echo $oRs4->DrsID; ?>&flagshow=<?php echo $flagshow; ?>&monthe=<?php echo $monthe;?>&searchYear=<?php echo $searchYear; ?>&searchName=<?php echo $searchName; ?>&searchNo=<?php echo $searchNo; ?>"><?php echo $oDoc5->DocSubject; ?></a>
<? if($RsID=="3"){
echo " <font color=\"#015181\"><storng>(จาก";
echo $oDoc5->DocFrom;
echo ")</strong></font>";
}
?>
<?php if($oDlp->DlpPID!="0"){ if($DLCID==$oDoc5->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<?php if($oDlp->DlpPID=="0"){ if($DlcPS2==$oDoc5->DlcID){ echo " <font color=\"#029b0a\"><storng>[รักษาการ]</strong></font>"; }} ?>
<?php
if($oDoc5->endDoc=="Y"){
echo "<font color=\"#FF0000\"><storng>[ยุติหนังสือ]</strong></font>";
}
?>
<?php 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">
<?php
list($DocD,$DocT) = split(' ',$oDoc5->DocDateCreate);
echo abbreDate2($DocD,'/')."<br>".a2th($DocT);
?></td>
<td align="center">
<?php $oRs3->SearchByDocIDStatus1($oDoc5->DocID);
if($oRs3->GetRecord()==1){
if($oRs3->DrsByPass=="Y"){
if($oDoc5->DtID!="15"){ echo "ส่งผ่าน"; }else{ 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"><?php if($oRs4->DrsflagRead=="N"){ ?><input name="unread2[<?php echo $z; ?>]" type="checkbox" value="<?php echo $oRs4->DrsID;?>"><?php }else{ echo " "; } ?></td>
</tr>
<?php
$z++; } ?>
<?php if($z=="0"){?>
<tr height=22><td align="center" bgcolor="#FFFFFF" colspan="7"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มี<?php if(($RsID=="2" && ($DtID=="1" || $DtID=="2"))){ echo "รายการหนังสือที่ลงทะเบียนส่ง"; }else if($RsID=="5"){ echo "รายการหนังสือที่ลงทะเบียนคุม"; }else{ echo "รายการหนังสือที่ลงทะเบียน เสนอหนังสือ"; } ?> **</font></td></tr>
<?php } ?>
<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=<?php echo $flagshow; ?>&monthe=<?php echo $monthe;?>&searchYear=<?php echo $searchYear; ?>&searchName=<?php echo $searchName; ?>&searchNo=<?php echo $searchNo; ?>"><?php echo '[ '. a2th($num).' ]'; if($num==14){echo "<br>";}?></a>
<?php
}
}
?> </td></tr> <input type="hidden" name="flagshow" value="<?php echo $flagshow; ?>">
<input type="hidden" name="z" value="<?php echo $z; ?>">
<input type="hidden" name="method">
</table>
|