<table width="200" border="0" align="center">
  <tr>
    <td><img src="addequip.jpg" alt="Add" width="120" height="50" /></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');

	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");	
	
	if (isset($_POST['search_input']))
	{
		$column_field = $_POST['search_option'];
		$search_string = strtoupper($_POST['search_input']);
				
		$sql = "SELECT * FROM printers WHERE printer_serial='$search_string'";
		$sql_result = mysql_query($sql, $equipConn) or die ("Unable to exercute query.<p>$sql</p>");
		
		if(($row = mysql_fetch_row($sql_result)) < 1)
			echo "<h2>Search result for $column_field matching '$search_string'</h2>
				  <p>No record matching $search_string in computers table</p>";
		else
		{
			$printer_serial = $row[0];
			$printer_name = $row[1];
			$printer_server = $row[2];
			$printer_make = $row[3];
			$printer_model = $row[4];
			$printer_uc_property_num = $row[5];
			
				$display_block = "<table>
					   <tr><td><strong>Printer Serial:</strong>&nbsp;<i>$printer_serial</i><td></tr>
					   <tr><td><strong>Printer Name:</strong>&nbsp;$printer_name</i></td></tr>
					   <tr><td><strong>Printer Server:</strong>&nbsp;<i>$printer_server</i></td></tr>
					   <tr>
					     <td>
					       <strong>Printer Make:</strong>&nbsp;<i>$printer_make</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					       <strong>Printer Model:</strong>&nbsp;<i>$printer_model</i>
					     </td>
					   </tr>		
					   <tr>
					     <td>
					       <strong>Printer UC Property Number:</strong>&nbsp;<i>$printer_uc_property_num</i>&nbsp;&nbsp;&nbsp;&nbsp;
					      </td>
					   </tr>
					   <tr><td>
					  		  <a href='move_surplus_print.php?printer_serial=$printer_serial'><img src='../../images/Surplus.gif' border='0'></a></td>
					   </tr>
					   
					</table>";

			echo "<h2>Search result for $column_field matching '$search_string'</h2>
				  $display_block
				  <br />
				 ";
		}
	}
	else  
	{
		header('Location: ./uclit/teaming/equipment/show_move.php');
		exit;				
	}

?>