What am I doing wrong with this code located in
The Cell bacground colour is always #FF0000 even though there are specific colours set for how close the due date is.
Events->Jobs->List Page: After Record Processed
$daysLeft = 0;
$fromDate = date($data["date_due"]);
$curDate = date('Y-m-d');
$daysLeft = strtotime($fromDate) - strtotime($curDate);
$days = $daysLeft/(60 60 24);
$days_left = $days;
IF($days_left <= "-4") // SEEMS THAT THE "-4" IS NOT BEING RECOGNISED BY THE SCRIPT
{
$record["Date_Due_css"]='background:#FF0000; color:#000000;';
}
ELSE {
IF($days_left == "-3") // SEEMS THAT THE "-3" IS NOT BEING RECOGNISED BY THE SCRIPT
{
$record["Date_Due_css"]='background:#CC0000; color:#ffffff;';
}
ELSE {
IF($days_left == "-2") // etc....
{
$record["Date_Due_css"]='background:#FFaa00; color:#000000;';
}
ELSE {
IF($days_left == "-1")
{
$record["Date_Due_css"]='background:#FFFF00; color:#ffffff;';
}
ELSE {
IF($days_left == "0")
{
$record["Date_Due_css"]='background:#CCCC00; color:#ffffff;';
}
ELSE
{
IF($days_left >= "1")
{
$record["Date_Due_css"]='background:#00FF00; color:#000000;';
}
}
}
}
}
}