Ejemplo n.º 1
0
 public function update()
 {
     try {
         $dbh = getPDOConnection();
         $dbh->beginTransaction();
         $stmt = $dbh->prepare("UPDATE expo SET startTime = ?, stopTime = ?, " . " expoHourCeiling = ?, title = ?, description = ?, " . " scheduleAssignAsYouGo = ?, scheduleVisible = ?, " . " allowScheduleTimeConflict = ?, newUserAddedOnRegistration = ? " . " WHERE expoid = ?");
         if (is_null($this->startTime)) {
             $this->startTime = new DateTime();
         }
         if (is_null($this->stopTime)) {
             $this->stopTime = new DateTime();
         }
         $stmt->execute(array(swwat_format_isodatetime($this->startTime), swwat_format_isodatetime($this->stopTime), $this->expoHourCeiling, $this->title, $this->description, $this->scheduleAssignAsYouGo, $this->scheduleVisible, $this->allowScheduleTimeConflict, $this->newUserAddedOnRegistration, $this->expoid));
         $dbh->commit();
         return $this;
     } catch (PDOException $pe) {
         logMessage('Expo::update()', $pe->getMessage());
     }
 }
Ejemplo n.º 2
0
 public function update()
 {
     try {
         $dbh = getPDOConnection();
         $dbh->beginTransaction();
         $stmt = $dbh->prepare("UPDATE station SET startTime = ?, stopTime = ?, " . " stationTitle = ?, description = ?, location = ?, instruction = ? " . " WHERE stationid = ?");
         if (is_null($this->startTime)) {
             $this->startTime = new DateTime();
         }
         if (is_null($this->stopTime)) {
             $this->stopTime = new DateTime();
         }
         $stmt->execute(array(swwat_format_isodatetime($this->startTime), swwat_format_isodatetime($this->stopTime), $this->stationTitle, $this->description, $this->location, $this->instruction, $this->stationid));
         $dbh->commit();
         return $this;
     } catch (PDOException $pe) {
         logMessage('Station::update()', $pe->getMessage());
     }
 }
Ejemplo n.º 3
0
                        $shiftstatus_new[$k]->statusTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STATUSDATE][$k - 1] . " " . $_POST[PARAM_STATUSHOUR][$k]), true);
                    }
                }
            } else {
                $shiftstatus_new[$k]->shiftstatusid = NULL;
                $shiftstatus_new[$k]->workerid = NULL;
                $shiftstatus_new[$k]->stationid = NULL;
                $shiftstatus_new[$k]->expoid = NULL;
                $shiftstatus_new[$k]->statusType = NULL;
                $shiftstatus_new[$k]->statusTime = NULL;
            }
        }
    }
    for ($k = 0; $k < $c; $k++) {
        if (!is_null($shiftstatus_new[$k]->shiftstatusid)) {
            $shiftstatus_old = ShiftStatus::selectID($shiftstatus_new[$k]->shiftstatusid);
            if ($shiftstatus_new[$k]->workerid != $shiftstatus_old->workerid || $shiftstatus_new[$k]->stationid != $shiftstatus_old->stationid || $shiftstatus_new[$k]->expoid != $shiftstatus_old->expoid || $shiftstatus_new[$k]->statusType != $shiftstatus_old->statusType || swwat_format_isodatetime($shiftstatus_new[$k]->statusTime) != swwat_format_isodatetime($shiftstatus_old->statusTime)) {
                $shiftstatus_new[$k]->update();
            }
        } else {
            if (!is_null($shiftstatus_new[$k]->statusType)) {
                $shiftstatus_new[$k]->insert();
            }
        }
    }
    header("Location: ShiftStatusViewPage.php?" . PARAM_LIST_INDEX . "=" . $type . ":" . $index);
    include "ShiftStatusViewPage.php";
    return;
}
header('Location: ShiftCheckInPage.php');
include 'ShiftCheckInPage.php';
Ejemplo n.º 4
0
 public static function selectWorker($workerId, $date = NULL, $expoId = NULL)
 {
     try {
         $sql = JOB_SELECT_WORKER;
         $params = array();
         $params[] = $workerId;
         if (!is_null($date)) {
             $sql .= " AND stopTime > ? ";
             $params[] = swwat_format_isodatetime($date);
         }
         if (!is_null($expoId)) {
             $sql .= " AND expoid = ? ";
             $params[] = $expoId;
         }
         $rows = simpleSelect("Job", $sql, $params);
         for ($k = 0; $k < count($rows); $k++) {
             $rows[$k]->fixDates();
         }
         // $k
         return $rows;
     } catch (PDOException $pe) {
         logMessage('Job::selectWorker(' . $workerId . ', ' . $date . ', ' . $expoId . ')', $pe->getMessage());
     }
 }
