I have the following function
function status($open, $lunch, $close)
{
if(date('H') < $open || date('H') > $close)
{
$GLOBALS['status'] = "Closed";
$GLOBALS['color'] = "rgba(255,0,0,1)";
}
elseif(date('H') == ($close-1))
{
if(date('i') > 29)
{
$GLOBALS['status'] = "Closing";
$GLOBALS['color'] = "rgba(255,255,0,1)";
}
else
{
$GLOBALS['status'] = "Open";
$GLOBALS['color'] = "rgba(0,255,0,1)";
}
}
else
{
if(date('H') == $lunch)
{
$GLOBALS['status'] = "Lunch";
$GLOBALS['color'] = "rgba(0,0,255,1)";
}
else
{
$GLOBALS['status'] = "Open";
$GLOBALS['color'] = "green";
}
}
}
and after 10:00PM it is supposed to return the status of closed and right now its 10:13 and it's still returning open, I've gone through the code and cannot seem to find the problem.
Could someone take a look and see where my code is failing??
10:00PM, you inputted22on closing?