This topic is locked

list page -change colour

12/10/2013 4:30:36 PM
PHPRunner General questions
I
ianhols author

Hi there
I am hoping you can help
I am looking to have a routine setup embedded in the list view , in that row colour changes to to red (or flashes) if ...... the created date of the record is older that thirty days if the data record is not "started"
So for example on my IT helpdesk database..
An entry (IT Fault) is placed on the database ...with a created date of "now". The entry is then allocated to a member of staff and he or she would "start" the record entry (starting the job). However i would like to put a routine in place ..so that if the nothing has been "started" after a certain date (based on the created date) the record in the list view would change colour (or flash)
many thanks

C
copper21 12/10/2013

Not sure how you indicate whether something has started or not, but try something like this:
List Page: After record processed

//calculates 30 days

$time_limit = 3600 * 24 * 30;
if ((strtotime($data["YOURDATETIMEFIELD"]) - time()) <= $time_limit && $data["STARTEDFIELD"] != 'Started')
{
$row["rowstyle"]='style="background:orange"';

}


YOURDATETIMEFIELD is the field you have stored with now(), and STARTEDFIELD is where you might have indicated on that record if it was started.
Brian

I
ianhols author 12/19/2013



Not sure how you indicate whether something has started or not, but try something like this:
List Page: After record processed

//calculates 30 days

$time_limit = 3600 * 24 * 30;
if ((strtotime($data["YOURDATETIMEFIELD"]) - time()) <= $time_limit && $data["STARTEDFIELD"] != 'Started')
{
$row["rowstyle"]='style="background:orange"';

}


YOURDATETIMEFIELD is the field you have stored with now(), and STARTEDFIELD is where you might have indicated on that record if it was started.
Brian


Thank you Brian

I will have chance to try in the next few days , and update this post