Viewing file: showSendDocAll.php (18.5 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 "../link/functionshow.php"; include_once "../class/clsDocLinePosition.php"; include_once "../class/clsDocLineConfig.php"; include_once "../class/clsReceiveSendType.php"; include_once "../class/clsDocType.php"; include_once "../class/clsDocSpeedLevel.php"; include_once "../class/clsDocSecreLevel.php"; include_once "../class/clsDocattatchesTmp.php"; include_once "../class/clsDocuments.php"; include_once "../class/clsDocattatches.php"; include_once "../class/clsDocReceiveSend.php"; include_once "../class/clsProposeType.php"; include_once "funct.php"; include_once "../class/clsDocSendtoPsTmp.php"; include_once "../class/clsannounceDocType.php"; include_once "../class/clsannounceDocType.php"; include_once "../class/clspsdept.php"; include_once "../class/clsDocWSign.php"; include_once "getPrefix.php"; include_once "../class/clsSysConfig.php"; include_once "uploadDocSended.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); $oDPt = new Department($oC); $oDPt2 = new Department($oC); $oDPt3 = new Department($oC); $oDPt4 = new Department($oC); $oPS = new person($oC); $oPS2 = new person($oC); $oPS3 = new person($oC); $oPS4 = new person($oC); $oPS5 = new person($oC); $oPS6 = new person($oC); $oPS7 = new person($oC); $oUG = new umgroup($oCu); $oDlc = new DocLineConfig($oC); $oDlc2 = new DocLineConfig($oC); $oDlc3 = new DocLineConfig($oC); $oDlc4 = new DocLineConfig($oC); $oDlc5 = new DocLineConfig($oC); $oDlc6 = new DocLineConfig($oC); $oDlc7 = new DocLineConfig($oC); $oDlp = new docLinePosition($oC); $oDlp1 = new docLinePosition($oC); $oDlp2= new docLinePosition($oC); $oRSt = new receiveSendType($oC); $oDt = new doctype($oC); $oDsl = new DocSpeedLevel($oC); $oDcl = new DocSecretLevel($oC); $oDtmp = new DocattatchesTmp($oC); $oDoc = new Documents($oC); $oDoc2 = new Documents($oC); $oDoc3 = new Documents($oC); $oDoc4 = new Documents($oC); $oDoc5 = new Documents($oC); $oDatt = new Docattatches($oC); $oRs = new DocReceiveSend($oC); $oRs1 = new DocReceiveSend($oC); $oRs2 = new DocReceiveSend($oC); $oRs3 = new DocReceiveSend($oC); $oRs4 = new DocReceiveSend($oC); $oRs5 = new DocReceiveSend($oC); $oRs6 = new DocReceiveSend($oC); $oRs7 = new DocReceiveSend($oC); $oRs8 = new DocReceiveSend($oC); $oRs9 = new DocReceiveSend($oC); $oRs10 = new DocReceiveSend($oC); $oPt = new ProposeType($oC); $oStmp=new DocSendToPsTmp($oC); $oStmp2=new DocSendToPsTmp($oC); $oAn=new announceDocType($oC); $oAn=new announceDocType($oC); $oPSd = new psdept($oC); $MaxDocGroup=$oDP->SearchMaxDocGroup(); $oDws = new docwsign($oC); $oSys = new sysConfig($oC); $InputThai=$oSys->SearchByInputThai(); doCheckAll(); if($_SESSION['DLCID'] && $_SESSION['one_position']!="1"){ include_once "selectposition.php"; ?>
<? $oDoc->SearchByKey($DocID); $oDoc->GetRecord(); $oDlc->SearchByKey($_SESSION['DLCID']); $oDlc->GetRecord(); if($_SESSION['DLCIDSECOND']=="Y"){ $oDlc7->SearchByKey($_SESSION['DLCIDSECONDID']); $oDlc7->GetRecord(); $mypersonId=$oDlc7->personId; }else{ $mypersonId=$oDlc->personId; } $DlcdeptId=$oDlc->deptId; $getDlpIDCenter=searchGetDlpIDCenter($oDlc->DlpID); $oSys->RSsysConfig(); $oSys->GetRecord(); ?> <html> <head> <script language="javascript" src="../source/calendarDateInput.js"></script> <script>window.onload= function defaultDivDisplay(){ selectPtID=document.getElementById("PtID").value;
if(selectPtID==0 || selectPtID==1 || selectPtID==2 || selectPtID==3){ for (var i=0; i<document.ff.length; i++) { if(document.ff.elements[i].type == 'radio') { document.ff.elements[i].style.display = "none"; } } }
} </script> <script language="javascript"> var XMLHttpRequestObject=false; if(window.XMLHttpRequest){ XMLHttpRequestObject=new XMLHttpRequest(); }else if(window.ActiveXObject){ XMLHttpRequestObject=new ActiveXObject("Microsoft.XMLHTTP"); } function getData(data,divID){ document.getElementById("div2").style.display = ""; if(XMLHttpRequestObject){ var searchName = document.getElementById("name").value; var obj = document.getElementById(divID); data=data+"?name="+searchName; XMLHttpRequestObject.open("GET",data); XMLHttpRequestObject.onreadystatechange=function(){ if(XMLHttpRequestObject.readyState==4 && XMLHttpRequestObject.status==200){ obj.innerHTML=XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); XMLHttpRequestObject.send(null); } } </script> <script src="getinfo.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <link href="../source/style.css" rel="stylesheet" type="text/css"> </head> <body> <iframe id="updoc" name="updoc" src="" style="width:0px;height:0px;border:0"></iframe> <table width="100%" align="center"> <tr><td > <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="sendDoc.php">ส่งหนังสือถึงผู้รับผิดชอบ</a> <img src="../picture/ico3.gif" width="10" border="0" align="absmiddle">รายละเอียดข้อมูลการส่งหนังสือถึงผู้รับผิดชอบ</font> </font></legend> <table align="center" width="93%" > <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> </tr> <tr> <td colspan="3"><hr color="#000099"></hr> </td> </tr> <tr> <td colspan="3"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>รายการหนังสือที่จะส่งถึงผู้รับผิดชอบ (ส่งทีละหลายฉบับ) </strong></font> </td> </tr> </table> <table width="93%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse" > <? $p=bgForRegisPage($DtID); ?> <tr height=22> <td width="10%" align="center" background="<? echo $p; ?>"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เลขทะเบียน</strong></font></td> <td width="15%" align="center" background="<? echo $p; ?>"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>ที่ ลงวันที่</strong></font></td> <td width="38%" align="center" background="<? echo $p; ?>"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>เรื่อง</strong></font></td> <td width="30%" align="center" background="<? echo $p; ?>"><font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong>แฟ้มหนังสือ</strong></font></td> </tr> <input type="hidden" name="DrsIDproposeDoc" id="DrsIDproposeDoc" value="<? echo $_POST['store_DrsID']; ?>"> <? if($_POST['store_DrsID']!=''){ $str = $_POST['store_DrsID']; $DrsIDproposeDoc= $_POST['store_DrsID']; }else{ $str = $DrsIDproposeDoc; } $tmp = explode("," ,$str); $tmp = array_reverse($tmp); $reversed_str = join(',', $tmp); //echo '<br>---------------------------------------<br>'; $store_DrsID_exp = explode("," ,$reversed_str); $store_DrsID_exp_count=count($store_del_exp); $store_DrsID_exp_count=count($store_DrsID_exp); $checkdoc=0; for($j=0; $j<$store_DrsID_exp_count;$j++){ $t_id = trim($store_DrsID_exp[$j]); if(strlen($t_id)==0){ }else{ $oRs5->SearchproposeAllDoc($t_id);$oRs5->GetRecord(); $oDoc->SearchByKey($oRs5->DocID);$oDoc->GetRecord(); echo '<tr>'; echo '<td height=22 align=center>'.a2th($oRs5->DocTypeNo).'</td>'; echo '<td height=22 align=left> '; if($oDoc->DtID!="15"){ echo $oDoc->DocNo; }else{ echo '-'; } echo '<br> '.abbreDate2($oDoc->DocDate,'/'); echo '</td>'; echo '<td height=22 align=left> '.a2th($oRs5->DocSubject).'</td>'; echo '<td height=22 align=left> '; if($oDoc->DocPID=="0" || $oDoc->DocPID==""){ $searchDoc=$oDoc->DocID; }else{ $searchDoc=$oDoc->DocPID; } ?> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>"> <img src="../picture/attach_ico.gif" border="0" > แฟ้มที่เกี่ยวข้อง <? $cdoc=$oDatt->CountDocByDocID($searchDoc); echo a2th($cdoc); if($cdoc==0){ $checkdoc++; }?> รายการ
<br></font> <? $c=0; $oDatt->SearchByDocID($searchDoc); while($oDatt->GetRecord()){ $c++; $pathfile=$GLOBALS['path_download_documents'].$oDatt->DaUpFileName; ?> <a href="<? echo $pathfile ; ?>" target="_blank"><img src="../picture/allregistered_ico.gif" title="เปิดดูแฟ้มหนังสือ" border="0" style="cursor:pointer;" ></a> <? echo " ".$c.". ".$oDatt->DaFileName."<br>"; } echo manageDocAtt2($searchDoc); echo '</td>'; echo '</tr>'; } } ?> </table> <form name="ff" METHOD="POST" action="processSendDocAll.php"> <? //------------------Sign------------------------------------------------------------------?> <br> <table width="93%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"><tr><td > <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse" background="../picture/table_header_bg2.gif"> <tr> <td width="68%" height="25"> <font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="2"><strong> รายละเอียดสำหรับส่งหนังสือถึงผู้รับผิดชอบ</strong></font> </td> </tr> </table> <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" > <tr><td> </td><td> </td></tr> <tr align="center" valign="top"> <td width="45%" align="center" valign="top"><? include("showSendDocSignAll.php");?></td><td width="45%" align="center" valign="top"><? include("showSendDocToPsAll.php");?> <div align="left"><br> <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"> <strong>คำชี้แจง </strong></font></legend> <img src="../picture/yes.gif" border="0" title="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว<br> <img src="../picture/radio_seleted2.gif"> หมายถึงเลือกหน่วยงานหลัก/ผู้รับผิดชอบหลัก<br> <input name="" type="checkbox" value="" checked disabled>หมายถึงเลือกผู้รับหนังสือ </fieldset></div></td> </tr> <tr><td colspan="3" > </td></tr> <? if($oSys->acceptDoc==Y){ ?> <tr><td colspan="2">*** กรณีการส่งหนังสือถึงผู้ใช้ทั่วไป หากผู้รับหนังสือเป็นคนเดียวกับผู้ส่ง หรือเป็นผู้ลงนามหนังสือนี้ หนังสือที่ถูกส่งจะมีสถานะเป็นรับทราบแล้ว </td></tr> <tr><td> </td></tr> <? } ?> <tr><td colspan="2" align="center"> <input type="submit" name="addsend" value="ส่งหนังสือ" onClick="return checkFormat('<? echo $mainPsselect; ?>','<? echo $firstpost; ?>','<? echo $getDlpIDCenter;?>');" <? if($oDlc->DlcActive!='Y'){ echo "disabled"; } ?>> <input name="mainPsselect" id="mainPsselect" type="hidden"> <input type="button" name="cancel" value="กลับหน้าหลัก" onClick="location.href = 'sendDoc.php?page_id2=<? echo $page_id2;?>&folderstaff2=<? echo $folderstaff2; ?>&forfolderstaff2=<? echo $forfolderstaff2;?>'"> <input type="hidden" name="method" id="method" > <input type="hidden" name="checkcountps" id="checkcountps" value="<? echo $checkcountps; ?>"> <input type="hidden" name="cansend" id="cansend" value="<? echo $cansend; ?>"> <input type="hidden" name="DlcdeptId" id="DlcdeptId" value="<? echo $DlcdeptId; ?>"> <input type="hidden" name="DlcIDlogin" id="DlcIDlogin" value="<? echo $DLCID; ?>"> <input type="hidden" name="personId" id="personId" value="<? echo $mypersonId; ?>"> <input type="hidden" name="firstpost" id="firstpost" value="<? echo $firstpost; ?>"> <input type="hidden" name="deletePstmp" id="deletePstmp" > <input type="hidden" name="checksearchPs" id="checksearchPs" > <input type="hidden" name="DrsIDproposeDoc" id="DrsIDproposeDoc" value="<? echo $DrsIDproposeDoc;?>"> <input type="hidden" name="page_id2" id="page_id2" value="<? echo $page_id2; ?>"> <input type="hidden" name="folderstaff2" id="folderstaff2" value="<? echo $folderstaff2; ?>"> <input type="hidden" name="forfolderstaff2" id="forfolderstaff2" value="<? echo $forfolderstaff2; ?>"> <input type="hidden" name="searchPreTypeNoF" id="searchPreTypeNoF" value="<? echo $searchPreTypeNoF; ?>"> <input type="hidden" name="searchPreTypeNoT" id="searchPreTypeNoT" value="<? echo $searchPreTypeNoT; ?>"> <input type="hidden" name="searchDeptPre" id="searchDeptPre" value="<? echo $searchDeptPre; ?>"> </td></tr> </table> </td></tr>
</table> <? //-----------------Line Doc--------------------------------------------------------------?> <br> </form> </fieldset> <table width="95%" border="0" align="center"> <tr> <td width="76" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"> <strong>หมายเหตุ : </strong> </font></td> <td width="618" align="left"><img src="../picture/allregistered_ico.gif" border="0" > <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">คลิกเพื่อเปิดดูแฟ้มหนังสือ </font></td> </tr> <tr> <td width="76"> </td> <td width="618" 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 checkFormat(p,r,checkdlpid){ if(document.getElementById('AnID').value!=0 && document.getElementById('AnIDselected').value!='1' && document.getElementById('DocShowIn').checked==false && document.getElementById('DocShowOut').checked==false){ if(!document.getElementById('DocShowIn').checked && !document.getElementById('DocShowOut').checked){ alert("กรุณาเลือกประเภทการแจ้งข่าวบน\nInternet (ภายนอก) และ/หรือ Intranet (ภายใน)"); return false; } } if(document.getElementById('AnID').value!=0 && r=="1"){ f = document.ff; var date1 = f.DrsstartDatePost.value.split("/"); var date2 = f.DrsendDatePost.value.split("/"); //Set the two dates date1 = new Date(eval(date1[2]), eval(date1[1]-1), eval(date1[0])); date2 = new Date(eval(date2[2]), eval(date2[1]-1), eval(date2[0])); //Month is 0-11 in JavaScript //Set 1 day in milliseconds var one_day = 1000*60*60*24; //Calculate difference btw the two dates, and convert to days var diff = Math.ceil((date2.getTime()-date1.getTime())/(one_day)); if(diff < 0){ alert("กรุณาตรวจสอบช่วง 'วันที่เริ่มต้น' ควรน้อยกว่า 'วันที่สิ้นสุด' !"); return false; } } if(checkdlpid!='Y'){ if(document.getElementById('PtID').value==0){ alert("กรุณาเลือกลักษณะหนังสือ"); document.getElementById('PtID').focus(); return false ; } } if(document.getElementById('PtID').value==3){ if(!document.getElementById('checkDocSpeedDate').checked){ alert('กรุณากำหนดระยะเวลาดำเนินการ'); return false; } } var agree=confirm("คุณต้องการส่งหนังสือแน่นอนใช่หรือไม่ ?"); if (agree){ document.ff.method.value="addsend"; return true; }else{ return false ; } } function changePtID(){ document.ff.method.value="addsend2"; document.ff.submit(); return true; } function radioSelectType(val){ document.ff.mainPs.value=val; } function showline(p){ FileName = "showlinedocTable.php?searchDoc="+p; var w=900; var h=500; strOption = "scrollbars=yes,left=370,top=100,menubar=1,width=" + w + ",height=" + h; window.open(FileName,"",strOption); } function showline2(p){ FileName = "showlinedocTable2.php?searchDoc="+p; var w=900; var h=500; strOption = "scrollbars=yes,left=370,top=100,menubar=1,width=" + w + ",height=" + h; window.open(FileName,"",strOption); } function up_downList(checksearchPs){ var mybrowser=navigator.userAgent; if(checksearchPs!=1){ if(mybrowser.indexOf('MSIE')>0){ if(openshow.style.display=='none'){ openshow.style.display=''; }else if(openshow.style.display==''){ openshow.style.display='none'; } }else{ if(document.getElementById( 'openshow' ).style.display=='none'){ document.getElementById( 'openshow' ).setAttribute( 'style', 'display:' ); }else if(document.getElementById( 'openshow' ).style.display==''){ document.getElementById( 'openshow' ).setAttribute( 'style', 'display:none' ); } } } } function changeDivDisplay(id) {
for (var i=0; i<document.ff.length; i++) { if(document.ff.elements[i].type == 'radio') { if(id==0 || id==1 || id==2 || id==6){ document.ff.elements[i].style.display = "none"; }else{ document.ff.elements[i].style.display = ""; } } } } function getDataDoc(searchDoc){ if(document.gg.fileupload.value==""){ alert("กรุณา Browse เลือกเแฟ้ม"); return false ; } document.gg.method.value="uploadfile"; document.gg.submit(); } function checkDelete(DtmpID){ var agree=confirm("คุณต้องการลบแฟ้มหนังสือนี้แน่นอนใช่หรือไม่ ?"); if (agree){ document.gg.DtmpID.value = DtmpID; document.gg.method.value="delfile"; document.gg.submit(); }else{ return false ; } } function test() { var check_sendToPs_len = document.ff.check_sendToPs.length; if(check_sendToPs_len==0) { document.getElementById('st_val').value ='';
} document.getElementById('st_val').value ='';
for ( i = 0; i<check_sendToPs_len ; i++) { if(document.ff.check_sendToPs[i].checked) { document.getElementById('st_val').value+=document.ff.check_sendToPs[i].value+','; } } fin_str = document.getElementById('st_val').value; document.getElementById('st_val').value = fin_str.replace(',on,',''); } </script>
|