<table width="200" border="0" align="center">
  <tr>
    <td><a href="http://ul.uc.edu/uclit/teaming/equipment/add_home.php"><img src="addequip.jpg" alt="Add" width="120" height="50" border="0" /></a></td>
    <td><a href="http://ul.uc.edu/uclit/teaming/equipment/sel_allequiptdetail.php"><img src="equipbydept.jpg" alt="dept" width="120" height="50" border="0" /></a></td>
    <td><a href="http://ul.uc.edu/uclit/teaming/equipment/show_move.php"><img src="searchequip.jpg" alt="search" width="120" height="50" border="0" /></a></td>
    <td><a href="http://ul.uc.edu/uclit/teaming/equipment/show_assignequipt.php"><img src="Assign.jpg" alt="assign" width="120" height="50" border="0" /></a></td>
    <td><a href="http://ul.uc.edu/uclit/teaming/equipment/printmon.php"><img src="printmon.jpg" alt="print" width="120" height="50" border="0" /></a></td>
  </tr>
</table>
<?php
	include('/var/www/html/uclit/protected/connections/db_equip.php');
    	
	
	$sql = "SELECT DISTINCT dept_id, dept_name FROM departments ORDER BY dept_name";
	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");
	$sql_result = mysql_query($sql, $equipConn) or die ("Unable to query the following SQL statement:<p>$sql</p>");

	if (!$sql_result) 
	{
		echo "<p>couldn't get list! $sql_result</p>";
	}
	else
	{
?>
	<h2>Select Equipment by Department</h2>
	<form method='post' action='process_equipbydept.php'>
  	<table CELLSPACING='3' CELLPADDING='3'>
    <tr>
      <td height='125' VALIGN=TOP><P><STRONG>Department:</STRONG><BR />
          <select name='staff_dept'>
            <option selected value=''>Select.......</option>
<?php
				while ($row = mysql_fetch_array($sql_result)) 
				{
					$deptid = $row['dept_id'];
					$deptname = $row['dept_name'];
					echo "<option value='$deptid'>$deptname</option>";
				}
?>
          </select>
        <P>
	          <INPUT TYPE='SUBMIT' NAME='submit' VALUE='Submit Department'>
        </P></td>
    </tr>
  </table>
</form>
<?php
	}
?>