-
Notifications
You must be signed in to change notification settings - Fork 2
/
booking.php
221 lines (186 loc) · 8.14 KB
/
booking.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
<!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
include_once 'core/database.php';
$db = new MS_Database();
$movies_now_showing = $db->callProcedure('selectMoviesNowShowing');
//$schedules = $db->callProcedure('selectSchedules');
$movie_id = isset($_GET['movie_id']) ? $_GET['movie_id'] : 0;
$date_filter = isset($_GET['filter']) ? $_GET['filter'] : '';
?>
<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" />
<!-- 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:25%">
<span>Choose Movie & Time</span>
</div>
<div class="progressStatus">Progress 25%</div>
</div>
<div id="dateBox">
<div class="dateTabs">
<a <?php if ($date_filter == '') echo 'class="selected"';?>>Display all</a>
<a <?php if ($date_filter == 'date_today') echo 'class="selected"';?>>Today</a>
<a <?php if ($date_filter == 'date_3days') echo 'class="selected"';?>>Next three days</a>
<a <?php if ($date_filter == 'date_7days') echo 'class="selected"';?>>This week</a>
</div>
</div>
<div id="main">
<div id="content">
<div class="padding">
<h1>Movie Schedule</h1>
<?php
try{
$today = new DateTime('15-03-2013');
} catch(Exception $e) {
}
foreach ($movies_now_showing as $movie) {
$schedules = $db->callProcedure('selectShowsByMovieId', $movie['id']);
echo '<div id="movie_' . $movie['id'] . '" class="box mod movieBox">';
echo '<a href="movie.php?id=' . $movie['id'] . '"><h1>' . $movie['title'] . '</h1></a>';;
foreach ($schedules as $s) {
$show_date = DateTime::createFromFormat('Y-m-d', $s['show_date']);
$dayDiff = $show_date->diff($today)->d;
echo '<div class="showDate ' . ( ($dayDiff == 0) ? 'date_today ' : ' ' ) . ( ($dayDiff >= 0 && $dayDiff <= 2) ? 'date_3days ' : ' ' ) . ( ($dayDiff >= 0 && $dayDiff <= 6) ? 'date_7days ' : ' ' ) .'" >' . $show_date->format('d/m/Y');
if (($time_block = '10:00') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
if (($time_block = '11:30') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
if (($time_block = '14:00') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
if (($time_block = '16:45') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
if (($time_block = '20:00') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
if (($time_block = '21:30') && $s[$time_block]) echo '<span class="showTime"><a onclick="process(\'' . $s['id'] . '\', \'' . $s[$time_block] . '\', \'' . $s['show_date'] . ' ' . $time_block . ':00' . '\')">' . $time_block . '</a></span>';
echo '</div>';
}
echo '</div>';
}
?>
<!-- Hidden form -->
<form id="movie_booking" action="booking-step2.php" method="post">
<input type="hidden" name="movie_id" />
<input type="hidden" name="room_id" />
<input type="hidden" name="show_time" />
</form>
</div>
</div>
<div id="sidebar">
<div class="padding">
<div class="box">
<h3>Select movies</h3>
<?php foreach ($movies_now_showing as $movie) {
echo '<label>';
echo '<input type="checkbox" class="movieCheckbox" name="movie" class="movieCheckbox" value="' . $movie['id'] . '" id="' . $movie['alias'] . '" ' . ($movie_id == $movie['id'] ? 'checked' : '') . '/>';
echo ' ' . $movie['title'] . '</label><br />';
}
?>
<div class="clr"></div>
</div>
</div>
</div>
<div class="clr"></div>
</div>
<div id="filmBarGrey"></div>
<div id="footer">
<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>
<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">
$(".movieBox").hide();
$(".movieCheckbox:checked").each(function() {
var movie_id = $(this).val();
$(".movieBox#movie_" + movie_id).show();
});
$(".movieCheckbox").change(function() {
var movie_id = $(this).val();
if ($(this).attr("checked")) {
$(".movieBox#movie_" + movie_id).slideDown(300);
} else {
$(".movieBox#movie_" + movie_id).slideUp(300);
}
});
var selectedClass = "<?php echo $date_filter;?>";
if (selectedClass != "") {
$(".showDate").hide();
$(".showDate." + selectedClass).show();
}
$(".dateTabs a").click(function() {
var o = $(this);
selectedClass = "";
$(".dateTabs a").removeClass("selected");
o.addClass("selected");;
switch (o.html().toLowerCase()) {
case "today":
selectedClass = "date_today";
break;
case "next three days":
selectedClass = "date_3days";
break;
case "this week":
selectedClass = "date_7days";
break;
default:
selectedClass = "";
break;
}
if (selectedClass != "") {
$(".showDate:not(." + selectedClass + ")").slideUp("fast", function() {
$(this).hide();
});
$(".showDate." + selectedClass).slideDown("fast");
} else {
$(".showDate").slideDown("fast");
}
})
function process(movieId, roomId, showTime) {
$("[name=movie_id]").val(movieId);
$("[name=room_id]").val(roomId);
$("[name=show_time]").val(showTime);
$("#movie_booking").submit();
}
</script>
</body>
</html>