public function index()
 {
     if (isset($this->post->action)) {
         if ($this->post->action == 'findflight') {
             $this->findflight();
         }
     } else {
         $this->set('airports', OperationsData::GetAllAirports());
         $this->set('airlines', OperationsData::getAllAirlines());
         $this->set('aircrafts', FrontSchedulesData::findaircrafttypes());
         $this->set('countries', FrontSchedulesData::findcountries());
         $this->show('RSL/airport_search.tpl');
     }
 }
Esempio n. 2
0
 /**
  * StatsTest::testPaxCount()
  * 
  * @return void
  */
 public function testPaxCount()
 {
     $total = DB::get_row('SELECT SUM(`load`) AS `total` 
             FROM phpvms_pireps WHERE `flighttype`=\'P\' AND `accepted`=' . PIREP_ACCEPTED);
     $this->assertEquals($total->total, StatsData::TotalPaxCarried(), 'StatsData::TotalPaxCarried(NO CODE)');
     $airlines = OperationsData::getAllAirlines(true);
     foreach ($airlines as $airline) {
         $pilotCount = StatsData::TotalPaxCarried($airline->code);
         $total = DB::get_row('SELECT SUM(`load`) AS `total` 
              FROM phpvms_pireps
              WHERE accepted =' . PIREP_ACCEPTED . ' 
                 AND flighttype = \'P\' 
                 AND code = \'' . $airline->code . '\'');
         $this->assertEquals($total->total, $pilotCount, 'StatsData::TotalPaxCarried(' . $airline->code . ')');
     }
 }
Esempio n. 3
0
 protected function ShowForm()
 {
     $field_list = RegistrationData::GetCustomFields();
     $this->set('extrafields', $field_list);
     $this->set('field_list', $field_list);
     $airline_list = OperationsData::getAllAirlines(true);
     $this->set('allairlines', $airline_list);
     $this->set('airline_list', $airline_list);
     $hub_list = OperationsData::getAllHubs();
     $this->set('allhubs', $hub_list);
     $this->set('hub_list', $hub_list);
     $country_list = Countries::getAllCountries();
     $this->set('countries', $country_list);
     $this->set('country_list', $country_list);
     $this->render('registration_mainform.tpl');
 }
Esempio n. 4
0
 public function index()
 {
     $revision = trim(file_get_contents(CORE_PATH . '/version'));
     if ($revision != 'simpilot 5.5.2') {
         echo '<center>phpVMS Version Installed Is Not Compatible With This Module!</center><br />';
         echo '<center>phpVMS Version Installed: ' . $revision . '</center>';
     } elseif (isset($this->post->action)) {
         if ($this->post->action == 'findflight') {
             $this->findflight();
         }
     } else {
         $this->set('airports', OperationsData::GetAllAirports());
         $this->set('airlines', OperationsData::getAllAirlines());
         $this->set('aircrafts', FBSVData::findaircrafttypes());
         $this->set('countries', FBSVData::findcountries());
         $this->show('fbsv/airport_search.php');
     }
 }
Esempio n. 5
0
 protected function ShowForm()
 {
     //Google reCaptcha
     //updated to Google noCaptcha 1/15
     $this->set('sitekey', RECAPTCHA_PUBLIC_KEY);
     $this->set('lang', 'en');
     $field_list = RegistrationData::GetCustomFields();
     $this->set('extrafields', $field_list);
     $this->set('field_list', $field_list);
     $airline_list = OperationsData::getAllAirlines(true);
     $this->set('allairlines', $airline_list);
     $this->set('airline_list', $airline_list);
     $hub_list = OperationsData::getAllHubs();
     $this->set('allhubs', $hub_list);
     $this->set('hub_list', $hub_list);
     $country_list = Countries::getAllCountries();
     $this->set('countries', $country_list);
     $this->set('country_list', $country_list);
     $this->render('registration_mainform.tpl');
 }
Esempio n. 6
0
 public function index()
 {
     if (!Auth::LoggedIn()) {
         $this->set('message', 'You must be logged in to access this feature!');
         $this->render('core_error.tpl');
         return;
     } else {
         if (isset($this->post->action)) {
             if ($this->post->action == 'search') {
                 $this->search();
             }
         } else {
             $this->set('airports', OperationsData::GetAllAirports());
             $this->set('airlines', OperationsData::getAllAirlines());
             $this->set('aircrafts', OperationsData::getAllAircraft('true'));
             $this->set('countries', FltbookData::findCountries());
             $this->show('Fltbook/search_form');
         }
     }
 }
Esempio n. 7
0
 /**
  * Extract the code and flight number portions from the flight number
  * Ensures that the code and number are properly split
  */
 public static function getProperFlightNum($flightnum)
 {
     if ($flightnum == '') {
         return false;
     }
     $ret = array();
     $flightnum = strtoupper($flightnum);
     $airlines = OperationsData::getAllAirlines(false);
     foreach ($airlines as $a) {
         $a->code = strtoupper($a->code);
         if (strpos($flightnum, $a->code) === false) {
             continue;
         }
         $ret['code'] = $a->code;
         $ret['flightnum'] = str_ireplace($a->code, '', $flightnum);
         return $ret;
     }
     # Invalid flight number
     $ret['code'] = '';
     $ret['flightnum'] = $flightnum;
     return $ret;
 }
Esempio n. 8
0
 /**
  * Parse a pilot ID from a passed ID
  *
  * @param int $pilotid Pass the ID string
  * @return int Returns the integer database ID
  *
  */
 public static function parsePilotID($pilotid)
 {
     if (!is_numeric($pilotid)) {
         $airlines = OperationsData::getAllAirlines();
         foreach ($airlines as $a) {
             $a->code = strtoupper($a->code);
             if (strpos($pilotid, $a->code) === false) {
                 continue;
             }
             $pilotid = intval(str_ireplace($a->code, '', $pilotid));
             $pilotid = $pilotid - Config::Get('PILOTID_OFFSET');
         }
     }
     return $pilotid;
 }
Esempio n. 9
0
 /**
  * PIREPS::FilePIREPForm()
  * 
  * @param string $bidid
  * @return
  */
 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::$pilot->firstname . ' ' . Auth::$pilot->lastname);
     $this->set('pilotcode', PilotData::GetPilotCode(Auth::$pilot->code, Auth::$pilot->pilotid));
     $this->set('pirepfields', PIREPData::GetAllFields());
     if ($bidid != '') {
         $this->set('bid', SchedulesData::GetBid($bidid));
         // get the bid info
     }
     $airport_list = OperationsData::getAllAirports();
     $this->set('allairports', $airport_list);
     #deprecated
     $this->set('airport_list', $airport_list);
     $airline_list = OperationsData::getAllAirlines(true);
     $this->set('allairlines', $airline_list);
     #deprecated
     $this->set('airline_list', $airline_list);
     $aircraft_list = OperationsData::getAllAircraft(true);
     /*	Skip any aircraft which have aircraft that the pilot
     			is not rated to fly (according to RANK)
                 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) {
         foreach ($aircraft_list as $index => $aircraft) {
             if ($aircraft->ranklevel > Auth::$pilot->ranklevel) {
                 unset($aircraft_list[$index]);
                 continue;
             }
         }
     }
     $this->set('allaircraft', $aircraft_list);
     #deprecated
     $this->set('aircraft_list', $aircraft_list);
     $this->render('pirep_new.tpl');
 }