keith21
Member
Hi
I want to use the cal element to determine the condition if it is red, amber or green. If greater than 2 months show red, if less than 2 months show amber and if less than or equal to 1 month show green.
I have written the code below using an online tutorial and it does not work.
$cal = '{prbi___TCDate}';
if ($cal >strtotime('2 Months'))
{
return 'Red';
}
elseif ($cal <strtotime('2 Months'))
{
return 'Amber';
}
else ($cal <=strtotime('1 Months'))
{
return 'Green';
}
I want to use the cal element to determine the condition if it is red, amber or green. If greater than 2 months show red, if less than 2 months show amber and if less than or equal to 1 month show green.
I have written the code below using an online tutorial and it does not work.
$cal = '{prbi___TCDate}';
if ($cal >strtotime('2 Months'))
{
return 'Red';
}
elseif ($cal <strtotime('2 Months'))
{
return 'Amber';
}
else ($cal <=strtotime('1 Months'))
{
return 'Green';
}