示例#1
0
function makeWorkerListHTMLRows(Worker $w, $position, Worker $author, $checkBoxFlag, $isSelected)
{
    echo "<tr>\n";
    if ($checkBoxFlag) {
        $option = array($position, "");
        echo "  <td class='checkValue'>";
        swwat_createRadioOption(PARAM_LIST_MULTIPLE, $option, SWWAT_CHECKBOX, $isSelected, FALSE);
        echo "  </td>\n";
    }
    echo '  <td class="fieldValueFirst">';
    if (!$checkBoxFlag && $author->isOrganizer()) {
        echo '<a href="WorkerViewPage.php?', PARAM_LIST_INDEX, '=', $position, '">';
    }
    echo htmlspecialchars($w->nameString());
    if (!$checkBoxFlag && $author->isOrganizer()) {
        echo "</a>";
    }
    echo "</td>\n";
    if (!$author->isCrewMember()) {
        echo "<td class='fieldValue'>";
        echo htmlspecialchars($w->email);
        echo "</td>\n";
        echo "<td class='fieldValue'>";
        echo swwat_format_phone($w->phone);
        echo "</td>\n";
    }
    echo "</tr>\n";
}
示例#2
0
function makeShiftCheckInListHTMLRows(Worker $w, $statusType)
{
    echo "<tr>\n";
    echo "<td class=\"fieldValueFirst\">" . htmlspecialchars($w->nameString()) . "</td>\n";
    echo "<td class=\"fieldValue\"><input type=\"submit\" name=\"" . $w->workerid . "\" value=\"Check In\"";
    if (!strcmp($statusType, 'CHECK_IN')) {
        echo " disabled=\"disabled\"";
    }
    echo "></td>\n";
    echo "<td class=\"fieldValue\"><input type=\"submit\" name=\"" . $w->workerid . "\" value=\"Check Out\"";
    if ($statusType == NULL || !strcmp($statusType, 'CHECK_OUT')) {
        echo " disabled=\"disabled\"";
    }
    echo "></td>\n";
    echo "<td class=\"fieldValue\"><input type=\"button\" name=\"" . $w->workerid . "\" value=\"View\" onclick=\"viewShiftStatus('" . $w->workerid . "')\"></td>\n";
    echo "</tr>\n";
}
function makeCheckInWorkerDashboardListHTMLRows2(Worker $w, $expoid)
{
    echo "<tr>\n";
    echo "<td class=\"fieldValueFirst\">" . htmlspecialchars($w->nameString()) . "</td>\n";
    echo "<td class=\"fieldValue\">" . htmlspecialchars($w->email) . "</td>\n";
    echo "<td class=\"fieldValue\">" . swwat_format_phone($w->phone) . "</td>\n";
    $ss = ShiftStatus::mostRecentStatusWorker($w->workerid, $expoid);
    echo "<td class=\"fieldValue\">";
    if (!is_null($ss)) {
        $s = StationJob::selectID($ss->stationid);
        echo $s->location . " (" . $s->title . ")";
    } else {
        echo "-";
    }
    echo "</td>\n";
    echo "<td class=\"fieldValue\">";
    if (!is_null($ss)) {
        if ($ss->statusType == "CHECK_IN") {
            echo "<div style=\"color: red\">Checked In</div>";
        } else {
            if ($ss->statusType == "CHECK_OUT") {
                echo "<div style=\"color: green\">Checked Out</div>";
            }
        }
    } else {
        echo "Never checked in";
    }
    echo "</td>\n";
    echo "<td class=\"fieldValue\">";
    if (!is_null($ss)) {
        $hours = ShiftStatus::WorkerHours($w->workerid, $expoid);
        if (is_int($hours)) {
            echo $hours;
        } else {
            echo sprintf('%.2f', $hours);
        }
    } else {
        echo "-";
    }
    echo "</td>\n";
    echo "</tr>\n";
}
function makeCheckInStationDashboardWorkerListHTMLRows(Worker $w, $ss, $max_name_size, $max_email_size)
{
    echo "<tr>\n";
    echo "<td width=\"" . $max_name_size . "\" class=\"fieldValueFirst\">" . htmlspecialchars($w->nameString()) . "</td>\n";
    echo "<td width=\"" . $max_email_size . "\" class=\"fieldValue\">" . htmlspecialchars($w->email) . "</td>\n";
    echo "<td class=\"fieldValue\">" . htmlspecialchars(swwat_format_phone($w->phone)) . "</td>\n";
    $statusType = NULL;
    if ($ss != NULL) {
        if (!strcmp($ss->statusType, 'CHECK_IN')) {
            $statusType = "<div style=\"color: red\">Checked In</div>\n";
        }
        if (!strcmp($ss->statusType, 'CHECK_OUT')) {
            $statusType = "<div style=\"color: green\">Checked Out</div>\n";
        }
    } else {
        $statusType = '-';
    }
    echo "<td width=\"110\" class=\"fieldValue\">" . $statusType . "</td>\n";
    echo "</tr>\n";
}
function makeSchedulingReportWorkerListHTMLRows(Worker $w, $k, $max_name_size, $max_email_size)
{
    echo "<tr>\n";
    echo "<td width='" . $max_name_size . "' class='fieldValueFirst'>\n";
    echo "<a href='StationLockReportPage.php?" . PARAM_LIST_INDEX . "=" . $k . "'>" . htmlspecialchars($w->nameString()) . "</a>\n";
    echo "</td>\n";
    echo "<td width='" . $max_email_size . "' class='fieldValue'>" . htmlspecialchars($w->email) . "</td>\n";
    echo "<td class='fieldValue'>" . htmlspecialchars(swwat_format_phone($w->phone)) . "</td>\n";
    echo "</tr>\n";
}