-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathget_date.php
executable file
·60 lines (45 loc) · 1.43 KB
/
get_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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include('db/db.php');
//Database connection selection
$db=new db();
$db->db_connect();
$db->db_select();
$loc_id = $_REQUEST['loc_id'];
$mov_id = $_REQUEST['mov_id'];
$sql = "SELECT m.release_date,a.todate FROM movies m LEFT JOIN assign_show a on a.fk_movie_id=m.id WHERE fk_location_id=$loc_id AND fk_movie_id=$mov_id AND a.todate >= curdate() ";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$date = $row['release_date'];
$todate=$row['todate'];
$release_date=strtotime($date)."<br>";
$today = date('D j M,Y');
$today = strtotime($today);
$todate = strtotime(date("D j M,Y", strtotime($todate)));
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);
if(strtotime($today)<=$todate)
{
echo "<option value='$today'>".$today."</option>";
}
if(strtotime($tomorrow)<=$todate)
{
echo "<option value='$tomorrow'>".$tomorrow."</option>";
}
if(strtotime($dayAftT)<=$todate)
{
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>";
}
?>