Example #1
0
function createStationDataHTMLRows(StationJob $station, Expo $expo, $formName, $isDisabledFlag = TRUE)
{
    if (is_null($station) || is_null($expo)) {
        return;
    }
    if (!is_null($station->startTime)) {
        $_POST[PARAM_DATE] = htmlspecialchars(swwat_format_isodate($station->startTime));
        $_POST[PARAM_STARTHOUR] = htmlspecialchars(swwat_format_isotime($station->startTime));
        $_POST[PARAM_STARTTIME] = htmlspecialchars(swwat_format_isodatetime($station->startTime));
    } else {
        $_POST[PARAM_DATE] = htmlspecialchars($station->startTime);
        $_POST[PARAM_STARTHOUR] = htmlspecialchars($station->startTime);
        $_POST[PARAM_STARTTIME] = htmlspecialchars($station->startTime);
    }
    if (!is_null($station->stopTime)) {
        $_POST[PARAM_STOPHOUR] = htmlspecialchars(swwat_format_isotime($station->stopTime));
        $_POST[PARAM_STOPTIME] = htmlspecialchars(swwat_format_isodatetime($station->stopTime));
    } else {
        $_POST[PARAM_STOPHOUR] = htmlspecialchars($station->stopTime);
        $_POST[PARAM_STOPTIME] = htmlspecialchars($station->stopTime);
    }
    $_POST[PARAM_LOCATION] = htmlspecialchars($station->location);
    $_POST[PARAM_INSTRUCTION] = htmlspecialchars($station->instruction);
    $_POST[PARAM_DESCRIPTION] = htmlspecialchars($station->description);
    $_POST[PARAM_TITLE] = htmlspecialchars($station->title);
    $_POST[PARAM_EXPOSTART] = htmlspecialchars(date_format($expo->startTime, 'l j, F Y'));
    $_POST[PARAM_EXPOSTOP] = htmlspecialchars(date_format($expo->stopTime, 'l j, F Y'));
    echo '<tr style="display:none"><td><input type="hidden" id="' . PARAM_EXPOSTART . '" name="' . PARAM_EXPOSTART . '" value="', $_POST[PARAM_EXPOSTART], '"/></td></tr>' . "\n";
    echo '<tr style="display:none"><td><input type="hidden" id="' . PARAM_EXPOSTOP . '" name="' . PARAM_EXPOSTOP . '" value="', $_POST[PARAM_EXPOSTOP], '"/></td></tr>' . "\n";
    echo "  <tr><td class='fieldTitle'>Title:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_TITLE, $formName, 'titleCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Description:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_DESCRIPTION, $formName, 'descriptionCheck', 2048, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Location:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_LOCATION, $formName, 'locationCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Instruction:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_INSTRUCTION, $formName, 'instructionCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Date:</td>\n<td>";
    echo '  <input type="text" id="', PARAM_DATE, '" name="', PARAM_DATE, '" value="', $_POST[PARAM_DATE], '" size="25" ';
    if ($isDisabledFlag) {
        echo ' disabled="disabled" ';
    }
    echo "/></td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Start Time:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_STARTHOUR, $formName, 'starthourCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Stop Time:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_STOPHOUR, $formName, 'stophourCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
}
Example #2
0
function makeShiftStatusDataHTMLRows($sm, $k, $l, $formName, $isDisabledFlag)
{
    if (!is_null($sm)) {
        $_POST[PARAM_STATUSID] = htmlspecialchars($sm->shiftstatusid);
        $_POST[PARAM_STATUSDATE] = htmlspecialchars(swwat_format_isodate($sm->statusTime));
        $_POST[PARAM_STATUSHOUR] = htmlspecialchars(swwat_format_isotime($sm->statusTime));
        $_POST[PARAM_STATUSTYPE] = htmlspecialchars($sm->statusType);
    } else {
        $_POST[PARAM_STATUSID] = NULL;
        $_POST[PARAM_STATUSDATE] = NULL;
        $_POST[PARAM_STATUSHOUR] = NULL;
        if ($l == 0) {
            $_POST[PARAM_STATUSTYPE] = "CHECK_IN";
        } else {
            if ($l == 1) {
                $_POST[PARAM_STATUSTYPE] = "CHECK_OUT";
            }
        }
    }
    if ($l == 0) {
        echo "<tr>\n";
    }
    echo "<td>\n";
    if ($isDisabledFlag) {
        $disabled = "disabled=\"disabled\" ";
    } else {
        $disabled = "";
    }
    echo "<input type=\"hidden\" name=\"" . PARAM_STATUSID . "[]\" value=\"" . $_POST[PARAM_STATUSID] . "\" " . $disabled . "/>\n";
    echo "<input type=\"hidden\" name=\"" . PARAM_STATUSDATE . "[]\" value=\"" . $_POST[PARAM_STATUSDATE] . "\" " . $disabled . "/>\n";
    echo "<input type=\"text\" name=\"" . PARAM_STATUSHOUR . "[]\" value=\"" . $_POST[PARAM_STATUSHOUR] . "\" " . $disabled . "/>\n";
    echo "<input type=\"hidden\" name=\"" . PARAM_STATUSTYPE . "[]\" value=\"" . $_POST[PARAM_STATUSTYPE] . "\" " . $disabled . "/>\n";
    echo "</td>\n";
    if ($l == 1) {
        echo "</tr>\n";
    }
}
Example #3
0
 public function insert($welcomeForm = NULL, $params = NULL)
 {
     $sqlParams = array();
     $sqlParams[] = $this->expoid;
     $sqlParams[] = swwat_format_isodate($this->expirationDate);
     $sqlParams[] = hashField($this->code);
     $sqlParams[] = $this->workerid;
     // null or not, is good
     if (is_null($this->workerid)) {
         $sqlParams[] = $this->email;
         $sqlParams[] = $this->phone;
         $sqlParams[] = $this->firstName;
         $sqlParams[] = $this->middleName;
         $sqlParams[] = $this->lastName;
     } else {
         $sqlParams[] = NULL;
         // email
         $sqlParams[] = NULL;
         // phone
         $sqlParams[] = NULL;
         // firstName
         $sqlParams[] = NULL;
         // middleName
         $sqlParams[] = NULL;
         // lastName
     }
     try {
         $dbh = getPDOConnection();
         $dbh->beginTransaction();
         $stmt = $dbh->prepare("INSERT INTO invitation (expoid, expirationDate, code, workerid, " . " email, phone, firstName, middleName, lastName) VALUES " . " (?, ?, ?, ?, lower(?), ?, ?, ?, ?)");
         $stmt->execute($sqlParams);
         $dbh->commit();
         if (!is_null($welcomeForm)) {
             $welcomeForm->sendForm($this->email, $params);
         }
         return $this;
     } catch (PDOException $pe) {
         logMessage('Invitation::insert()', $pe->getMessage());
     }
 }
