-
Notifications
You must be signed in to change notification settings - Fork 2
/
movies.php
153 lines (135 loc) · 5.38 KB
/
movies.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
<!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 = $db->callProcedure('selectMovies');
$movie_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 - Movies</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><a href="booking.php">Ticket Booking</a></li>
<li class="current"><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="movieBox">
<div class="movieTabs">
<a <?php if ($movie_filter == '') echo 'class="selected"';?>>All Movies</a>
<a <?php if ($movie_filter == 'movie_now_showing') echo 'class="selected"';?>>Now Showing</a>
<a <?php if ($movie_filter == 'movie_featured') echo 'class="selected"';?>>Featured by Movie Square</a>
<a <?php if ($movie_filter == 'movie_coming_soon') echo 'class="selected"';?>>Coming Soon</a>
</div>
<div class="movieGrid">
<?php // Load all movies
foreach ($movies as $key => $movie ) {
if (($key + 1) % 5 == 0) {
echo '<div class="movieCell last ' . $movie['class'] . '">';
} else {
echo '<div class="movieCell ' . $movie['class'] . '">';
}
echo '<img src="media/movies/' . $movie['alias'] , '/poster_portrait.jpg" />';
echo '<div class="hoverBox" onclick="location.href=\'movie.php?id=' . $movie['id'] . '\';">';
echo '<a href="movie.php?id=' . $movie['id'] . '" class="button">Preview</a>';
if (strpos($movie['class'],'movie_now_showing') !== false) {
echo '<a href="booking.php?movie_id=' . $movie['id'] . '" class="button">Book now</a>';
}
echo '</div>';
echo '<div class="movieName"><a href="movie.php?id=' . $movie['id'] . '">' . $movie['title'] . '</a></div>';
echo '</div>';
}
?>
<div class="clr"></div>
</div>
</div>
<div id="filmBarDark"></div>
<div id="footer">
<ul>
<li><a href="index.php">Home </a></li>
<li><a href="booking.php">Ticket Booking</a></li>
<li class="current"><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: contact@moviesquare.com</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">
var selectedClass = "<?php echo $movie_filter;?>";
if (selectedClass != "") {
$(".movieCell").hide();
$(".movieCell").removeClass("last");
$(".movieCell." + selectedClass).filter(function(index) {
return (index + 1) % 5 == 0;
}).addClass("last");
$(".movieCell." + selectedClass).show();
}
$(".movieTabs a").click(function() {
var o = $(this);
selectedClass = "";
$(".movieTabs a").removeClass("selected");
o.addClass("selected");;
switch (o.html().toLowerCase()) {
case "featured by movie square":
selectedClass = "movie_featured";
break;
case "now showing":
selectedClass = "movie_now_showing";
break;
case "coming soon":
selectedClass = "movie_coming_soon";
break;
}
if (selectedClass != "") {
$(".movieCell").hide();
$(".movieCell").removeClass("last");
$(".movieCell." + selectedClass).filter(function(index) {
return (index + 1) % 5 == 0;
}).addClass("last");
$(".movieCell." + selectedClass).fadeIn(500, "linear");
} else {
$(".movieCell").hide();
$(".movieCell").removeClass("last");
$(".movieCell").filter(function(index) {
return (index + 1) % 5 == 0;
}).addClass("last");
$(".movieCell").fadeIn(500, "linear");
}
})
</script>
</body>
</html>