-
Notifications
You must be signed in to change notification settings - Fork 0
/
rooms.php
300 lines (286 loc) · 12.8 KB
/
rooms.php
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html lang="en">
<head>
<title>
<?= $_SESSION['setting_hotel_name'] . " | Rooms" ?>
</title>
</head>
<style>
img.category-img{
height: 16rem;
object-fit: cover;
border-radius: .3rem;
&:hover{
transform: scale(1.05);
transition: ease-in .4s;
-webkit-transition: ease-in .4s;
}
}
.room-category{
text-transform: capitalize;
}
</style>
<body>
<?php
global $conn;
// $date_in = isset($_POST['date_in']) ? $_POST['date_in'] : date('Y-m-d');
// $date_out = isset($_POST['date_out']) ? $_POST['date_out'] : date('Y-m-d',strtotime(date('Y-m-d').' + 3 days'));
$date_in = isset($_POST['date_in']) ? date('Y-m-d', strtotime($_POST['date_in'])) : date('Y-m-d');
$date_out = isset($_POST['date_out']) ? date('Y-m-d', strtotime($_POST['date_out'])) : date('Y-m-d', strtotime('+3 days'));
?>
<!-- Page Preloder -->
<div id="preloder">
<div class="loader"></div>
</div>
<!-- Offcanvas Menu Section Begin -->
<div class="offcanvas-menu-overlay"></div>
<div class="canvas-open">
<i class="icon_menu"></i>
</div>
<div class="offcanvas-menu-wrapper">
<div class="canvas-close">
<i class="icon_close"></i>
</div>
<div class="search-icon search-switch">
<i class="icon_search"></i>
</div>
<div class="header-configure-area">
<div class="language-option">
<span>EN <i class="fa fa-angle-down"></i></span>
<div class="flag-dropdown">
<ul>
<li><a href="#">Fr</a></li>
</ul>
</div>
</div>
<a href="./index.php?page=home" class="bk-btn">Book Now</a>
</div>
<nav class="mainmenu mobile-menu">
<ul>
<li class="active"><a href="./index.php?page=home">Home</a></li>
<li><a href="./index.php?page=rooms">Rooms</a></li>
<li><a href="./index.php?page=about-us">About Us</a></li>
<!-- <li><a href="./pages.html">Pages</a>
<ul class="dropdown">
<li><a href="./room-details.html">Room Details</a></li>
<li><a href="#">Deluxe Room</a></li>
<li><a href="#">Family Room</a></li>
<li><a href="#">Premium Room</a></li>
</ul>
</li> -->
<li><a href="./index.php?page=blog">News</a></li>
<li><a href="./index.php?page=contact">Contact</a></li>
</ul>
</nav>
<div id="mobile-menu-wrap"></div>
<div class="top-social">
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-instagram"></i></a>
</div>
<ul class="top-widget">
<li><i class="fa fa-phone"></i> <?= $_SESSION['setting_contact'] ?></li>
<li><i class="fa fa-envelope"></i> <?= $_SESSION['setting_email'] ?></li>
</ul>
</div>
<!-- Offcanvas Menu Section End -->
<!-- Header Section Begin -->
<header class="header-section">
<div class="top-nav">
<div class="container">
<div class="row">
<div class="col-lg-6">
<ul class="tn-left">
<li><i class="fa fa-phone"></i> <?= $_SESSION['setting_contact'] ?></li>
<li><i class="fa fa-envelope"></i> <?= $_SESSION['setting_email'] ?></li>
</ul>
</div>
<div class="col-lg-6">
<div class="tn-right">
<div class="top-social">
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-instagram"></i></a>
</div>
<a href="./index.php?page=home" class="bk-btn">Book Now</a>
<div class="language-option">
<span>EN <i class="fa fa-angle-down"></i></span>
<div class="flag-dropdown">
<ul>
<li><a href="#">Fr</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="menu-item">
<div class="container">
<div class="row">
<div class="col-lg-2">
<div class="logo">
<a href="./index.php?page=home">
<img src="img/logo.png" alt="logo image">
</a>
</div>
</div>
<div class="col-lg-10">
<div class="nav-menu">
<nav class="mainmenu">
<ul>
<li><a href="./index.php?page=home">Home</a></li>
<li class="active"><a href="./index.php?page=rooms">Rooms</a></li>
<li><a href="./index.php?page=about-us">About Us</a></li>
<!-- <li><a href="./pages.php">Pages</a>
<ul class="dropdown">
<li><a href="./room-details.html">Room Details</a></li>
<li><a href="./blog-details.html">Blog Details</a></li>
<li><a href="#">Family Room</a></li>
<li><a href="#">Premium Room</a></li>
</ul> -->
</li>
<li><a href="./index.php?page=blog">News</a></li>
<li><a href="./index.php?page=contact">Contact</a></li>
</ul>
</nav>
<div class="nav-right search-switch">
<i class="icon_search"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Header End -->
<!-- Breadcrumb Section Begin -->
<div class="breadcrumb-section">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb-text">
<h2>Room Categories</h2>
<div class="bt-option">
<a href="./index.php?page=home">Home</a>
<span>Categories</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Breadcrumb Section End -->
<!-- Rooms Section Begin -->
<section class="rooms-section spad">
<div class="container">
<div class="row">
<?php
$cat = $conn->query("SELECT * FROM room_categories");
$cat_arr = array();
while($row = $cat->fetch_assoc()){
$cat_arr[$row['id']] = $row;
}
// $qry = $conn->query("SELECT distinct(category_id),category_id from rooms where id not in (SELECT room_id from checked where '$date_in' BETWEEN date(date_in) and date(date_out) and '$date_out' BETWEEN date(date_in) and date(date_out) )");
$qry = $conn->query("SELECT distinct(category_id), category_id
FROM rooms
WHERE id NOT IN (
SELECT room_id
FROM checked
WHERE ('$date_in' BETWEEN date(date_in) AND date(date_out)
OR '$date_out' BETWEEN date(date_in) AND date(date_out)
OR ('$date_in' <= date_in AND '$date_out' >= date_out))
)
");
while($row= $qry->fetch_assoc()):
?>
<div class="col-lg-4 col-md-6">
<div class="room-item">
<img src="assets/img/<?= $cat_arr[$row['category_id']]['cover_img'] ?>" alt="Category image" loading="lazy" class="category-img">
<div class="ri-text">
<h4 class="room-category"><?= $cat_arr[$row['category_id']]['name'] ?></h4>
<h3><?= '₦ '.number_format($cat_arr[$row['category_id']]['price'],2) ?><span>/Pernight</span></h3>
<table>
<tbody>
<tr>
<td class="r-o">Capacity:</td>
<td>Max. person <?= $cat_arr[$row['category_id']]['capacity'] ?></td>
</tr>
<tr>
<td class="r-o">Services:</td>
<td><?= $cat_arr[$row['category_id']]['services'] ?></td>
</tr>
</tbody>
</table>
<a href="#" class="primary-btn book_now" data-id="<?= $row['category_id'] ?>">Book Now</a>
=======
$qry = $conn->query("SELECT distinct(category_id),category_id from rooms where id not in (SELECT room_id from checked where '$date_in' BETWEEN date(date_in) and date(date_out) and '$date_out' BETWEEN date(date_in) and date(date_out) )");
while($row= $qry->fetch_assoc()):
?>
<div class="col-lg-4 col-md-6">
<div class="room-item">
<img src="assets/img/<?= $cat_arr[$row['category_id']]['cover_img'] ?>" alt="Category image" loading="lazy" class="category-img">
<div class="ri-text">
<h4 class="room-category"><?= $cat_arr[$row['category_id']]['name'] ?></h4>
<h3><?= '₦ '.number_format($cat_arr[$row['category_id']]['price'],2) ?><span>/Pernight</span></h3>
<table>
<tbody>
<tr>
<td class="r-o">Capacity:</td>
<td>Max. person <?= $cat_arr[$row['category_id']]['capacity'] ?></td>
</tr>
<tr>
<td class="r-o">Services:</td>
<td><?= $cat_arr[$row['category_id']]['services'] ?></td>
</tr>
</tbody>
</table>
<a href="#" class="primary-btn book_now" data-id="<?= $row['category_id'] ?>">Book Now</a>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<!-- <div class="col-lg-12">
<div class="room-pagination">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">Next <i class="fa fa-long-arrow-right"></i></a>
</div>
</div> -->
</div>
</div>
</section>
<!-- Rooms Section End -->
<!-- Footer -->
<?php
include('./footer.php');
?>
<!--/ Footer -->
<!-- Search model Begin -->
<div class="search-model">
<div class="h-100 d-flex align-items-center justify-content-center">
<div class="search-close-switch"><i class="icon_close"></i></div>
<form class="search-model-form">
<input type="text" id="search-input" placeholder="Search here ..." autocomplete="off">
</form>
</div>
</div>
<!-- Search model end -->
<!-- Js Plugins -->
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/jquery.slicknav.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/main.js"></script>
<script>
$('.book_now').click(function(){
uni_modal('Book','admin/book.php?in=<?php echo $date_in ?>&out=<?php echo $date_out ?>&cid='+$(this).attr('data-id'))
})
</script>
</body>
</html>