Example #4
0
// loop over array of emails
foreach ($email_array as $email) {
    $messages = $messagedata[$email];
    $subject = $messages[0]->expo . " Reminder";
    $message = "Dear " . $messages[0]->workerName . ",\n\n";
    if (PARAM_ANTEREMINDER_TIME == 1) {
        $message .= "This message is to remind you that your upcoming shift assignment for " . PARAM_ANTEREMINDER_TIME . " day from now is:\n\n";
    } else {
        $message .= "This message is to remind you that your upcoming shift assignment for " . PARAM_ANTEREMINDER_TIME . " days from now is:\n\n";
    }
    $message .= "Expo: " . $messages[0]->expo . "\n\n";
    $body = $message;
    foreach ($messages as $message) {
        $body .= "Station: " . $message->station . "\n";
        $shift = explode(';', swwat_format_shift($message->startTime, $message->stopTime));
        $body .= "Time: " . $shift[0] . " (" . $shift[1] . ")\n";
    }
    // $message
    //START SIGNATURE BLOCK
    $message .= "\n\n Your participation in the conference is appreciated.";
    //    $message .= "\n\n Please notify us at zzz-xxx-yyyy if unable to make your shift.";
    $message .= "\n\n Thank you,";
    $message .= "\n\n Your " . SITE_NAME . " Team";
    // ENDIT SIGNATURE BLOCK
    FormMail::send($email, $subject, $body);
    logMessage("SendMessagesCron", "email sent to " . $email);
}
// $email
ReminderSent::insert(swwat_format_isodate($targtag));
logMessage("SendMessagesCron", "Date: " . swwat_format_isodate($targtag) . " written to database.");
 public static function selectDate($expoId, $date)
 {
     return self::select(SHIFTASSIGNMENTVIEW_SELECT_DATE, array($expoId, swwat_format_isodate($date)));
 }
