コード例 #1
0
ファイル: WorkerList.php プロジェクト: ConSked/scheduler
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
ファイル: WorkerData.php プロジェクト: ConSked/scheduler
function createWorkerDataHTMLRows(Worker $worker, $formName, $isDisabledFlag = TRUE, $code = FALSE)
{
    if (is_null($worker)) {
        return;
    }
    $_POST[PARAM_FIRSTNAME] = htmlspecialchars($worker->firstName);
    $_POST[PARAM_MIDDLENAME] = htmlspecialchars($worker->middleName);
    $_POST[PARAM_LASTNAME] = htmlspecialchars($worker->lastName);
    $_POST[PARAM_EMAIL] = htmlspecialchars($worker->email);
    $_POST[PARAM_PHONE] = swwat_format_phone($worker->phone);
    if (is_null($worker)) {
        $service = NULL;
    } else {
        $service = strstr($worker->smsemail, "@");
        $service = substr($service, 1);
    }
    $_POST[PARAM_SMS_SERVICE] = $service;
    echo "<table>\n";
    echo '  <tr><td class="fieldTitle">First Name:</td><td>';
    swwat_createInputValidateLength(PARAM_FIRSTNAME, $formName, 'swwat_ValidateLength', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo '  <tr><td class="fieldTitle">Middle Name:</td><td>';
    swwat_createInputValidateLength(PARAM_MIDDLENAME, $formName, 'swwat_ValidateLength', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo '  <tr><td class="fieldTitle">Last Name:</td><td>';
    swwat_createInputValidateLength(PARAM_LASTNAME, $formName, 'swwat_ValidateLength', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo '  <tr><td class="fieldTitle">Email:</td><td>';
    swwat_createInputValidateLength(PARAM_EMAIL, $formName, 'swwat_ValidateLength', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo '  <tr><td class="fieldTitle">Phone:</td><td>';
    swwat_createInputValidatePhone(PARAM_PHONE, $formName, 12, $isDisabledFlag);
    echo "</td></tr>\n";
    //    echo '  <tr><td class="fieldTitle">Texting Service:</td><td>';
    //    swwat_createSelect(0, PARAM_SMS_SERVICE, SMSEnum::$OPTION, "none", $isDisabledFlag);
    //    echo "</td></tr>\n";
    if (FALSE != $code) {
        $code = is_null($code) ? "" : $code;
        $_POST[PARAM_WITHCODE] = $code;
        echo '  <tr><td class="fieldTitle">Registration Code:</td><td>';
        swwat_createInputValidateLength(PARAM_WITHCODE, $formName, 'swwat_ValidateLength', 255, $isDisabledFlag);
        echo "</td></tr>\n";
    }
    echo "</table>\n";
}
コード例 #3
0
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";
}
コード例 #4
0
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";
}
コード例 #5
0
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";
}
コード例 #6
0
require_once 'db/Expo.php';
require_once 'db/Worker.php';
require_once 'util/log.php';
require_once 'util/mail.php';
require_once 'util/mailSchedule.php';
require_once 'util/session.php';
require_once 'swwat/gizmos/format.php';
require_once 'swwat/gizmos/parse.php';
$author = getWorkerAuthenticated();
$expo = Expo::selectActive($author->workerid);
$subject = swwat_parse_string(html_entity_decode($_POST[PARAM_SUBJECT_MESSAGE]));
$message = swwat_parse_string(html_entity_decode($_POST[PARAM_MESSAGE]));
$to = "*****@*****.**";
$message .= "\n\n\n...............................\nStandard Data Included\n...............................";
$message .= "\nfrom: {$author->lastName}, {$author->firstName}";
$message .= "\nrole: " . RoleEnum::getString($author->authrole);
$message .= "\nemail: {$author->email}";
$message .= "\nphone: " . swwat_format_phone($author->phone);
$message .= "\nstatus: " . ($author->isDisabled ? "disabled" : "enabled");
if (!is_null($expo)) {
    $message .= "\ncurrent expo: " . $expo->titleString();
    $message .= "\nschedule:\n";
    $savList = ShiftAssignmentView::selectWorker($expo->expoid, $author->workerid);
    $message .= sprintfSchedule($savList);
} else {
    $message .= "no current expo";
}
$message .= "\n\n";
FormMail::send($to, $subject, $message);
header('Location: WorkerViewPage.php');
include 'WorkerViewPage.php';