| 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 : |
<?
$star = array(6);
$star[6] =0 ;
$star[5] =0 ;
$star[4] =0 ;
$star[3] =0 ;
$star[2] =0 ;
$star[1] =0 ;
/*$star4 =0;
$star3 =0;
$star2 =0;
$star1 =0;
$star0 =0;*/
$database_host = 'localhost';
$database_username = 'root';
$database_password = '090407';
$database_name = 'mit';
$mysqli = new mysqli($database_host, $database_username, $database_password, $database_name);
//กำหนด charset ให้เป็น utf8 เพื่อรองรับภาษาไทย
$mysqli->set_charset("utf8");
//กรณีมี Error เกิดขึ้น
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
//เรียกข้อมูลจาก ตาราง chart
$get_data = $mysqli->query("SELECT COUNT(evaluation) as Numb,evaluation FROM report GROUP BY evaluation");
while($data = $get_data->fetch_assoc()){
$star[$data['evaluation']+1]= $data['Numb'];
}
/*while($data = $get_data->fetch_assoc()){
$star5 = $star5+1 ;
}
$get_data = $mysqli->query("SELECT * FROM report where evaluation ='4'");
while($data = $get_data->fetch_assoc()){
$star4 = $star4+1 ;
}
$get_data = $mysqli->query("SELECT * FROM report where evaluation ='3'");
while($data = $get_data->fetch_assoc()){
$star3 = $star3+1 ;
}
$get_data = $mysqli->query("SELECT * FROM report where evaluation ='3'");
while($data = $get_data->fetch_assoc()){
$star2 = $star2+1 ;
}*/
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>KPI</title>
</head>
<a target ="_blank" href= "http://10.0.0.10/kpiit/chart.php">
<table width="88" height="158" border="0">
<tr>
<td width="60" height="20"><img src="img/rate-stars5.png" width="59" height="10"></td>
<td><div align="right"><font color=\"red\"><?php echo $star[6]?></font></div></td>
</tr>
<tr>
<td height="20"><img src="img/rate-stars4.png" width="59" height="10"></td>
<td><div align="right"><?php echo $star[5] ?></div></td>
</tr>
<tr>
<td height="20"><img src="img/rate-stars3.png" width="60" height="10"></td>
<td><div align="right"><?php echo $star[4] ?></div></td>
</tr>
<tr>
<td height="20"><img src="img/rate-stars2.png" width="59" height="10"></td>
<td><div align="right"><?php echo $star[3] ?></div></td>
</tr>
<tr>
<td height="20"><img src="img/rate-stars1.png" width="59" height="10"></td>
<td><div align="right"><?php echo $star[2] ?></div></td>
</tr>
<tr>
<td height="20"><img src="img/rate-stars.png" width="59" height="10"></td>
<td><div align="right"><?php echo $star[1] ?></div></td>
</tr>
<tr>
<td height="22"><div align="center"><div style=\"font-size:2.5em;\">
<p>รวม</p></div></div></td>
<td><div align="right"><?php echo $star[6]+$star[1]+$star[2]+$star[3]+$star[4]+$star[5] ?></div></td>
</tr>
</table>
</a>