Example #6
0
function stationStopHourMax($stations, $day)
{
    $daystring = swwat_format_isodate($day);
    $stopHourMax = 0;
    foreach ($stations as $station) {
        $stopTime = swwat_format_isodate($station->stopTime);
        if ($stopTime == $daystring) {
            $stopHour = date_format($station->stopTime, 'H');
            if ($stopHour > $stopHourMax) {
                $stopHourMax = $stopHour;
            }
        }
    }
    return (int) $stopHourMax;
}
<div id="main">
    <?php 
if (!is_null($expo->expoid)) {
    include 'section/LinkExpo.php';
}
?>

	<div id="invitation_fileupload">
		<!-- form method="POST" id="invitationpage_invite" -->
		<table>
            <tr><td class="fieldTitle">Date Invitation Expires:</td>
                <td><input readonly="readonly" type="text" name="<?php 
echo PARAM_STOPTIME;
?>
" value="<?php 
echo swwat_format_isodate($expDate);
?>
" size="25"/></td>
            </tr>
            <tr><td class="fieldTitle">Require generic code:</td>
                <td><?php 
swwat_createRadioOption(PARAM_WITHCODE, array(PARAM_WITHCODE, ""), SWWAT_CHECKBOX, $withCode, TRUE);
?>
</td>
            </tr>
            <tr><td class="fieldTitle">Make code unique:</td>
                <td><?php 
swwat_createRadioOption(PARAM_UNIQUE, array(PARAM_UNIQUE, ""), SWWAT_CHECKBOX, $uniqueCode, TRUE);
?>
</td>
            </tr>
Example #8
0
 /**
  * This method updates a calculated desire;
  * use updateRaw for raw desires.
  *
  * @param $dbh is the PDOConnection this transaction is a part of
  * @throws PDOException
  */
 public static function updateCalculated(PDO $dbh, $desirePercent, $expoId, $workerId, $location, DateTime $stationDate, DateTime $startTime, DateTime $stopTime)
 {
     // validation check
     if (!is_null($desirePercent)) {
         if ($desirePercent > 100.0) {
             $desirePercent = 100.0;
         }
         if ($desirePercent < 0.0) {
             $desirePercent = 0.0;
         }
         $desirePercent = round($desirePercent);
     }
     $sql = GROSSPREF_UPDATE_STATION;
     $params = array($desirePercent, $expoId, $workerId, $location, swwat_format_isodate($stationDate), swwat_format_isotime($startTime), swwat_format_isotime($stopTime));
     // now onto the update
     $stmt = $dbh->prepare($sql);
     return $stmt->execute($params);
 }
