-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservation-add.sql
31 lines (31 loc) · 1.08 KB
/
reservation-add.sql
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
<?
if ($arrival_time=="") {
$arrival_time="Not known";
}
if ($departure_time=="") {
$departure_time="Not known";
}
$sql="INSERT INTO reservations (reservationTime,reservedBy,guestID,
reason,arrivalDate,departureDate,
guestNumber,roomType,roomStatus,
special,arrivalTime,departureTime,proxy)
VALUES ('$timestamp','$user_id','$guest_id','$reason','$arrival_date',
'$departure_date','$guest_number','$room_type','Pending',
'$special','$arrival_time','$departure_time','$proxy')";
$result=mysql_query($sql);
$affected_rows=mysql_affected_rows();
if ($affected_rows==1) {
?>
<h2>Reservation request for
<? echo $name; ?>
has been submitted<br/>
Preferred room: <? echo $room_type; ?><br/>
Arriving: <? echo $arrival_date; ?><br/>
Departing: <? echo $departure_date; ?><br/>
<br/>
<form action="<? echo $PHP_SELF; ?>" method="POST";>
<input type="hidden" name="activity" value="Request room">
<input type="submit" value="Make another Reservation">
</form>
</h2>
<? } ?>