<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');

	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");	
	
	if (isset($_POST['search_input']))
	{
		$search_string = strtoupper($_POST['search_input']);
				
		$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");
		$monitor_serial = $_POST['search_input'];
	
		$dbtablemon = 'monitors';
		$sql = "SELECT * FROM monitors WHERE monitor_serial='$monitor_serial'";
		//echo"$sql search string = $search_string  and serial $monitor_serial";
			
		$vdj_result = mysql_query($sql, $equipConn) or die ("Unable to exercute query: <p>$sql</p>");
		if(($row = mysql_fetch_row($vdj_result)) < 1)
			echo "<h2>Search result for $column_field matching '$search_string'</h2>
				  <p>No record matching $search_string in monitor table</p>";
		else
		{
		
			$monitor_make = strtoupper($row['0']);
			$monitor_model = $row['1'];
			$monitor_serial = strtoupper($row['2']);
			$monitor_uc = strtoupper($row['3']);
			$monitor_lock_key = strtoupper($row['4']);
			$monitor_size = $row['5'];
			$monitor_type = $row['6'];
			$monitor_room = $row['7'];
		
			echo"<h2>$h3</h2>
<font color='red'>*</font><font size='-1'>- Indicates required fields</font>
<form action='$goto' method='post' name='monitor_form' onSubmit='return validator();'>
<table border='0' cellspacing='3' cellpadding='1'>
				<tr>
      <td align='right'>Monitor Make:&nbsp;&nbsp;</td>
    <td>
		<select name='monitor_make'>";
		echo "<option value=''>Select ....</option>";

	$db = mysql_select_db('equipment', $equipConn) or die ("Unable to select equipment database.");
	$sql_mbrand = "SELECT mbrand FROM monitor_brand ORDER BY mbrand";
	$mbrand_result = mysql_query($sql_mbrand, $equipConn) or die ("Unable to exercute query. <p>$sql_mbrand</p>");
	
	while($row = mysql_fetch_array($mbrand_result))
	{
	
	$BrandName = strtoupper($row['mbrand']);
	
	if ($monitor_make == $BrandName)
		echo "\\n<option value='$BrandName' selected>$BrandName</option>";
	else 
		echo "\\n<option value='$BrandName'>$BrandName</option>";
	}
echo "
        </select><font color='red'>*</font>
      </td>
  </tr>
  <tr>
    <td align='right'>Monitor Model:&nbsp;&nbsp;</td>
    <td><input name='monitor_model' type='text' id='monitor_model' size='30' maxlength='30' value='$monitor_model'><font color='red'>*</font></td>
  </tr>
    <tr>
    <td align='right'>Monitor Size:&nbsp;&nbsp;</td>
    <td><select name='monitor_size'>
		<option value='$monitor_size' selected>$monitor_size</option>
						<option value='14inch'>14inch</option>
						<option value='15inch'>15inch</option>
						<option value='17inch'>17inch</option>
						<option value='18inch'>18inch</option>
						<option value='19inch'>19inch</option>
						<option value='20inch'>20inch</option>
						<option value='21inch'>21inch</option>
						<option value='22inch'>22inch</option>
						<option value='24inch'>24inch</option>
						<option value='29inch'>29inch</option>
						<option value='34inch'>34inch</option>
				    </select><font color='red'>*</font></td>
  </tr>
  
   <tr>
    <td align='right'>Monitor Type:&nbsp;&nbsp;</td>
    <td><select name='monitor_type'>
		<option value='$monitor_size' selected>$monitor_type</option>
						<option value='ALL-IN-ONE'>ALL-IN-ONE</option>
						<option value='LCD'>LCD</option>
						<option value='CRT'>CRT</option>
						<option value='LAPTOP'>LAPTOP</option>
						
				    </select><font color='red'>*</font></td>
  </tr>

	
	  <tr>
    <td align='right'>Monitor Serial:&nbsp;&nbsp;</td>
    <td><input name='monitor_serial' type='text' id='monitor_serial' size='30' maxlength='30' value='$monitor_serial'  disabled='true'><font color='red'>*</font></td>
  </tr>
  <tr>
    <td align='right'>UC Property Number:&nbsp;&nbsp;</td>
    <td><input name='monitor_uc_property_num' type='text' id='monitor_uc_property_num' size='30' maxlength='30' value='$monitor_uc'></td>
  </tr>
  <tr>
    <td align='right'>Monitor Lock Key:&nbsp;&nbsp;</td>
    <td><input name='monitor_lock_key' type='text' id='monitor_lock_key' size='30' maxlength='30' value='$monitor_lock_key'></td>
  </tr>					   <tr><td><br /><br />
					   <a href='move_surplus_mon.php?monitor_serial=$monitor_serial'><img src='../../images/Surplus.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
					  		   <a href='choose_room_mon.php?monitor_serial=$monitor_serial'><img src='../../images/Stock.gif' border='0'></a></td>  
					</table>";
		}
	}
	else  
	{
		header("Location: ./uclit/teaming/equipment/show_move.php");
		exit;				
	}


