コード例 #1
0
                    }
                    if ($schedule[$k]['startDate'] . ' ' . $schedule[$k]['startTime'] <= $j . ' ' . $date->format('H:i:s') && $schedule[$k]['endDate'] . ' ' . $schedule[$k]['endTime'] > $j . ' ' . $date->format('H:i:s')) {
                        $count++;
                        echo nameByNetId($schedule[$k]['employee']) . ' - ' . $schedule[$k]['name'] . "\n";
                    }
                }
            }
        }
        if ($count == 0) {
            echo '">' . $count . '</span></td>';
        } else {
            echo '">' . $count . '</span></td>';
        }
        $date->modify('+1 day');
    }
    echo '<td id="hour' . $i . 'LabelRight">' . hourToTime($i) . '</td>';
    $date->modify('-' . DAYS . ' day');
    echo '</tr>';
    $date->add($areaTimeInterval);
}
echo '	</table>';
if ($mode == DEFAULT_MODE) {
    echo '<input id="period" type="hidden" value="' . $schedule[0]['period'] . '">';
}
echo '	<br />
	
	<h2>Total Hours</h2>';
for ($i = 0; $i < count($employees); $i++) {
    $totalHours = 0;
    for ($j = 0; $j < count($schedule); $j++) {
        if (isset($schedule[$j]['employee']) && $schedule[$j]['employee'] == $employees[$i]) {
コード例 #2
0
$startTime = getStartTime();
$endTime = getEndTime();
if (!isSchedulePosted($date)) {
    echo "<h3 align='center' style='color:red'>Schedule For Week Not Yet Posted</h3>";
}
echo "<table class='schedule' id='sched'><thead><tr><th class='schedule_time'><b>Hours</b></th>";
while ($row = $hourTypesQuery->fetch(PDO::FETCH_ASSOC)) {
    $hourTypes[] = $row['ID'];
    if (!in_array($row['ID'], $values)) {
        continue;
    }
    echo "<th class='schedule' style='background-color:" . $row['color'] . "'> <b> " . $row['name'] . "</b> </th>";
}
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>";
コード例 #3
0
$hourDays[] = $date;
if ($hourTimes[2] >= 24) {
    $hourTimes[2] -= 24;
    $hourDays[] = $nextDate;
} else {
    $hourDays[] = $date;
}
echo "<table class='schedule'><tbody>";
// header stuff
echo "<tr><th class='hourType'>Shift</th>";
for ($hour = 0; $hour < count($hourTimes); $hour++) {
    if ($hourTimes[$hour] == $currentTime && $hourDays[$hour] == $currentDate) {
        //echo "<th class='schedule'><span style='color:green'>".hourToTime($hourTimes[$hour])." - ".hourToTime($hourTimes[$hour]+$hourSize)."</span></th>";
        echo "<th class='schedule' style='background:#c0c0c0'>" . hourToTime($hourTimes[$hour]) . " - " . hourToTime($hourTimes[$hour] + $hourSize) . "</th>";
    } else {
        echo "<th class='schedule'>" . hourToTime($hourTimes[$hour]) . " - " . hourToTime($hourTimes[$hour] + $hourSize) . "</th>";
    }
}
echo "</tr>";
// hour types and names
try {
    $hourTypesQuery = $db->prepare("SELECT ID,value,name,color FROM scheduleHourTypes WHERE area=:area AND `deleted` = 0");
    $hourTypesQuery->execute(array(':area' => $area));
} catch (PDOException $e) {
    exit("error in query");
}
while ($row = $hourTypesQuery->fetch(PDO::FETCH_ASSOC)) {
    if (!in_array($row['ID'], $values)) {
        continue;
    }
    echo "<tr>";