<?php
$username="corey";
$password="41945549";
$database="controls";

mysql_connect('127.0.0.1',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM boilers ORDER BY id DESC LIMIT 1"; 
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();
?>

<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"boiler1stmflo");
$f2=mysql_result($result,$i,"blr1fdtemp");
$f3=mysql_result($result,$i,"blr1flugas");
$f4=mysql_result($result,$i,"blr1idtemp");
$f5=mysql_result($result,$i,"boiler1drmlvl");
$f6=mysql_result($result,$i,"boiler1idfnspd");
$f7=mysql_result($result,$i,"boiler1drmpres");
$f8=mysql_result($result,$i,"boiler1fdwtrflo");
$f9=mysql_result($result,$i,"boiler2stmflo");
$f10=mysql_result($result,$i,"blr2fdtemp");
$f11=mysql_result($result,$i,"blr2fluemp");
$f12=mysql_result($result,$i,"blr2idtemp");
$f13=mysql_result($result,$i,"boiler2drmlvl");
$f14=mysql_result($result,$i,"boiler2idfnspd");
$f15=mysql_result($result,$i,"boiler2drmpres");
$f16=mysql_result($result,$i,"boiler2fdwtrflo");
$f17=mysql_result($result,$i,"boiler3stmflo");
$f18=mysql_result($result,$i,"blr3fdtemp");
$f19=mysql_result($result,$i,"blr3fluetemp");
$f20=mysql_result($result,$i,"blr3idtemp");
$f21=mysql_result($result,$i,"boiler3drmlvl");
$f22=mysql_result($result,$i,"boiler3idfnspd");
$f23=mysql_result($result,$i,"boiler3drmpres");
$f24=mysql_result($result,$i,"boiler3fdwtrflo");
$f25=mysql_result($result,$i,"boilr3draft");
$f26=mysql_result($result,$i,"boiler4stmflo");
$f27=mysql_result($result,$i,"blr4fdtemp");
$f28=mysql_result($result,$i,"blr4flugas");
$f29=mysql_result($result,$i,"blr4idtemp");
$f30=mysql_result($result,$i,"boiler4drmlvl");
$f31=mysql_result($result,$i,"boiler4idfnspd");
$f32=mysql_result($result,$i,"boiler4drmpres");
$f33=mysql_result($result,$i,"boilr4draft");
$f34=mysql_result($result,$i,"boiler5stmflo");
$f35=mysql_result($result,$i,"blr5fdtemp");
$f36=mysql_result($result,$i,"blr5flugas");
$f37=mysql_result($result,$i,"blr5idtemp");
$f38=mysql_result($result,$i,"boiler5drmlvl");
$f39=mysql_result($result,$i,"boiler5idfnspd");
$f40=mysql_result($result,$i,"boiler5drmpres");
$f41=mysql_result($result,$i,"boiler5fdwtrflo");
$f42=mysql_result($result,$i,"boilr5draft");
$f43=mysql_result($result,$i,"boiler6stmflo");
$f44=mysql_result($result,$i,"blr6fdtemp");
$f45=mysql_result($result,$i,"blr6flugas");
$f46=mysql_result($result,$i,"blr6idtemp");
$f47=mysql_result($result,$i,"boiler6drmlvl");
$f48=mysql_result($result,$i,"boiler6idfnspd");
$f49=mysql_result($result,$i,"boiler6drmpres");
$f50=mysql_result($result,$i,"boiler6fdwtrflo");
$f51=mysql_result($result,$i,"ttlstmflo");
$f52=mysql_result($result,$i,"livestmpres");
$f53=mysql_result($result,$i,"exstflow1");
$f54=mysql_result($result,$i,"exstflow2");
$f55=mysql_result($result,$i,"gate1");
$f56=mysql_result($result,$i,"gate2");
$f57=mysql_result($result,$i,"gate3");
$f58=mysql_result($result,$i,"exhaustpr");
$f59=mysql_result($result,$i,"boiler4fdwtrflo");
$f60=mysql_result($result,$i,"blr2superheat");
$f61=mysql_result($result,$i,"blr6superheat");
$f62=mysql_result($result,$i,"blr6superheat");
$f63=mysql_result($result,$i,"exstflow3");
$f64=mysql_result($result,$i,"ttlstmflo2");
?>

<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv BOILERS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->

<!-- ****************************************** ROW START ******************************************** -->

