-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathget_movie.php
executable file
·47 lines (35 loc) · 995 Bytes
/
get_movie.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
<?php
include('db/db.php');
//Database connection selection
$db=new db();
$db->db_connect();
$db->db_select();
$loc_id = $_REQUEST['loc_id'];
$sql = "SELECT movies.name,movies.id,todate FROM assign_show join movies on assign_show.fk_movie_id = movies.id where assign_show.fk_location_id='$loc_id' order by movies.id desc";
$result = mysql_query($sql);
$date=date('Y-m-d');
$moviearray=array();
$a="<option value=''>Select Movie</option>";
$j=0;
$moviesarray=array();
$moviesid=array();
while($row = mysql_fetch_array($result))
{
$movie_name = $row['name'];
$mid = $row['id'];
$todate=$row['todate'];
array_push($moviesarray, $movie_name);
array_push($moviesid, $mid);
if(strtotime($todate)>strtotime($date))
{
$moviesarray=array_unique($moviesarray);
$moviesid=array_unique($moviesid);
if($moviesarray[$j]!='')
{
$a.="<option value='$moviesid[$j]'>".$moviesarray[$j]."</option>";
}
}
$j++;
}
echo $a;
?>