<?php 
	include('/var/www/html/uclit/protected/common/login/check.php'); 
	include('/var/www/html/uclit/protected/common/css_login/css_head2.php'); 
	include('/var/www/html/uclit/protected/connections/db_pharos.php');

	$db_comments = "pharos";
	$table_comments = "data";

	//Select a database
	$db = mysql_select_db('pharos', $pharosConn) or die("Couldn't select database. pharos");

	$query = "SELECT * FROM data order by ping_result desc,location" ;
	$result = mysql_query($query, $pharosConn) or die("Couldn't execute query.");
?>

<h1>Pharos Printer Monitoring</h1>
<h3>Trouble</h3>
<table width="100%"  border="0" bordercolor = "#FFFFCC">
  <tr bordercolor="#666666">
    <th align='center'>status</div></th>
    <th align='center'>Last Check </div></th>
    <th align='center'>printer</div></th>
    <th align='center'>IP</div></th>
    <th align='center'>Release Station</th>
    <th align='center'>Location</div></th>
  </tr>
<?php 
	while($row = mysql_fetch_array($result)) 
	{
		$name=$row['name'];
		$ip=$row['ip'];
		$station = $row['station'];
		$ping_last = $row['ping_last'];
		$ping_result = $row['ping_result'];
		$location = $row['location'];

		if("$ping_result" == "1") 
			echo"<tr bordercolor='#666666' bgcolor='#FF9933'>";
		else 
			echo"<tr bordercolor='#666666'>";
		
		echo"<td nowrap height='22'>$ping_result</td>
			 <td nowrap>$ping_last</td>
			 <td nowrap>$name</td>
			 <td nowrap><a href='http://$ip'>$ip</td>
			 <td>$station</td>
			 <td nowrap>$location</td>
		   </tr>";
  	}
?> 
</table>
<?php
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php'); 
?>