I need help with conditionals using dates ..
I need when creating a record the cell of the table is colored verde
,
By passing 3
days after the record was created, the cell is automatically naranja
and when going from 6
days to roja
...
I did something in which I change the color manually, but I would like it to be automatic using dates ...
This is what I have ... Thank you:
<?php
foreach ($respuesta as $registro) {
$tr = '<tr>';
if ($registro['idEstado'] == '1') {
$tr = '<tr style="background-color:#F98888;color:#B72212;">';
}else if ($registro['idEstado'] == '2') {
$tr = '<tr style="background-color:#F9BD88;color:brown;">';
} else {
$tr = '<tr style="background-color:#B7D5B6;color:green;">';
}
$cadena .= $tr."
<td>".$registro['fecha']."</td>
<td>".$registro['nombre']."</td>
<td>".$registro['direccion']."</td>
<td>".$registro['telefono']."</td>
<td>".$registro['estados']."</td>
</tr>";
}
echo $cadena;
?>