I'm having a little problem using If with a function to show a result.
function estaParaExpirar($data, $dias){
return(strtotime($data) < strtotime("+".$dias. "days") );
}
if (estaParaExpirar($row[11], "10") ||
estaParaExpirar($row[12], "10") || estaParaExpirar($row[13], "10") ||
estaParaExpirar($row[14], "10") ||
estaParaExpirar($row[15], "10") ||
estaParaExpirar($row[16], "10") ||
estaParaExpirar($row[17], "10")) {
$Nome1 = '<p>Nome: '.$row[10].'</p>' ;}
I did a little test with the code that @jader gave.
$row[11] = '0000-00-00';
$row[12] = '2014-08-15';
$row[13] = '2014-08-15';
$row[14] = '2014-08-15';
$row[15] = '2014-08-15';
$row[16] = '2014-08-15';
$row[17] = '2014-08-15';
if (($row[11] != '0000-00-00' and $row[12] != '0000-00-00' and $row[13]
!= '0000-00- 00' and $row[14] != '0000-00-00' and $row[15] != '0000-00-00'
and $row[16] != '0000-00-00' and $row[17] != '0000-00-00')
and ((estaParaExpirar($row[11], "10")) and (estaParaExpirar($row[12], "10")) and
(estaParaExpirar($row[13], "10")) and
(estaParaExpirar($row[14], "10")) and
(estaParaExpirar($row[15], "10")) and
(estaParaExpirar($row[16], "10")) and
(estaParaExpirar($row[17], "10")))) {
Result;
echo 'missing more than 10 days'; You're wrong
PS: I changed the code to but I'm having trouble displaying the result. If the result is 10 above the current date it shows no result
if (($row[11] != '0000-00-00' && estaParaExpirar($row[11], "10"))
|| ($row[12] != '0000-00-00' && estaParaExpirar($row[12], "10"))
|| ($row[13] != '0000-00-00' && estaParaExpirar($row[13], "10"))
|| ($row[14] != '0000-00-00' && estaParaExpirar($row[14], "10"))
|| ($row[15] != '0000-00-00' && estaParaExpirar($row[15], "10"))
|| ($row[16] != '0000-00-00' && estaParaExpirar($row[16], "10"))
|| ($row[17] != '0000-00-00' && estaParaExpirar($row[17], "10"))) {
$Nome1 = '<p>Nome: '.$row[10].'</p>' ;}