public function overview() { $this->set('acstats', StatsData::AircraftUsage()); $this->set('toproutes', StatsData::TopRoutes()); $this->set('allairlines', OperationsData::GetAllAirlines()); $this->render('reports_main.php'); }
protected function ShowForm() { $this->set('extrafields', RegistrationData::GetCustomFields()); $this->set('allairlines', OperationsData::GetAllAirlines(true)); $this->set('allhubs', OperationsData::GetAllHubs()); $this->set('countries', Countries::getAllCountries()); $this->render('registration_mainform.tpl'); }
public function getairlines() { $xml = new SimpleXMLElement("<sitedata />"); $airlines = OperationsData::GetAllAirlines(); foreach ($airlines as $a) { $airline_xml = $xml->addChild('airline'); $airline_xml->addChild('code', $a->code); $airline_xml->addChild('name', $a->name); $airline_xml->addChild('enabled', $a->enabled); } header('Content-type: text/xml'); echo $xml->asXML(); }
public function editpirep() { $this->set('pirep', PIREPData::GetReportDetails($this->get->pirepid)); $this->set('allairlines', OperationsData::GetAllAirlines()); $this->set('allairports', OperationsData::GetAllAirports()); $this->set('allaircraft', OperationsData::GetAllAircraft()); $this->set('fielddata', PIREPData::GetFieldData($this->get->pirepid)); $this->set('pirepfields', PIREPData::GetAllFields()); $this->set('comments', PIREPData::GetComments($this->get->pirepid)); $this->render('pirep_edit.tpl'); }
public function editschedule() { $id = $this->get->id; $this->set('title', 'Edit Schedule'); $this->set('schedule', SchedulesData::GetSchedule($id)); $this->set('action', 'editschedule'); $this->set('allairlines', OperationsData::GetAllAirlines()); $this->set('allaircraft', OperationsData::GetAllAircraft()); $this->set('allairports', OperationsData::GetAllAirports()); $this->set('flighttypes', Config::Get('FLIGHT_TYPES')); $this->render('ops_scheduleform.tpl'); }
public function showSchedules() { $depapts = OperationsData::GetAllAirports(); $equip = OperationsData::GetAllAircraftSearchList(true); $airlines = OperationsData::GetAllAirlines(); $this->set('airlines', $airlines); $this->set('depairports', $depapts); $this->set('equipment', $equip); $this->render('schedule_searchform.tpl'); # Show the routes. Remote this to not show them. $schedules = SchedulesData::GetSchedules(); # Do some filtering and whatnots, take it out of the template... $today = getdate(); $week_number = intval(($today['mday'] - 1) / 7) + 1; $current_day == date('w'); $var_name = 'week' . $week_number; # query once, save for later if (Config::get('SCHEDULES_ONLY_LAST_PIREP') === true && Auth::LoggedIn() == true) { $reports = PIREPData::findPIREPS(array('p.pilotid' => Auth::$userinfo->pilotid, 'p.accepted' => PIREP_ACCEPTED), 1); // return only one } foreach ($schedules as $key => $s) { # should we skip schedules based on day of week? if (Config::get('CHECK_SCHEDULE_DAY_OF_WEEK') === true) { if (isset($s->{$var_name}) && !empty($s->{$var_name})) { # check if today is in the active list for this week if (@substr_count($s->{$var_name}, $current_day) == 0) { unset($schedules[$key]); continue; } } else { if (substr_count($s->daysofweek, date('w')) == 0) { unset($schedules[$key]); continue; } } } # remove this schedule from the list if there's a bid on it if (Config::get('DISABLE_SCHED_ON_BID') === true && $route->bidid != 0) { unset($schedules[$key]); continue; } /* This means the aircraft rank level is higher than what the pilot's ranklevel, so just do "continue" and move onto the next route in the list */ if (Config::get('RESTRICT_AIRCRAFT_RANKS') === true && Auth::LoggedIn()) { if ($route->aircraftlevel > Auth::$userinfo->ranklevel) { unset($schedules[$key]); continue; } } if (Config::get('SCHEDULES_ONLY_LAST_PIREP') === true && Auth::LoggedIn() == true) { if (count($reports) > 0) { # IF the arrival airport doesn't match the departure airport if ($reports[0]->arricao != $s->depicao) { unset($schedules[$key]); continue; } } } } // end foreach schedules $this->set('allroutes', $schedules); $this->render('schedule_list.tpl'); }
?> " /></td> </tr> <tr> <td align="right"><b>Last Name:</b></td> <td><input type="text" name="lastname" value="<?php echo $pilot->lastname; ?> " /></td> </tr> <tr> <td align="right"><b>Airline:</b></td> <td> <select name="code"> <?php $allairlines = OperationsData::GetAllAirlines(); foreach ($allairlines as $airline) { if ($pilot->code == $airline->code) { $sel = ' selected'; } else { $sel = ''; } echo '<option value="' . $airline->code . '" ' . $sel . '>' . $airline->name . '</option>'; } ?> </select> </td> </tr> <tr> <td align="right"><b>Transfer Hours:</b></td>
protected function FilePIREPForm($bidid = '') { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $this->set('pilot', Auth::$userinfo->firstname . ' ' . Auth::$userinfo->lastname); $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid)); $this->set('pirepfields', PIREPData::GetAllFields()); if ($bidid != '') { $this->set('bid', SchedulesData::GetBid($bidid)); // get the bid info } $this->set('allairports', OperationsData::GetAllAirports()); $this->set('allairlines', OperationsData::GetAllAirlines(true)); $this->set('allaircraft', OperationsData::GetAllAircraft(true)); $this->render('pirep_new.tpl'); }