This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrates_and_showtimes.php
320 lines (264 loc) · 12.6 KB
/
rates_and_showtimes.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
308
309
310
311
312
313
314
315
316
317
318
319
320
<?php
session_start();
include 'assets/rates_and_showtimes.inc.php';
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!--Font Awesome CSS-->
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<!--Glyphicons CSS-->
<link rel="stylesheet" type="text/css" href="css/glyphicon.css">
<!--JQuery-UI CSS-->
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
<!--Owl Carousel CSS-->
<link rel="stylesheet" type="text/css" href="css/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="css/owl.theme.default.css">
<!--Custom Style CSS-->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/movies_slider.css">
<!--Favicon Image-->
<link rel="shortcut icon" type="image/png" href="images/icon.png">
<title>InstaMovies</title>
</head>
<body id="itemid-3">
<!--Navbar Code - Start-->
<?php include('header.php'); ?>
<!--Navbar Code - End-->
<!--Rates and ShowTimes Body - Start-->
<div class="rates_and_showtimes">
<!--Banner Code - Start-->
<div class="banner">
<img src="images/banner.jpg?v=<?php echo time(); ?>">
</div>
<!--Banner Code - End-->
<div class="container mt-4">
<h1>Rates and Show Times</h1>
<p>
Please select the required movie and the theatre from the dropdown lists and it will display current ticket rates and show times for the relevant theater.
<br>
<strong>Note:</strong>
<br>
The Ticket Rates and Show Times displayed are standard rates and showtimes for the Theatre ONLY. Ticket Rates and Show Times may differ from Movie to Movie.
</p>
<form class="form_details mt-4" action="request.php" id="detailsFrm" name="frmName" method="POST">
<div class="form-group row">
<label for="inputMovie" class="col-sm-2 col-form-label">Movie</label>
<div class="col-sm-10">
<select class="form-control" id="movie" name="movie">
<option value="">Select Movie</option>
<?php echo $options_movie;?>
</select>
</div>
</div>
<div class="form-group row" >
<label for="inputDate" class="col-sm-2 col-form-label">Date</label>
<div class="date col-sm-10">
<div class="input-group">
<input type='text' class="form-control" id='datepicker' name="date" readonly="true">
</div>
</div>
</div>
<div class="form-group" action="assets/rates_and_showtimes.inc.php" method="POST">
<div class="row">
<label for="inputTheatre" class="col-sm-2 col-form-label">Theatre</label>
<div class="col-sm-10">
<select class="form-control" id="theatre" name="theatre">
<option value="">Select Theatre</option>
</select>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<input class="btn btn-warning" role="button" name="view" value="View Details" type="submit">
</div>
</div>
</form>
<div class="output_details" id="output_details" style="display:none;">
<div class="rates_details mt-4">
<label class="heading">Rates:</label>
<div class="rates_table mt-2" id="output_details_rates_table">
<!--table file link-->
</div>
</div>
<div class="showtimes_details mt-4">
<label class="heading">Show Times:</label>
<div class="showtimes_table mt-2" id="output_details_showtimes_table">
<!--table file link-->
</div>
</div>
<button id="buy_tickets_btn" class="btn btn-danger mt-4">Buy Tickets</button>
</div>
</div>
</div>
</div>
<!--Rates and ShowTimes Body - End-->
<!--Footer Code - Start-->
<?php include('footer.php') ?>
<!--Footer Code - End-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js,then Owl_Carousel, then Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/owl.carousel.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui.js"></script>
<!--Date Picker Script-->
<script>
$( function() {
$( "#datepicker" ).datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
buttonImage: "images/calendar.png",
buttonText: "Select Date",
minDate: 0,
});
});
</script>
<!--Output_Details Script-->
<script>
jQuery(document).ready(function(){
jQuery("#detailsFrm").submit(function (e) {
e.preventDefault();
var frm = jQuery('#detailsFrm');
var outPut1 = jQuery('#output_details_rates_table');
var outPut2 = jQuery('#output_details_showtimes_table');
var movieID = jQuery('#movie').val();
var selectedDate = jQuery('#datepicker').val();
var theatreID = jQuery('#theatre').val();
if (movieID!='',selectedDate!='',theatreID!=''){
document.getElementById('output_details').style.display = "block";
jQuery.ajax({
type: 'POST',
data:'action=submitForm&movie_id=' + movieID + '&selected_date=' + selectedDate + '&theatre_id=' + theatreID,
url: 'assets/rates_and_showtimes.details_rates.php',
success: function(data) {
outPut1.html(data);
}
});
jQuery.ajax({
type: 'POST',
data:'action=submitForm&movie_id=' + movieID + '&selected_date=' + selectedDate + '&theatre_id=' + theatreID,
url: 'assets/rates_and_showtimes.details_showtimes.php',
success: function(data) {
outPut2.html(data);
}
});
}
});
});
</script>
<!---------------------------------------------------------------------------->
<!--Output Details Script -------- draft-->
<!-- <script>
function show_output_details() {
var movieID = document.getElementById('movie').value;
var selectedDate = document.getElementById('datepicker').value;
var theatreID = document.getElementById('theatre').value;
$.ajax({
type:"POST",
url:'assets/rates_and_showtimes.inc.php',
data:'movieID' + movieID + '&theatreID' + theatreID,
cache:false,
success:function(response){
$('#output_details_table').html(response);
}
})
}
</script> -->
<!---------------------------------------------------------------------------->
<!--Select Options Data Dependancy-->
<script>
//Datepicker minDate Dependant on Movie Option
//Hiding Output_Details division when changing selection of Movie
$('#movie').on('change',function(){
document.getElementById('output_details').style.display = "none";
document.getElementById('datepicker').value='';
document.getElementById('theatre').value='';
var movieID = $(this).val();
if(movieID){
$.ajax({
type:'POST',
url:'assets/rates_and_showtimes.inc.php',
data:'movie_id_1=' + movieID,
success:function(data){
var start_Date = data;
$('#datepicker').datepicker('option','minDate',start_Date);
$('#theatre').html('<option value="">Select Theatre</option>');
}
});
}else{
$('#theatre').html('<option value="">Select Theatre</option>');
}
});
//Hiding Output_Details division when changing selection of Theatre
$('#theatre').on('change',function(){
document.getElementById('output_details').style.display = "none";
})
//Theatre Option Dependant on Date Selection in Datepicker
//Hiding Output_Details division when changing selection of Date
$('#datepicker').on('change',function(){
document.getElementById('output_details').style.display = "none";
var sel_Date = $(this).val();
var movieID = jQuery('#movie').val();
if(sel_Date){
$.ajax({
type:'POST',
url:'assets/rates_and_showtimes.inc.php',
data:'sel_date=' + sel_Date + '&movie_id=' + movieID,
success:function(html){
$('#theatre').html(html);
}
});
}else{
$('#theatre').html('<option value="">Select Theatre</option>');
}
})
// $('#movie').on('change',function(){
// var movieID = $(this).val();
// $('#datepicker').datepicker('option','maxDate',+20);
// });
</script>
<!------------------------------------------------------------------------------------>
<!--Enabling Dates between Two Dates-->
<!-- <script>
//Converting any number to two digits (for example: (9 -> 09))
function pad2(number) {
return (number < 10 ? '0' : '') + number;
}
//Fetching an array of dates between two dates
var getDateArray = function(start, end) {
var array_dates = new Array();
var cur_date = new Date(start);
while (cur_date <= end) {
var current_date=new Date(cur_date);
var formatted_date = current_date.getFullYear() + "-" + pad2(current_date.getMonth() + 1) + "-" + pad2(current_date.getDate());
array_dates.push(formatted_date);
cur_date.setDate(cur_date.getDate() + 1);
}
return array_dates;
}
var startDate = new Date("<?php echo $start_date?>"); //YYYY-MM-DD
var endDate = new Date("<?php echo $end_date?>"); //YYYY-MM-DD
//Enabling an array of dates
var availableDates = getDateArray(startDate, endDate); //desired Dates
function enableAvailableDays(date) {
var sdate = $.datepicker.formatDate('yy-mm-dd', date)
if($.inArray(sdate, availableDates) != -1){
return [true];
}
return[false];
}
</script> -->
<!---------------------------------------------------------------------------------->
<script>
$(".header_wrapper .main_menu_wrapper .item-3").addClass("active");
</script>
</body>
</html>