I need to make a table that shows whether the employee is missing or not. if there is no need to show your point beats in front of the respective date.
Can anyone help me?
Example: In my bank I have several employees registered, assuming I have an employee with the following hits:
hit_id => 1 contributor_id = > 1 data = > 06/01/2016 hit = > 07:30 type = > entrance
hit_id => 2 collaborator_id = > 1 data = > 06/01/2016 hit = > 12:00 Type = > exit
hit_id => 3 collaborator_id = > 1 data = > 06/01/2016 hit = > 13:30 type = > entrance
hit_id => 4 collaborator_id = > 1 data = > 06/01/2016 hit = > 17:00 type = > exit
From these beats I need to organize them by placing in front of the respective date:
It would look something like this:
01 - Wednesday - 07:30 a.m. 1:30 p.m.
02 - Thursday - foul
03 - Friday - missing
04 - Saturday - missing
(...)
Note: as it only has day hits 06/01/2016 I need to fill in the remaining days as missing :
<table class="table table-striped">
<tr>
<th>Data</th>
<th>Dia Semana</th>
<th>Ocorrências</th>
</tr> <br />
<?php
$diasSemana[1] = 'Segunda-feira';
$diasSemana[2] = 'Terça-feira';
$diasSemana[3] = 'Quarta-feira';
$diasSemana[4] = 'Quinta-feira';
$diasSemana[5] = 'Sexta-feira';
$diasSemana[6] = 'Sábado';
$diasSemana[7] = 'Domingo';
for($dias = 1; $dias <= date('t',strtotime('2016-06')); $dias++)
{
echo "<tr>";
echo "<th>".$dias."</th>" . "<th>".$diasSemana[date('N', strtotime("2016-06-$dias"))] ."</th>" . "<th>";
}
echo "</tr>";
?>
</table>