-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroom_details.php
More file actions
232 lines (200 loc) · 9.25 KB
/
Copy pathroom_details.php
File metadata and controls
232 lines (200 loc) · 9.25 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>GrandStay - ROOMS DETAILS</title>
<link rel="icon" href="images/logo/hotel-logo.avif">
<?php require('inc/links.php'); ?>
</head>
<body class="bg-light">
<?php require('inc/header.php'); ?>
<?php
if(!isset($_GET['id'])){
redirect('rooms.php');
}
$data = filteration($_GET);
$room_res = select("SELECT * FROM `rooms` WHERE `id`=? AND `status`=? AND `remove`=?",[$data['id'],1,0],'iii');
if(mysqli_num_rows($room_res)==0){
redirect('rooms.php');
}
$room_data = mysqli_fetch_assoc($room_res);
?>
<div class="container">
<div class="row">
<div class="col-12 my-5 mb-4 px-4">
<h2 class="fw-bold"><?php echo $room_data['name'] ?></h2>
<div style="font-size: 14px;">
<a href="index.php" class="text-secondary text-decoration-none">HOME</a>
<span class="text-dark"> > </span>
<a href="rooms.php" class="text-secondary text-decoration-none">ROOMS</a>
</div>
</div>
<div class="col-lg-7 col-md-12 px-4">
<div id="roomCarousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner rounded">
<?php
// Get thumbnail of the image
$room_img = ROOMS_IMG_PATH . "thumbnail.jpg"; // Default thumbnail
$thumb_q = mysqli_query($con, "SELECT `image` FROM `room_image`
WHERE `room_id` = '$room_data[id]' AND `thumb` = '1'");
if ($thumb_q && mysqli_num_rows($thumb_q) > 0) {
$thumb_res = mysqli_fetch_assoc($thumb_q);
if (!empty($thumb_res['image'])) {
$room_thumb = ROOMS_IMG_PATH . $thumb_res['image']; // Update with the actual thumbnail
}
else{
echo "<div class='carousel-item'>
<img src='$room_img' class='d-block w-100' >
</div>";
}
}
?>
<div class="carousel-item">
<img src="images/rooms/1.jpg" class="d-block w-100" >
</div>
<div class="carousel-item">
<img src="images/rooms/2.png" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="images/rooms/3.png" class="d-block w-100" >
</div>
<div class="carousel-item">
<img src="images/rooms/4.png" class="d-block w-100" >
</div>
<div class="carousel-item">
<img src="images/rooms/5.png" class="d-block w-100" >
</div>
<div class="carousel-item active">
<img src="images/rooms/6.png" class="d-block w-100" >
</div>
<div class="carousel-item">
<img src="images/rooms/7.png" class="d-block w-100" >
</div>
<div class="carousel-item">
<img src="images/rooms/8.png" class="d-block w-100" >
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#roomCarousel" 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="#roomCarousel" 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-mb-12 px-4">
<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="mb-3">
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
</div>
rating;
// get feature of rooms
$fea_q = mysqli_query($con,"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($fea_q)){
$features_data .="<span class='badge rounded-pill text-bg-light text-wrap me-1 mb-1'>
$fea_row[name]
</span>";
}
echo<<<features
<div class="mb-3">
<h6 class="mb-1">Features</h6>
$features_data
</div>
features;
// get facilities of rooms
$fac_q = mysqli_query($con,"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($fac_q)){
$facilities_data .="<span class='badge rounded-pill text-bg-light text-wrap me-1 mb-1'>
$fac_row[name]
</span>";
}
echo<<<facilities
<div class=" mb-3">
<h6 class="mb-1">Facilities</h6>
$facilities_data
</div>
facilities;
echo<<<guests
<div class="guest">
<h6 class="mb-1">Guest</h6>
<span class="badge rounded-pill text-bg-light text-wrap">
$room_data[adult] Adult
</span>
<span class="badge rounded-pill text-bg-light text-wrap">
$room_data[children] Children
</span>
</div>
guests;
echo<<<area
<div class="area mb-3 mt-3">
<h6 class="mb-1">Area</h6>
<span class='badge rounded-pill text-bg-light text-wrap me-1 mb-1'>
$room_data[area] sq. ft.
</span>
</div>
area;
$book_btn = "";
if(!$row['shutdown']){
$login=0;
if(isset($_SESSION['login']) && $_SESSION['login'] === true){
$login=1;
}
echo<<<book
<button onclick='checkLoginToBook($login,$room_data[id])' class="btn w-100 text-white custom-bg shadow-none mb-1">Book Now</button>
book;
}
?>
</div>
</div>
</div>
<div class="col-12 mt-4 px-4">
<div class="mb-5">
<h5>Description</h5>
<p>
<?php echo $room_data['description']?>
</p>
</div>
<div>
<h5>Reviews & Ratings</h5>
</div>
<div class="profile d-flex align-item-center mb-2">
<img src="images/features/star.svg" width="30px">
<h6 class="m-2 ms-0">Vivek Yadav</h6>
</div>
<p>
Great value for money stay near Helsinki station, location was fantastic,
room was spacious a living room area flanked by the 2
rooms on each side , place was clean, staff were friendly, breakfast was
great, water pressure was strong and water heater worked well."
</p>
<div class="rating">
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
<i class="bi bi-star-fill text-warning"></i>
</div>
</div>
</div>
</div>
</div>
<?php require('inc/footer.php');?>
</body>
</html>