|
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_integration/requirement/application/ecomplain/ |
Upload File : |
<?
session_start();
include "../../config/config.inc.php";
include("function/function.php");
include ("graph.inc.php");
if(!isset($session_username)){
header("Location: ../document/login.php");
}
include("header_menu.php");
//insert timeQuery
include("../../common/common_system.inc.php");
$ApplicationName="ecomplain";
$time_start = getmicrotime();
//insert timeQuery
$month_arr=array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
if($yy == ""){
$yy = date("Y");
}else{
$yy = $yy;
}
addlog("แสดงหน้ารายงานสัดส่วนการรับเรื่องราวร้องทุกข์จำแนกรายเดือน",$app_id,$act7); // add log
$sql_re = "SELECT month( accept_date ) as mm FROM tbl_complain_approve WHERE year( accept_date )='$yy'";
$result_re = @mysql_db_query($dbname,$sql_re);
$num_c = @mysql_num_rows($result_re);
while($rs = @mysql_fetch_assoc($result_re)){
$Arr_report[$rs[mm]] = $Arr_report[$rs[mm]] +1;
}
$xmonth_arr = $month_arr;
for($m=1;$m<count($xmonth_arr);$m++){
if($daylist > "") $daylist .= ";";
if($data1 > "") $data1 .= ";";
$daylist .= $xmonth_arr[$m];
$data1 .= intval($Arr_report[$m]);
}
$txt_title = "สัดส่วนการรับเรื่องร้องเรียนจำแนกรายเดือน ปี ".($yy+543);
$graphurl = $graph_path . "?category=$daylist&data1=$data1&outputstyle=&numseries=1&seriesname=&graphtype=pie&title=$txt_title&xname=เดือน&yname=จำนวน(ความต้องการ)&subtitle=&graphstyle=srd_sf_004.scs";
$w1 = 250;
$h1 = 150;
?>
<html>
<head>
<title><?=$show_title?></title>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
<link href="../../common/style.css" type="text/css" rel="stylesheet" />
<script language='javascript' src='daily_popcalendar.js'></script>
<script language='javascript' src='displayelement.js'></script>
<style type="text/css">
<!--
body { margin: 0px 0px; padding: 0px 0px}
a:link { color: #005CA2; text-decoration: none}
a:visited { color: #005CA2; text-decoration: none}
a:active { color: #0099FF; text-decoration: underline}
a:hover { color: #0099FF; text-decoration: underline}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
function CheckForm(){
var f1 = document.form;
a = Number(f1.date_late.value) ;
missinginfo = "";
missinginfo1 = "";
if (document.form.subject.value == "") {missinginfo1 += "\n- กรุณากรอก ความต้องการ "; }
if (document.form.subject_no_in.value == "") {missinginfo1 += "\n- กรุณากรอก เลขที่หนังสือ "; }
if (document.form.date_start.value == "") {missinginfo1 += "\n- กรุณากรอก วันเริ่มต้น "; }
if (document.form.date_end.value == "") {missinginfo1 += "\n- กรุณากรอก สิ้นสุด "; }
if (document.form.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;
}
}
</SCRIPT>
<script language="javascript">
function popWindow(url, w, h){
var popup = "Popup";
if(w == "") w = 420;
if(h == "") h = 300;
var newwin = window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
newwin.focus();
}
function popWindow1(url, w, h){
var popup = "Popup";
if(w == "") w = 420;
if(h == "") h = 300;
var newwin = window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
newwin.focus();
}
function popWindow2(url, w, h){
var popup = "Popup";
if(w == "") w = 420;
if(h == "") h = 300;
var newwin = window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
newwin.focus();
}
</script>
<script language="javascript">
function clearselect()
{
document.post.salary_day.disabled=true;
document.post.salary_month.disabled=true;
document.post.salary_year.disabled=true;
document.post.label_date.disabled=true;
if (document.post.salary_day.value!="")
{
document.post.salary_day.value="";
document.post.salary_day.disabled=true;
}
if (document.post.salary_month.value!="")
{
document.post.salary_month.value="";
document.post.salary_month.disabled=true;
}
if (document.post.salary_year.value!="")
{
document.post.salary_year.value="";
document.post.salary_year.disabled=true;
}
if (document.post.label_date.value!="")
{
document.post.label_date.value="";
document.post.label_date.disabled=true;
}
}
</script>
</head>
<body >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top" background="bimg/bg1.gif" style="background-repeat: no-repeat; background-position:right bottom ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" bgcolor="#FFFFFF"><form name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6%" align="center" valign="middle"> เลือกปี </td>
<td width="89%"><label>
<? $c_yy = date("Y");?>
<select name="yy" id="yy">
<?
for($n=2008;$n<=$c_yy;$n++){
if($n == $yy){ $sel_e = "selected";}else{ $sel_e = "";}
echo "<option value='$n' $sel_e>".($n+543)."</option>";
}
?>
</select>
<input type="submit" name="Submit" value="ตกลง">
</label></td>
<td width="5%" align="center"><img src="../../images/element_previous.png" width="24" height="24" alt="กลับหน้าหลัก" onClick="location.href='report_main.php'" style="cursor:hand"></td>
</tr>
</table>
</form> </td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="38%" align="center" valign="top">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="<?=$w1?>" height="<?=$h1?>">
<param name="movie" value="<?=$graphurl?>">
<param name="quality" value="high">
<embed src="<?=$graphurl?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<?=$w1?>" height="<?=$h1?>"></embed>
</object>
<BR><BR>
<button name="graph1" class="epm_button" style="width:120px;" onClick="window.open('<?=$graphurl?>')">กราฟขนาดใหญ่</button> </td>
<td width="62%" align="center" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" bgcolor="#000000"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="2" align="left" valign="top" bgcolor="#BDC9F9"><strong>สัดส่วนการรับเรื่องร้องเรียนจำแนกรายเดือนสูงสุด 5 อันดับแรก </strong></td>
</tr>
<tr>
<td width="70%" align="center" valign="top" bgcolor="#BDC9F9"><strong>เดือน</strong></td>
<td width="30%" align="center" valign="top" bgcolor="#BDC9F9"><strong>จำนวนเรื่อง</strong></td>
</tr>
<?
$temp_arr = $Arr_report;
for($k=1;$k<count($month_arr);$k++){ // เก็บจำนวนเรื่องในแต่ละเดือนในไว้ในตัวแปร array
$arr[$k] = $temp_arr[$k];
}
arsort($arr);
$j=0;
foreach($arr as $key1 => $val1){
$bg = ($j%2)?'#F1F1F1':'FFFFFF';$j++;
?>
<tr bgcolor="<?=$bg?>">
<td align="left" valign="top"> <?="เดือน".$month_arr[$key1]?></td>
<td align="right" valign="top"> <?=number_format($val1);?></td>
</tr>
<?
if($j == "5"){ break;}
}
?>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
<td align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#000000"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="3" align="center" bgcolor="#BDC9F9"><strong>สัดส่วนการรับเรื่องร้องเรียนจำแนกรายเดือน ปี
<?=$yy+543?>
</strong></td>
</tr>
<tr>
<td width="15%" align="center" bgcolor="#BDC9F9"><strong>เดือน</strong></td>
<td width="45%" align="center" bgcolor="#BDC9F9"><strong>จำนวนเรื่อง</strong></td>
<td width="40%" align="center" bgcolor="#BDC9F9"><strong>คิดเป็นร้อยละ</strong></td>
</tr>
<?
$sum_t = @array_sum($Arr_report);
$kk=0;
for($m1=1;$m1< count($month_arr);$m1++){
$bg_color = ($kk%2)?'#F1F1F1':'FFFFFF';$kk++;
$sum_a += $Arr_report[$m1];
?>
<tr bgcolor="<?=$bg_color?>">
<td align="left"><?=$month_arr[$m1]?></td>
<td align="center"><?=number_format($Arr_report[$m1])?></td>
<td align="center"><?
if($num_c > 0){
$cal_persent = (($Arr_report[$m1]*100)/($sum_t)); echo number_format($cal_persent,2);
$all_persent += $cal_persent;
}else{
echo "0.00";
}
?></td>
</tr>
<?
}
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><strong>รวม</strong></td>
<td align="center" bgcolor="#FFFFFF"><?=$sum_a?></td>
<td align="center" bgcolor="#FFFFFF"><? if($num_c > 0){ echo number_format($all_persent,2);}else{ echo "0.00";}?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?
//insert timeQuery
$time_end = getmicrotime();
writetime2db($timestart,$timeend);
//insert timeQuery
?>