Ejemplo n.º 5
0
function createJobDataHTMLRows(StationJob $job, $formName, $showDates, $isDisabledFlag = TRUE)
{
    if (is_null($job)) {
        return;
    }
    $_POST[PARAM_MAXCREW] = htmlspecialchars($job->maxCrew);
    $_POST[PARAM_MINCREW] = htmlspecialchars($job->minCrew);
    $_POST[PARAM_ASSIGNEDCREW] = htmlspecialchars($job->assignedCrew);
    $_POST[PARAM_MAXSUPERVISOR] = htmlspecialchars($job->maxSupervisor);
    $_POST[PARAM_MINSUPERVISOR] = htmlspecialchars($job->minSupervisor);
    $_POST[PARAM_ASSIGNEDSUPERVISOR] = htmlspecialchars($job->assignedSupervisor);
    if ($showDates) {
        // remember these are READ-only
        echo "<tr><td class='fieldTitle'>Start Time:</td>\n<td>";
        echo "<input type='text' value='" . swwat_format_isodatetime($job->startTime) . "' disabled='disabled'/>";
        echo "</td></tr>\n";
        echo "<tr><td class='fieldTitle'>Start Time:</td>\n<td>";
        echo "<input type='text' value='" . swwat_format_isodatetime($job->stopTime) . "' disabled='disabled'/>";
        echo "</td></tr>\n";
    }
    // $optionArray = 2D array {{name, value}, {name, value}, ...}
    $jobOptionArray = JobTitle::titleOptions($job->expoid);
    if (is_null($job->jobTitle)) {
        $job->jobTitle = $jobOptionArray[0][0];
    }
    $_POST[PARAM_JOB] = $job->jobTitle;
    echo "  <tr><td class='fieldTitle'>Job:</td>\n<td>";
    swwat_createSelect(0, PARAM_JOB, $jobOptionArray, $_POST[PARAM_JOB], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Min Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MINCREW, $formName, 'mincrewCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Max Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MAXCREW, $formName, 'maxcrewCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Assigned Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_ASSIGNEDCREW, $formName, NULL, 11, TRUE);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Min Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MINSUPERVISOR, $formName, 'minsupervisorCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Max Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MAXSUPERVISOR, $formName, 'maxsupervisorCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Assigned Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_ASSIGNEDSUPERVISOR, $formName, NULL, 11, TRUE);
    echo "</td></tr>\n";
}
Ejemplo n.º 6
0
 public function update()
 {
     try {
         $dbh = getPDOConnection();
         $dbh->beginTransaction();
         $stmt = $dbh->prepare("UPDATE shiftstatus SET workerid = ?, stationid = ?, expoid = ?, statusType = ?, statusTIme = ? WHERE shiftstatusid = ?");
         if (is_null($this->statusTime)) {
             $this->statusTime = new DateTime();
         }
         $stmt->execute(array($this->workerid, $this->stationid, $this->expoid, $this->statusType, swwat_format_isodatetime($this->statusTime), $this->shiftstatusid));
         $dbh->commit();
         return $this;
     } catch (PDOException $pe) {
         logMessage('ShiftStatus::update()', $pe->getMessage());
     }
 }