-
Notifications
You must be signed in to change notification settings - Fork 32
/
movies-search.php
executable file
·251 lines (209 loc) · 6.94 KB
/
movies-search.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
<?php
include('db/db.php');
include('frontend.php');
//Database connection selection
$db=new db();
$db->db_connect();
$db->db_select();
$frontend=new frontend();
//loation
$array=$frontend->getlocation();
$size=sizeof($array);
$t_size=$size;
$i=0;
$t=0;
if($_POST)
{
$location_id=$_POST['location1'];
$theatre_id=$_POST['theatres'];
$query="SELECT t.*,m.name as moviename,m.rating,m.image,m.cast,l.location FROM theatres t
LEFT JOIN movies m on m.id=t.movies_id
LEFT JOIN location l on l.id=t.location_id WHERE t.id=$theatre_id AND t.location_id=$location_id";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
?>
<html>
<head>
<title>Searh Movie Theatres Online</title>
<link rel="shortcut icon" type="image/png" href="favicon.ico"/>
<link href="css/style.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="select2.css" rel="stylesheet"/>
<script src="jquery-1.8.0.min.js"></script>
<script src="select2.js"></script>
<script>
$(document).ready(function()
{
$("#location").select2();
$("#location1").select2();
$("#movies").select2();
$("#theatres").select2();
$('#movies').prop('disabled', 'disabled');
$('#theatres').prop('disabled', 'disabled');
var location=$("#location").val();
var location1=$("#location1").val();
$('#location').change(function()
{
var id=$(this).val();
var dataString = 'id='+ id;
$.ajax
({
type: "POST",
url: "ajax_city.php",
data: dataString,
cache: false,
success: function(html)
{
$("#movies").html(html);
if($("#movies").val())
{
$('#movies').removeAttr('disabled');
}
else
{
$('#movies').prop('disabled', 'disabled');
}
}
});
});
$('#location1').change(function()
{
var id=$(this).val();
var dataString = 'id='+ id;
$.ajax
({
type: "POST",
url: "ajax_theatre.php",
data: dataString,
cache: false,
success: function(html)
{
$("#theatres").html(html);
if($("#theatres").val())
{
$('#theatres').removeAttr('disabled');
}
else
{
$('#theatres').prop('disabled', 'disabled');
return false;
}
}
});
});
});
</script>
</head>
<body style="background:white">
<div class="bar">
</div>
<center>
<br/>
<ul id="ul">
<li><a href="index.php">Home</a></li>
<li><a href="movies.php">Movies</a></li>
<li><a href="theatres.php">Theatres</a></li>
<li><a href="trailers.php">Trailers</a></li>
<li><a href="moibile-app.php">Mobile App</a></li>
<li style="float:right;margin-right:10px;"><input type="text" style="padding:3px;width:250px;" placeholder="Movie/Location.." ><button style="padding:3px;background:#c00029;color:white;border:solid 2px #c00029;">Go</button></li>
</ul>
<br/>
<table width="950px" style="background:white">
<tr style="background:#3399ff;color:white">
<td colspan=2> Movie In <b><?php echo $row['location'];?></b></td>
</tr>
<tr>
<td width=10% style="padding:5px" valign="top">
<table>
<tr>
<td>
<img src="uploads/<?php echo $row['image'];?>" height="270px"/>
</td>
<td valign="top">
<br/>
</td>
</tr>
</table>
</td>
<td valign="top" width="60%">
<h2><?php echo $row['moviename']; ?></h2>
<b>Theatre:</b> <pstyle="color:f71d57"><?php echo $row['name']; ?></p>
<p><b>Addr:</b> <?php echo $row['address']; ?></p>
<span style="color:#444444"><b>Timings:</b> 11:00 am 2:30 pm 6:15pm 9:30pm</span><br/><br/>
<b>Rating:</b> <?php echo $row['rating'];?>/5<br/><br/>
<b>Cast:</b> <?php echo $row['cast'];?><br/>
</td>
<td valign="top">
<div style="margin-top:-25px;background:white;border:solid 1px pink;padding:15px;margin-left:5px;width:305px;box-shadow:0px 0px 7px 0px rgba(50, 50, 50, 1);">
<button id="movies_cinemachoodu">Movies</button> <button id="theatres_cinemachoodu">Theatres</button><br/><br/><br/>
<span style="color:red;font-size:20px">Search By</span> <span id="selection" style="font-size:20px"></span><br/><br/>
<form action="theatres-search.php" method="post" id="mm">
<select style="width:300px;" name="location" id="location" required>
<option value="">Select Location...</option>
<?php
while($size>0)
{
?>
<option value="<?php echo $array[$i]['id'];?>"><?php echo $array[$i]['name'];?></option>
<?php
$size--;
$i++;
}
?>
</select><br/><br/>
<select style="width:300px;" name="movies" id="movies" required>
<option value="">Select Movies...</option>
</select><br/><br/>
<button id="submit">Search Theatres</button><br/><br/>
</form>
<form action="theatres-search1.php" method="post" id="tt">
<select style="width:300px;" name="location1" id="location1" required>
<option value="">Select Location...</option>
<?php
while($t_size>0)
{
?>
<option value="<?php echo $array[$t]['id'];?>"><?php echo $array[$t]['name'];?></option>
<?php
$t_size--;
$t++;
}
?>
</select><br/><br/>
<select style="width:300px;" name="theatres" id="theatres" required>
<option value="">Select Theatres...</option>
</select><br/><br/>
<button id="submit">Search Movies</button><br/><br/>
</form>
</div>
</td>
</tr>
</table>
<br/>
</center>
<center><b style="color:red">Ticket Booking Coming soon !!!!</b></center><br/>
<center><img src="images/logo1.jpg" width=286px height=100px></center>
<script type="text/javascript">
$(function()
{
$('#movies_cinemachoodu').click(function()
{
$('#tt').hide();
$('#mm').show();
$('#selection').html('<b>Movies</b>');
});
$('#theatres_cinemachoodu').click(function()
{
$('#mm').hide();
$('#tt').show();
$('#selection').html('<b>Theatres</b>');
});
});
</script>
</body>
</html>
<?php
}
else
header('Location:index.php');
?>