}
echo "</tr></thead><tbody>";
for ($hour = $startTime * 1; $hour <= $endTime; $hour += $hourSize) {
    echo "<tr class='schedule'><td class='schedule_time'>" . hourToTime($hour) . "</td>";
    foreach ($hourTypes as $curType) {
        if (!in_array($curType, $values)) {
            continue;
        }
        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 />";
        }
 } else {
     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;
                 }
             }
         }