5
Good afternoon everyone, as per the code below, I am not being able to check the remaining days between $data and $prazocontact.
$consulta = mysql_query("
SELECT s.id_cliente, p.nome_servicos, s.data, s.prazocontato, s.email, s.vaifazerservicos
FROM dadoscliente AS s
INNER JOIN servicos2 AS p
ON p.id_servicos = s.vaifazerservicos
ORDER BY s.id_cliente DESC
LIMIT $start, $limite");
while ($linha = mysql_fetch_array($consulta)) {
$id_cliente = $linha['id_cliente'];
$nome_servicos = $linha['nome_servicos'];
$data = date('d/m/Y', strtotime($linha['data']));
$prazocontato = date('d/m/Y', strtotime($linha['prazocontato']));
$ValorUm = $data;
$ValorDois = $prazocontato;
$prazo = $ValorUm + $ValorDois;
?>
<?php if($prazo == 0){
echo "
<tr>
<td>$id_cliente</td>
<td>$nome_servicos</td>
<td>$data</td>
<td>$prazocontato</td>
<td style='color:blue;'><b>ENCERRA HOJE!</b></td>
<td><a href='editar.php?id_cliente=$id_cliente'><img src='img/editar3.png' title='Editar'></a></td>
</tr>
";
}elseif($prazo < 0){
echo "
<tr>
<td>$id_cliente</td>
<td>$nome_servicos</td>
<td>$data</td>
<td>$prazocontato</td>
<td style='color:red;'><b>ENCERRADO!</b></td>
<td style='visibility: hidden;'><a href='editar.php?id_cliente=$id_cliente'><img src='img/editar3.png' title='Editar'></a></td>
</tr>
";
}else{
echo "
<tr>
<td>$id_cliente</td>
<td>$nome_servicos</td>
<td>$data</td>
<td>$prazocontato</td>
<td>$prazo Dia(s)</td>
<td><a href='editar.php?id_cliente=$id_cliente'><img src='img/editar3.png' title='Editar'></a></td>
</tr>
";
}
What’s the problem? There’s less lost sign on that line
$prazo = - $ValorUm + $ValorDois;
– rray
Describe your problem better... besides what colleague @rray described, I couldn’t identify anything else that might be a problem.
– Isa
$Value = $date; Where the variable $date comes from?
– MagicHat
It comes from the @Magichat database, I just edited it, actually ;and $data.
– Mauro Santos
Won’t the "Missing" column always show the same values? The way it is there makes it seem like a Countdown.
– lcssanches