function makeWorkerScheduleListHTMLRows(ShiftAssignmentView $s, $position) { echo '<tr>' . "\n"; echo '<td class="fieldValueFirst"><a href="StationViewPage.php?'; echo PARAM_LIST2_INDEX, '=', $position, '">'; echo htmlspecialchars($s->stationTitle), "</a></td>\n"; echo '<td class="fieldValue">' . htmlspecialchars($s->location) . '</td>' . "\n"; $stationDateTime = swwat_format_shift($s->startTime, $s->stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); echo '<td class="fieldValue">' . htmlspecialchars($stationDate) . '</td>' . "\n"; echo '<td class="fieldValue">' . htmlspecialchars($stationTime) . '</td>' . "\n"; echo '<td class="fieldValue">' . htmlspecialchars($s->instruction) . '</td>' . "\n"; $expo = Expo::selectID($s->expoid); if ($expo->isPast() || $expo->isRunning()) { $hours = ShiftStatus::WorkerStationHours($s->workerid, $s->stationid, $s->expoid); } else { $hours = "-"; } echo "<td class=\"fieldValue\"><a href=\"ShiftStatusViewPage.php?"; echo PARAM_LIST_INDEX, '=S:', $s->stationid, '">'; echo htmlspecialchars($hours); echo "</a></td>\n"; if ($s->URL != NULL) { echo '<td><iframe src="https://www.facebook.com/plugins/like.php?href=' . $s->URL . '&send=false&layout=button_count&width=80&show_faces=true&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px;" allowTransparency="true"></iframe></td>' . "\n"; } echo '</tr>' . "\n"; }
public function addJob(JobSchedule $job, $expoId, $override = FALSE) { if (array_key_exists($job->jobid, $this->jobList)) { return; } // already added if (!$override) { $expo = Expo::selectID($expoId); $preference = $this->jobPreferences[$job->jobid]; if (is_null($preference->desirePercent)) { $job->subWorker($this, $expoId, TRUE); // we may have added it throw new ScheduleImpossibleException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid); } $newJobMinutes = $this->jobMinutes + $job->jobMinutes(); if ($newJobMinutes > $this->maxMinutes) { $job->subWorker($this, $expoId, TRUE); // we may have added it throw new ScheduleOverMaxHoursException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " as will have total minutes above max:" . ($newJobMinutes - $this->maxMinutes)); } if ($newJobMinutes > 60 * $expo->expoHourCeiling) { $job->subWorker($this, $expoId, TRUE); // we may have added it throw new ScheduleOverMaxHoursException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " as will have total minutes above expo max:" . ($newJobMinutes - 60 * $expo->expoHourCeiling)); } foreach ($this->jobList as $existing) { if ($job->isTimeConflict($existing)) { if ($expo->allowScheduleTimeConflict) { logMessage("WorkerSchedule", "overlapping conflict allowed"); if ($job->isStartTimeConflict($existing)) { $job->subWorker($this, $expoId, TRUE); // we may have added it $sce = new ScheduleConflictException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " due to identical start time conflict with existing Job:" . $existing->jobid); $sce->conflict = $existing; logMessage("WorkerSchedule", $sce); throw $sce; } } else { $job->subWorker($this, $expoId, TRUE); // we may have added it $sce = new ScheduleConflictException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " due to conflict with existing Job:" . $existing->jobid); $sce->conflict = $existing; logMessage("WorkerSchedule", $sce); throw $sce; } // allowScheduleTimeConflict } } // $existing } // $override $this->jobList[$job->jobid] = $job; $this->jobMinutes += $job->jobMinutes(); $job->addWorker($this, $expoId, $override); // must be at very end return; }
echo SITE_NAME; ?> - Worker Registration Page</title> <link href="css/site.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php $author = getWorkerAuthenticated(); $invitationList = Invitation::selectWorker($author->workerid); $expoList = array(); foreach ($invitationList as $invitation) { if (!is_null($invitation->expoid)) { $expoList[] = Expo::selectID($invitation->expoid); } } $_SESSION[PARAM_LIST] = $expoList; //setExpoCurrent(NULL); $invitationList = NULL; // gc hint // ok, start the html include 'section/header.php'; ?> <div id="main"> <div id="workerregistrationpage_register"> <h5>Register for Expos</h5>
function getExpoOne() { $expo = Expo::selectID(1); return $expo; //return isset($_SESSION[EXPOCURRENT]) ? $_SESSION[EXPOCURRENT] : NULL; }