-
Notifications
You must be signed in to change notification settings - Fork 2
/
booking-step3.php
312 lines (275 loc) · 11.2 KB
/
booking-step3.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
$movie_id = $_POST['movie_id'];
$room_id = $_POST['room_id'];
$show_time = $_POST['show_time'];
$seats = json_decode($_POST['seats'], true);
if (!$movie_id || !$room_id || !$show_time) {
// 404 Redirect
header('Location: booking.php');
}
include_once 'core/database.php';
$db = new MS_Database();
$show = $db->callProcedure('selectShow', $movie_id, $room_id, $show_time);
$show_time = DateTime::createFromFormat('Y-m-d H:i:s', $show['show_time']);
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Movie Square Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." />
<meta name="keywords" content="Ex ea, commodo, consequat, duis aute irure, dolor in, reprehenderit" />
<title>Movie Square - Home</title>
<!-- CSS -->
<link href="css/rs.css" rel="stylesheet" type="text/css" />
<link href="css/myriadpro.css" rel="stylesheet" type="text/css" />
<link href="css/dropkick.css" rel="stylesheet" type="text/css" />
<!-- Custom CSS -->
<link href="css/ms.css" rel="stylesheet" type="text/css" />
<link href="css/booking.css" rel="stylesheet" type="text/css" />
<!-- Javascript and JQuery -->
<script src="js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.dropkick-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
$('.default').dropkick();
});
</script>
</head>
<body>
<div class="w">
<div id="header">
<h1><a href="index.php">Movie Square</a></h1>
<div id="nav">
<ul>
<li><a href="index.php">Home </a></li>
<li class="current"><a href="booking.php">Ticket Booking</a></li>
<li><a href="movies.php">Movies</a></li>
<li><a href="news.php">News & Events</a></li>
<li><a href="services.php">Services</a></li>
<li><a href="aboutus.php">About Us</a></li>
</ul>
</div>
</div>
<div id="filmBar"></div>
<div class="progressBar">
<div class="currentStep" style="width:75%">
<span>Information & Payment</span>
</div>
<div class="progressStatus">Progress 75%</div>
</div>
<div id="main">
<div id="content">
<div class="padding">
<div class="box">
<form id="movie_booking" action="booking-process.php" method="post">
<h1>Information</h1>
<table class="formTable">
<tr>
<td class="formLabel"><label for="yourname">Your Name (*)</label></td>
<td class="formBody"><input name="yourname" id="yourname" type="text" class="inputbox wide" placeholder="someone"//></td>
</tr>
<tr>
<td class="formLabel"><label for="email">Email (*)</label></td>
<td class="formBody"><input name="email" id="email" type="text" class="inputbox wide" placeholder="[email protected]"/></td>
</tr>
<tr>
<td class="formLabel"><label for="phone">Phone (*)</label></td>
<td class="formBody"><input name="phone" id="phone" type="text" class="inputbox" /></td>
</tr>
<tr>
<td class="formLabel">Payment Methods</td>
<td class="formBody paymentSelector">
<label><input type="radio" name="payment" value="visa" id="visa" onclick="updatePayment();"/>VISA Card, Master Card, Credit Card</label>
<label><input type="radio" name="payment" value="booth" id="booth" onclick="updatePayment();"/>Ticket Booth (30 mins before show time)</label>
<label><input type="radio" name="payment" value="delivery" id="delivery" checked="checked" onclick="updatePayment();"/>On Delivery</label>
<label><input type="radio" name="payment" value="internet" id="internet" onclick="updatePayment();"/>Internet Banking</label>
</td>
</tr>
</table>
<div id="visa_card_payment" hidden="display">
<h2>VISA CARD PAYMENT</h2>
<table class="formTable">
<tr>
<td class="formLabel"><label for="cardnumber">Card Number</label></td>
<td class="formBody"><img src="images/creditcard.jpg" align="right"/><input id="cardnumber" name="cardnumber" type="text" class="inputbox" /></td>
</tr>
<tr>
<td class="formLabel"><label for="cardname">Name</label></td>
<td class="formBody"><input id="cardname" name="cardname" type="text" class="inputbox" /></td>
</tr>
<tr>
<td class="formLabel"><label for="cardcvv">CCV Number</label></td>
<td class="formBody"><input id="cardcvv" name="cardcvv" type="text" class="inputbox short" /> <a href="http://www.cvvnumber.com/cvv.html" target="_blank">What is my CVV code?</a></td>
</tr>
<tr>
<td class="formLabel"><label for="carddate">Expired Date</label></td>
<td class="formBody"><input id="carddate" name="carddate" type="text" class="inputbox short" placeholder="dd/mm/yyyy"/></td>
</tr>
</table>
</div>
<input type="hidden" name="movie_id" value="<?php echo $show['movie_id']; ?>"/>
<input type="hidden" name="room_id" value="<?php echo $show['room_id']; ?>"/>
<input type="hidden" name="show_time" value="<?php echo $show['show_time']; ?>"/>
<input type="hidden" name="seats" value='<?php echo $_POST['seats']; ?>'/>
</form>
<p>Orders will be processed only after a billing address, and other billing information, has been verified. Occasionally, we receive incorrect billing or credit card account information for a ticket order that can delay processing and delivery. In these cases, Ticketplease customer service will attempt to contact you, using the information provided at the time of purchase. If Ticketplease is unable to reach you after its initial attempt, Ticketplease may cancel your order and may sell your tickets to another customer.</p>
<button onclick="back();" class="button">Back</button>
<button onclick="process();" class="button">I agree & confirm this step</button>
</div>
</div>
</div>
<div id="sidebar">
<div class="padding">
<div class="box">
<h3>Your Ticket</h3>
<div class="yourTicket">
<a href="#">
<img src="media/movies/<?php echo $show['movie_alias']; ?>/poster_portrait.jpg" />
</a>
<ul>
<li><span class="label">Movie</span><?php echo $show['movie_title']; ?></li>
<li><span class="label">Date</span><?php echo $show_time->format('d/m/Y'); ?></li>
<li><span class="label">Time</span><?php echo $show_time->format('H:i'); ?></li>
<li class="yourSeats">
<?php
$vip = 0; $standard = 0;
$last_row_id = $seats[0]['rowId'];
foreach ($seats as $seat) {
if ($last_row_id != $seat['rowId'])
echo '<br />';
if ($seat['type'] == "vip") {
echo '<span class="vip">' . $seat['rowId'] . '' . $seat['colId'] . '</span>';
$vip++;
} else {
echo '<span class="standard">' . $seat['rowId'] . '' . $seat['colId'] . '</span>';
$standard++;
}
$last_row_id = $seat['rowId'];
} ?>
</li>
<li class="ticketStandard"><span class="label">Standard (x<?php echo $standard; ?>)</span><?php echo $standard*30;?>$</li>
<li class="ticketVIP"><span class="label">VIP (x<?php echo $vip; ?>)</span><?php echo $vip*100;?>$</li>
<li class="ticketVAT"><span class="label">VAT (10%)</span><?php echo ($standard*30 + $vip*100)/10; ?>$</li>
<li class="ticketTotal"><span class="label">Total</span><?php echo ($standard*30 + $vip*100)*11/10; ?>$</li>
</ul>
</div>
</div>
</div>
</div>
<div class="clr"></div>
</div>
<div id="filmBar"></div>
<div id="footer">
<ul>
<li class="current"><a href="index.php">Home </a></li>
<li><a href="booking.php">Ticket Booking</a></li>
<li><a href="movies.php">Movies</a></li>
<li><a href="news.php">News & Events</a></li>
<li><a href="services.php">Services</a></li>
<li><a href="aboutus.php">About Us</a></li>
</ul>
<h3>Movie Square Entertainment Jsc © Copyright 2012</h3>
<p>Address: Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua<br />
Phone: 123-123456 | Fax: 123-123456 | Email: [email protected]</p>
<div class="socialIcons">
<a href="#" title="Find us on Facebook"><img src="images/facebook.png" /></a><a href="#" title="Follow us on Twitter"><img src="images/twitter.png" /></a><a href="#" title="Your Channel on Youtube"><img src="images/youtube.png" /></a><a href="#" title="Get RSS Feeds"><img src="images/rss.png" /></a>
</div>
</div>
</div>
<script type="text/javascript">
// Back to last step
function back() {
if (confirm("Are you sure?") == false)
return false;
$("#movie_booking").attr("action", "booking-step2.php");
$("#movie_booking").submit();
}
// Process form
function process() {
o = $("#yourname");
regex = /^([a-zA-z\s]{2,})$/;
if (o.val() == "") {
alert("You haven't enter your name!");
return false;
}
if (!regex.test(o.val())) {
alert("The name you entered is invalid!");
return false;
}
o = $("#email");
regex = /^[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9]@[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9][\.][a-z0-9]{2,4}$/;
if (o.val() == "") {
alert("You haven't enter your email address!");
return false;
}
if (!regex.test(o.val())) {
alert("The email address you entered is invalid!");
return false;
}
o = $("#phone");
//regex = /^[0-9]{7,12}$/;
if (o.val() == "") {
alert("You haven't enter your phone number!");
return false;
}
/*if (!regex.test(o.val())) {
alert("The phone number you entered is invalid!");
return false;
}*/
if ($(".paymentSelector input[type=radio]:eq(0)").attr("checked") == "checked") {
o = $("#cardnumber");
regex = /\b(?:\d[ -]*?){13,16}\b/;
if (o.val() == "") {
alert("You haven't enter your Visacard number!");
return false;
}
if (!regex.test(o.val())) {
alert("The Visacard number you entered is invalid!");
return false;
}
o = $("#cardname");
regex = /^([a-zA-z\s]{2,})$/
if (o.val() == "") {
alert("You haven't enter your card name!");
return false;
}
if (!regex.test(o.val())) {
alert("The card name you entered is invalid!");
return false;
}
o = $("#cardcvv");
regex = /^[0-9]{3,4}$/;
if (o.val() == "") {
alert("You haven't enter your card CCV number!");
return false;
}
if (!regex.test(o.val())) {
alert("The card CCV number you entered is invalid!");
return false;
}
o = $("#carddate");
regex = /^([0]?[1-9]|[1|2][0-9]|[3][0|1])\/([0]?[1-9]|[1][0-2])\/([0-9]{4}|[0-9]{2})$/;
if (o.val() == "") {
alert("You haven't enter your card expired date!");
return false;
}
if (!regex.test(o.val())) {
alert("The expired date you entered is invalid!");
return false;
}
}
//$("#movie_booking").attr("action", "booking-process.php");
$("#movie_booking").submit();
return true;
}
updatePayment();
function updatePayment() {
if ($("#visa:checked").length) {
$("#visa_card_payment").show(300);
return;
}
$("#visa_card_payment").hide(300);
}
</script>
</body>
</html>