I have a table in html, which generates the days of the week of a month. I wanted to help you in a piece of code.
I want to show in front of each date of a particular employee point markings.
Example:
Monday - 07:30 12:00 13:30 17:00
It is very complicated to do this? I need help.
Remember that the point markings of the staff comes from my database table.
I show here how my bank:
table: markings
marking_id(int)
employee_id(int)
record(date)
date(date)
Example:
If an employee has worked only on “first day of June” and make the following markings: 07:30 12:00 13:30 17:00 show in the table, and the other days show the message: lack.
The end result of his point card would look something like this:
Code incomplete:
<table border="3">
<tr>
<th>Date</th>
<th>Days of the week</th>
<th>Markings</th>
</tr><br />
<?php
$daysWeek[1] = 'Monday';
$daysWeek[2] = 'Tuesday';
$daysWeek[3] = 'Wednesday';
$daysWeek[4] = 'Thursday';
$daysWeek[5] = 'Friday';
$daysWeek[6] = 'Saturday';
$daysWeek[7] = 'Sunday';
for($days = 1; $days <= date('t',strtotime('2016-06')); $days++)
{
echo "<tr>";
echo "<th>".$days."</th>" . "<th>".$daysWeek[date('N', strtotime("2016-06-$days"))] ."</th>" . "<th>";
}
?>
</table>