-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrooms.php
More file actions
161 lines (146 loc) · 8.87 KB
/
Copy pathrooms.php
File metadata and controls
161 lines (146 loc) · 8.87 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hotel - Rooms</title>
<?php require('inc/links.php'); ?>
<style>
</style>
</head>
<body class="bg-light">
<!-- Header file is required -->
<?php require('inc/header.php'); ?>
<!-- Header file require end-->
<div class="my-5 px-4">
<h2 class="fw-bold text-center">Rooms</h2>
<div class="h-line bg-dark"></div>
<p class="text-center mt-3">"Discover your perfect retreat in our thoughtfully designed rooms, where comfort meets elegance for a truly relaxing stay."</p>
</div>
<div class="container">
<div class="row">
<!-- Filter Section -->
<!-- <div class="col-lg-3 col-md-12 mb-lg-0 mb-4 px-lg-0">
<nav class="navbar navbar-expand-lg navbar-light bg-white rounded shadow">
<div class="container-fluid flex-lg-column align-items-stretch">
<h4 class="mt-2">Filters</h4>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#filterDropdown" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse flex-column mt-2 align-items-stretch" id="filterDropdown">
<div class="border bg-light p-3 rounded mb-3">
<h5 class="mb-3" style="font-size: 18px;">Check Availability</h5>
<label for="check-in" class="form-label">Check-in</label>
<input type="date" class="form-control mb-3" id="check-in" required>
<label for="check-out" class="form-label">Check-out</label>
<input type="date" class="form-control" id="check-out" required>
</div>
<div class="border bg-light p-3 rounded mb-3">
<h5 class="mb-3" style="font-size: 18px;">Facilities</h5>
<div class="mb-2">
<input type="checkbox" class="form-check-input" id="f1" required>
<label class="form-check-label" for="f1">Facility one</label>
</div>
<div class="mb-2">
<input type="checkbox" class="form-check-input" id="f2" required>
<label class="form-check-label" for="f2">Facility two</label>
</div>
<div class="mb-2">
<input type="checkbox" class="form-check-input" id="f3" required>
<label class="form-check-label" for="f3">Facility three</label>
</div>
</div>
<div class="border bg-light p-3 rounded mb-3">
<h5 class="mb-3" style="font-size: 18px;">Guests</h5>
<div class="d-flex">
<div class="me-3">
<label class="form-label">Adults</label>
<input type="number" class="form-control">
</div>
<div>
<label class="form-label">Children</label>
<input type="number" class="form-control">
</div>
</div>
</div>
</div>
</div>
</nav>
</div> -->
<div class="col-lg-3 col-md-12 mb-lg-0 mb-4 px-lg-0">
<nav class="navbar navbar-expand-lg navbar-light bg-white rounded shadow">
<div class="container-fluid flex-lg-column align-items-stretch">
<h4 class="mt-2">Availabe Room are</h4>
</div>
</nav>
</div>
<!-- Filter Section End -->
<div class="col-lg-9 col-md-12 px-4">
<?php
$room_res = select("SELECT * FROM `rooms` WHERE `status`=? AND `removed`=?", [1, 0], 'ii');
while ($room_data = mysqli_fetch_assoc($room_res)) {
$room_thumb = ROOM_IMG_PATH . "thumbnail.jpg";
// Use prepared statement to prevent SQL injection
$thumb_q = select("SELECT * FROM `room_image` WHERE `room_id`=? AND `thumb`='1'", [$room_data['id']], 'i');
if ($thumb_q->num_rows > 0) {
$thumb_res = mysqli_fetch_assoc($thumb_q);
$room_thumb = ROOM_IMG_PATH . $thumb_res['image'];
}
// echo "Room ID: " . $room_data['id'] . "<br>";
// echo "Room Name: " . $room_data['name'] . "<br>";
// echo "Thumbnail Image: " . $room_thumb . "<br><br>";
if(isset($_SESSION["login"]) && $_SESSION['login'] == true) {
$login = 1;
}
?>
<!-- Room Record -->
<div class="card mb-4 border-0 shadow">
<div class="row g-0 p-3 align-items-center">
<div class="col-md-5 mb-lg-0 mb-md-0 mb-3">
<img src="<?php echo $room_thumb; ?>" class="img-fluid rounded" alt="Room Thumbnail">
</div>
<div class="col-md-5 px-lg-3 px-md-3 px-0">
<h5 class="mb-3"><?php echo $room_data['name']; ?></h5>
<div class="features mb-3">
<h6 class="mb-1">Features</h6>
<?php
$features = explode(',', $room_data['features']);
foreach ($features as $feature) {
echo "<span class='badge rounded-pill bg-light text-dark me-2'>$feature</span>";
}
?>
</div>
<div class="facilities mb-3">
<h6 class="mb-1">Facilities</h6>
<?php
$facilities = explode(',', $room_data['facilities']);
foreach ($facilities as $facility) {
echo "<span class='badge rounded-pill bg-light text-dark me-2'>$facility</span>";
}
?>
</div>
<div class="guests">
<h6 class="mb-1">Guests</h6>
<h6 class="mb-1">Guests</h6>
<span class="badge rounded-pill bg-light text-dark mb-3 text-wrap"><?php echo $room_data['adult']; ?> Adults</span>
<span class="badge rounded-pill bg-light text-dark mb-3 text-wrap"><?php echo $room_data['children']; ?> Children</span>
</div>
</div>
<div class="col-md-2 mt-lg-0 mt-md-0 mt-4 text-center">
<h6 class="mb-4">₹ <?php echo $room_data['price']; ?> per night</h6>
<a href="#" onclick="checkLoginToBook('<?php echo $login; ?>', <?php echo $room_data['id']; ?>)" class="btn btn-sm text-white custom-bg shadow mb-3">Book Now</a>
<a href="room_details.php?id=<?php echo $room_data['id']; ?>" class="btn btn-sm btn-outline-primary shadow">More Details</a>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
<!-- Footer -->
<?php require('inc/footer.php'); ?>
<!-- Footer end -->
</body>
</html>