Ejemplo n.º 1
0
function expoListWorkerRow(Expo $expo, $position, $isOrganizer, Worker $worker, array $docList)
{
    expoListStartRow($expo, $position, $isOrganizer);
    if ($expo->isPast() || $expo->isRunning()) {
        $hours = ShiftStatus::WorkerHours($worker->workerid, $expo->expoid);
    } else {
        $hours = "-";
    }
    echo "  <td class='fieldValue'>" . htmlspecialchars($hours) . "</td>\n";
    if ($isOrganizer || !$expo->isPast()) {
        echo "  <td class='fieldValue'><a href='WorkerDocumentUploadPage.php?" . PARAM_LIST_INDEX . "=" . $position . "'>Upload</a></td>\n";
    } else {
        echo "  <td class='fieldValue'>Upload</td>\n";
    }
    echo "</tr>\n";
    // insert a non-expo row in the expo table!
    if (($isOrganizer || !$expo->isPast()) && !is_null($docList)) {
        if (count($docList) > 0) {
            makeDocumentListHTMLHeader(FALSE);
            for ($d = 0; $d < count($docList); $d++) {
                $document = $docList[$d];
                if ($document->expoid == $expo->expoid) {
                    makeDocumentListHTMLRow($document, $d, !$expo->isPast(), $isOrganizer, NULL);
                }
            }
            // $d
        }
    }
}
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";
}