<?php
	include('/var/www/html/uclit/protected/common/login/check.php');
	include('/var/www/html/uclit/protected/common/css_login/css_head2.php');
	include ('/var/www/html/uclit/protected/connections/db_lockers.php');

	$today="";
	$today=date("Y-m-d");
	$id = $_POST['id'];

	$db = mysql_select_db('lockers', $lockerConn) or die("Couldn't select database lockers.");
	$update_query= "UPDATE locker SET Status='R', Date_Assigned='$today' WHERE ID='$id'" ;
	$update_result = mysql_query($update_query, $lockerConn) or die("Couldn't execute query; $update_query");

	$display_query= "SELECT Lnumber, Location, Combo FROM locker WHERE ID='$id' ";
	$display_result = mysql_query($display_query, $lockerConn) or die("Couldn't execute query; $update_query");
		
	$row = mysql_fetch_array($display_result); 

		$lockernumber = $row['Lnumber'];
		$location = $row['Location'];
		$combo = $row['Combo'];		

	$comboarray = explode('-', $combo);

		echo "
<p>Your record has been renewed.</p></br>

<table width='500' border='1'>
<tr height='25' valign='top'>
   <td width='50%'>
      Locker Number: <b>$lockernumber</b>
   </td>
   <td widht='50%'>
      Location: <b>$location</b>
   </td>
</tr>
<tr>
   <td colspan='2'>
      <p>Combination: <b>$combo</b></br></br>
      To open: turn the dial right two or more complete turns and stop at:  <b>$comboarray[0]</b></br>
      Turn dial left one complete turn past <b>0</b> and stop at:  <b>$comboarray[1]</b></br>
      Turn dial right and stop at:  <b>$comboarray[2]</b>  and pull down the lock.</p> <br>"; 
?>
   </td>
</tr>
<tr>
   <td colspan='2'>
      <ul>
        <li>
Lockers are for current UC students; enrollment verification is required before assignment can be made.  			Locker assignments are for the full academic year (September - June).  Lockers will be cleaned out each summer, with new assignments to begin the following Fall Quarter. Some lockers will be assigned for Summer Quarter use.
	 </li>
	 <li>
Lockers are to be used for personal belongings and library materials that have been checked out.  Food and non-circulating library materials (such as journals and reference books) are not to be kept in the lockers. 
	 </li>
	 <li>
Any lock not belonging to the library will be removed.  Contents of these lockers will be removed to Lost and Found for claiming; unclaimed items will be disposed. 
	 </li>
	 <li>
The library assumes no responsibility for any items stored within or removed from the lockers.  The person assigned to a locker is responsible for its contents.  Lockers will be checked periodically by library personnel at which time prohibited items will be removed. 
	 </li>
      </ul> 
   </td>
</tr>
</table></br></br>
<center></br></br>
<p><a href='index.php'>Locker Home</a> | <a href='show_assign.php'>Assign</a> | <a href='show_renew.php'>Renew</a> |<a href='show_locker.php'>Maintenance</a></p></center>
<?php
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php');
?>