<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($_GET['printer_serial']))
	{
		$pserial = $_GET['printer_serial'];
							
		$dbtablemon = 'printers';
		$sql = "SELECT * FROM printers WHERE printer_serial='$pserial'";
			
		$vdj_result = mysql_query($sql, $equipConn) or die ("Unable to exercute query: <p>$sql</p>");
		
		while($row = mysql_fetch_array($vdj_result))
		{
			$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>
					   
					</table>";
		
		
		$sqlinsert = "INSERT INTO Surplus_PRINT SELECT * FROM printers WHERE printer_serial='$pserial'";
		$sql_result = mysql_query($sqlinsert, $equipConn) or die ("Unable to exercute query.<p>$sqlinsert</p>");		//echo"Insert INTO Successfull.";
			
		//$today = date("Y-m-d");  
		//$sqlupdate = "UPDATE surplus_cpu SET surplus_date='$today' WHERE computer_serial='$cserial'";
		//$sql_result = mysql_query($sqlupdate, $equipConn) or die ("Unable to exercute query.<p>$sqlupdate</p>");		//echo"Change Date Successfull.";
		$sqldel = "DELETE from printers WHERE printer_serial='$pserial'";
		$sql_result = mysql_query($sqldel, $equipConn) or die ("Unable to exercute query.<p>$sqldel</p>");
		//echo"Delete Computer 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 "<h2>Printer '$pserial ' has been sent to Surplus</h2>
			  $display_block
			  <br /> <a href='show_move.php'>Search for another printer to Move</a>";
		}	
	else  
	{
		header("Location: ./uclit/protected/itstaff/show_move.php");
		exit;				
	}
		
?>