Hi all I am trying to call images using time to define the image shown to the user. Im new to php and time is a thing I am learning very slowly. Can you help me or point me in the right direction here any help would be great.
In Short
what im tring to do is call and image based on one time i pull from the datbase $depart holds the time in the time format. Based on this time and the time that the server says it is now depends on how the script works.
CODE
<?php
//time now
$timezone = +1; //(GMT -5:00) EST (U.S. & Canada)
$timenow = gmdate("Y/m/j H:i:s", time() + 3600*($timezone+date("I")));
//time set for paramaters
$checkin=date("Y-m-d", strtotime("-2 hour ".$depart));
$departure=date("Y-m-d", strtotime("-1 hour ".$depart));
php?>
<?php
// Function to choose image to display in image box
function chooseImage($depart){
if ($depart = $) $img = lights_off; //would like to show this image at all other times
else if ($depart = $) $img = checkin; //would like show 2 hours before $depart a time stored in database
else if ($depart = $) $img = gotogate; //would like show 1 hours before the time shown in the database
else if ($depart = $) $img = boarding; //would like show an image that whould show fifteen minutes before the time from db
else if ($depart = $) $img = gateclosed; //would like show 5 minutes before the timne from database
else if ($depart = $) $img = departed; //would like to show from the time the time in the datbase stated
else if ($depart = $) $img = Landed; //would like to show this image based upon another time stored in the datbase arrival time
return '<img src="'.$img.'.gif" width="27" height="11">';
}
php?>
thanks in advance
Lee