-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathget_theatre_date.php
executable file
·43 lines (33 loc) · 1.14 KB
/
get_theatre_date.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
<?php
include('db/db.php');
//Database connection selection
$db=new db();
$db->db_connect();
$db->db_select();
$the_id = $_REQUEST['the_id'];
echo $sql = "SELECT m.release_date FROM assign_show a LEFT JOIN theatres t on t.id=a.fk_theater_id LEFT JOIN movies m on m.id=a.fk_movie_id WHERE t.id=$the_id";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$date = $row['release_date'];
$release_date=strtotime($date)."<br>";
$today = date('D j M Y');
$today = strtotime($today);
if($today>$release_date)
{
$today = date('D j M Y');
$tomorrow = date('D j M,Y', time()+86400);
$dayAftT = date('D j M,Y', time()+172800);
echo"<option value='$today'>".$today."</option>";
echo"<option value='$tomorrow'>".$tomorrow."</option>";
echo"<option value='$dayAftT'>".$dayAftT."</option>";
}
else
{
$today = $date;
$tomorrow = date('D j M Y', strtotime($today. ' + 1 day'));
$dayAftT = date('D j M Y', strtotime($today. ' + 2 day'));
echo"<option value='$today'>".$today."</option>";
echo"<option value='$tomorrow'>".$tomorrow."</option>";
echo"<option value='$dayAftT'>".$dayAftT."</option>";
}
?>