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 pathmovies.php
246 lines (209 loc) · 7.36 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
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
<?php
session_start();
include_once( 'libs/MoviegetItems.php' );
include_once( 'libs/ip.php' );
include_once ('db_config.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">
<!--Rating CSS-->
<link rel="stylesheet" href="css/jRating.jquery.css" />
<!--Custom Style CSS-->
<link rel="stylesheet" type="text/css" href="css/style.css">
<!--Favicon Image-->
<link rel="shortcut icon" type="image/png" href="images/icon.png">
<title>InstaMovies</title>
<style>
.movies .banner img {
width:100%
}
.movie {
margin-bottom: 25px;
}
.movie_image {
width:100%;
}
@media (max-width: 480px){
.movie_image {
width: 100%;
}
}
@media (max-width: 767px) and (min-width: 481px){
.movie_image {
width: 100%;
}
}
.movie_image:hover {
opacity: 0.9;
}
.movie_bottom_wrap {
background: #f5f5f5;
padding: 20px;
text-align: center;
}
.movie_name {
text-decoration:none;
}
.movie_name:hover {
text-decoration:none;
}
.movie_name h6 {
font-size: 18px;
color: #000;
margin-bottom: 10px;
text-align: center;
line-height: 22px;
}
.movie_name h6:hover {
color:#bf0000;
}
.upcoming_movies {
margin-top:20px;
}
.btn-danger {
background-color:#c60506;
}
.btn-danger:hover {
background-color:#ec0405;
border:1px solid transparent;
}
.btn-danger:active {
box-shadow:none !important;
background-color:#c60506 !important;
}
.btn-danger:focus {
box-shadow:none !important;
}
p.jRatingInfos {
background: transparent url('images/rating_icons/bg_jRatingInfos.png') no-repeat;
}
.ratings_wrap{
margin-bottom:12px;
padding:5px 0;
background:white;
border-radius:5px;
}
.rating {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<!--Navbar Code - Start-->
<?php include('header.php'); ?>
<!--Navbar Code - End-->
<!--Movies Body - Start-->
<div class="movies">
<!--Banner Code - Start-->
<div class="banner">
<img src="images/banner.jpg?v=<?php echo time(); ?>">
</div>
<!--Banner Code - End-->
<div class="container mt-4" style="line-height:22px; font-size: 14px; color: #606978; font-family:sans-serif">
<?php
$sql_nowshowing = "SELECT * FROM tbl_movies WHERE starting_date<=CURDATE() AND ending_date>=CURDATE()";
$result_nowshowing = mysqli_query($db,$sql_nowshowing);
if(mysqli_num_rows($result_nowshowing) > 0){
?>
<div class="nowshowing_movies">
<h2 style="font-weight:normal; color:#23241d; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-size:45px; margin-bottom:30px; padding-top:15px">Now Showing</h2>
<div class="row">
<?php while($row_nowshowing = mysqli_fetch_array($result_nowshowing)){
$allIpAddress = explode(',',$row_nowshowing['user_ip_addresses']);
$current_ipAddress = GetUserIP();
if(in_array($current_ipAddress,$allIpAddress))
{
$class = 'jDisabled';
}
else
{
$class = '';
}
?>
<div class="col-md-3 col-sm-4">
<div class="movie">
<a href="movie.php?movie_id=<?php echo $row_nowshowing['movie_id'];?>"><img src="data:image/jpeg;base64,<?php echo base64_encode($row_nowshowing['poster'])?>" class="movie_image"></a>
<div class="movie_bottom_wrap">
<a href="movie.php?movie_id=<?php echo $row_nowshowing['movie_id'];?>" class="movie_name"><h6><?php echo $row_nowshowing['movie_name']?></h6></a>
<div class="ratings_wrap">
<div class="rating <?php echo $class; ?>" id="<?php echo $row_nowshowing['avg_ratings']; ?>_<?php echo $row_nowshowing['movie_id']; ?>"></div>
</div>
<a href="buy_tickets.php?movieID=<?php echo $row_nowshowing['movie_id'];?>" class="btn btn-danger" style="width:100%; font-size: 18px;">Buy Tickets</a>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php
$sql_upcoming = "SELECT * FROM tbl_movies WHERE starting_date>CURDATE()";
$result_upcoming = mysqli_query($db,$sql_upcoming);
if(mysqli_num_rows($result_upcoming) > 0){
?>
<div class="upcoming_movies">
<h2 style="font-weight:normal; color:#23241d; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-size:45px; margin-bottom:30px; padding-top:15px">Upcoming Movies</h2>
<div class="row">
<?php while($row_upcoming = mysqli_fetch_array($result_upcoming)){ ?>
<div class="col-md-3 col-sm-4">
<div class="movie">
<a href="movie.php?movie_id=<?php echo $row_upcoming['movie_id']; ?>"><img src="data:image/jpeg;base64,<?php echo base64_encode($row_upcoming['poster'])?>" class="movie_image"></a>
<div class="movie_bottom_wrap">
<a href="movie.php?movie_id=<?php echo $row_upcoming['movie_id'];?>" class="movie_name"><h6><?php echo $row_upcoming['movie_name']?></h6></a>
<?php
if($row_upcoming['status']=='1'){
?>
<a href="buy_tickets.php?movieID=<?php echo $row_upcoming['movie_id'];?>" class="btn btn-danger" style="width:100%; font-size: 18px;">Buy Tickets</a>
<?php
}else if($row_upcoming['status']=='0'){
?>
<button class="btn btn-danger" style="width:100%; font-size: 18px;" disabled>Tickets not available!</button>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
</div>
<!--Movies Body - End-->
<!--Footer Code - Start-->
<?php include('footer.php') ?>
<!--Footer Code - End-->
<!-- Optional JavaScript -->
<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jRating.jquery.js"></script>
<script type="text/javascript">
$(function(){
$(".rating").jRating({
bigStarsPath : 'images/rating_icons/stars.png',
smallStarsPath : 'images/rating_icons/small.png',
decimalLength : 1,
rateMax : 5, // maximal rate - integer from 0 to 9999 (or more)
phpPath: 'libs/Movierating.php',
onSuccess: function(){
alert('Your rating has been submitted');
},
onError: function(){
alert('There was a problem submitting your feedback');
}
});
});
</script>
<script>
$(".header_wrapper .main_menu_wrapper .item-2").addClass("active");
</script>
</body>
</html>