-
Notifications
You must be signed in to change notification settings - Fork 0
/
sql-list_available.inc
39 lines (39 loc) · 1.56 KB
/
sql-list_available.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?
include('rooms-available.sql');
if (!ISSET($room_id)) {
?>
<h2>Book room for <? echo $first_name . " " . $last_name; ?></h2>
<div>
Arrive: <strong><? echo $arrival_date; ?></strong>, time of day: <? echo $arrival_time; ?><br/>
Depart: <strong><? echo $departure_date; ?></strong>, time of day: <? echo $departure_time; ?><br/>
</div>
<? } ?>
<h3>Preferred room type <? echo $availability; ?>. Please select a room from the list below.</h3>
<form action="<? echo $PHP_SELF; ?>" method="POST">
<input type="hidden" name="form_action" value="<? echo $form_new_action; ?>">
<input type="hidden" name="form_new_action" value="booking_confirmed">
<input type="hidden" name="room_status" value="Confirmed">
<input type="hidden" name="after_update_file" value="<? echo $after_update_file; ?>">
<input type="hidden" name="reservation_id" value="<? echo $reservation_id; ?>">
<input type="hidden" name="booking_time" value="<? echo $timestamp; ?>">
<input type="hidden" name="booked_by" value="<? echo $user_id; ?>">
<input type="hidden" name="activity" value="<? echo $activity; ?>">
<select name="room_id">
<?
while($row = mysql_fetch_array($result)){
include('dbVars.inc');
$bookCount=$row['bookCount'];
if ($total[$db_roomID] <= $bookCount) {
if ($room_id==$db_roomID) {
?>
<option value="<? echo $db_roomID; ?>" selected><? echo $db_roomID; ?> (<? echo $db_roomType; ?>)</option>
<? } else { ?>
<option value="<? echo $db_roomID; ?>"><? echo $db_roomID; ?> (<? echo $db_roomType; ?>)</option>
<?
}
}
}
?>
<input type="submit" value="Book it!">
</form>
</table>