-
Notifications
You must be signed in to change notification settings - Fork 0
/
hoteldetails.php
307 lines (293 loc) · 10.9 KB
/
hoteldetails.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
301
302
303
304
305
306
307
<?php
include("header.php");
$sql = "SELECT * FROM hotel LEFT JOIN tourism_location ON hotel.location_id = tourism_location.location_id WHERE hotel_id='$_GET[hotelid]'";
$qsql = mysqli_query($con, $sql);
$rshotelrec = mysqli_fetch_array($qsql);
$sqltourism_location = "SELECT * FROM tourism_location WHERE status='Active' AND location_id='$rshotelrec[location_id]'";
$qsqltourism_location = mysqli_query($con, $sqltourism_location);
$rstourism_location = mysqli_fetch_array($qsqltourism_location);
if ($rstourism_location['location_img'] == "") {
$img = "images/nophoto.jpg";
} else if (file_exists("imglocation/" . $rstourism_location['location_img'])) {
$img = "imglocation/" . $rstourism_location['location_img'];
} else {
$img = "images/nophoto.jpg";
}
$imglink = $img;
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2><?php echo $rshotelrec['hotel_name']; ?> - <?php echo strtoupper($rstourism_location['location_name']); ?></h2>
</div>
</div>
<!-- Sub Banner Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<div class="row">
<div class="col-md-8">
<!-- Room Detail Wrap Start -->
<div class="mg_room_detail_wrap">
<!-- Room Slider Start -->
<div class="room-slider-wrap">
<div class="room-slider">
<?php
$sql = "SELECT hotel_image.*,room_type.room_type FROM hotel_image LEFT JOIN room_type ON hotel_image.room_typeid=room_type.room_typeid WHERE hotel_image.hotel_id='$_GET[hotelid]'";
$qsql = mysqli_query($con, $sql);
while ($rs = mysqli_fetch_array($qsql)) {
if ($rs['hotel_image'] == "") {
$img = "images/nophoto.jpg";
} else if (file_exists('imghotel/' . $rs['hotel_image'])) {
$img = 'imghotel/' . $rs['hotel_image'];
} else {
$img = "images/nophoto.jpg";
}
?>
<figure><img src="<?php echo $img; ?>" alt="" style="height: 500px;"></figure>
<?php
}
?>
</div>
<!-- Room Slider Start -->
<!-- Room Slider Nav Start -->
<div class="room-slider-nav">
<?php
$sql = "SELECT hotel_image.*,room_type.room_type FROM hotel_image LEFT JOIN room_type ON hotel_image.room_typeid=room_type.room_typeid WHERE hotel_image.hotel_id='$_GET[hotelid]'";
$qsql = mysqli_query($con, $sql);
while ($rs = mysqli_fetch_array($qsql)) {
if ($rs['hotel_image'] == "") {
$img = "images/nophoto.jpg";
} else if (file_exists('imghotel/' . $rs['hotel_image'])) {
$img = 'imghotel/' . $rs['hotel_image'];
} else {
$img = "images/nophoto.jpg";
}
?>
<figure><img src="<?php echo $img; ?>" alt="" style="height: 100px;"></figure>
<?php
}
?>
</div>
<!-- Room Slider Nav End -->
</div>
<!-- Room Slider End -->
<hr>
<!--############################################################################-->
<!-- iqoniq Search Wrapper Start-->
<div class="">
<div class="">
<div class="mg_blog_medium fancy-overlay">
<!-- Nav tabs Start -->
<ul class="mg_hotel_search" role="tablist">
<li role="presentation" style="width: 100%;padding-left: 10px;"><a href="#hotels" aria-controls="hotels" role="tab" data-toggle="tab">Hotel Facilities</a></li>
</ul>
<!-- Nav tabs End -->
<form method="get" action="">
<!-- Tab panes Start -->
<div class="tab-content" style="padding: 20px;">
<div class="row">
<?php
$sqlhotel_facility = "SELECT hotel_facility.*,room_type.room_type FROM hotel_facility LEFT JOIN room_type ON hotel_facility.room_typeid=room_type.room_typeid WHERE hotel_facility.hotel_id='$_GET[hotelid]'";
$qsqlhotel_facility = mysqli_query($con, $sqlhotel_facility);
echo mysqli_error($con);
while ($rshotel_facility = mysqli_fetch_array($qsqlhotel_facility)) {
?>
<!-- iqoniq Travel Services Start -->
<div class="col-md-4 col-sm-6">
<div class="mg_services">
<img src="imgfacility/<?php echo $rshotel_facility['facility_img']; ?>" style="width: 100%; height: 150px;">
<h5><a href="#"><?php echo $rshotel_facility['facility_type']; ?></a></h5>
<label><?php echo $rshotel_facility['room_type']; ?> </label>
</div>
</div>
<!-- iqoniq Travel Services End -->
<?php
}
?>
</div>
</div>
<!-- Tab panes End -->
</form>
</div>
</div>
</div>
<!-- iqoniq Search Wrapper End-->
<!--############################################################################-->
</div>
<!-- Room Detail Wrap Start -->
<!-- Accordian Start -->
<div class="mg-accordion-wrap">
<?php
//include("searchroomtype.php");
//include("looproomtypes.php");
?>
</div>
<!-- Accordian End -->
</div>
<!-- Sidebar Start-->
<div class="col-md-4">
<div class="mg_sidebar">
<!-- Widget Contant Start-->
<div class="">
<div class="">
<h5 class="widget_default_title"><?php echo $rshotelrec['hotel_name']; ?></h5>
<p><?php echo $rshotelrec['hotel_description']; ?>.
<hr>
</p>
<h4>Address</h4>
<?php echo $rshotelrec['hotel_address']; ?>,<br>
<?php echo $rshotelrec['location_name']; ?>,<br>
<b>PIN -</b><?php echo $rshotelrec['hotel_pincode']; ?>
<hr>
<?php echo $rshotelrec['hotel_map']; ?><br>
<hr>
<hr>
<b>Policies: </b>
<br><?php echo $rshotelrec['hotel_policies']; ?>
</div>
</div>
<!-- Widget Contant End-->
</div>
</div>
<!-- Side Bar End-->
<hr>
<div class="col-md-12">
<?php include("searchroomtype.php"); ?>
</div>
<div class="col-md-12">
<!-- Pricing Table Section Start-->
<section class="pricing_wrap">
<div class="" style="padding-left: 10px; padding-right: 10px;">
<!-- iqoniq Heading Start -->
<div class="mg_hotel_hd1">
<h4>Room Types</h4>
</div>
<!-- iqoniq Heading End -->
<div class="row">
<?php
$sqlroom_type = "SELECT * FROM room_type WHERE hotel_id='$_GET[hotelid]' AND status='Active' ";
if (isset($_GET['room_type'])) {
$sqlroom_type = $sqlroom_type . " AND room_typeid='$_GET[room_type]'";
}
$qsqlroom_type = mysqli_query($con, $sqlroom_type);
while ($rsroom_type = mysqli_fetch_array($qsqlroom_type)) {
$sqlhotel_image = "SELECT * FROM hotel_image WHERE room_typeid='$rsroom_type[0]'";
$qsqlhotel_image = mysqli_query($con, $sqlhotel_image);
$rshotel_image = mysqli_fetch_array($qsqlhotel_image);
?>
<div class="col-md-4 col-sm-6">
<!-- iqoniq Pricing Table Start -->
<div class="mg_pricing fancy-overlay">
<div class="thumb">
<?php
if (file_exists("imghotel/" . $rshotel_image['hotel_image'])) {
echo "<img src='imghotel/$rshotel_image[hotel_image]' alt='' style='width: 360px;height: 220px;'>";
}
?>
<div class="caption">
<?php
/*
<div class="rating_down">
<div class="rating_up" style="width:0%;"></div>
</div>
*/
?>
<div class="clear"></div>
<strong><?php echo $rsroom_type['room_type']; ?></strong>
<p><?php echo $rsroom_type['max_adults']; ?> Adults, <?php echo $rsroom_type['max_children']; ?> Children</p>
<b>Rs. <?php echo $rsroom_type['cost']; ?></b>
</div>
</div>
<div class="text">
<h6><a href="#"><?php echo $rsroom_type['room_type']; ?></a></h6>
<?php
if (isset($_SESSION['customer_id'])) {
?>
<?php
$sqlroom_booking = "SELECT * FROM room_booking WHERE room_typeid='$rsroom_type[0]' AND (('$_GET[checkin]' BETWEEN check_in AND check_out) OR ('$_GET[checkout]' BETWEEN check_in AND check_out)) AND status='Active'";
$qsqlsqlroom_booking = mysqli_query($con, $sqlroom_booking);
echo mysqli_error($con);
$noofbookings = mysqli_num_rows($qsqlsqlroom_booking);
//echo $rsroom_type['available_rooms'];
$noavailableroom = $rsroom_type['available_rooms'] - $noofbookings;
if ($noavailableroom >= 1) {
?>
(No. of Rooms Available: <?php echo $noavailableroom; ?>)
<a class="mg_btn1" href="hotelbooking.php?location_id=<?php
echo $_GET['location_id']; ?>&adults=<?php if (isset($_GET['adults'])) {
echo $_GET['adults'];
} else {
echo $rsroom_type['max_adults'];
}
?>&children=<?php
if (isset($_GET['children'])) {
echo $_GET['children'];
} else {
echo $rsroom_type['max_children'];
}
?>&checkin=<?php
if (isset($_GET['checkin'])) {
echo $_GET['checkin'];
} else {
echo date("Y-m-d", strtotime('tomorrow'));
}
?>&checkout=<?php
if (isset($_GET['checkout'])) {
echo $_GET['checkout'];
} else {
echo date("Y-m-d", strtotime('tomorrow'));
}
?>&hotelid=<?php echo $_GET['hotelid']; ?>&room_type=<?php echo $rsroom_type['room_typeid']; ?>&checkintime=<?php
if (isset($_GET['checkintime'])) {
echo $_GET['checkintime'];
} else {
echo "12:30";
}
?>&checkouttime=<?php
if (isset($_GET['checkouttime'])) {
echo $_GET['checkouttime'];
} else {
echo "12:30";
}
?>">Book Room</a>
<?php
} else {
?>
<a class="mg_btn1" href="#">No Rooms Available</a>
<?php
}
} else {
?>
<a class="mg_btn1" data-toggle="modal" data-target="#reg-box" href="#"><i class="fa fa-lock"></i><span>Login Or Register</span></a>
<?php
}
?>
</div>
</div>
<!-- iqoniq Pricing Table End -->
</div>
<?php
}
?>
</div>
</div>
</section>
<!-- Pricing Table Section End-->
</div>
</div>
</div>
</section>
</div>
<?php
include("feedback.php");
include("footer.php");
?>
<script>
/*
$('#checkin').on("change",function()
{
$("#checkout").
});
*/
</script>