I am in doubt as to how I could perform the sum (time format) of the records that were returned in the query.
I'm picking up the office start time considering that above 08:01 it is delayed through there calculating how many minutes in arrears the employee is ...
if ($GetEntrada >= '08:01:00') {
$horaEntrada = '08:01:30';
$entrada = $tMC['Hora_Entrada'];
$total = (strtotime($entrada) - strtotime($horaEntrada));
$hora = floor($total / 60 / 60);
$minutos = round(($total - ($hora * 60 * 60)) / 60);
$hora = str_pad($hora, 2, "0", STR_PAD_LEFT);
$minutos = str_pad($minutos, 2, "0", STR_PAD_LEFT);
$atraso = $hora.':'.$minutos;
} else {
$atraso = "00:00";
}
echo "
<tr>
<td>$DataN[2]/$DataN[1]/$DataN[0]</td>
<td>$atraso</td>
<td>{$tMC['Hora_Entrada']}</td>
<td>{$tMC['Hora_InicioIntervalo']}</td>
<td>{$tMC['Hora_FimIntervalo']}</td>
<td>{$tMC['Hora_Saida']}</td>
</tr>
";
I would like to compute all values of "<td>$atraso</td>"
as shown in the attachment below and display in time format.