i have a list with some days listed in a table, so , my database result come like this:
$day = $res->fields['DAY'];
$month = $res->fields['MONTH'];
$year = $res->fields['YEAR'];
and i put they all together to form a valid date
// put together the date
$date = $res->fields['DAY']."/".$res->fields['MONTH']."/".$res->fields['YEAR'];
// get the present day
$today = date('d/m/Y'); // 28/10/2011
and i check:
if($date == $today){
$backGroundTr = "red";
}
setting a <tr> background red.
the html is something like this:
<tr bgcolor="green">
<td>31/10/2011</td>
</tr>
<tr bgcolor="green">
<td>30/10/2011</td>
</tr>
<tr bgcolor="green">
<td>29/10/2011</td>
</tr>
<tr bgcolor="red"> // this reciave the red bgcolor because is today
<td>28/10/2011</td>
</tr>
now, what i’m trying to do is:
how can i set other color to the next 3 days ? as u can see in the example, i put the green color.
dont know if i was clear, any question, please, be my guest
This should do the trick
or you can do something like that: (i assume you loop through your days) (this solution will not work as days are printed in the opposite order)
or you can do something like that: