Viewing file: editDocRefAnsTable.php (6.32 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/clsDocuments.php"; include_once "../link/function.php"; include_once "../class/clsReceiveSendType.php"; include_once "../link/keyThai.php"; include_once "../class/clsDocReceiveSend.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDoc = new Documents($oC); $oRSt = new receiveSendType($oC); $oRs = new DocReceiveSend($oC); $oRs1 = new DocReceiveSend($oC); $oRs2 = new DocReceiveSend($oC); $oRs3 = new DocReceiveSend($oC);
if($RsID==4){ $searchRsID=3; } if($method=="myaddDocRefAns"){ $oRs1->SearchByDocIDStatus3register($DocRefAnsID); $oRs1->GetRecord();
$oRs2->SearchByDrsFromDrsIDDocIDDrsMainPsYDrsID($oRs1->DrsID,$DocRefAnsID); while($oRs2->GetRecord()){ $oRs3->DocReceiveUpdateDocRefAnsDate($oRs2->DrsID,$DocDate); } ?> <script> window.close(); </script> <? } ?> <html> <head> <title>ค้นหาหนังสือที่อ้างถึง</title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <link href="../source/style.css" rel="stylesheet" type="text/css"> </head> <body><br> <fieldset> <? // echo "==".$RsID."==".$DtID."==".$endDoc."==".$DocNoSearch; ?> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_2"];?>"> <strong><img src="../picture/official_letter.gif" border="0" > ค้นหาหนังสือที่อ้างถึงเพื่อตอบกลับ</strong> </font></legend> <br> <form name="ff" action="editDocRefAnsTable.php"> <input type="hidden" name="DocID" id="DocID" value="<? echo $DocID; ?>"> <input type="hidden" name="RsID" id="RsID" value="<? echo $RsID; ?>"> <input type="hidden" name="DLCID" id="DLCID" value="<? echo $DLCID; ?>"> <input type="hidden" name="DlcPS2" id="DlcPS2" value="<? echo $DlcPS2; ?>"> <input type="hidden" name="useMainDocNo" id="useMainDocNo" value="<? echo $useMainDocNo; ?>"> <table border="0" align="center" width="98%"> <tr><td><strong>ชนิดหนังสือ</strong></td><td><? echo $oRSt->SearchShowRsName($searchRsID);?></td></tr> <tr><td width="30%"><strong>ที่หนังสือ</strong></td><td width="43%"> <input name="DocNoSearch" id="DocNoSearch" type="text" maxlength="50" size="25"></td> <td width="27%"> </td> </tr> <tr><td width="30%"><strong>เรื่อง</strong></td><td width="43%"> <input name="DocSubjectSearch" id="DocSubjectSearch" type="text" maxlength="50" size="30"></td> <td width="27%"><input type=submit value="ค้นหา" align=center onClick="return checkSearch();"></td> </tr> </table> <? if(th2a($DocNoSearch)!="" || th2a($DocSubjectSearch)!=""){ ?> <table width="98%" 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="14%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ลำดับที่</strong></font></td> <td width="40%" 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> </tr> <tr bgcolor="#FFFFFF"><td align="center" height="22"><? echo a2th('1');?></td><td> <a style="cursor:pointer;" onClick="return checkFormat('0','','0000-00-00 00:00:00');">ไม่เลือก</a> <td> </td><td> </td> </tr> <? $i=1; $oDoc->SearchDocRefAnsTable($searchRsID,th2a($DocNoSearch),$DLCID,$DlcPS2,th2a($DocSubjectSearch)); while($oDoc->GetRecord()){ $i++; ?> <? $showDocRef=a2th($oDoc->DocNo); $showDocRef.=" ".a2th($oDoc->DocSubject); $showDocRef.=" ".abbreDate(splitDateDb2($oDoc->DocDate,'/')); ?> <tr bgcolor="#FFFFFF"><td align="center" height="22"><? echo a2th($i); ?></td> <td> <a style="cursor:pointer;" onClick="checkFormat('<? echo $oDoc->DocID;?>','<? echo $showDocRef; ?>','<? echo $oDoc->DocDate; ?>');"><? echo $oDoc->DocNo.'<br> '.$oDoc->DocSubject; ?></a></td> <td align="center"><?php if($oDoc->DocDate =="0000-00-00"){ echo ""; }else{ echo abbreDate(splitDateDb2($oDoc->DocDate ,'/')); }?></td> <td align="center"><?php list($DocD,$DocT) = preg_split('[ ]',$oDoc->DocDateCreate); echo abbreDate2($DocD,'/')."<br>".a2th($DocT);?></td> </tr> <? } ?> <? if($i==1){ ?> <tr bgcolor="#FFFFFF"><td align="center" height="22" colspan="4"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มีรายการหนังสือที่ค้นหา **</font></td> </tr> <? } ?> </table> <table border="0" align="center" width="98%"> <tr bgcolor="#FFFFFF"><td align="center" colspan="2"> <input type="button" name="cancel" value="ยกเลิก" onClick="window.close();"> </td></tr> </table><? } // if search ?> <input type="hidden" name="method" id="method"> <input type="hidden" name="DocRefAnsID" id="DocRefAnsID"> <input type="hidden" name="showDocRef" id="showDocRef"> <input type="hidden" name="DocDate" id="DocDate"></form> </fieldset><table border="0" align="center" width="98%"> <tr><td width="25%" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"> <strong>หมายเหตุ : </strong> </font></td> <td width="85%" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">คลิกเลือกที่หนังสือที่ต้องการอ้างถึง </font></td></tr> </table> </body> </html> <script language="JavaScript"> function checkSearch(){ /* if(document.ff.DocNoSearch.value == ""){ alert("กรุณากรอกที่หนังสือ"); document.ff.DocNoSearch.focus(); return false; } */ } function checkFormat(DocRefAnsID,showDocRef,DocDate){ document.ff.method.value="myaddDocRefAns"; window.opener.document.getElementById("DocRefAnsID").value= DocRefAnsID; document.ff.showDocRef.value=showDocRef; document.ff.DocDate.value=DocDate; window.opener.document.getElementById("DocRefAns").value= showDocRef; document.ff.submit(); } </script>
|