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


	//Select a database to work with
	$db = mysql_select_db('lockers', $lockerConn) or die("Couldn't select database: db_lockers");
	
	$Lock_Location = $_POST['lock_location'];
	$Upper_Check = $_POST['upper_check'];
		
	//SQL Select statement
	$query= "SELECT ID, Status, Location, Hcapped, Lnumber, Combo, Lname, Fname, UCnumber, Date_Assigned, Notes 
			FROM locker WHERE ((Status='F') and (Location = '$Lock_Location') and (Hcapped = '$Upper_Check'))";

	$result = mysql_query($query,$lockerConn) or die("Couldn't execute query.<p>$query</p>");

	while ($row = mysql_fetch_array($result)) 
	{
		$id =$row['ID'];
		$status = $row['Status'];
		$location = $row['Location'];
		$h_capped = $row['Hcapped'];
		$l_number = $row['Lnumber'];
		$combo = $row['Combo'];
		$l_name = $row['Lname'];
		$f_name = $row['Fname'];
		$uc_number = $row['UCnumber'];
		$date_assigned = $row['Date_Assigned'];
		$notes = $row['Notes'];
		
		
	$display_block .="<tr>
				<td align='center'><a href='http://ul.uc.edu/resources/locker/edit_locker.php?ID=$id'>
					<img src='/uclit/images/edit.gif' border='0'></a>
				</td>
				<td>$l_number</td>
				<td>$location</td>
				<td>$notes</td>
			  </tr>";
	}

echo"
<H1 align='center'>Available Lockers</H1>
<center>

<table width=95% border=1>
  <tr>
    <td align=center><b>Assign</b></td>
	<td align=center><b>Locker Number</b></td>
	<td align=center><b>Location</b></td>
	<td align=center><b>Notes</b></td>
  </tr>
$display_block
</table> 
</br>
</br>
<p align='center'><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>";
	
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php');
?>

