-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroom_details.php
273 lines (239 loc) · 17.4 KB
/
room_details.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
<?php
require('./admin/db_config.php');
require('./admin/essentials.php')
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your stay</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<link rel="stylesheet" href="./yourStay.css">
</head>
<body>
<?php
require('./components/header.php');
?>
<?php
if (!isset($_GET['id'])) {
redirect('rooms.php');
}
$data = filteration($_GET);
$room_res = select("SELECT * FROM `rooms` WHERE `id`=? AND `status`=? AND `removed`=?", [$data['id'], 1, 0], 'iii');
if (mysqli_num_rows($room_res) == 0) {
redirect('rooms.php');
}
$room_data = mysqli_fetch_assoc($room_res);
?>
<main>
<!-- <section class="heroStay">
<div class="container">
<div class="heroStay_content d-flex justify-content-center align-items-center">
<h1 class="text-white">Your Stay</h1>
</div>
</div>
</section> -->
<section class="roomCollection py-md-5 container-fluid py-5">
<div class=" py-md-5">
<div class="roomCollection_content">
<div class="title" style="margin-top: 7rem;">
<h1><?php echo $room_data['name'] ?></h1>
<div class="mb-4">
<a href="../client/yourStay.php">Home</a>
<span> > </span>
<a href="rooms.php">Rooms</a>
</div>
</div>
<div class="row">
<div class="col-lg-7 col-md-12 position-relative" style="height: 400px;">
<div id="carouselExample" class="carousel slide h-100">
<div class="carousel-inner h-100">
<?php
$room_img = ROOMS_PATH . "thumbnail.jpg";
$img_query = mysqli_query($conn, "SELECT * FROM `room_images`
WHERE `room_id`='$room_data[id]'");
if (mysqli_num_rows($img_query) > 0) {
$active_class = 'active';
while ($img_res = mysqli_fetch_assoc($img_query)) {
echo "
<div class='carousel-item $active_class'>
<img src='" . ROOMS_PATH . $img_res['image'] . "' class='h-100 d-block w-100 rounded' alt='..'>
</div>
";
$active_class = '';
}
} else {
echo "<div class='carousel-item active'>
<img src='$room_img' class='d-block w-100' alt='>
</div>";
}
?>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExample" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExample" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
<div class="col-lg-5 col-md-12">
<div class="card mb-4 border-0 shadow_sm rounded-3">
<div class="card-body">
<?php
echo <<<price
<h4>₱$room_data[price] per night</h4>
price;
echo <<<rating
<div class="star_ratings mb-3">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
</div>
rating;
$features_query = mysqli_query($conn, "SELECT f.name FROM `features` f
INNER JOIN `room_features` rfea ON f.id = rfea.features_id
WHERE rfea.room_id = '$room_data[id]'");
$features_data = "";
while ($fea_row = mysqli_fetch_assoc($features_query)) {
$features_data .= "<span class='badge rounded-pill bg-light text-dark text-wrap'>$fea_row[name]</span>";
}
echo <<<features
<div class="features mb-3">
<h6>Features</h6>
$features_data
</div>
features;
$facility_query = mysqli_query($conn, "SELECT f.name FROM `facilities` f
INNER JOIN `room_facilities` rfac ON f.id = rfac.facilities_id
WHERE rfac.room_id = '$room_data[id]'");
$facilities_data = "";
while ($fac_row = mysqli_fetch_assoc($facility_query)) {
$facilities_data .= "<span class='badge rounded-pill bg-light text-dark text-wrap'>$fac_row[name]</span>";
}
echo <<<facilities
<div class="facilities mb-3">
<h6>Facilities</h6>
$facilities_data
</div>
facilities;
echo <<<guests
<div class="guests mb-3">
<h6 class='mb-1'>Guests</h6>
<span class="badge rounded-pill bg-light text-dark text-wrap">
$room_data[adult] Adults
</span>
</div>
guests;
echo <<<area
<div class='mb-3'>
<h6 class='mb-1'>Area</h6>
<span class='badge rounded-pill bg-light text-dark text-wrap'>
$room_data[area] sg. ft.
</span>
</div>
area;
echo <<<book
<a type="button" href="#" class="btn btn-primary w-100 border-0 rounded-0" style="background-color: #1A5F7A">
BOOK NOW
</a>
book;
?>
</div>
</div>
</div>
<div class="col-12 mt-4">
<div class="mb-4">
<h5><strong>Description</strong></h5>
<p>
<?php echo $room_data['description'] ?>
</p>
</div>
<div>
<h5 class="mb-4 fw-bold">Reviews & Ratings</h5>
<div class="d-flex flex-column gap-4">
<div class="statement d-flex flex-column gap-3">
<div class="userProfile">
<table>
<tr class="d-flex gap-3">
<td>
<img src="../assets/capcake.jpg" alt="" width="40" height="40" class="rounded-5">
</td>
<td class="d-flex justify-content-center align-items-center">
<h2>Judith Black</h2>
</td>
</tr>
</table>
</div class='w-100'>
<p class="">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Alias, commodi
aperiam quisquam, veritatis aut quasi, doloribus unde veniam maxime iste
qui. Quasi, maiores. Amet deleniti laboriosam harum consequatur recusandae
dicta cum nobis consectetur culpa. Laudantium aut ea magni quod. Atque?</p>
</div>
<div class="star_ratings d-flex gap-2">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" />
</svg>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<?php
require('./footer.php')
?>
</body>
</html>