-
Notifications
You must be signed in to change notification settings - Fork 0
/
Book.php
307 lines (212 loc) · 10.5 KB
/
Book.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1.0">
<script src="assets/js/fg.timepicker.js"></script>
<link type="text/css" rel="stylesheet" href="assets/css/fg.timepicker.css" />
</head>
<?php session_start();
require ('inc/head.php'); ?>
<body>
<?php require ('inc/preloader_area.php');
require ('inc/top_Bar.php');
if(isset($_SESSION['userId'])){
$userid=$_SESSION['userId'];
require ('inc/LoginHeader.php');
}else{
require ('inc/Header.php');
}
$shallId=$_GET['shallId'];
require('admin/handlers/db.php');
$sql= "SELECT * FROM images where subhall_id=$shallId";
$query = mysqli_query($conn,$sql);
$sql="SELECT * FROM subhalls where id=$shallId";
$sqlResult=mysqli_query($conn,$sql);
$hallData=mysqli_fetch_assoc($sqlResult);
$hallid= $hallData['hall_id'];
$sql="SELECT * FROM halls where id=$hallid";
$sqlResult=mysqli_query($conn,$sql);
$hall=mysqli_fetch_assoc($sqlResult);
?>
<!-- ========== Breadcumb start============= -->
<div class="breadcrumb-section-login">
<div class="container">
<div class="row d-flex justify-content-center align-items-center text-center">
<div class="col-lg-8">
<div class="hero-video">
<h2 class="breadcrumb-title wow fadeInLeft" data-wow-duration="1.5s" data-wow-delay=".2s">Booking A Hall</h2>
<nav aria-label="breadcrumb">
<ol class="breadcrumb d-flex justify-content-center">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Book</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
</div>
<!-- ========== Breadcumb end============= -->
<!-- ========== Room & Suits start============= -->
<div class="room-suits-details-page pt-120 mb-120">
<div class="container">
<div class="row mb-80 g-8">
<div class="col-lg-7">
<style>
.dot {
height: 15px;
width: 15px;
background-color: #00D700;
border-radius: 40%;
display: inline-block;
}
</style>
<div id='calendar'></div>
<script src=" https://cdn.jsdelivr.net/npm/[email protected]/index.global.min.js "></script>
<script>
var shallId = <?php echo json_encode($shallId); ?>;
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'timeGridWeek',
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'timeGridWeek,timeGridDay' // user can switch between the two
},
events: 'getreservation.php?shallId='+shallId,
});
calendar.render();
});
</script>
<br>
<div class="btn-group">
<div style="width: 25px; height: 25px; background-color:#00D700; border-radius: 15px;"></div>
<p> Approved Reservation </p>
<div style="width: 25px; height: 25px; background-color:#D70000; border-radius: 15px;"></div>
<p> Pended Reservation</p>
</div>
<br>
</div>
<div class="col-lg-5">
<div class="widget-area2">
<?php if(isset( $_SESSION['errors'])){
foreach($_SESSION['errors'] as $error){?>
<div class="alert alert-danger" role="alert"> <?php echo $error;?> </div>
<?php }
unset($_SESSION['errors']);
}
if(isset( $_SESSION['success'])){?>
<div class="alert alert-success" role="alert"> <?php echo $_SESSION['success'];?> </div>
<?php unset($_SESSION['success']);
}
?>
<div class="widget-title">
<h5>Book <?php echo $hall['name'];?> - <?php echo $hallData['name'];?></h5>
</div>
<div class="single-widgets booking-widgets">
<form action="admin/handlers/insert-reservation.php" enctype="multipart/form-data" method="POST">
<div class="wp-block-text__inside-wrapper select-items">
<select name ="event_type" class="custom-select" id="inputGroupSelect01" >
<option selected value="1">choose event type</option>
<?php if($hallData['type']!='2' ) { ?>
<option value="2">Wedding</option>
<option value="3">Birthday Party</option>
<option value="4">Consolation</option>
<option value="5">Shower Party</option>
<option value="6">Graduation party</option>
<option value="7">Welcome party</option>
<option value="8">Gender reveal party</option>
<?php } if($hallData['type']=='3' or $hallData['type']=='2'){?>
<option value="9">Meeting</option>
<option value="10"> Honoring Ceremony</option>
<?php } ?>
</select>
</div>
<div class="wp-block-text__inside-wrapper select-items">
<input type="hidden" name="shallId" value="<?= $hallData['id'];?>" >
<select name ="number_guest" class="custom-select" id="inputGroupSelect01" >
<option selected value="1">Number of Guests</option>
<option value="100">from 50 to 100 guests</option>
<option value="200">from 100 to 200 guests</option>
<option value="500">from 200 to 500 guests</option>
<option value="1000">from 500 to 1000 guests</option>
</select>
</div>
<div class="cwp-block-text__inside-wrapper">
<div class="searchbox-input date-picker-input input__list">
<input autocomplete="off" placeholder="Pick A Date" type="text" name="date" id="datepicker16" value="" class="claender">
</div>
<div class="row">
<div class="col-xl-6">
<div class="example" id="e2_std_input">
<div class="wp-block-text__inside-wrapper ">
<input type="text" id="e2_input" name="start_time" placeholder="Starting Time">
</div>
<script>
let e2TP = new fg.Timepicker({
hoursStart:09,
hoursEnd: 24,
bindInput: document.getElementById('e2_input'),
animatePopup: true});
</script>
</div>
</div>
<div class="col-xl-6"">
<div class="example" id="e3_std_input">
<div class="wp-block-text__inside-wrapper ">
<input type="text" id="e3_input" name="end_time" placeholder="Ending Time">
</div>
<script>
let e3TP = new fg.Timepicker({
hoursStart:09,
hoursEnd: 24,
bindInput: document.getElementById('e3_input'),
animatePopup: true,});
</script>
</div>
</div>
</div>
<div class="wp-block-text__inside-wrapper ">
<textarea name="notes" placeholder="Note (If Any)"></textarea>
</div>
<div id="results"></div>
<br>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
var hallId = <?php echo $shallId; ?>;
$('#datepicker16').on('change', function() {
var date = $(this).val();
$.ajax({
type: 'POST',
url: 'price.php',
data: { date: date, hallId: hallId },
success: function(result) {
$('#results').html(result);
},
error: function() {
$('#results').html('An error occurred.');
}
});
});
});
</script>
<div class="wp-block-text__inside-wrapper submit-btn">
<button type="submit">Book Now</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ========== Room & Suits end============= -->
<?php require ('inc/footer.php');
require('inc/js_file_link.php'); ?>
</body>
</html>