I'm having a hard time making a table. Could someone make a table that shows the times an employee did during the month? the idea would be to show the beating of employees during the month.
In my bank would have the table that would keep these beats of the employees:
tag
batida_id (int) is the id of the hit contributor_id (int) (time) is the time of the strike eg: 07:30:00, 12:00:00.
date (date) is the date
type (char) is the type of hit entry or exit.
Example:
if an employee has 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
The table should look like this:
I was able to do only one part of the table, I can not logically show the beats in front of the dates.
<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>
Could anyone help me?