39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
include("inc/FusionCharts.php");
|
|
include("config.php");
|
|
?>
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Previous Tons</TITLE>
|
|
<link rel="shortcut icon" href="http://lasuca.com/images/favicon.ico" />
|
|
<SCRIPT LANGUAGE="Javascript" SRC="js/FusionCharts.js"></SCRIPT>
|
|
</HEAD>
|
|
<BODY>
|
|
<CENTER>
|
|
<?php
|
|
$link = connectToDB();
|
|
$strXML = "<chart legendPostion='' theme='fint' caption='Previous Tons' subCaption='' updateInterval='30' refreshInterval='5' YAxisMaxValue='1000' numberSuffix='PPH/Ton' showValues='0' formatNumberScale='0'>";
|
|
$strXML .="<categories>";
|
|
$strQuery = "select Z_TIMESTAMP, LBSPERHR FROM milling GROUP by LBSPERHR ORDER by Z_TIMESTAMP DESC";
|
|
$result = mysql_query($strQuery) or die(mysql_error());
|
|
if ($result) {
|
|
while($ors = mysql_fetch_array($result)) {
|
|
$strXML .= "<category label='" . $ors['Z_TIMESTAMP'] . "' />";
|
|
}
|
|
}
|
|
$result2 = mysql_query($strQuery) or die(mysql_error());
|
|
$strXML .="</categories><dataset seriesName='Previous Tons'>";
|
|
if ($result2) {
|
|
while($ors1 = mysql_fetch_array($result2)) {
|
|
$strXML .= "<set value='".$ors1['LBSPERHR']."' />";
|
|
}
|
|
}
|
|
|
|
|
|
mysql_close($link);
|
|
$strXML .= "</dataset></chart>";
|
|
|
|
echo renderChart("msline", "", $strXML, "", '100%', 500, false, true);
|
|
?>
|
|
</BODY>
|
|
</HTML>
|