This topic is locked

using function month()

2/27/2008 10:16:28 PM
PHPRunner General questions
V
vytb author

I would like to highlight the records entered during the last month (using the field value 'enter_date'), using the list event. For example,
if (month('enter_date')=month(now())

{

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

}
How should I change(formulate) the first line?

J
Jane 2/28/2008

Vitas,
try to use this code:

if (date("m",strtotime($data["enter_date"]))==date("m") && date("Y",strtotime($data["enter_date"]))==date("Y"))

{

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

}

S
swanside 3/1/2008

Where would you put this code??

J
Jane 3/3/2008

In the List page: After record processed event.

S
swanside 3/3/2008

In the List page: After record processed event.


Thanks Jane. This might be an alternative to one of my last ideas
Paul.