unset($workerList[$k]); // remove } } $workerList = array_values($workerList); // reindex $originWorkerListFlag = TRUE; } else { $workerList = array(); $workerList[0] = $worker; // currentworker $originWorkerFlag = TRUE; } } else { // done this way as PARAM_LIST may be reused $workerList = Worker::selectExpo($expo->expoid); $originExpoFlag = TRUE; } } else { // done this way as PARAM_LIST may be reused $workerList = Worker::selectStation($station->stationid); $originStationFlag = TRUE; } // this is the organizer get; need to finish with super/crew get if ($author->isCrewMember()) { // remove all workers // remove Organizers if Station // remove Supervisors if Expo for ($k = 0; $k < count($workerList); $k--) { $w = $workerList[$k]; if ($originStationFlag && $w->isSupervisor() || $originExpoFlag && $w->isOrganizer()) {
/** * returns an array of Worker which is assigned to the expo, but not in the list */ public function oddWorkerList($workerList) { $oddWorkerList = Worker::selectExpo($this->expoid); for ($k = 0; $k < count($oddWorkerList); $k++) { $worker = $oddWorkerList[$k]; if (in_array($worker, $workerList)) { $oddWorkerList[$k] = NULL; } } return array_filter($oddWorkerList); // removes NULL but does not re-index }
function createCheckInWorkerDashboardHTMLList($expoid) { $numColumns = 6; $workerList = Worker::selectExpo($expoid); $c = count($workerList); echo "<div id=\"workerlist_table\"><table>\n"; echo "<tr>\n"; echo "<th class='rowTitle'>Name</th>\n"; echo " <th class='rowTitle'>Email</th>\n"; echo " <th class='rowTitle'>Phone</th>\n"; echo " <th class='rowTitle'>Most Recent Shift</th>\n"; echo " <th class='rowTitle'>Status</th>\n"; echo " <th class='rowTitle'>Hours</th>\n"; echo "</tr>\n"; echo "<tr class=\"rowTitle\"><td colspan=\"" . $numColumns . "\">Supervisors</td></tr>\n"; $supervisors = 0; for ($k = 0; $k < $c; $k++) { $w = $workerList[$k]; if ($w->isDisabled) { continue; } // skip to next if (FALSE == $w->isSupervisor()) { continue; } // skip to next // else makeCheckInWorkerDashboardListHTMLRows2($w, $expoid); $supervisors++; } if ($supervisors == 0) { echo "<tr><td class=\"fieldError\" colspan=\"" . $numColumns . "\">No Supervisors assigned to this expo.</td></tr>\n"; } echo "<tr class=\"rowTitle\"><td colspan=\"" . $numColumns . "\">Crew</td></tr>\n"; $crew = 0; for ($k = 0; $k < $c; $k++) { $w = $workerList[$k]; if ($w->isDisabled) { continue; } // skip to next if (FALSE == $w->isCrewMember()) { continue; } // skip to next // else makeCheckInWorkerDashboardListHTMLRows2($w, $expoid); $crew++; } if ($crew == 0) { echo "<tr><td class=\"fieldError\" colspan=\"" . $numColumns . "\">No Crew assigned to this expo.</td></tr>\n"; } echo "<tr class=\"rowTitle\"><td colspan=\"" . $numColumns . "\">Organizers</td></tr>\n"; $organizers = 0; for ($k = 0; $k < $c; $k++) { $w = $workerList[$k]; if ($w->isDisabled) { break; } // skip to next if (FALSE == $w->isOrganizer()) { continue; } // skip to next // else makeCheckInWorkerDashboardListHTMLRows2($w, $expoid); $organizers++; } if ($organizers == 0) { echo "<tr><td class=\"fieldError\" colspan=\"" . $numColumns . "\">No Organizers assinged to this expo.</td></tr>\n"; } echo "</table></div><!-- workerlist_table -->\n"; }
$uniqueCode = 0 == strcmp(PARAM_UNIQUE, swwat_parse_string(html_entity_decode($_POST[PARAM_UNIQUE]))); $errorMessage = ""; // invite or upload file button? $invite = isset($_POST[PARAM_SAVE]); $upload = isset($_POST[PARAM_UPLOAD]); // // todo should be _enum(, get if we ever have anything other than 5degrees // $uploadFileType = swwat_parse_string(html_entity_decode($_POST[PARAM_UPLOADFILETYPE])); if ($invite) { // get emails typed in $emails = swwat_parse_string(html_entity_decode($_POST[PARAM_EMAIL])); $emails = preg_replace('/\\s+/', ':', $emails); logMessage("message", $emails); // parse via whitespace $invitationArray = Invitation::loadEmails($emails); $existingWorkers = Worker::selectExpo($expo->expoid); $checkWorkers = array(); foreach ($existingWorkers as $worker) { $checkWorkers[] = $worker->workerid; } $existingWorkers = NULL; $workerArray = array(); $unknownArray = array(); $index = 0; foreach ($invitationArray as $invitation) { $index += 1; try { if (!empty($invitation->email)) { $worker = Worker::selectUsername($invitation->email); if (!is_null($worker)) { if (FALSE != array_search($worker->workerid, $checkWorkers)) {
function createSchedulingReportHTMLList($expoid) { $stationList = StationJob::selectExpo($expoid); $dates = array(); foreach ($stationList as $s) { $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime)); $dates[] = $stationDateTime[0]; } $dates = array_values(array_unique($dates)); echo "Select Date: <select id='" . PARAM_DATE . "' name='" . PARAM_DATE . "' onchange='hideRows()'>\n"; for ($k = 0; $k < count($dates); $k++) { echo "<option value='" . $dates[$k] . "'> " . $dates[$k] . " </option>\n"; } echo "<option value='All'> All Dates </option>\n"; echo "</select>\n"; echo "<p />\n"; echo "<input type='radio' name='role' value='Supervisors' onclick='hideRoles()' /> Supervisors"; echo " <input type='radio' name='role' value='Crew' onclick='hideRoles()' /> Crew"; echo " <input type='radio' name='role' value='Both' checked='checked' onclick='hideRoles()' /> Both\n"; echo "<p />\n"; $workerList = Worker::selectExpo($expoid); $_SESSION[PARAM_LIST] = $workerList; $max_name_size = 0; $max_email_size = 0; foreach ($workerList as $worker) { $name = $worker->nameString(); if (strlen($name) > $max_name_size) { $max_name_size = strlen($name); } $email = $worker->email; if (strlen($email) > $max_email_size) { $max_email_size = strlen($email); } } $max_name_size = 10 * $max_name_size; $max_email_size = 10 * $max_email_size; $table_size = "75%"; echo "<div id='stationlist_table'>\n"; echo "<table width='" . $table_size . "'>\n"; echo "<tr class='mainTitle'>\n"; echo "<td class='fieldValue' colspan='5' onclick='ExpandCollapseAll()'>\n"; echo "<div style='float:right'><div class='alldiv' style='display:inline'>Expand All</div> <img id='allicon' src='" . PARAM_EXPAND_ICON . "'/></div>\n"; echo "</td>\n</tr>\n"; $jobList = Job::selectExpo($expoid); usort($jobList, "JobCompare"); $_SESSION[PARAM_LIST2] = $jobList; $c = count($jobList); if ($c > 0) { for ($k = 0; $k < $c; $k++) { $job = $jobList[$k]; makeSchedulingReportStationListHTMLRows($job, $workerList, $k, $max_name_size, $max_email_size); } } else { echo "<tr><td class='fieldError' colspan='5'>There are currently no stations assigned to this expo.</td></tr>"; } echo "</table>\n</div>\n"; }