-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathf_checkin_waiting_select.php
More file actions
103 lines (93 loc) · 3.49 KB
/
f_checkin_waiting_select.php
File metadata and controls
103 lines (93 loc) · 3.49 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customer Check-in</title>
<link rel="stylesheet" href="style.css"/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
</head>
<body>
<!-- Check-in Navbar -->
<div class="navbar">
<nav class="navbar-container">
<a href="f_checkin_waiting.php">
<img src="./logo/Assumption_University(logo).png" alt="logo"/>
</a>
<ul class="navbar-left">
<li>
<a href="f_checkin_waiting.php">
<h1>online hotel management system</h1>
</a>
</li>
</ul>
<ul class="navbar-right">
<li>
<a style="color:#d73938;" href="f_checkin_waiting.php">customer check-in</a>
</li>
<li>
<a href="f_checkout_waiting.php">customer check-out</a>
</li>
</ul>
</nav>
</div>
<!-- Check-in -->
<div class="list-container">
<?php
// Include database connection file
require_once "DB_connect.php";
// Retrieve reservation_no sent via POST
$reservation_no = $_POST['reservation_no'];
// Fetch the selected reservation information
$query = "SELECT reservation_no, email, firstname, lastname, agent, total_room, arrive_date, depart_date
FROM reservation JOIN customer USING(email) JOIN account USING(email)
WHERE reservation_no = $reservation_no;";
$result = mysqli_query($conn, $query);
// Fetch the row
$row = mysqli_fetch_assoc($result);
// Output reservation information
echo "<br><br>";
echo "Reservation No.: " . sprintf("%06d", $row['reservation_no']) . "<br><br>";
echo "Email: " . $row['email'] . "<br><br>";
echo "Customer Name: " . $row['firstname'] . " " . $row['lastname'] . "<br><br>";
echo "Agent: " . $row['agent'] . "<br><br>";
echo "Arrive: " . $row['arrive_date'] . "<br><br>";
echo "Depart: " . $row['depart_date'] . "<br><br>";
echo "Total Room: " . $row['total_room'] . "<br><br>";
/* Fecth room numbers associated with the selected reservation */
$query = "SELECT room_no
FROM reservation JOIN reserved_room USING(reservation_no)
WHERE reservation_no = $reservation_no
ORDER BY room_no ASC;";
$result = mysqli_query($conn, $query);
// Loop through and display the room numbers
echo "Room Number: ";
$first = true;
while ($row = mysqli_fetch_assoc($result)) {
if (!$first) {
echo ", ";
}
echo $row['room_no'];
$first = false;
}
// Close database connection
mysqli_close($conn);
?>
<!-- Display form for inserting paid amount and insert to in_house-->
<br><br>
<form action="f_action_checkin.php" method="post">
<label for="paidamount"> Paid Amount: </label>
<input type="text" name="paidamount" placeholder="1600" style="width: 65px;">
<input type='hidden' name='reservation_no' value='<?php echo $reservation_no; ?>'>
<button class="reservation-button-red">Check-in</button>
</form>
<a href="f_checkin_waiting.php" class="reservation-button-black">Cancel</a>
</div>
</body>
</html>