<?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_equip.php');
?>
<table border='1' width='90%' cellpadding='1' cellspacing='1' >
  <tr>
    <td align='center'><b>Department</b></td>
    <td align='center'><b>Data Jack#</b></td>
    <td align='center'><b>Room#</b></td>
    <td align='center'><b>Building</b></td>
	<td align='center'><b>Account</b></td>
	<td align='center'><b>Notes</b></td>
	<td align='center'><b>Active Status</b></td>
	<td align='center'><b>Edit</b></td>
    <td align='center'><b>De-Activate</b></td> 
  </tr>
<?php		
	$sql = "SELECT jack_id, department, data_jack, room_jack, building, notes, account, active FROM data_jacks ORDER BY department";
	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");
	$sql_result = mysql_query($sql, $equipConn) or die ("Unable to query<p>$sql</p>");

	while ($row = mysql_fetch_array($sql_result))
	{
		$jack_id = $row['jack_id'];
		$department = $row['department'];
		$data_jack = $row['data_jack'];
		$room_jack = $row['room_jack'];  
		$building = $row['building'];
		$account = $row['account'];
		$notes = $row['notes'];
		$active = $row['active'];
		if($active=='1')
			$active_status = 'TRUE';
		else
			$active_status = 'FALSE';
		
		echo"<tr>
    		   <td>$department</td>
    		   <td>$data_jack</td>
    		   <td>$room_jack</td>
			   <td>$building</td>
			   <td>$account</td>
			   <td>$notes</td>
			   <td>$active_status</td>
			   <td align='center'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addpdjack.php?jack_id=$jack_id&uaction=edit'><img src='../../images/edit.gif' border='0'></a></td>
    		   <td align='center'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addpdjack.php?jack_id=$jack_id&uaction=delete'><img src='../../images/delete.gif' border='0'></a></td>
             </tr>";    		
    }
    echo"</table>";
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php'); 
?>