<?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');
?>
<h2>List ALL Assigned Equiptment</h2>
<table border='1' cellpadding='2' cellspacing='2'>
  <tr>
	<td align='center' width='60'>Detail ID</td>
	<td align='center' width='93'>Employee ID</td>
	<td align='center' width='140'>PC Serial</td>
	<td align='center' width='140'>Monitor Serial</td>
	<td align='center' width='140'>Printer Serial</td>
	<td align='center' width='87'>Data Jack ID</td>
	<td align='center' width='87'>Voice Jack ID</td>
  </tr>
<?php		
	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");	
	$sql_detail = "SELECT * FROM equipment_detail";
	$sql_detail_result = mysql_query($sql_detail, $equipConn);
	$counter = 0;
	while($rowPC = mysql_fetch_array($sql_detail_result))
	{
		$edid = $rowPC['detail_id'];
		$ekey = $rowPC['personnel_id'];
		$pckey = $rowPC['computer_serial'];
		$mkey = $rowPC['monitor_serial'];
		$pkey = $rowPC['printer_serial'];
		$vdjkey = $rowPC['jacks_id'];
		$voicekey = $rowPC['voice_id'];
		if ($counter % 2 == 0)
			$columnColor = '#CCCCCC';
		else 
			$columnColor = '#FFFFFF';
		
		$displayblock .= "
		<tr>
		  <td align='center' bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_relationdetail.php?edid=$edid&uaction=display'>$edid</a></td>
		  <td align='center' bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addemployee.php?pid=$ekey&uaction=edit'>$ekey</a></td>
		  <td bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_pcspecs.php?computer_serial=$pckey'>$pckey</a></td>
		  <td bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addmonitor.php?monitor_serial=$mkey&uaction=edit'>$mkey</a></td>
		  <td bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addprinter.php?printer_serial=$pkey&uaction=edit'>$pkey</a></td>
		  <td align='center' bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addpdjack.php?jack_id=$vdjkey&uaction=edit'>$vdjkey</a></td>
		  <td align='center' bgcolor='$columnColor'><a href='http://ul.uc.edu/uclit/protected/itstaff/show_addvjack.php?jack_id=$voicekey&uaction=edit'>$voicekey</a></td>
		</tr>";	
		
		$counter++;
	}
	
	echo "
	$displayblock
	</table>
	<br />
	<a href='http://ul.uc.edu/uclit/protected/itstaff/show_assignequipt.php'>Assign Equipment Form</a>";
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php'); 
?>