Example #9
0
function createExpoDataHTMLRows(Expo $expo, $formName, $isDisabledFlag = TRUE)
{
    if (!is_null($expo)) {
        if (!is_null($expo->startTime)) {
            $_POST[PARAM_STARTTIME] = htmlspecialchars(swwat_format_isodate($expo->startTime));
        } else {
            $_POST[PARAM_STARTTIME] = htmlspecialchars($expo->startTime);
        }
        if (!is_null($expo->stopTime)) {
            $_POST[PARAM_STOPTIME] = htmlspecialchars(swwat_format_isodate($expo->stopTime));
        } else {
            $_POST[PARAM_STOPTIME] = htmlspecialchars($expo->stopTime);
        }
        $_POST[PARAM_MAXHOURS] = htmlspecialchars($expo->expoHourCeiling);
        $_POST[PARAM_TITLE] = htmlspecialchars($expo->title);
        $_POST[PARAM_DESCRIPTION] = htmlspecialchars($expo->description);
        $_POST[PARAM_SCHEDULE_ALGO] = $expo->scheduleAssignAsYouGo;
        $_POST[PARAM_SCHEDULE_PUBLISH] = $expo->scheduleVisible;
        $_POST[PARAM_SCHEDULE_TIME_CONFLICT] = $expo->allowScheduleTimeConflict;
        $_POST[PARAM_NEWUSER_ADDED_ON_REGISTRATION] = $expo->newUserAddedOnRegistration;
    }
    echo "<table>\n";
    echo "  <tr>\n";
    echo "    <td>\n";
    echo "      <table>\n";
    echo "         <tr><td class='fieldTitle'>Title:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_TITLE, $formName, 'titleCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Description:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_DESCRIPTION, $formName, 'descriptionCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Max Hours:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MAXHOURS, $formName, 'maxhoursCheck', 255, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Start:</td>\n<td>";
    echo '<input type="text" id="', PARAM_STARTTIME, '" name="', PARAM_STARTTIME, '" value="', $_POST[PARAM_STARTTIME], '" readonly="readonly" size="25" ';
    if ($isDisabledFlag) {
        echo ' disabled="disabled" ';
    }
    echo "/></td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Stop:</td>\n<td>";
    echo '<input type="text" id="', PARAM_STOPTIME, '" name="', PARAM_STOPTIME, '" value="', $_POST[PARAM_STOPTIME], '" readonly="readonly" size="25" ';
    if ($isDisabledFlag) {
        echo ' disabled="disabled" ';
    }
    echo "/></td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Assign As You Go:</td>\n<td>\n";
    swwat_createRadioOption(PARAM_SCHEDULE_ALGO, array(PARAM_SCHEDULE_ALGO, ""), SWWAT_CHECKBOX, $_POST[PARAM_SCHEDULE_ALGO], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Publish Schedule:</td>\n<td>";
    swwat_createRadioOption(PARAM_SCHEDULE_PUBLISH, array(PARAM_SCHEDULE_PUBLISH, ""), SWWAT_CHECKBOX, $_POST[PARAM_SCHEDULE_PUBLISH], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>Allow Time Conflicts:</td>\n<td>\n";
    swwat_createRadioOption(PARAM_SCHEDULE_TIME_CONFLICT, array(PARAM_SCHEDULE_TIME_CONFLICT, ""), SWWAT_CHECKBOX, $_POST[PARAM_SCHEDULE_TIME_CONFLICT], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "         <tr><td class='fieldTitle'>New User Added on Registration:</td>\n<td>\n";
    swwat_createRadioOption(PARAM_NEWUSER_ADDED_ON_REGISTRATION, array(PARAM_NEWUSER_ADDED_ON_REGISTRATION, ""), SWWAT_CHECKBOX, $_POST[PARAM_NEWUSER_ADDED_ON_REGISTRATION], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "      </table>\n";
    echo "    </td>\n";
    echo "    <td valign=\"top\" style=\"padding-left: 150px;\">\n";
    echo "      <table>\n";
    $jobTitle = JobTitle::selectExpo($expo->expoid);
    for ($j = 0; $j < count($jobTitle); $j++) {
        if ($j == 0) {
            echo "        <tr><td class='fieldTitle'>Job Titles:</td><td style=\"font-size: 10pt;\">" . $jobTitle[$j]->jobTitle . "</td></tr>\n";
        } else {
            echo "        <tr><td></td><td style=\"font-size: 10pt;\">" . $jobTitle[$j]->jobTitle . "</td></tr>\n";
        }
    }
    echo "      </table>\n";
    echo "    </td>\n";
    echo "  </tr>\n";
    echo "</table>\n";
}