HJB 3/12/2017 | |
Not tested, so, for inspiration purposes only ... if ($data["Order_date"] <= date("Y-m-d H:i:s",strtotime("-30 minutes"))) |
C
|
cardman3000 author 3/12/2017 |
Not tested, so, for inspiration purposes only ... if ($data["Order_date"] <= date("Y-m-d H:i:s",strtotime("-30 minutes"))) $record["Order_date_css"]='background:red;'; if ($data["Order_date"] >= date("Y-m-d H:i:s",strtotime("-15 minutes"))) $record["Order_date_css"]='background:yellow;'; if ($data["Order_date"] >= date("Y-m-d H:i:s",strtotime("-0 minutes"))) $record["Order_date_css"]='background:lightgreen;';
|
HJB 3/12/2017 | |
https://www.youtube.com/watch?v=Q3jx-x6zT14 |
lefty 3/12/2017 | |
****>
|
HJB 3/13/2017 | |
**** Won't work . We need help from admin here . I have tried all types of php date functions in after processed event and have not got this to work. ( tests using different fieldname on my audit log ). Tried this : would not work Red background date_default_timezone_set('EST'); $start = Now(); if ($data["datetime"] >= date('Y-m-d H:i:s',strtotime('+30 minutes',strtotime($start)))) $record["datetime_css"]='background:red;'; elseif ($data["datetime"] < date('Y-m-d H:i:s',strtotime('+30 minutes',strtotime($start)))) $record["datetime_css"]='background:lightgreen;'; Tried This : would not work Red Background $value = now(); if (($data["datetime"]) >= strtotime($value, '- 30 minutes' )) { $record["datetime_css"]='background:red;'; } elseif (($data["datetime"]) < strtotime($value , '-30 minutes')) { $record["datetime_css"]='background:lightgreen;'; } else { } Tried This : would not work RED Background $t = now(); if (strtotime($data['datetime']) >= (date("d/m/Y h:i:s", strtotime("+30 minutes", $t)))) { $record["datetime_css"]='background:red;'; } if (strtotime($data['datetime']) < (date("d/m/Y h:i:s", strtotime("+30 minutes", $t)))) { $record["datetimecss"]='background:lightgreen;'; } else { } This was my original from cardman3000 help message but kept - try but kept coming up green with my fields $data["datetime"] . Just won't work in after record processed event , which I have used many times to change font's , background etc.... Never DATES though._ Get Green background.with my test fields if ($data["Order_date"] <= date("Y-m-d H:i:s",strtotime("-30 minutes"))) $record["Order_date_css"]='background:red;'; if ($data["Order_date"] > date("Y-m-d H:i:s",strtotime("-30 minutes"))) $record["Order_date_css"]='background:lightgreen;'; MYSQL Database - with datetime structure / PHPrunner with edit as date / view as datetime. I know one of these are close.
|
H
|
Hertz2P 3/21/2017 |
I think you need to use 'else if' code here. Here's a working example from one of my applications for inspiration:
|
H
|
Hertz2P 3/21/2017 |
Actually, one of yours looked pretty close to me... try this (untested):
|
C
|
cardman3000 author 3/23/2017 |
Actually, one of yours looked pretty close to me... try this (untested):
|
H
|
Hertz2P 3/23/2017 |
Thank you Hertz2P, with the first option all rows become green background and with second option are all rows yellow. It seems that "elseif" and "else" apparently doesn't work in List page: After record processed.
|
L
|
laonian 3/23/2017 |
Also put my 2 cents here. I have not tested my code though.
|
C
|
cardman3000 author 3/23/2017 |
Thank you for assistance. |
lefty 3/23/2017 | |
Thank you for assistance. Here are the results @Hertz2P: 0 - 15 min green OK, 15 - 30 min yellow OK, over 30 min red NOK. It remains in yellow. @alshine: background only green at all time It's really tricky because all minutes >30 are in the same time also >15 <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81770&image=1&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />
|
C
|
cardman3000 author 3/23/2017 |
Thank you guys, but none of these approaches will change my background into 3 colors.
|
H
|
Hertz2P 3/23/2017 |
Thank you guys, but none of these approaches will change my background into 3 colors. This is my code, and it works:
|
C
|
cardman3000 author 3/24/2017 |
That's it! It works perfectly and the background changes the color every 15 minutes
|