|
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");
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 = "SELECT org_staffgroup.groupname,tbl_complain_approve.office_id FROM org_staffgroup LEFT JOIN tbl_complain_approve ON org_staffgroup.gid=tbl_complain_approve.office_id WHERE org_staffgroup.group_type='1' AND year(tbl_complain_approve.date_start)='$yy' ORDER BY org_staffgroup.groupname ASC"; // group_type = 1 คือเลือกมาเฉพาะหน่วยงานเท่านั้นยกเว้นกลุ่มภาระกิจ
//echo $sql;
$result = @mysql_db_query($dbname,$sql);
$num_rc = @mysql_num_rows($result);
while($rs = mysql_fetch_assoc($result)){
$Arr_gname[$rs[groupname]] = $Arr_gname[$rs[groupname]]+1;
}
$temp_arr = $Arr_gname;
$a = 0;
if($num_rc > 0){ // ในกรณีมีรายการ
foreach($temp_arr as $keyx => $valx){
$a++;
if($daylist > "") $daylist .= ";";
if($data1 > "") $data1 .= ";";
$daylist .= $keyx;
$data1 .= $valx;
if($a == "15"){ break;} // แสดงกราฟเฉพาะ 15 อันดับแรกเท่านั้น
}
} // end if($num_rc > 0){
$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_arr1 = $Arr_gname;
arsort($temp_arr1);
$j=0;
foreach($temp_arr1 as $k1 => $v1){
$bg = ($j%2)?'#F1F1F1':'FFFFFF';$j++;
?>
<TR bgcolor="<?=$bg?>">
<TD align="left" valign="top"> <?=$k1?></TD>
<TD align="right" valign="top"> <?=number_format($v1);?></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="57%" align="center" bgcolor="#BDC9F9"><STRONG>หน่วยงาน</STRONG></TD>
<TD width="24%" align="center" bgcolor="#BDC9F9"><STRONG>จำนวนเรื่อง</STRONG></TD>
<TD width="19%" align="center" bgcolor="#BDC9F9"><STRONG>คิดเป็นร้อยละ</STRONG></TD>
</TR>
<?
$sum_t = @array_sum($Arr_gname);
$kk=0;
foreach($Arr_gname as $key => $val){
$bg_color = ($kk%2)?'#F1F1F1':'FFFFFF';$kk++;
?>
<TR bgcolor="<?=$bg_color?>">
<TD align="left"><?=$key?></TD>
<TD align="center"><?=number_format($val)?></TD>
<TD align="center"><?
if($sum_t > 0){
echo number_format(($val*100)/$sum_t,2);
}else{
echo "0.00";
}
?></TD>
</TR>
<?
}
?>
<TR>
<TD align="center" bgcolor="#FFFFFF"><STRONG>รวม</STRONG></TD>
<TD align="center" bgcolor="#FFFFFF"><?=$sum_t?></TD>
<TD align="center" bgcolor="#FFFFFF"><? if($sum_t > 0){ echo number_format(($sum_t*100)/$sum_t,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
?>