This topic is locked
[SOLVED]

  Change Row Color based on Expiration Date

12/9/2011 3:32:18 PM
PHPRunner General questions
S
stec5345 author

I am using PHPrunner 6 and need to know how to change a row color based on a given date in a given field. If this date is 60 days from expiring, I need the row to turn RED. How can I accomplish this using the events area for the list page?
Steve Currier

C
cgphp 12/10/2011
$time_limit = 3600 * 24 * 60;

if ((strtotime($data["date_field_name"]) - time()) <= $time_limit)

$row["rowstyle"]='style="background:red"';
S
stec5345 author 12/10/2011

OK, so I tried a few places to insert this without success.
First, I inserted in the "Before Display" but returned an error when I tried to load the page saying there were undefined variables.
Second, I tried the "Javascript OnLoad event", that let me load my page but the "Loading" indicator would not go away so I could not access the paghe.
Any ideas? AmI missing something or placing this in the wrong area?
Steve


$time_limit = 3600 * 24 * 60;

if ((strtotime($data["date_field_name"]) - time()) <= $time_limit)

$row["rowstyle"]='style="background:red"';


C
cgphp 12/10/2011

In the "After record processed" event of the list page.

S
stec5345 author 12/10/2011

It worked beautifully. Thanks so much.



In the "After record processed" event of the list page.