<?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'];
	$locationtext = $_POST['locationtext'];
	$lockernumbertext = $_POST['lockernumbertext'];
	$combotext = $_POST['combotext'];
	$l_nametext = $_POST['l_nametext'];
	$f_nametext = $_POST['f_nametext'];
	$uc_numbertext = $_POST['uc_numbertext'];
	$notestext = $_POST['notestext'];
	

	$query= "UPDATE locker SET Lname='$l_nametext', Fname='$f_nametext', Status='A',
	         	 	Location='$locationtext', Lnumber='$lockernumbertext', Combo='$combotext', UCnumber='$uc_numbertext',
			 		Date_Assigned='$today', Notes='$notestext' WHERE ID='$id'" ;


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

	$db = @mysql_select_db('lockers', $lockerConn) or die("Couldn't select database.");
	$result = @mysql_query($query, $lockerConn)	or die("Couldn't execute query; $query");
	if (!$result) 
	{
		echo"<P>Couldn't update record!";
	}
	else
	{
		echo "
<p>Your record has been updated.</p></br></br>

<table width='500' border='1'>
<tr height='25' valign='top'>
   <td width='50%'>
      Locker Number: <b>$lockernumbertext</b>
   </td>
   <td widht='50%'>
      Location: <b>$locationtext</b>
   </td>
</tr>
<tr>
   <td colspan='2'>
      <p>Combination: <b>$combotext</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> 
   </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>

</br></br>
<p> <a href='index.php'>Locker Home</a></p>";
	}

	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php');
?>