
Comparar dos fechas de un array de la base ded
Publicado por alex (1 intervención) el 17/09/2022 20:51:25
Estoy intentando programar una tabla que muestre las llegadas tarde y las imprima junto al respectiva hora de entrada que el funcionario realizo solo que siempre imprime el mensaje de llegada tarde en todos los registros de entrada y no el los que deberia
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<div id="diventradasysalidas">
<?php
require_once "../../../conexion.php";
$conexion = conectar();
$ci=$_GET['ci'];
$sql = "SELECT * FROM horario_entrada_salida h LEFT JOIN horario_funcionarios hf ON h.id_horario_entrada_salida = hf.id_horario WHERE h.ci_fun='$ci' and h.entradasalida='entrada';";
$result = mysqli_query($conexion,$sql);
?>
<table id="tablaentradas">
<tr>
<td>Fecha</td>
<td>Horario Entrada</td>
</tr>
<?php
echo '<link href="../../../CSS/estilos.css" type="text/css" rel="stylesheet">';
while ($fila = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $fila['fecha'] . "</td>";
echo "<td>" . $fila['hora_entrada'] . "</td>";
$horarioentrada=$fila['horario_entrada'];
$horaentrada=$fila['hora_entrada'];
if ($horaentrada > $horarioentrada) {
echo "<td class='circulo'>Tarde</td>";
}
}
?>
</table>
Valora esta pregunta


0