I tried to accomplish the following task, i have to calculate the ammount of days that a truck has been parked on my parking lot, the tricky part is that it has to exclude weekends and american holidays.
For Example: FreeTime is the value that I need to calculate with the rules explained before.
DateIn = The date the truck gets to my parking lot;
Freetime = (FLOOR(abs (now() - abs(DateIn))/(606024)/10)- WEEKENDS - HOLIDAYS);
limit=5;
if ($data["FreeTime"] == limit)
echo ('Your time expires today');
$row["rowstyle"]='style="background:32D85F"';
elseif ($data["FreeTime"] < limit)
echo ('You have 1 day left');
$row["rowstyle"]='style="background:FFE13B"';
elseif ($data["FreeTime"] > limit)
echo ('Your time has expired, your truck will be charged an extra $85');
$row["rowstyle"]='style="background:FF4D3B"';
Any Ideas? Thanks!!!