<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['stock_room']))
	{
		$room = $_POST['stock_room'];
					
		echo" <H2>The following Workstations are located in the Stock Room: $room</H2>
				
	
	<table width='660' border='1' class='sortable' id='maintable' border='1' cellpadding='2' cellspacing='2'>
				  <tr>
               	
					<td align='center' width='140'>Workstation ID</td>
					<td align='center' width='140'>Computer Serial</td>
					<td align='center' width='140'>Property Number</td>
					<td align='center' width='95'>Computer Type</td>
					<td align='center' width='95'>CPU TYPE/Speed</td>
					<td align='center' width='95'>Stock Room</td>
				  </tr>";	
				  	
		$sql = "SELECT * FROM computers WHERE room='$room'";
		echo"$sql";
		$sql_result = mysql_query($sql, $equipConn) or die ("Unable to exercute query.<p>$sql</p>");
	
		while($row = mysql_fetch_array($sql_result))
		{
						
			$workstation_id = $row['workstation_id'];
			$computer_serial = $row['computer_serial'];
			$computer_uc_property_num = $row['computer_uc_property_num'];
			$computer_type = $row['computer_type'];
			$cpu_type_speed = $row['cpu_type_speed'];
			$room_stock = $row['room'];
		
			
			
			
			
			
				$display_block .= "
					  <tr>
			 <td align='center'>$workstation_id</td>
			 <td align='center'>$computer_serial</td>
			  <td align='center'>$computer_uc_property_num</td>
			  <td align='center'>$computer_type</td>
			  <td align='center'>$cpu_type_speed</td>
			   <td align='center'>$room</td>
			</tr>
				";
		}
		
		//$today = date("Y-m-d");  
		//$sqlupdate = "UPDATE computers SET room='$room' WHERE computer_serial='$cserial'";
		//$sql_result = mysql_query($sqlupdate, $equipConn) or die ("Unable to exercute query.<p>$sqlupdate</p>");		//echo"Change Date Successfull.";
		
		//$sqlprod = "DELETE from equipment_detail WHERE computer_serial='$cserial'";
		//$sql_result = mysql_query($sqlprod, $equipConn) or die ("Unable to exercute query.<p>$sqlprod</p>");
		//echo"Delete Production Successfull.";
		
		//end while

		echo "  $display_block
		</table>";
			  
			  		echo" <H2>The following Monitors are located in the Stock Room: $room</H2>
				
	
	<table width='660' border='1' class='sortable' id='maintable' border='1' cellpadding='2' cellspacing='2'>
				  <tr>
               	
					<td align='center' width='140'>Monitor Make</td>
					<td align='center' width='140'>Monitor Model</td>
					<td align='center' width='140'>Monitor Serial</td>
					<td align='center' width='95'>Property Number</td>
					<td align='center' width='95'>Monitor Size</td>
					<td align='center' width='95'>Stock Room</td>
				  </tr>";	
				  	
		$sqlmon = "SELECT * FROM monitors WHERE monitor_room='$room'";
		$sqlmon_result = mysql_query($sqlmon, $equipConn) or die ("Unable to exercute query.<p>$sql</p>");
	
		while($row = mysql_fetch_array($sqlmon_result))
		{
						
			$monitor_make = strtoupper($row['monitor_make']);
			$monitor_model = $row['monitor_model'];
			$monitor_serial = strtoupper($row['monitor_serial']);
			$monitor_uc = strtoupper($row['monitor_uc_property_num']);
			$monitor_lock_key = strtoupper($row['monitor_lock_key']);
			$monitor_size = $row['monitor_size'];
			$monitor_type = $row['monitor_type'];
			$monitor_room = $row['monitor_room'];
		
			
			
			
			
			
				$display_block2 .= "
					  <tr>
			 <td align='center'>$monitor_make</td>
			 <td align='center'>$monitor_model</td>
			  <td align='center'>$monitor_serial</td>
			  <td align='center'>$monitor_uc</td>
			  <td align='center'>$monitor_size</td>
			   <td align='center'>$room</td>
			</tr>
				";
		}
		
		//$today = date("Y-m-d");  
		//$sqlupdate = "UPDATE computers SET room='$room' WHERE computer_serial='$cserial'";
		//$sql_result = mysql_query($sqlupdate, $equipConn) or die ("Unable to exercute query.<p>$sqlupdate</p>");		//echo"Change Date Successfull.";
		
		//$sqlprod = "DELETE from equipment_detail WHERE computer_serial='$cserial'";
		//$sql_result = mysql_query($sqlprod, $equipConn) or die ("Unable to exercute query.<p>$sqlprod</p>");
		//echo"Delete Production Successfull.";
		
		//end while

		echo "  $display_block2
		</table>
				
			  <br /> <a href='show_move.php'>Search for another workstation</a>";
			  
		}	
	else  
	{
		header("Location: ./uclit/teaming/equipment/show_pcsearch.php");
		exit;				
	}
		
?>