<?php
error_reporting(E_ERROR);
$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 milling 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,"livstmpr");
$f2=mysql_result($result,$i,"mainspd");
$f3=mysql_result($result,$i,"mill1spd");
$f4=mysql_result($result,$i,"tonshr");
$f5=mysql_result($result,$i,"mccoutput");
$f6=mysql_result($result,$i,"exhaustpr");
$f7=mysql_result($result,$i,"mill1wsp");
$f8=mysql_result($result,$i,"canetot");
$f9=mysql_result($result,$i,"15minavg");
$f10=mysql_result($result,$i,"weightwsp");
$f11=mysql_result($result,$i,"Levelswitch");
$f12=mysql_result($result,$i,"cercoutput");
$f13=mysql_result($result,$i,"crecpv");
$f14=mysql_result($result,$i,"crecsp");
$f15=mysql_result($result,$i,"netablwt");
$f16=mysql_result($result,$i,"vaporpres");
$f17=mysql_result($result,$i,"pan8lvl");
$f18=mysql_result($result,$i,"pan8evapvapor");
$f19=mysql_result($result,$i,"pan7hdrpres");
$f20=mysql_result($result,$i,"pan9exhaust");
$f21=mysql_result($result,$i,"mill1lvl");
$f22=mysql_result($result,$i,"mill2lvl");
$f23=mysql_result($result,$i,"mill3lvl");
$f24=mysql_result($result,$i,"mill4lvl");
$f25=mysql_result($result,$i,"mill5lvl");
$f26=mysql_result($result,$i,"mill6lvl");
$f27=mysql_result($result,$i,"mill1pres");
$f28=mysql_result($result,$i,"mill2pres");
$f29=mysql_result($result,$i,"mill3pres");
$f30=mysql_result($result,$i,"mill4pres");
$f31=mysql_result($result,$i,"mill5pres");
$f32=mysql_result($result,$i,"mill6pres");
$f33=mysql_result($result,$i,"mill2spd");
$f34=mysql_result($result,$i,"mill3spd");
$f35=mysql_result($result,$i,"mill4spd");
$f36=mysql_result($result,$i,"mill5spd");
$f37=mysql_result($result,$i,"mill6spd");
$f38=mysql_result($result,$i,"mill1spd");
$f39=mysql_result($result,$i,"knife1pres");
$f40=mysql_result($result,$i,"knife2pres");
$f41=mysql_result($result,$i,"knife3pres");
$f42=mysql_result($result,$i,"knife1spd");
$f43=mysql_result($result,$i,"knife2spd");
$f44=mysql_result($result,$i,"knife3spd");
$f45=mysql_result($result,$i,"knife1op");
$f46=mysql_result($result,$i,"knife2op");
$f47=mysql_result($result,$i,"knife3op");
$f48=mysql_result($result,$i,"kc1");
$f49=mysql_result($result,$i,"kc2");
$f50=mysql_result($result,$i,"kc3");
$f51=mysql_result($result,$i,"neoutput");
$f52=mysql_result($result,$i,"nescale");
$f53=mysql_result($result,$i,"nesetpoint");
$f54=mysql_result($result,$i,"seoutput");
$f55=mysql_result($result,$i,"sescale");
$f56=mysql_result($result,$i,"sesetpoint");
$f57=mysql_result($result,$i,"woutput");
$f58=mysql_result($result,$i,"wscale");
$f59=mysql_result($result,$i,"wsetpoint");
$f60=mysql_result($result,$i,"latchon");
$f61=mysql_result($result,$i,"runhrstoday");
$f62=mysql_result($result,$i,"prevtons");
$f63=mysql_result($result,$i,"prevtime");
$f64=mysql_result($result,$i,"canetot");
$f65=mysql_result($result,$i,"avgtcd");
$f66=mysql_result($result,$i,"juicetankbit");
$f67=mysql_result($result,$i,"juicelvl");
$f68=mysql_result($result,$i,"nam");
$f69=mysql_result($result,$i,"sam");
$f70=mysql_result($result,$i,"wam");
$f71=mysql_result($result,$i,"tdoutput");
$f72=mysql_result($result,$i,"mill1highlvl");
$f73=mysql_result($result,$i,"mill5highlvl");
$f74=mysql_result($result,$i,"mill6highlvl");
$f75=mysql_result($result,$i,"imbflow");
$f76=mysql_result($result,$i,"imbsp");
$f77=mysql_result($result,$i,"pan8hrdpress");
$f78=mysql_result($result,$i,"mill1automan");
$f79=mysql_result($result,$i,"mill1output");
$f80=mysql_result($result,$i,"mill1automan1");
$f81=mysql_result($result,$i,"losstime");
$f82=mysql_result($result,$i,"tdratio");
$f83=mysql_result($result,$i,"tdsetpoint");
$f84=mysql_result($result,$i,"tdinput");
$f85=mysql_result($result,$i,"tdmg");
$f86=mysql_result($result,$i,"mill1sp");
$f87=mysql_result($result,$i,"mill2sp");
$f88=mysql_result($result,$i,"mill3sp");
$f89=mysql_result($result,$i,"mill4sp");
$f90=mysql_result($result,$i,"mill5sp");
$f91=mysql_result($result,$i,"mill6sp");
$f92=mysql_result($result,$i,"nesetpoint3");
$f93=mysql_result($result,$i,"nespswitch");
$f94=mysql_result($result,$i,"wsetpoint3");
$f95=mysql_result($result,$i,"wspswitch");
$f96=mysql_result($result,$i,"tdratios");
$f97=mysql_result($result,$i,"exhaustam");
$f98=mysql_result($result,$i,"b1pidswitch");
$f99=mysql_result($result,$i,"b1sf");
$f100=mysql_result($result,$i,"b2sf");
$f101=mysql_result($result,$i,"b3sf");
$f102=mysql_result($result,$i,"b4sf");
$f103=mysql_result($result,$i,"b5sf");
$f104=mysql_result($result,$i,"b6sf");
$f105=mysql_result($result,$i,"ttlstmflo");
$f106=mysql_result($result,$i,"tdsetpoint3");
$f107=mysql_result($result,$i,"tdsetpoint3switch");
$f108=mysql_result($result,$i,"stblsp3");
$f109=mysql_result($result,$i,"stblsp3switch");
$f110=mysql_result($result,$i,"dmbeltrunning");
$f111=mysql_result($result,$i,"tdbeltscale");
$f112=mysql_result($result,$i,"tdbeltscaleonoff");
$f113=mysql_result($result,$i,"syrupoverflow");
$f114=mysql_result($result,$i,"molbreclvl");
$f115=mysql_result($result,$i,"syruprcvrlvl");
$f116=mysql_result($result,$i,"amollvl");
?>