<table class="tftable1"> 
<tr>
<td colspan="2"><font color="#e0e0e0">Total Steam Flow:</font></td>
<td align="right" width="75"><font color="00FF00"><b><?php echo $f105; ?></b></font></td>
<td><font color="#e0e0e0">Kpph</font></td>

<td colspan="2"><font color="#e0e0e0">Vapor Header Pressure:</font></td>
<td align="right" id="lsp"><font color="00FF00"><b><?php echo $f77; ?></b></font></td>
<td><font color="#e0e0e0">PSI</font></td>

<td colspan="2"><font color="#e0e0e0">Live Steam Pressure:</font></td>
<?php
		$color = "#e0e0e0";
		
		if (($f52 >= 0) && ($f52 <= 155))
		$color = "#FF0000";
		else if (($f52 >= 156) && ($f52 <= 165))
		$color = "#FFFF00";
		else if ($f52 >= 165)
		$color = "#00FF00";
		
		echo "<td align=\"right\"><font color=\"$color\"><b> $f52 </b></font></td>";
	?>
<td><font color="#e0e0e0">PSI</font></td>
</tr>

<!-- ****************************************** ROW END ******************************************** -->

<!-- ****************************************** ROW START ******************************************** -->

<tr>
<td><font color="#e0e0e0">Exhaust Pressure:</font></td>
	<?php
		if ($f97 == 0)
		echo "<td align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
		if ($f97 == 1)
		echo "<td align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
	?>
	<?php
		$color = "#e0e0e0";
		
		if (($f58 >= 0) && ($f58 <= 5))
		$color = "#FF0000";
		else if (($f58 >= 6) && ($f58 <= 13))
		$color = "#FFFF00";
		else if ($f58 >= 14)
		$color = "#00FF00";
		
		echo "<td align=\"right\"><font color=\"$color\"><b> $f58 </b></font></td>";
	?>
<td><font color="#e0e0e0">PSI</font></td>

<td colspan="2"><font color="#e0e0e0"></font></td>
<td align="right"><font color="00FF00"><b></b></font></td>
<td><font color="#e0e0e0"></font></td>

<td colspan="2"><font color="#e0e0e0"></font></td>
<td align="right"><font color="00FF00"><b></b></font></td>
<td><font color="#e0e0e0"></font></td>
</tr>

</table>

<!-- ****************************************** ROW END ******************************************** -->

<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ START OF BOILERS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<table class="tftable5" border="1">
		<tr>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 1</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 2</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 3</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 4</font></td>		
		</tr>
		<tr>
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="110" value="<?php echo $f1; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f1; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="105" value="<?php echo $f9; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f9; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="90" value="<?php echo $f17; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f17; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="60" value="<?php echo $f26; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f26; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>		
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f5; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f13; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f21; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f30; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>				
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f8; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f16; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f24; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f59; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>				
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f7; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f15; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f23; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f32; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>				
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f6; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f14; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f22; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f31; ?></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>			
		</tr>
</table>
<table class="tftable5" border="1">
		<tr>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 5</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 6</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 7</font></td>
			<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 8</font></td>	
		</tr>
		<tr>
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="50" value="<?php echo $f34; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f34; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="85" value="<?php echo $f43; ?>"></progress></td>
			<td align="right" width="50"><font color="#e60000"><?php echo $f43; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="50" value=""></progress></td>
			<td align="right" width="50"><font color="#e60000"></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
			<td align="left" width="80"><progress id="progresstanks" max="50" value=""></progress></td>
			<td align="right" width="50"><font color="#e60000"></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>			
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f38; ?><font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><?php echo $f47; ?><font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><font></td>			
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
			<td align="right" width="50"><font color="#12bd5a"><font></td>				
			<td align="left" width="50"><font color="#e0e0e0">%</font></td>			
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f41; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"><?php echo $f50; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>	
			<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
			<td align="right" width="50"><font color="#129dbd"></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>			
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f40; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"><?php echo $f49; ?></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"></font></td>			
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
			<td align="right" width="50"><font color="#e2c211"></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">psi</font></td>				
		</tr>
		<tr>
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f39; ?></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"><?php echo $f48; ?></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"></font></td>				
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>		
			<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
			<td align="right" width="50"><font color="#0c7300"></font></td>					
			<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>				
		</tr>
</table>

<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF BOILERS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF PAGE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<?php
$i++;
}
?>