echo "<td class='schedule'>"; $shifts = getShifts(hourToMilitary($hour), hourToMilitary($hour + $hourSize), $curType, $date); foreach ($shifts as $curShift) { $netId = $curShift['employee']; if (!in_array($netId, $employees)) { continue; } if (checkStartShift($curShift, $hour) && $printMode == false) { echo "<span style='color:green'>" . nameByNetId($netId) . "</span>"; if (can("access", "033e3c00-4989-4895-a4d5-a059984f7997")) { echo " <a href='https://" . $_SERVER['SERVER_NAME'] . "/performance/tardy.php?employee=" . $netId . "&startTime=" . $hour . "' >(T)</a>"; echo " <a href='https://" . $_SERVER['SERVER_NAME'] . "/performance/absence.php?employee=" . $netId . "&startTime=" . $hour . "'>(A)</a>"; } echo " (" . date("g:ia", strtotime($curShift['startTime'])) . " - " . date("g:ia", strtotime($curShift['endTime'])) . ")"; } else { if (checkEndShift($curShift, $hour + $hourSize) && $printMode == false) { echo "<span style='color:red'>" . nameByNetId($netId) . "</span>"; } else { echo nameByNetId($netId); } } echo "<br />"; } echo "</td>"; } echo "</tr>"; } echo "</tbody></table>"; function getShifts($start, $end, $type, $date) { global $area, $db, $showUnposted;
echo "<td class='schedule'>"; } if ($displayHours[$hour + 1] == "00:00" && $hour == 0) { $curShifts = getShifts($displayHours[$hour], $displayHours[$hour + 1], $row['ID'], date("Y-m-d", strtotime($date . "-1 day"))); } else { if ($displayHours[$hour] == "00:00" && $hour == 2) { $curShifts = getShifts($displayHours[$hour], $displayHours[$hour + 1], $row['ID'], date("Y-m-d", strtotime($date . "+1 day"))); } else { $curShifts = getShifts($displayHours[$hour], $displayHours[$hour + 1], $row['ID'], $date); } } foreach ($curShifts as $cur) { if (in_array($cur['employee'], $employees_post)) { $name = nameByNetId($cur['employee']); $start = checkStartShift($cur, $displayHours[$hour]); $end = checkEndShift($cur, $displayHours[$hour + 1]); // Starting and ending shift if ($start && $end) { echo "<span style='color:green'>" . $name . "</span>"; } else { if ($start) { echo "<span style='color:green'>" . $name . "</span>"; } else { if ($end) { echo "<span style='color:red'>" . $name . "</span>"; } else { echo $name; } } } if ($start) {