<style type="text/css">

.tftable1 {font-family:sans-serif;font-size:12px;color:#fbfbfb;width:100%;border-width: 1px;border-color: #686767;border-collapse: collapse;empty-cells: hide;}
.tftable1 th {font-family:arial;font-size:12px;background-color:#171515;border-width: 1px;padding: 8px;border-style: solid;border-color: #686767;text-align:left;}
.tftable1 tr {background-color:#171515;}
.tftable1 td {font-family:sans-serif;font-size:28px;font-weight:bold;border-width: 2px;padding: 3px;border-style: solid;border-color: #686767;}

.tftable2 {font-family:sans-serif;font-size:10px;color:#fbfbfb;width:100%;border-width: 1px;border-color: #686767;border-collapse: collapse;empty-cells: hide;}
.tftable2 th {font-family:sans-serif;font-size:10px;background-color:#171515;border-width: 1px;padding: 8px;border-style: solid;border-color: #686767;text-align:left;}
.tftable2 tr {background-color:#171515;}
.tftable2 td {font-family:sans-serif;font-size:28px;font-weight:bold;border-width: 2px;padding: 3px;border-style: solid;border-color: #686767;}

.tftable3 {font-family:sans-serif;font-size:12px;color:#fbfbfb;width:100%;border-width: 1px;border-color: #686767;border-collapse: collapse;empty-cells: hide;}
.tftable3 th {font-family:sans-serif;font-size:12px;background-color:#171515;border-width: 1px;padding: 8px;border-style: solid;border-color: #686767;text-align:left;}
.tftable3 tr {background-color:#171515;}
.tftable3 td {font-family:sans-serif;font-size:28px;font-weight:bold;border-width: 2px;padding: 3px;border-style: solid;border-color: #686767;}

.tftable4 {font-family:sans-serif;font-size:12px;color:#fbfbfb;width:100%;border-width: 1px;border-color: #686767;border-collapse: collapse;empty-cells: hide;}
.tftable4 th {font-family:sans-serif;font-size:12px;background-color:#171515;border-width: 1px;padding: 8px;border-style: solid;border-color: #686767;text-align:left;}
.tftable4 tr {background-color:#171515;}
.tftable4 td {font-family:sans-serif;font-size:28px;font-weight:bold;border-width: 1px;padding: 1px;border-style: solid;border-color: #686767;}
</style>

<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv MILLS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->

<table class="tftable2" border="1">
<tr>
			<td colspan="2" bgcolor="#0B3B17" align="center" width="12%"><font color="#e0e0e0">E Mill 1</font></td>
			<td bgcolor="#D7DF01" align="center" width="8.4%"><font color="#000000">E Mill 2</font></td>
			<td bgcolor="#04B404" align="center" width="8.4%"><font color="#e0e0e0">E Mill 3</font></td>
			<td bgcolor="#DF7401" align="center" width="8.4%"><font color="#000000">E Mill 4</font></td>
			<td bgcolor="#5858FA" align="center" width="8.4%"><font color="#e0e0e0">E Mill 5</font></td>
			<td bgcolor="#8A0808" align="center" width="8.4%"><font color="#e0e0e0">E Mill 6</font></td>	
			<td colspan="2" bgcolor="#0B3B17" align="center" width="12%"><font color="#e0e0e0">W Mill 1</font></td>	
			<td bgcolor="#D7DF01" align="center" width="8.4%"><font color="#000000">W Mill 2</font></td>	
			<td bgcolor="#04B404" align="center" width="8.4%"><font color="#e0e0e0">W Mill 3</font></td>
			<td bgcolor="#DF7401" align="center" width="8.4%"><font color="#000000">W Mill 4</font></td>
			<td bgcolor="#5858FA" align="center" width="8.4%"><font color="#e0e0e0">W Mill 5</font></td>				
</tr>
<tr>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">RPM</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f38; ?></font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f33; ?></font></td>
			<td bgcolor="#04B404" align="center"><font color="#81F781"><?php echo $f34; ?></font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f35; ?></font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f36; ?></font></td>
			<td bgcolor="#8A0808" align="center"><font color="#00FF00"><?php echo $f37; ?></font></td>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">RPM</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f37; ?></font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f37; ?></font></td>
			<td bgcolor="#04B404" align="center"><font color="#00FF00"><?php echo $f37; ?></font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f35; ?></font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f36; ?></font></td>				
</tr>
<tr>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">SP</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f86; ?></font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f87; ?></font></td>
			<td bgcolor="#04B404" align="center"><font color="#81F781"><?php echo $f88; ?></font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f89; ?></font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f90; ?></font></td>
			<td bgcolor="#8A0808" align="center"><font color="#00FF00"><?php echo $f91; ?></font></td>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">SP</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f91; ?></font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f91; ?></font></td>
			<td bgcolor="#04B404" align="center"><font color="#00FF00"><?php echo $f91; ?></font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f89; ?></font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f90; ?></font></td>				
</tr>
<tr>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">Lvl</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f21; ?>%</font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f22; ?>%</font></td>
			<td bgcolor="#04B404" align="center"><font color="#81F781"><?php echo $f23; ?>%</font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f24; ?>%</font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f25; ?>%</font></td>
			<td bgcolor="#8A0808" align="center"><font color="#00FF00"><?php echo $f26; ?>%</font></td>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">Lvl</font></td>
			<td bgcolor="#0B3B17" align="center"><font color="#00FF00"><?php echo $f26; ?>%</font></td>
			<td bgcolor="#D7DF01" align="center"><font color="#298A08"><?php echo $f26; ?>%</font></td>
			<td bgcolor="#04B404" align="center"><font color="#00FF00"><?php echo $f26; ?>%</font></td>
			<td bgcolor="#DF7401" align="center"><font color="#00FF00"><?php echo $f24; ?>%</font></td>
			<td bgcolor="#5858FA" align="center"><font color="#00FF00"><?php echo $f25; ?>%</font></td>			
</tr>
<!--
<tr>
			<td bgcolor="#0B3B17" align="right"><font color="#e0e0e0">PSI</font></td>
			<td bgcolor="#0B3B17" align="left"><font color="#00FF00"><?php echo $f27; ?></font></td>
			<td bgcolor="#D7DF01" align="right"><font color="#000000">PSI</font></td>
			<td bgcolor="#D7DF01" align="left"><font color="#298A08"><?php echo $f28; ?></font></td>
			<td bgcolor="#04B404" align="right"><font color="#e0e0e0">PSI</font></td>
			<td bgcolor="#04B404" align="left"><font color="#81F781"><?php echo $f29; ?></font></td>
			<td bgcolor="#DF7401" align="right"><font color="#000000">PSI</font></td>
			<td bgcolor="#DF7401" align="left"><font color="#00FF00"><?php echo $f30; ?></font></td>
			<td bgcolor="#5858FA" align="right"><font color="#e0e0e0">PSI</font></td>
			<td bgcolor="#5858FA" align="left"><font color="#00FF00"><?php echo $f31; ?></font></td>
			<td bgcolor="#8A0808" align="right"><font color="#e0e0e0">PSI</font></td>
			<td bgcolor="#8A0808" align="left"><font color="#00FF00"><?php echo $f32; ?></font></td>				
</tr>
-->
</table>

<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF MILLS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->

<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF PAGE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->

<?php
$i++;
}
?>