| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/kpiit/ |
Upload File : |
<?php
if (isset($_GET['Month'])) $MonthRP = $_GET['Month'];
else $MonthRP = 'All';
if (isset($_GET['Year'])) $YearRP = $_GET['Year'];
else {
if ( $MonthRP == 'All' || $MonthRP <= '09' ) $YearRP = date('Y')+543;
else $YearRP = date('Y')+544;
}
if ( $MonthRP == 'All' ) {
$nyear = $YearRP-544;
$startd = $nyear.'-10-01 00:00:00';
$stopd = ($nyear+1).'-10-01 00:00:00';
}
else {
if ( $MonthRP == '12' ) {
$nyear = $YearRP-544;
$startd = $nyear.'-12-01 00:00:00';
$stopd = ($nyear+1).'-01-01 00:00:00';
} else {
if ( $MonthRP >= '10' ) $nyear = $YearRP-544;
else $nyear = $YearRP-543;
$startd = $nyear.'-'.$MonthRP.'-01 00:00:00';
$stopd = $nyear.'-'.($MonthRP+1).'-01 00:00:00';
}
}
//ตั้งค่าการเชื่อมต่อฐานข้อมูล
$iTList = 'xxx';
$database_host = '192.168.1.39';
$database_port = '3306';
$database_username = 'root';
$database_password = '090407';
$database_name = 'mit';
$mysqli = new mysqli($database_host, $database_username, $database_password, $database_name, $database_port);
$mysqli->set_charset("utf8");
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$get_user = $mysqli->query('SELECT userID,name FROM user where instr(acctype,",IT") > 0 ' );
while($user = $get_user->fetch_assoc()){
$itUser= $user['userID'];
if (!strpos($iTList,$itUser)){
$iTList .= ';'.$itUser;
$Sql = 'SELECT "'.$itUser.'" as resID,sum(evaluation),count(*) FROM report where (resID ="'.$itUser.'" OR INSTR(coworker,"'.$itUser.'")) AND (reqDate BETWEEN "'.$startd.'" AND "'.$stopd.'")';
echo $Sql .'<br>';
$get_data = $mysqli->query($Sql);
while($data = $get_data->fetch_assoc()){
$result[] = $data;
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
function getValue(vname)
{
var n = document.getElementById(vname).value
return n;
}
function changeFunc() {
var URL;
URL = "<?php echo $_SERVER['PHP_SELF'] ?>";
URL += "?&Month=";
URL += getValue('MonthRP');
URL+="&Year=";
URL+=getValue('Cyear');
//alert(URL);
//"RedirectURL('.$RepId.','.$row["ItemID"].','.$RepYear.',\''.$RepMonth.'\','.$RepYCP.',\''.$RepMCP.'\');return false;"
window.location= URL;
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>ผลงาน IT</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
</head>
<table width = "20%" height="28" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="15%" height="28" ><div align="right">ปีงบประมาณ </div></td>
<td width="6%" height="28"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
<?php echo '<input name="regist" type="text" id="Cyear" value = "'.$YearRP.'" size="4" maxlength="4" >'; ?></font></td>
<td width="4%" height="28"><div align="right">เดือน </div></td>
<td width="6%" height="28" >
<select name="MonthRP" id="MonthRP" onChange="changeFunc()" >
<option value="All" <?php if($MonthRP == 'All'){echo("selected");}?>>All</option>
<option value="01" <?php if($MonthRP == '01'){echo("selected");}?>>01</option>
<option value="02" <?php if($MonthRP == '02'){echo("selected");}?>>02</option>
<option value="03" <?php if($MonthRP == '03'){echo("selected");}?>>03</option>
<option value="04" <?php if($MonthRP == '04'){echo("selected");}?>>04</option>
<option value="05" <?php if($MonthRP == '05'){echo("selected");}?>>05</option>
<option value="06" <?php if($MonthRP == '06'){echo("selected");}?>>06</option>
<option value="07" <?php if($MonthRP == '07'){echo("selected");}?>>07</option>
<option value="08" <?php if($MonthRP == '08'){echo("selected");}?>>08</option>
<option value="09" <?php if($MonthRP == '09'){echo("selected");}?>>09</option>
<option value="10" <?php if($MonthRP == '10'){echo("selected");}?>>10</option>
<option value="11" <?php if($MonthRP == '11'){echo("selected");}?>>11</option>
<option value="12" <?php if($MonthRP == '12'){echo("selected");}?>>12</option>
</select>
</td>
</tr>
</table>
<table class="table" id="datatable">
<thead>
<th>ผู้ให้บริการ</th>
<th>จำนวนครั้ง</th>
<th>คะแนนจากการประเมิน</th>
</tr>
</thead>
<tbody>
<?php
foreach($result as $result_tb){
$get_user = $mysqli->query('SELECT name FROM user where userID="'.$result_tb['resID'].'"');
while($user = $get_user->fetch_assoc()){
echo "<td>".$user['name']."</td>";
if ($result_tb['count(*)'] >= 1) echo "<td>".$result_tb['count(*)']."</td>";
else echo "<td>0</td>";
if ($result_tb['sum(evaluation)'] >=1) echo "<td>".$result_tb['sum(evaluation)']."</td>";
else echo "<td>0</td>";
echo"</tr>";
break;
}
}
?>
</tbody>
</table>
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script>
$(function () {
$('#container').highcharts({
data: {
//กำหนดให้ ตรงกับ id ของ table ที่จะแสดงข้อมูล
table: 'datatable'
},
chart: {
type: 'column'
},
title: {
text: 'ตัวชี้วัดการปฏิบัติงาน ศูนย์ข้อมูลและคอมพิวเตอร์ รพ.สัตหีบ กม.10'
},
yAxis: {
allowDecimals: false,
title: {
text: 'รวมคะแนน จากการประเมิน'
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
this.point.y; + ' ' + this.point.name.toLowerCase();
}
}
});
});
</script>
<iframe src="/phpgrid/demos/editing/report.php"height="500" width="1500"frameborder="0"scrolling="auto"align="left">
</iframe>
</body>
</html>