<?php // $Id: PreferenceWelcomePage.php 2418 2012-10-28 19:23:53Z ecgero $ Copyright (c) ConSked, LLC. All Rights Reserved. include 'util/authenticate.php'; require_once 'preferences/' . PREF . 'Preferences.php'; require_once 'properties/constants.php'; require_once 'section/Menu.php'; require_once 'util/log.php'; require_once 'util/session.php'; $author = getWorkerAuthenticated(); if (isset($_REQUEST[PARAM_LIST_INDEX])) { $expo = getParamItem(PARAM_LIST, PARAM_LIST_INDEX); if (!is_null($expo)) { setExpoCurrent($expo); } $_SESSION[PARAM_LIST] = NULL; } $expo = getExpoCurrent(); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="cache-control" content="no-cache"/> <meta http-equiv="expires" content="31 Dec 2011 12:00:00 GMT"/> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title><?php echo SITE_NAME; ?> - Shift Preference Welcome</title> <link href="css/site.css" rel="stylesheet" type="text/css">
return; } } else { // maybe the crew is not assigned to anything! if (!is_null($expo) && $expo->isRunning()) { header('Location: WorkerSchedulePage.php'); include 'WorkerSchedulePage.php'; return; } else { $expoList = Expo::selectWorker($worker->workerid); if (count($expoList) == 1) { $future = $expoList[0]->isFuture(); $preferncesEntered = ShiftPreference::preferencesEntered($expoList[0]->expoid, $worker->workerid); } if (count($expoList) == 1 && $future && !$preferencesEntered) { setExpoCurrent($expoList[0]); header('Location: PreferenceWelcomePage.php'); include 'PreferenceWelcomePage.php'; return; } else { header('Location: WorkerViewPage.php'); include 'WorkerViewPage.php'; return; } } } } catch (RequirePasswordReset $ex) { header('Location: WorkerLoginChangePage.php'); include 'WorkerLoginChangePage.php'; return; }
<body> <div id="container"> <?php require_once 'db/Expo.php'; require_once 'db/Worker.php'; require_once 'section/ExpoList.php'; require_once 'section/Menu.php'; require_once 'swwat/gizmos/format.php'; require_once 'util/date.php'; setWorkerCurrent(NULL); $expoList = Expo::selectMultiple(); // should be in order for display usort($expoList, "ExpoCompare"); $_SESSION[PARAM_LIST] = $expoList; setExpoCurrent(NULL); $_REQUEST[PARAM_LIST_INDEX] = NULL; setStationCurrent(NULL); // ok, start the html include 'section/header.php'; ?> <div id="main"> <div id="expolistpage_filters"> </div><!-- expolistpage_filters --> <?php echo "<form method=\"GET\" name=\"expoviewpage_newstation_form\" action=\"ExpoEditPage.php\">\n"; echo "<input class=\"fieldValue\" type=\"Submit\" value=\"Create New Expo\"/>\n</form>\n"; createExpoHTMLList($expoList, $author->isOrganizer());
function createExpoHTMLList(array $expoList, $isOrganizer) { $_SESSION[PARAM_LIST] = $expoList; $_REQUEST[PARAM_LIST_INDEX] = NULL; setExpoCurrent(NULL); $CURRENT_TIME_STAMP = new DateTime(); expoListStartTable(); echo "</tr>\n"; // close header row echo "<tr class='rowTitle'><td colspan='3'>Future Expos</td></tr>\n"; $future = 0; for ($k = 0; $k < count($expoList); $k++) { $expo = $expoList[$k]; if (dateCompare($expo->startTime, $CURRENT_TIME_STAMP) <= 0) { break; } expoListStartRow($expo, $k, $isOrganizer); echo "</tr>\n"; // close row $future++; } // $k if ($future == 0) { echo "<tr><td class='fieldError' colspan='3'>There are no future Expos.</td></tr>\n"; } echo "<tr class='rowTitle'><td colspan='3'>Current Expos</td></tr>\n"; $future = 0; for (; $k < count($expoList); $k++) { $expo = $expoList[$k]; if (dateCompare($expo->stopTime, $CURRENT_TIME_STAMP) < 0) { break; } expoListStartRow($expo, $k, $isOrganizer); echo "</tr>\n"; // close row $future++; } // $k if ($future == 0) { echo "<tr><td class='fieldError' colspan='3'>There are no current Expos.</td></tr>\n"; } echo "<tr class='rowTitle'><td colspan='3'>Past Expos</td></tr>\n"; $future = 0; for (; $k < count($expoList); $k++) { $expo = $expoList[$k]; expoListStartRow($expo, $k, $isOrganizer); echo "</tr>\n"; // close row $future++; } // $k if ($future == 0) { echo "<tr><td class='fieldError' colspan='3'>There are no past Expos.</td></tr>\n"; } echo "</table>\n"; echo "</div><!-- expolistpage_table -->\n"; }