|
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_eoffice/application/ecomplain/ |
Upload File : |
<?
session_start();
include "config/config.inc.php";
include("function/function.php");
if(!isset($session_username)){
header("Location:login.php");
}
$month_arr=array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
//insert timeQuery
include("../../common/common_system.inc.php");
$ApplicationName="ecomplain";
$time_start = getmicrotime();
//insert timeQuery
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" >
<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>
<?
//insert timeQuery
$time_end = getmicrotime();
writetime2db($timestart,$timeend);
//insert timeQuery
?>