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 pathoffers.php
210 lines (176 loc) · 6.54 KB
/
offers.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
<?php
session_start();
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: 0px;
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;
}
</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">
<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:48px; margin-bottom:20px; padding-top:15px">Offers & Promotions</h2>
<p style="line-height:30px">
From time to time InstaMovies offers its patrons various offers with third party tie ups. These offers are sometimes linked to a particular movie and or a Theater.<br/>
Listed below are some of the current and upcoming promotions and offers that are being offered to InstaMovies patrons.
</p>
<?php
$sql_nowshowing = "SELECT * FROM tbl_offers WHERE start_date<=CURDATE() AND end_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:40px; margin-bottom:30px; padding-top:15px">Now Available</h2>
<div class="row">
<?php while($row_nowshowing = mysqli_fetch_array($result_nowshowing)){ ?>
<div class="col-md-3 col-sm-4">
<div class="movie">
<a href="offer.php?offer_id=<?php echo $row_nowshowing['offer_id'];?>"><img src="data:image/jpeg;base64,<?php echo base64_encode($row_nowshowing['image'])?>" class="movie_image"></a>
<div class="movie_bottom_wrap">
<a href="offer.php?offer_id=<?php echo $row_nowshowing['offer_id'];?>" class="movie_name"><h6><?php echo $row_nowshowing['name']?></h6></a>
<span>Valid till <?php echo $row_nowshowing['end_date']?></span>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php
$sql_upcoming = "SELECT * FROM tbl_offers WHERE start_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:40px; margin-bottom:30px; padding-top:15px">Upcoming Offers</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="offer.php?offer_id=<?php echo $row_upcoming['offer_id'];?>"><img src="data:image/jpeg;base64,<?php echo base64_encode($row_upcoming['image'])?>" class="movie_image"></a>
<div class="movie_bottom_wrap">
<a href="offer.php?offer_id=<?php echo $row_upcoming['offer_id'];?>" class="movie_name"><h6><?php echo $row_upcoming['name']?></h6></a>
<span>Valid from <?php echo $row_upcoming['start_date']?></span>
</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-6").addClass("active");
</script>
</body>
</html>