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"; }
function createStationLockHTMLMatrix($expoid, $workerid) { $station = StationJob::selectExpo($expoid); // make titles $htitle = array(); $vtitle = array(); foreach ($station as $s) { $htitle[] = $s->location . " (" . $s->title . ")"; $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime)); $vtitle[] = $stationDateTime[0] . " (" . $stationDateTime[1] . ")"; } $htitle = array_values(array_unique($htitle)); $vtitle = array_values(array_unique($vtitle)); // initialize matrix for ($h = 0; $h <= count($htitle); $h++) { for ($v = 0; $v <= count($vtitle); $v++) { $matrix[$h][$v] = '<td align="center"></td>'; } } //add horizontal titles to matrix for ($h = 0; $h < count($htitle); $h++) { $matrix[$h + 1][0] = '<td class="rowTitle">' . $htitle[$h] . '</td>'; } //add vertical titles for ($v = 0; $v < count($vtitle); $v++) { $matrix[0][$v + 1] = '<td class="rowTitle">' . $vtitle[$v] . '</td>'; } // fill assignment data to matrix foreach ($station as $s) { $hvalue = $s->location . " (" . $s->title . ")"; $hpos = array_search($hvalue, $htitle); $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime)); $vvalue = $stationDateTime[0] . " (" . $stationDateTime[1] . ")"; $vpos = array_search($vvalue, $vtitle); if (ShiftAssignmentView::isWorkerAssignedStation($workerid, $expoid, $s->stationid)) { $matrix[$hpos + 1][$vpos + 1] = '<td align="center">X</td>'; } else { $matrix[$hpos + 1][$vpos + 1] = '<td align="center">-</td>'; } } // make table echo '<table>'; for ($v = 0; $v <= count($vtitle); $v++) { echo '<tr>'; for ($h = 0; $h <= count($htitle); $h++) { echo $matrix[$h][$v]; } echo '</tr>'; } echo '</table>'; echo '<p />'; }
function sprintfSchedule(array $shiftAssignmentViewList) { if (0 == count($shiftAssignmentViewList)) { return "no stations assigned"; } $body = ""; $sizeTitle = 0; $sizeDate = 0; $sizeTime = 0; $lines = array(); // convert to array of lines foreach ($shiftAssignmentViewList as $shift) { $stationDateTime = swwat_format_shift($shift->startTime, $shift->stopTime); list($stationDate, $stationTime, $ignore) = explode(';', $stationDateTime); $line = array(); // convert to array of strings if ($sizeTitle < strlen($shift->titleString())) { $sizeTitle = strlen($shift->titleString()); } if ($sizeDate < strlen($stationDate)) { $sizeDate = strlen($stationDate); } if ($sizeTime < strlen($stationTime)) { $sizeTime = strlen($stationTime); } $line[] = $shift->titleString(); $line[] = $stationDate; $line[] = $stationTime; $lines[] = $line; } // $shift $sizeTitle += 2; $sizeDate += 2; $sizeTime += 2; $format = "\n\t%{$sizeTitle}" . "s%{$sizeDate}" . "s%{$sizeTime}" . "s"; foreach ($lines as $line) { $body .= sprintf($format, $line[0], $line[1], $line[2]); } // $line $lines = NULL; return $body; }
function swwat_format_shifttime($startTime, $stopTime) { $stationDateTime = swwat_format_shift($startTime, $stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); return "(" . $stationTime . ", " . $stationDate . ")"; }
function createStationHTMLList($expo, array $stationList) { $jobList = Job::selectExpo($expo->expoid); usort($jobList, "JobCompare"); $date = array(); foreach ($jobList as $j) { $stationDateTime = swwat_format_shift($j->startTime, $j->stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); $date[] = $stationDate; } $date = array_values(array_unique($date)); echo "<table width=\"50%\">\n"; echo "<tr>\n"; echo "<td>\n"; echo "Select Date: <select id=\"" . PARAM_DATE . "\" name=\"" . PARAM_DATE . "\" onchange=\"hideDateRows()\">\n"; for ($k = 0; $k < count($date); $k++) { echo "<option value=\"" . $date[$k] . "\"> " . $date[$k] . " </option>\n"; } echo "<option value=\"All\"> All Dates </option>\n"; echo "</select>\n"; echo "</td>\n"; $jobTitle = JobTitle::titleEnums($expo->expoid); echo "<td>\n"; echo "Select Job: <select id=\"" . PARAM_JOB . "\" name=\"" . PARAM_JOB . "\" onchange=\"hideJobRows()\">\n"; for ($k = 0; $k < count($jobTitle); $k++) { echo "<option value=\"" . $jobTitle[$k] . "\"> " . $jobTitle[$k] . " </option>\n"; } echo "<option value=\"All\" selected=\"selected\"> All Jobs </option>\n"; echo "</select>\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td>\n"; echo "<p />Search Shift By: <input type=\"text\" id=\"search\" name=\"search\" onkeyup=\"searchRows()\"\\>"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "<p />\n"; echo "<div id=\"stationlist_table\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<th class=\"rowTitle\">Shift</th>\n"; echo "<th class=\"rowTitle\">Job</th>\n"; echo "<th class=\"rowTitle\">Location</th>\n"; echo "<th class=\"rowTitle\">Date</th>\n"; echo "<th class=\"rowTitle\">Time</th>\n"; echo "<th class=\"rowTitle\">Crew</th>\n"; echo "<th class=\"rowTitle\">Supervisors</th>\n"; echo "<th class=\"rowTitle\">Instructions</th>\n"; echo "<th class=\"rowTitle\"></th>\n"; echo "</tr>\n"; $c = count($stationList); if ($c > 0) { for ($k = 0; $k < $c; $k++) { $s = $stationList[$k]; makeStationListHTMLRows($s, $k); } } else { echo "<tr><td class=\"fieldError\" colspan=\"5\">No stations for this Expo currently exist.</td></tr>\n"; } echo "</table></div><!-- stationlist_table -->\n"; }
function createCheckInStationDashboardHTMLList($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"; $assignedWorkerList = ShiftAssignmentView::selectExpo($expoid); $c = count($assignedWorkerList); $max_name_size = 0; $max_email_size = 0; for ($k = 0; $k < $c; $k++) { $worker = Worker::selectID($assignedWorkerList[$k]->workerid); $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=\"checkinlist_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]; makeCheckInStationDashboardStationListHTMLRows($job, $k, $expoid, $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>\n"; } echo "</table>\n</div>\n"; }
function createShiftCheckInHTMLMatrix($expoid) { $station = StationJob::selectExpo($expoid); // make titles $htitle = array(); $date = array(); $vtitle = array(); $dates = array(); foreach ($station as $s) { $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime)); $htitle[] = $stationDateTime[0] . " (" . $stationDateTime[1] . ")"; $date[] = $stationDateTime[0]; $vtitle[] = $s->location . " (" . $s->title . ")"; } $htitle = array_values(array_unique($htitle)); $vtitle = array_values(array_unique($vtitle)); $dates = array_values(array_unique($date)); echo "Select Date: <select id=\"" . PARAM_DATE . "\" name=\"" . PARAM_DATE . "\" onchange=\"hideColumns()\">\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 />"; // get class names $hdate = array(); for ($h = 0; $h < count($htitle); $h++) { for ($d = 0; $d < count($dates); $d++) { if (preg_match("/" . $dates[$d] . "/", $htitle[$h])) { $hdate[$h] = preg_replace('/\\s/', '_', $dates[$d]); } } } // initialize matrix for ($h = 0; $h <= count($htitle); $h++) { for ($v = 0; $v <= count($vtitle); $v++) { if ($h == 0 && $v == 0) { $matrix[$h][$v] = "<td align=\"center\"></td>\n"; } else { if ($h == 0) { $matrix[$h][$v] = "<td align=\"center\">-</td>\n"; } else { $matrix[$h][$v] = "<td align=\"center\" class=\"" . $hdate[$h - 1] . "\">-</td>\n"; } } } } //add horizontal titles to matrix for ($h = 0; $h < count($htitle); $h++) { $matrix[$h + 1][0] = "<td class=\"rowTitle " . $hdate[$h] . "\">" . $htitle[$h] . "</td>\n"; } //add vertical titles for ($v = 0; $v < count($vtitle); $v++) { $matrix[0][$v + 1] = "<td class=\"rowTitle\">" . $vtitle[$v] . "</td>\n"; } // fill assignment data to matrix foreach ($station as $s) { $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime)); $hvalue = $stationDateTime[0] . " (" . $stationDateTime[1] . ")"; $hpos = array_search($hvalue, $htitle); $vvalue = $s->location . " (" . $s->title . ")"; $vpos = array_search($vvalue, $vtitle); $matrix[$hpos + 1][$vpos + 1] = "<td align=\"center\" class=\"" . $hdate[$hpos] . "\">"; $matrix[$hpos + 1][$vpos + 1] .= "<a href=\"ShiftCheckInPage.php?" . PARAM_LIST_INDEX . "=" . $s->stationid . "\">"; $matrix[$hpos + 1][$vpos + 1] .= "Super: " . $s->assignedSupervisor . "; Crew: " . $s->assignedCrew . "</a></td>\n"; } // determine pattern array for ($d = 0; $d < count($dates); $d++) { $darray[$d] = array(); for ($h = 1; $h <= count($htitle); $h++) { if (!strpos($matrix[$h][0], $dates[$d])) { $darray[$d][] = $h; } } } // find row class for ($v = 0; $v <= count($vtitle); $v++) { $vdate[$v] = NULL; for ($d = 0; $d < count($dates); $d++) { $flag = true; foreach ($darray[$d] as $dvalue) { if (!strpos($matrix[$dvalue][$v], '>-<')) { $flag = false; } } if ($flag) { $vdate[$v] = preg_replace('/\\s/', '_', $dates[$d]); } } } echo "<table>\n"; for ($v = 0; $v <= count($vtitle); $v++) { if (!is_null($vdate[$v])) { echo "<tr class=\"" . $vdate[$v] . "\">\n"; } else { echo "<tr>\n"; } for ($h = 0; $h <= count($htitle); $h++) { echo $matrix[$h][$v]; } echo "</tr>\n"; } echo "</table>\n"; echo "<p />\n"; }
// create data array // 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.");
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"; }
$j = 0; // Todo: Make shift/job name span the relevant fields. foreach ($jobList as $job) { $matrix[$j][0] = 'Date'; $matrix[$j][1] = 'Day of Week'; $matrix[$j][2] = 'Shift Time'; $matrix[$j][3] = 'Volunteer Role'; $matrix[$j][4] = 'Volunteer Name'; $matrix[$j][5] = 'Shift Name'; $matrix[$j][6] = true; $j++; $assignedWorkerList = ShiftAssignmentView::selectJob($expoId, $job->jobid); foreach ($assignedWorkerList as $aw) { $date = date_format($aw->startTime, 'd-M'); $weekDay = date_format($aw->startTime, 'l'); $awDateTime = swwat_format_shift($aw->startTime, $aw->stopTime); list($awDate, $shiftTime, $start) = explode(';', $awDateTime); $shiftName = $aw->stationTitle . ' - ' . $aw->location; $worker = Worker::selectID($aw->workerid); $matrix[$j][0] = $date; $matrix[$j][1] = $weekDay; $matrix[$j][2] = $shiftTime; $matrix[$j][3] = $worker->roleString(); $matrix[$j][4] = $worker->nameString2(); $matrix[$j][5] = $shiftName; $matrix[$j][6] = false; $j++; } } //find column widths $colwidth = array(0, 0, 0, 0, 0, 0);
function reviewPageContent() { echo "<form method=\"POST\" name=\"preferencereview_form\" action=\"PreferenceReviewAction.php\">\n"; echo "\n"; echo "<div id=\"content\" style=\"clear:both\">\n"; echo "Below are all the sessions you've shown interest in. You're welcome to trim down the list. You MUST set a maximum number of hours at the bottom of the page (it is defaulted to 20), and we'll schedule you for where we need you the most!\n"; echo "<p />\n"; echo "Note: Our system won't allow us to double book you, so if you have two sessions at the same time, you'll only be scheduled for one. Also know that if you requested more shifts than the maximum amount of hours you can commit, you will not be booked to all of the events you selected.\n"; echo "<p />\n"; echo "Click next at the bottom of the page once you are comfortable with your selections.\n"; echo "<p />\n"; $jobIncludeList = array(); $jobIncludeList[] = "Volunteer"; $jobList = Job::selectExpo($expo->expoid); usort($jobList, "JobCompare"); $date = array(); $max_job_size = 0; $max_time_size = 0; $max_location_size = 0; $max_title_size = 0; foreach ($jobList as $j) { $stationDateTime = swwat_format_shift($j->startTime, $j->stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); $date[] = $stationDate; $job = $j->jobTitle; if (strlen($job) > $max_job_size) { $max_job_size = strlen($job); } if (strlen($stationTime) > $max_time_size) { $max_time_size = strlen($stationTime); } $location = $j->location; if (strlen($location) > $max_location_size) { $max_location_size = strlen($location); } $title = $j->stationTitle; if (strlen($title) > $max_title_size) { $max_title_size = strlen($title); } } $date = array_values(array_unique($date)); $max_radio_size = "10%"; $max_percent_size = "5%"; //$max_job_size = 12*($max_job_size); $max_time_size = "12%"; $max_hours_size = "5%"; $max_location_size = "15%"; $max_title_size = "53%"; $table_size = "95%"; $numColumns = 6; echo "<table width=\"" . $table_size . "\" align=\"center\" class=\"research\">\n"; echo "<tr class=\"accordion\">\n"; echo "<th width=\"120\" class=\"rowTitle\"></th>"; echo "<th width=\"" . $max_percent_size . "\" class=\"rowTitle\">Percent Filled</th>"; //echo "<th width=\"".$max_job_size."\" class=\"rowTitle\">Job</th>"; echo "<th width=\"" . $max_time_size . "\" class=\"rowTitle\">Time</th>"; echo "<th width=\"" . $max_hours_size . "\" class=\"rowTitle\">Hours</th>"; echo "<th width=\"" . $max_location_size . "\" class=\"rowTitle\">Location</th>"; echo "<th width=\"" . $max_title_size . "\" class=\"rowTitle\">Title</th>"; echo "</tr>\n"; // kludge to remove empty dates for ($k = 0; $k < count($date); $k++) { $count[$k] = 0; for ($l = 0; $l < count($jobList); $l++) { $sp = ShiftPreference::selectID($author->workerid, $jobList[$l]->jobid); if (!is_null($sp)) { $desire = $sp->desirePercent; } else { $desire = 0; } $stationDateTime = swwat_format_shift($jobList[$l]->startTime, $jobList[$l]->stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); if (!strcmp($date[$k], $stationDate) && in_array($jobList[$l]->jobTitle, $jobIncludeList) && $desire != 0) { $count[$k]++; } } } for ($k = 0; $k < count($date); $k++) { $dow = date('l', strtotime($date[$k])); if ($count[$k] != 0) { echo "<tr class=\"accordion\">\n"; echo "<th colspan=\"" . $numColumns . "\" class=\"rowTitle\">"; echo "<div style=\"float:left\">" . htmlspecialchars($date[$k] . ", " . $dow) . "</div>\n"; echo "<div style=\"float:right\"><img id=\"icon1\" src=\"" . PARAM_COLLAPSE_ICON . "\"/></div>\n"; echo "</th>\n"; echo "</tr>\n"; } for ($l = 0; $l < count($jobList); $l++) { //$optionArray = array(array($jobList[$l]->jobid.":0", "No"), array($jobList[$l]->jobid.":1", "Yes")); $param_station = PARAM_TITLE . $l; if (!isset($_POST[$param_station])) { $_POST[$param_station] = NULL; } $sp = ShiftPreference::selectID($author->workerid, $jobList[$l]->jobid); if (!is_null($sp)) { $desire = $sp->desirePercent; } else { $desire = 0; } $stationDateTime = swwat_format_shift($jobList[$l]->startTime, $jobList[$l]->stopTime); list($stationDate, $stationTime, $start) = explode(';', $stationDateTime); $start = $jobList[$l]->startTime; $stop = $jobList[$l]->stopTime; $diff = $start->diff($stop); $hours = $diff->d * 24 + $diff->h + $diff->i / 60 + $diff->s / 360; if ($jobList[$l]->minCrew != 0) { $percent = intval(100 * ($jobList[$l]->assignedCrew / $jobList[$l]->minCrew)) . "%"; } else { $percent = "-"; } $s = Station::selectID($jobList[$l]->stationid); $dclass = preg_replace('/\\s/', '_', $date[$k]); if (!strcmp($date[$k], $stationDate) && in_array($jobList[$l]->jobTitle, $jobIncludeList) && $desire != 0) { echo "<tr class=\"" . $dclass . "\">\n"; echo "<td class=\"fieldValue\">"; //swwat_createRadioSelect($param_station, $optionArray, "radio", $jobList[$l]->jobid.":".$desire); echo "<input id=\"" . $param_station . "n\" name=\"" . $param_station . "\" type=\"radio\" value=\"" . $jobList[$l]->jobid . ":0" . "\" "; if ($desire == 0) { echo "checked=\"checked\" "; } echo "/>"; echo "<label for=\"" . $param_station . "n\">No </label>\n"; echo "<input id=\"" . $param_station . "y\" name=\"" . $param_station . "\" type=\"radio\" value=\"" . $jobList[$l]->jobid . ":100" . "\" "; if ($desire != 0) { echo "checked=\"checked\" "; } echo "/>"; echo "<label for=\"" . $param_station . "y\">Yes</label>\n"; echo "</td>\n"; echo "<td class=\"fieldValue\">" . htmlspecialchars($percent) . "</td>\n"; //echo "<td class=\"fieldValue\">".htmlspecialchars($jobList[$l]->jobTitle)."</td>\n"; echo "<td class=\"fieldValue\">" . htmlspecialchars($stationTime) . "</td>\n"; echo "<td class=\"fieldValue\">" . htmlspecialchars($hours) . "</td>\n"; echo "<td class=\"fieldValue\">" . htmlspecialchars($jobList[$l]->location) . "</td>\n"; echo "<td class=\"fieldValue\">"; echo "<div style=\"float:left\">" . htmlspecialchars($jobList[$l]->stationTitle) . "</div>\n"; echo "<div style=\"float:right\"><img id=\"icon2\" src=\"" . PARAM_EXPAND_ICON . "\"/></div>\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr class=\"description " . $param_station . " " . $dclass . "\">\n"; echo "<td class=\"fieldValue\" style=\"text-align: center\" colspan=\"" . $numColumns . "\">"; echo htmlspecialchars($s->description) . "<br><a href=\"" . htmlspecialchars($s->URL) . "\">" . htmlspecialchars($s->URL) . "</a></td>\n"; echo "</td>\n"; echo "</tr>\n"; } } } echo "</table>\n"; echo "<p />"; $_POST[PARAM_MAXHOURS] = $author->selectMaxHours($expo->expoid); echo "The MAXIMUM number of hours I am available to work is "; swwat_createInputValidateInteger(PARAM_MAXHOURS, "content", 2); echo "<p />"; echo "</div><!-- content -->\n"; }