|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_fd/ |
Upload File : |
<?
session_start();
include "config/config.inc.php";
include("function/function.php");
if(!isset($session_username)){
header("Location:login.php");
}
$month_arr=array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
if($action == "save_late"){
// update รายการทั้งหมด
$strSQL_sl = "UPDATE tbl_request SET date_late='$save_date_late'";
$Result_sl = mysql_db_query($dbname,$strSQL_sl);
echo "
<script language=\"javascript\">
location.href='report_index.php?action=report_group&num=bt';
</script>
";
exit();
}
if($action == "DEL"){
$strSQL_del ="DELETE FROM tbl_request WHERE runid='$del_id'";
$Result_del = mysql_db_query($dbname,$strSQL_del);
if($Result_del){
echo "
<script language=\"javascript\">
alert(\"ลบรายการเรียบร้อย\\n \");
location.href='report_index.php?action=report_group&num=$num';
</script>";
exit();
}
}
?>
<html>
<head>
<title><?=$show_title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<LINK href="common/style.css" rel=stylesheet>
<script language='javascript' src='daily_popcalendar.js'></script>
<script language='javascript' src='displayelement.js'></script>
<script language='javascript' src='sorttable.js'></script>
<style type="text/css">
<!--
.header1 { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:1em;
font-weight:bold;
color: #FFFFFF;
}
.main { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
color:#FF0000;
font-weight:bold;
}
.normal { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style5 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
function CheckForm(){
var f1 = document.form;
a = Number(f1.save_date_late.value) ;
missinginfo = "";
missinginfo1 = "";
if (document.form.save_date_late.value == "") {missinginfo1 += "\n- กรุณากรอก จำนวนวันที่แจ้งเตือน"; }
if (a == null || !a.toString().match(/^[-]?\d*\.?\d*$/)){ missinginfo1 += "\n- กรุณากรอกเป็นตัวเลขเท่านั้น "; }
if (missinginfo1 != "") {
missinginfo += "ไม่สามารถบันทึกข้อมูลได้ เนื่องจาก \n";
missinginfo +="_____________________________\n";
missinginfo = missinginfo + missinginfo1 ;
missinginfo += "\n___________________________";
missinginfo += "\nกรุณาตรวจสอบ อีกครั้ง";
alert(missinginfo);
return false;
}
}
function popWindow(url, w, h){
var popup = "Popup";
if(w == "") w = 640;
if(h == "") h = 480;
var newwin = window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
newwin.focus();
}
</SCRIPT>
</head>
<body >
<? include("header_menu.php"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#144C85', EndColorStr='#ffffff');">
<tr>
<td align="center" valign="top">
<table width="550" border="0" cellspacing="1" cellpadding="1">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#8DA0C0"><span class="style5">ตรวจสอบการติดตามงาน</span></td>
</tr>
<tr>
<td align="center" bgcolor="#ECEFF4">
<form name="form" method="post" action="?" onSubmit="return CheckForm();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$strSQL_keylate = "SELECT * FROM tbl_request ";
$Result_keylate = mysql_db_query($dbname,$strSQL_keylate);
$Rs_k = mysql_fetch_object($Result_keylate);
?>
<tr>
<td width="40%" align="right">ระบุวันแจ้งเตือนก่อนดำเนินการเสร็จ</td>
<td width="24%" align="center"><label>
<input name="save_date_late" type="text" class="main" value="<?=$Rs_k->date_late?>" size="5">
วัน
</label></td>
<td width="36%" align="left"><label>
<input type="hidden" name="action" value="save_late">
<input type="submit" name="Submit2" value="บันทึกจำนวนวันแจ้งเตือน" >
</label></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td align="right" bgcolor="#ECEFF4">
<form name="form2" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<?
$strSQL = "SELECT COUNT(*) AS num_all FROM tbl_request";
$Result = mysql_db_query($dbname,$strSQL);
$Rs = mysql_fetch_object($Result);
?>
<tr>
<td width="33" align="center" bgcolor="#ECEFF4"><img src="images/view_backup.gif" width="16" height="16"></td>
<td width="138" align="left" bgcolor="#ECEFF4">จำนวนเรื่องทั้งหมด</td>
<td colspan="2" align="center" bgcolor="#ECEFF4"> <a href="?action=report_group&num=all"><?=$Rs->num_all?></a></td>
<td width="135" align="center" bgcolor="#ECEFF4">รายการ</td>
</tr>
<?
$c_md = date("m-d");
$c_y = date("Y")+543;
$c_date = $c_y."-".$c_md;
$strSQL1 = "SELECT * FROM tbl_request WHERE date_complate = '' or date_complate IS NULL";
$Result1 = mysql_db_query($dbname,$strSQL1);
$nk = 0;
while($Rs1 = mysql_fetch_object($Result1)){
$date_end[$nk] = $Rs1->date_end;
$date_late[$nk] = $Rs1->date_late;
$xrunid[$nk] = $Rs1->runid;
$nk++;
}
$num_late = 0;
for($j=0;$j<count($date_end);$j++){
$date_start_c = date("Y-m-d");
$type_time = "d";
$check_status = Check_subject_count($date_start_c,$date_end[$j],$type_time,$xrunid[$nk]);
//echo $check_status." <= ".$date_late[$j]."<br>";
//echo $Rs2->t1."<<<======".$date_late[$j]."<br>";
if($check_status <= $date_late[$j]){
$num_late++;
}
}
?>
<tr>
<td align="center" bgcolor="#ECEFF4"><img src="images/view_backup.gif" width="16" height="16"></td>
<td align="left" bgcolor="#ECEFF4">จำนวนเรื่องที่ล่าช้า</td>
<td colspan="2" align="center" bgcolor="#ECEFF4"><? if($num_late < 1){ echo $num_late ; }else{?><a href="?action=report_late&mun=late"><?=$num_late?></a><? }?></td>
<td align="center" bgcolor="#ECEFF4">รายการ</td>
</tr>
<?
$strSQL3 = "SELECT COUNT(*) AS num_comp FROM tbl_request WHERE date_complate <> '' or date_complate <> NULL";
$Result3 = mysql_db_query($dbname,$strSQL3);
$Rs3 = mysql_fetch_object($Result3);
?>
<tr>
<td align="center" bgcolor="#ECEFF4"><img src="images/view_backup.gif" width="16" height="16"></td>
<td align="left" bgcolor="#ECEFF4">จำนวนเรื่องที่สำเร็จ</td>
<td colspan="2" align="center" bgcolor="#ECEFF4">
<?
if($Rs3->num_comp > 0){
?>
<a href="?action=report_group&num=comp">
<?=$Rs3->num_comp?>
</a>
<?
}else{
echo $Rs3->num_comp;
}
?> </td>
<td align="center" bgcolor="#ECEFF4">รายการ</td>
</tr>
<tr>
<td align="center" bgcolor="#ECEFF4"> </td>
<td align="left" bgcolor="#ECEFF4"> </td>
<td colspan="2" align="center" bgcolor="#ECEFF4"> </td>
<td align="center" bgcolor="#ECEFF4"> </td>
</tr>
<tr>
<td rowspan="2" align="center" valign="middle" bgcolor="#ECEFF4"><img src="images/view_backup.gif" width="16" height="16"></td>
<td rowspan="2" align="left" bgcolor="#ECEFF4">แสดงรายงานตามช่วงเวลา </td>
<td width="211" align="left" bgcolor="#ECEFF4"><input name="date_s" type="text" onFocus="blur();" value="<?=$date_s?>" size="15" readonly>
<input name="button2" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_s, 'yyyy-mm-dd')" value='วันเดือนปี'>
</td>
<td width="23" rowspan="2" align="left" valign="middle" bgcolor="#ECEFF4">ถึง </td>
<td rowspan="2" align="center" valign="middle" bgcolor="#ECEFF4"><label>
<input type="submit" name="Submit" value="แสดงรายการ">
<input type="hidden" name="action" value="report_group">
<input type="hidden" name="num" value="bt">
</label></td>
</tr>
<tr>
<td align="left" bgcolor="#ECEFF4"><input name="date_e" type="text" onFocus="blur();" value="<?=$date_e?>" size="15" readonly>
<input name="button" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_e, 'yyyy-mm-dd')" value='วันเดือนปี'></td>
</tr>
<tr>
<td colspan="5" align="center" valign="middle" bgcolor="#ECEFF4">
<? if(Check_menu($session_status_pri)){?>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td colspan="2" align="center"> </td>
</tr>
<tr>
<td colspan="2" align="center"><a href="report_stat.php" target="_self">รายงานสถิติเรื่องร้องเรียน</a></td>
</tr>
<tr>
<td width="6%" align="center"> </td>
<td width="94%"> </td>
</tr>
</table>
<?
}
?>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td> </td>
</tr>
<tr valign="top">
<td>
<?
if($action == "report_group"){
if($num == "bt"){
if($date_s != "" and $date_e != ""){
$strSQL_group = "SELECT * FROM tbl_request WHERE date_start >= '$date_s' AND date_end <= '$date_e' ORDER BY runid DESC";
}else{
$strSQL_group = "SELECT * FROM tbl_request ORDER BY runid DESC";
}
}else if($num == "all"){
$strSQL_group = "SELECT * FROM tbl_request ORDER BY runid DESC";
}else if($num == "comp"){
$strSQL_group = "SELECT * FROM tbl_request WHERE date_complate <> '' or date_complate <> NULL ORDER BY runid DESC";
}else{
$strSQL_group = "SELECT * FROM tbl_request ORDER BY runid DESC ";
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="99%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666" class="sortable" id="table0">
<tr onMouseOver="this.style.cursor='hand'; this.style.background='#EFEFEF';" onMouseOut="this.style.cursor='point'; this.style.background='#FFFFFF';">
<td width="4%" align="center" bgcolor="#8DA0C0"><strong>ลำดับ</strong></td>
<td width="15%" align="center" bgcolor="#8DA0C0"><strong>ชื่อเรื่อง</strong></td>
<td width="11%" align="center" bgcolor="#8DA0C0"><strong>เลขที่หนังสือ/ลว.</strong></td>
<td width="8%" align="center" bgcolor="#8DA0C0"><strong>จาก</strong></td>
<td width="9%" align="center" bgcolor="#8DA0C0"><strong>ผู้รับผิดชอบ</strong></td>
<td width="10%" align="center" bgcolor="#8DA0C0"><strong>เลขที่หนังสือออก</strong></td>
<td width="9%" align="center" bgcolor="#8DA0C0"><strong>ส่งที่ไหน</strong></td>
<td width="22%" align="center" bgcolor="#8DA0C0"><strong>รายละเอียด</strong></td>
<td width="5%" align="center" bgcolor="#8DA0C0"><strong>สถานะ</strong></td>
<td width="7%" align="center" bgcolor="#8DA0C0">
<input name="button3" type="button" onClick="location.href='form_add_system.php?action=ADD&num=<?=$num?>'" value="เพิ่ม" <?=Check_menu($session_status_pri)?>></td>
</tr>
<?
$Result_group = mysql_db_query($dbname,$strSQL_group);
$kk = 0;
while($Rs_g = mysql_fetch_object($Result_group)){
$bg_color = ($i%2)?'#F1F1F1':'FFFFFF';$kk++;
$date_start_c = date("Y-m-d");
$type_time = "d";
$check_status = Check_subject_late($date_start_c,$Rs_g->date_end,$type_time,$Rs_g->runid);
if(($check_status == 1) AND ($Rs_g->date_complate == "" OR $Rs_g->date_complate == NULL)){ $img = "<img src=\"images/notapprove.gif\" width=\"16\" height=\"16\" border=\"0\" alt='ยังไม่ดำเนินการ'>";}else if($Rs_g->date_complate != ""){ $img = "<img src=\"images/approve20.png\" width=\"16\" height=\"16\" border=\"0\" alt='ดำเนินการเรียบร้อยแล้ว'>";}else{ $img = "<img src=\"images/alert.gif\" width=\"16\" height=\"16\" border=\"0\" alt='อยู่ระหว่างการดำเนินการ'>";}
//echo $check_status;
?>
<tr bgcolor="<? if(($check_status == 1)AND ($Rs_g->date_complate =="" OR $Rs_g->date_complate == NULL)){ echo"#FF6600";}else{ echo $bg_color;}?>">
<td align="center"><?=$kk?></td>
<td align="left"><a href="#" onClick="popWindow('report_detail.php?runid=<?=$Rs_g->runid?>','640','480')"><?=$Rs_g->subject?></a></td>
<td align="left"><?=$Rs_g->subject_no_in?><? if($Rs_g->attach_sb_in != "" or $Rs_g->attach_sb_in <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_sb_in' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="left"><?=$Rs_g->subject_form?></td>
<td align="left">
<?
echo $Rs_g->person_res
?>
</td>
<td align="left"><?=$Rs_g->subject_no_out?><? if($Rs_g->attach_sb_out != "" or $Rs_g->attach_sb_out <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_sb_out' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="left"><?=$Rs_g->depart?></td>
<td align="left"><?=$Rs_g->detail?><? if($Rs_g->attach_date_comp != "" or $Rs_g->attach_date_comp <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_date_comp' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="center"><?=$img?></td>
<td align="center">
<? if($session_status_pri == 1){ echo "<img src=\"images/b_drop.png\" alt=\"ลบรายการ\" width=\"16\" height=\"16\" border=\"0\">";}else{?><a href="report_index.php?action=DEL&del_id=<?=$Rs_g->runid?>&num<?=$num?>"><img src="images/b_drop.png" width="16" height="16" border="0"></a><? }?>
<? if($session_status_pri == 1){ echo "<img src=\"images/document_edit.gif\" alt=\"แก้ไขรายการ\" width=\"20\" height=\"20\" border=\"0\">";}else{?><a href="form_add_system.php?action=EDIT&runid=<?=$Rs_g->runid?>&num=<?=$num?>"><img src="images/document_edit.gif" alt="แก้ไขรายการ" width="20" height="20" border="0"></a><? }?></td>
</tr>
<?
}
?>
</table></td>
</tr>
</table>
<?
}
?>
</td>
</tr>
<tr>
<td>
<?
if($action == "report_late"){
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="99%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666" class="sortable" id="table0">
<tr onMouseOver="this.style.cursor='hand'; this.style.background='#EFEFEF';" onMouseOut="this.style.cursor='point'; this.style.background='#FFFFFF';">
<td width="4%" align="center" bgcolor="#8DA0C0"><strong>ลำดับ</strong></td>
<td width="14%" align="center" bgcolor="#8DA0C0"><strong>ชื่อเรื่อง</strong></td>
<td width="11%" align="center" bgcolor="#8DA0C0"><strong>เลขที่หนังสือ/ลว.</strong></td>
<td width="9%" align="center" bgcolor="#8DA0C0"><strong>จาก</strong></td>
<td width="9%" align="center" bgcolor="#8DA0C0"><strong>ผู้รับผิดชอบ</strong></td>
<td width="10%" align="center" bgcolor="#8DA0C0"><strong>เลขที่หนังสือออก</strong></td>
<td width="9%" align="center" bgcolor="#8DA0C0"><strong>ส่งที่ไหน</strong></td>
<td width="22%" align="center" bgcolor="#8DA0C0"><strong>รายละเอียด</strong></td>
<td width="5%" align="center" bgcolor="#8DA0C0"><strong>สถานะ</strong></td>
<td width="7%" align="center" bgcolor="#8DA0C0"><input name="button4" type="button" onClick="location.href='form_add_system.php?action=ADD&num=<?=$num?>'" value="เพิ่ม" <?=Check_menu($session_status_pri)?>></td>
</tr>
<?
$strSQL_group = "SELECT * FROM tbl_request WHERE date_complate = '' or date_complate IS NULL ORDER BY runid DESC";
$Result_group = mysql_db_query($dbname,$strSQL_group);
$kk = 0;
while($Rs_g = mysql_fetch_object($Result_group)){
$bg_color = ($i%2)?'#F1F1F1':'FFFFFF';
///========
$date_start_c = date("Y-m-d");
$type_time = "d";
$check_status = Check_subject_late($date_start_c,$Rs_g->date_end,$type_time,$Rs_g->runid);
//============
//$check_status = Check_subject_late($Rs_g->runid);
if($check_status){
$kk++;
if(($check_status == 1) AND ($Rs_g->date_complate == "" OR $Rs_g->date_complate == NULL)){ $img = "<img src=\"images/notapprove.gif\" width=\"16\" height=\"16\" border=\"0\" alt='ยังไม่ดำเนินการ'>";}else if($Rs_g->date_complate != ""){ $img = "<img src=\"images/approve20.png\" width=\"16\" height=\"16\" border=\"0\" alt='ดำเนินการเรียบร้อยแล้ว'>";}else{ $img = "<img src=\"images/alert.gif\" width=\"16\" height=\"16\" border=\"0\" alt='อยู่ระหว่างการดำเนินการ'>";}
?>
<tr bgcolor="<? if($check_status){ echo"#FF6600";}else{ echo $bg_color;}?>">
<td align="center"><?=$kk?></td>
<td align="left"><a href="#" onClick="popWindow('report_detail.php?runid=<?=$Rs_g->runid?>','640','480')"><?=$Rs_g->subject?></a></td>
<td align="left"><?=$Rs_g->subject_no_in?>
<? if($Rs_g->attach_sb_in != "" or $Rs_g->attach_sb_in <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_sb_in' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="left"><?=$Rs_g->subject_form?></td>
<td align="left"><?
echo $Rs_g->person_res;
?> </td>
<td align="left"><?=$Rs_g->subject_no_out?>
<? if($Rs_g->attach_sb_out != "" or $Rs_g->attach_sb_out <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_sb_out' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="left"><?=$Rs_g->depart?></td>
<td align="left"><?=$Rs_g->detail?>
<? if($Rs_g->attach_date_comp != "" or $Rs_g->attach_date_comp <> NULL ){ echo "<a href='attach_file/$Rs_g->attach_date_comp' target='_blank'><img src=\"images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
<td align="center"><?=$img?></td>
<td align="center">
<? if($session_status_pri == 1){ echo "<img src=\"images/b_drop.png\" width=\"16\" height=\"16\" border=\"0\">";}else{?>
<a href="report_index.php?action=DEL&del_id=<?=$Rs_g->runid?>&num=<?=$num?>"><img src="images/b_drop.png" width="16" height="16" border="0"></a><? }?>
<? if($session_status_pri == 1){ echo "<img src=\"images/document_edit.gif\" alt=\"แก้ไขรายการ\" width=\"20\" height=\"20\" border=\"0\">";}else{?><a href="form_add_system.php?action=EDIT&runid=<?=$Rs_g->runid?>&num=<?=$num?>"><img src="images/document_edit.gif" alt="แก้ไขรายการ" width="20" height="20" border="0"></a><? }?></td>
</tr>
<?
}
}
?>
</table></td>
</tr>
</table>
<?
}
?> </td>
</tr>
</table>
</body>
</html>