62 lines
2.1 KiB
PHP
62 lines
2.1 KiB
PHP
<head>
|
|
<link rel="stylesheet" href="styles.css">
|
|
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
|
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
$username="corey";
|
|
$password="41945549";
|
|
$database="controls";
|
|
|
|
mysql_connect('192.168.0.2',$username,$password);
|
|
@mysql_select_db($database) or die( "Unable to select database");
|
|
$query = "(SELECT DATE_FORMAT(`DATE`,'%h:%i:%s') AS timeonly, DATE_FORMAT(DATE,'%Y-%m-%d') AS dateonly, AVG(BOILER1SF) as BOILER1, AVG(BOILER2SF) as BOILER2, AVG(BOILER3SF) as BOILER3, AVG(BOILER4SF) as BOILER4, AVG(BOILER5SF) as BOILER5, AVG(BOILER6SF) as BOILER6
|
|
FROM trending WHERE TIME(`DATE`) BETWEEN '07:00:22' AND '23:59:22'
|
|
GROUP BY dateonly
|
|
ORDER BY ID ASC)";
|
|
|
|
$result=mysql_query($query);
|
|
|
|
mysql_close();
|
|
|
|
?>
|
|
|
|
<table id="table" style="margin: 1px auto; border: 2px solid black; border-collapse: collapse; width=850px;" class="stat">
|
|
<thead>
|
|
<tr style="margin: 1px auto; border: 1px solid black; border-collapse: collapse;">
|
|
<th>Date</th>
|
|
<th>Boiler1</th>
|
|
<th>Boiler2</th>
|
|
<th>Boiler3</th>
|
|
<th>Boiler4</th>
|
|
<th>Boiler5</th>
|
|
<th>Boiler6</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
while($row=mysql_fetch_assoc($result))
|
|
{
|
|
echo "<tr>";
|
|
echo "<td width=100>".$row [ 'dateonly' ]."</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER1' ], 2)." kpph</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER2' ], 2)." kpph</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER3' ], 2)." kpph</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER4' ], 2)." kpph</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER5' ], 2)." kpph</td>";
|
|
echo "<td width=150>".number_format ($row [ 'BOILER6' ], 2)." kpph</td>";
|
|
echo "</tr>";
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
<table id="table" style="margin: 1px auto; width=850px;" class="stat">
|
|
<tr>
|
|
<td align="left" colspan="6" bgcolor="#FFFFFF" border="0"><font color="#00BFFF"><i><a href="../data/boilerexport.php"> Export To Excel </a></i></font></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|