Viewing file: downloadNewSendDoc.php (20.14 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once "template.php"; include_once "../link/function.php"; include_once "funct.php"; include_once "../link/keyThai.php"; include_once "../class/clsSendReceive.php"; include_once "../link/functionshow.php"; include_once "../class/clsDocLinePosition.php"; include_once "../class/clsDocLineConfig.php"; include_once "../class/clsDepartment.php"; include_once "../class/clsDocSpeedLevel.php"; include_once "../class/clsDocSecreLevel.php"; include_once "../class/clsCollegeDetail.php"; include_once "../class/clsSendNewDocSR.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']); $time_startpage = microtime_float(); $InputThai=$oSys->SearchByInputThai(); $oDP = new Department($oC); $oTsr = new sendreceive($oC); $oTsr2 = new sendreceive($oC); $oTsr3 = new sendreceive($oC); $oDlc = new DocLineConfig($oC); $oDlc2 = new DocLineConfig($oC); $oDlc3 = new DocLineConfig($oC); $oDlc4 = new DocLineConfig($oC); $oDlc9 = new DocLineConfig($oC); $oDlp = new docLinePosition($oC); $oDlp1 = new docLinePosition($oC); $oDlp2 = new docLinePosition($oC); $oDsl = new DocSpeedLevel($oC); $oDcl = new DocSecretLevel($oC); $oDsl2 = new DocSpeedLevel($oC); $oDcl2 = new DocSecretLevel($oC); $oCd = new collegedetail($oC); $oCd2 = new collegedetail($oC); $oCd3 = new collegedetail($oC); $oSn = new sendnewdocsr($oC); $oSn2 = new sendnewdocsr($oC); $oSn3 = new sendnewdocsr($oC);
$MaxDocGroup=$oDP->SearchMaxDocGroup(); if($_SESSION['DLCID'] && $_SESSION['one_position']!="1"){ include_once "selectposition.php";
$oDlc->SearchByKey($_SESSION['DLCID']); $oDlc->GetRecord(); if($_SESSION['DLCIDSECOND']=="Y"){ $oDlc9->SearchByKey($_SESSION['DLCIDSECONDID']); $oDlc9->GetRecord(); $mypersonId=$oDlc9->personId; }else{ $mypersonId=$oDlc->personId; } $checkcan=SearchSendAll_receive($oDlc->DlpID); $useReceiveAll=$oSys->SearchuseReceiveAll(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <link href="../source/style.css" rel="stylesheet" type="text/css"> </head> <!-- CSS --> <!-- CSS --> <style type="text/css"><!-- .aceButton { font-size: 3pt; margin: 0; padding: 0; } --></style> <body> <table width="100%" align="center"> <tr><td > <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="sendReceiveDoc_c.php">ดาวน์โหลดเอกสารที่ถูกส่งเพิ่มเติม</a> </font></legend> <form name="gg" METHOD="POST" action="processReSendDocSR.php"> <table align="center" width="98%" > <tr> <td width="68%" height="25"><img src="../picture/official_letter.gif" border="0" > <font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong>ดาวน์โหลดเอกสารที่ถูกส่งเพิ่มเติม</strong></font> </td><input type="hidden" id="st_val2" name="store_DrsID2" style="border:#000000 1px solid" > <td width="7%" align="right"> </td> <td width="40%" align="right" ><a onClick = "showprogramXSendNew()" style="cursor:pointer;"><font color="#000066">[<img src="../picture/download.gif"> เริ่มดาวน์โหลดเอกสาร]</font></a></td> </tr> <tr> <tr> <td colspan="3"><hr color="#000099"></hr> </td> </tr> </table> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse" > <tr height=22> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ที่</strong></font></td> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>จาก</strong></font></td> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>วันที่ส่งหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>วันที่รับหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>แฟ้มหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>สถานะ</strong></font></td> </tr> <? $oSn->SearchDocStatusNoReceive($GLOBALS["COLLEGEID"],'r4'); $i=0; while($oSn->GetRecord()){ $oCd->SearchByKey($oSn->sn_fr_node); $oCd->GetRecord(); $oTsr->SearchBytsr_id_send_tsr_fr_node($oSn->sn_tsr_id_send,$oSn->sn_fr_node); $oTsr->GetRecord();
list($DocD,$DocT) = preg_split('[ ]',$oSn->sn_fr_node_date); list($DocD2,$DocT2) = preg_split('[ ]',$oSn->sn_to_node_date);
if(($i%2) == 0) echo "<tr bgcolor=\"#FFFFFF\" height=22 >"; else echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22 align=\"left\">"; ?> <td><a href="showDetailReceiveDocSRshow.php?tsr_id=<? echo $oTsr->tsr_id; ?>"><? echo $oTsr->tsr_DocNo;?></a></td> <td><? echo $oCd->collegeAbbr; ?></td> <td align=center><? echo abbreDate2($DocD,'/')." ".a2th($DocT); ?></td> <td align=center><? echo abbreDate2($DocD2,'/')." ".a2th($DocT2); ?></td> <td><? echo $oSn->sn_docname;?></td> <td align=center><? echo Showtsr_status($oSn->sn_status);?></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=22><td align="right"> </td></tr> <tr height=22 bgcolor="#FFFFFF"> <td colspan="4" valign="bottom"><br> <hr color="#000099"></hr></td> </tr> </table> </form> <form name="ff" METHOD="POST"> <? 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" > <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" title="แสดง" border="0" > <U>แสดงรายการหนังสือที่ดาวน์โหลดสำเร็จแล้วทั้งหมด</U></a> <a id="closeshow" <? if($flagshow=="1"){ ?>style="display:''; cursor:pointer" <? }else{ ?>style="display:none; cursor:pointer" <? }?> title="ซ่อน" onclick="up_downList('<? if($flagshow=="1"){ echo "down"; }else{ echo "down"; }?>')"><img src="../picture/downshow.gif" title="ซ่อน" border="0" > <U>ซ่อนรายการหนังสือที่ดาวน์โหลดสำเร็จแล้วทั้งหมด</U></a> </strong></font> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="showtable" <? if($flagshow=="1"){ ?>style="display:''; border-collapse:collapse" <? }else{ ?>style="display:none; border-collapse:collapse" <? }?>> <tr><td> <div id="showselect"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse"> <tr><td height=30> เพิ่มแฟ้มหนังสือลงในทะเบียนหนังสือ</td></tr> <tr> <td align="right"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"> <? if($oDlp1->DlpPID!="0"){ ?> <? }else{ ?> <input type="hidden" name="s" id="s" value="<? echo $s; ?>"> <? } ?> ค้นหาหนังสือ ประจำเดือน <select name="monthe" id="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" id="searchYear" type="text" size="5" maxlength="5" value=<? if($searchYear!=""){ echo a2th($searchYear); }else{ echo a2th(Date('Y')+543); } ?> onKeyUp="On_Year('<?php echo $DLCID; ?>','<?php echo $MaxDocGroup; ?>','<?php echo $DlcPS2; ?>','<? echo $InputThai; ?>')" onkeypress="return isNumberKey('<? echo $InputThai; ?>',event)"></td> </tr> </table> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse"> <? $flagshow=1;?> <tr height=22> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ที่</strong></font></td> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>จาก</strong></font></td> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>วันที่ส่งหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>วันที่รับหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>แฟ้มหนังสือ</strong></font></td> <td align="center" background="../picture/table_header_bg2.gif"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เพิ่มใน<br>ทะเบียนหนังสือ</strong></font></td> </tr> <? //--------------------------------find count $numrow=0; $numRow =$oSn2->SearchCountDocStatusNoReceive($GLOBALS["COLLEGEID"],'r4'); $z=0; if($numRow!=0){ $total_page = (int)($numRow/$GLOBALS['PAGE_SIZE']); if(($numRow%$GLOBALS['PAGE_SIZE']) != 0) $total_page++;
if($page_id!=""){ if($page_id>$total_page){ $page_id = 1; $start = 0; }}else{ $page_id = 1; $start = 0;} if(isset($page_id)) $start = $GLOBALS['PAGE_SIZE']*($page_id-1); else { $page_id = 1; $start = 0; } //-------------------------------
$oSn3->SearchDocStatusGetReceive($GLOBALS["COLLEGEID"],'r4', $start,$GLOBALS['PAGE_SIZE'],th2a($searchYear),$monthe); while($oSn3->GetRecord() && $checkcan=='All'){
$oCd->SearchByKey($oSn3->sn_fr_node); $oCd->GetRecord(); $oTsr->SearchBytsr_id_send_tsr_fr_node($oSn3->sn_tsr_id_send,$oSn3->sn_fr_node); $oTsr->GetRecord();
list($DocD,$DocT) = preg_split('[ ]',$oSn3->sn_fr_node_date); list($DocD2,$DocT2) = preg_split('[ ]',$oSn3->sn_to_node_date);
if(($z%2) == 0) echo "<tr bgcolor=\"#FFFFFF\" height=22 >"; else echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22>"; ?> <td><a href="showDetailReceiveDocSRshow.php?tsr_id=<? echo $oTsr->tsr_id; ?>"><? echo $oTsr->tsr_DocNo;?></a></td> <td><? echo $oCd->collegeAbbr; ?></td> <td align=center><? echo abbreDate2($DocD,'/')." ".a2th($DocT); ?></td> <td align=center><? echo abbreDate2($DocD2,'/')." ".a2th($DocT2); ?></td> <td> <? $file_name = basename($oSn3->sn_doc_url); list($filename_,$filetype_)=preg_split("/\./",$file_name);
list($filetype_,$cc)=preg_split('[,]',$filetype_,2); $pathfile=$GLOBALS['path_download_documentsTmp'].$filename_.'-'.$oSn3->sn_fr_node.'.'.$filetype_;e; ?> <a href="<? echo $pathfile ; ?>" target="_blank"><? echo $oSn3->sn_docname;?></a></td> <td align="center"> <? if($oSn3->sn_receive=='Y'){ echo "ถูกเพิ่มในทะเบียนหนังสือแล้ว"; list($DocD,$DocT) = preg_split('[ ]',$oSn3->sn_receivedate); echo '<br>'.abbreDate2($DocD,'/')."<br>".a2th($DocT); }else{ ?> <input class="aceButton" name="accept" type="button" value="เพิ่ม" onClick="return goAccept('<? echo $oSn3->sn_id; ?>')" > <? } ?></td> <? $z++; } } ?> <? if($z=="0"){?> <tr height=22><td align="center" bgcolor="#FFFFFF" colspan="6"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มีรายการหนังสือ **</font></td></tr> <? }else{ ?> <tr height=22 bgcolor="#DADADA"><td align="right" colspan="7"> </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="downloadNewSendDoc.php?page_id=<?php echo $num;?>&flagshow=<? echo $flagshow; ?>&monthe=<? echo $monthe;?>&searchYear=<? echo $searchYear; ?>"><?php echo '[ '.a2th($num).' ]'; if($num==14){echo "<br>";}?></a> <?php } } ?> </td></tr> <? } ?> </table> </div></td></tr></table> </td></tr> </table><input type="hidden" name="flagshow" id="flagshow" value="<? echo $flagshow; ?>"> <input type="hidden" name="DlcID" id="DlcID" value="<? echo $oDlc->DlcID; ?>"> <input type="hidden" name="page_id" id="page_id" value="<? echo $page_id; ?>"> </form> <br> </fieldset> </td> </tr> </table> </body> </html> <? }else{ include_once "unselectposition.php"; } ?> <? $time_endpage = microtime_float(); echo '<div align=right><font color=#AAAAAA>'.$time = $time_endpage - $time_startpage; echo ' s</font></div>'; ?> <script language="javascript"> function showprogramXSendNew(){ var tsr_idselect=document.getElementById('st_val2').value;
FileName = "programXSendNew.php?tsr_idselect="+tsr_idselect; var w=500; var h=200; strOption = "scrollbars=yes,left=370,top=100,menubar=1,status=1, width=" + w + ",height=" + h; window.open(FileName,"",strOption); } function showDoc(){ document.ff.submit(); } function up_downList(status){ var mybrowser=navigator.userAgent; if(status=='up'){ if(mybrowser.indexOf('MSIE')>0){ closeshow.style.display=''; openshow.style.display='none'; showtable.style.display=''; }else{ document.getElementById( 'closeshow' ).setAttribute( 'style', 'display:' ); document.getElementById( 'openshow' ).setAttribute( 'style', 'display:none' ); document.getElementById( 'showtable' ).setAttribute( 'style', 'display:' ); } }else{ if(mybrowser.indexOf('MSIE')>0){ openshow.style.display=''; closeshow.style.display='none'; showtable.style.display='none'; }else{ document.getElementById( 'openshow' ).setAttribute( 'style', 'display:' ); document.getElementById( 'closeshow' ).setAttribute( 'style', 'display:none' ); document.getElementById( 'showtable' ).setAttribute( '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_selectCoID(){ document.gg.action="sendReceiveDoc_c.php"; document.gg.submit(); } function On_selectCoID2(){ 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(DLCID,MaxDocGroup,DlcPS2,InputThai){ 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 goAccept(a){ page_id=document.getElementById('page_id').value var agree=confirm("คุณต้องการเพิ่มแฟ้มหนังสือลงในทะเบียนหนังสือแน่นอนใช่หรือไม่ ?"); if (agree){ window.location.href="processReceiveDocSR.php?sn_id="+a+"&p=new"; return true; }else{ return false ; } } function showprogramX(){ var tsr_idselect=document.getElementById('st_val2').value;
FileName = "programX.php?tsr_idselect="+tsr_idselect; var w=500; var h=200; strOption = "scrollbars=yes,left=370,top=100,menubar=1,status=1, width=" + w + ",height=" + h; window.open(FileName,"",strOption); } </script> <script type="text/javascript"> function checkAll() { var check_DrsID_len = document.ff.check_DrsID.length; document.getElementById('st_val').value=''; for ( i = 0; i<check_DrsID_len ; i++) { document.ff.check_DrsID[i].checked=true; document.getElementById('st_val').value+=document.ff.check_DrsID[i].value+','; } fin_str = document.getElementById('st_val').value; document.getElementById('st_val').value = fin_str.replace(',on,',''); }
function clearAll() { var check_DrsID_len = document.ff.check_DrsID.length; for ( i = 0; i<check_DrsID_len ; i++) { document.ff.check_DrsID[i].checked=false; document.getElementById('st_val').value=''; } }
function validate() { if(document.getElementById('st_val').value=='') { alert('กรุณาเลือกหนังสือที่ต้องการลงทะเบียนรับ'); return false; } else { var agree=confirm("คุณต้องการเพิ่มแฟ้มหนังสือลงในทะเบียนหนังสือแน่นอนใช่หรือไม่ ?"); if (agree){ document.ff.action="processReceiveDocSRAll.php"; return true; }else{ return false ; } } } function test() { var check_DrsID_len = document.ff.check_DrsID.length; if(check_DrsID_len==0) { document.getElementById('st_val').value ='';
} document.getElementById('ch_all').checked =false; document.getElementById('st_val').value ='';
for ( i = 0; i<check_DrsID_len ; i++) { if(document.ff.check_DrsID[i].checked) { document.getElementById('st_val').value+=document.ff.check_DrsID[i].value+','; } } fin_str = document.getElementById('st_val').value; document.getElementById('st_val').value = fin_str.replace(',on,',''); } function test2() { var check_DrsID2_len = document.gg.check_DrsID2.length;
if(check_DrsID2_len==0) { document.getElementById('st_val2').value =''; } document.getElementById('ch_all').checked =false; document.getElementById('st_val2').value =''; for ( i = 0; i<check_DrsID2_len ; i++) { if(document.gg.check_DrsID2[i].checked) { document.getElementById('st_val2').value+=document.gg.check_DrsID2[i].value+','; } } fin_str = document.getElementById('st_val2').value; document.getElementById('st_val2').value = fin_str.replace(',on,','');
} </script>
|