当前位置: 首页>>代码示例>>PHP>>正文


PHP OperationsData::getAllAircraft方法代码示例

本文整理汇总了PHP中OperationsData::getAllAircraft方法的典型用法代码示例。如果您正苦于以下问题:PHP OperationsData::getAllAircraft方法的具体用法?PHP OperationsData::getAllAircraft怎么用?PHP OperationsData::getAllAircraft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OperationsData的用法示例。


在下文中一共展示了OperationsData::getAllAircraft方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_airport

 public function get_airport()
 {
     $icao = $_GET['icao'];
     $this->set('aircrafts', OperationsData::getAllAircraft('true'));
     $this->set('name', OperationsData::getAirportInfo($icao));
     $this->show('realschedulelite/realschedulelite_airport_details.tpl');
 }
开发者ID:phpmods,项目名称:FlightBookingSystem_V1.0,代码行数:7,代码来源:RealScheduleLite.php

示例2: index

 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');
         }
     }
 }
开发者ID:web541,项目名称:FltbookSystem,代码行数:20,代码来源:Fltbook.php

示例3: getAllAircraft

 public static function getAllAircraft()
 {
     $results = OperationsData::getAllAircraft(true);
     $xml = new SimpleXMLElement("<aircraftdata />");
     $info_xml = $xml->addChild('info');
     foreach ($results as $row) {
         $info_xml->addChild('aircraftICAO', $row->icao);
         $info_xml->addChild('aircraftReg', $row->registration);
     }
     # For debug
     #$this->log("Sending: \n".print_r($xml_string, true), 'kacars');
     header('Content-type: text/xml');
     echo $xml->asXML();
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:14,代码来源:kACARS_Free.php

示例4: importaircraft

    public function importaircraft()
    {
        if (!file_exists($_FILES['uploadedfile']['tmp_name'])) {
            $this->render('import_aircraftform.tpl');
            return;
        }
        echo '<h3>Processing Import</h3>';
        # Get the column headers
        $allaircraft = OperationsData::getAllAircraft(false);
        $headers = array();
        $dbcolumns = DB::get_cols();
        foreach ($dbcolumns as $col) {
            if ($col->name == 'id' || $col->name == 'minrank' || $col->name == 'ranklevel') {
                continue;
            }
            $headers[] = $col->name;
        }
        # Open the import file
        # Fix for bug VMS-325
        $temp_name = $_FILES['uploadedfile']['tmp_name'];
        $new_name = CACHE_PATH . $_FILES['uploadedfile']['name'];
        move_uploaded_file($temp_name, $new_name);
        $fp = fopen($new_name, 'r');
        if (isset($_POST['header'])) {
            $skip = true;
        }
        $added = 0;
        $updated = 0;
        $total = 0;
        echo '<div style="overflow: auto; height: 400px; 
					border: 1px solid #666; margin-bottom: 20px; 
					padding: 5px; padding-top: 0px; padding-bottom: 20px;">';
        while ($fields = fgetcsv($fp, 1000, ',')) {
            // Skip the first line
            if ($skip == true) {
                $skip = false;
                continue;
            }
            # Map the read in values to the columns
            $aircraft = array();
            $aircraft = @array_combine($headers, $fields);
            if (empty($aircraft)) {
                continue;
            }
            # Enabled or not
            if ($aircraft['enabled'] == '1') {
                $aircraft['enabled'] = true;
            } else {
                $aircraft['enabled'] = false;
            }
            # Get the rank ID
            $rank = RanksData::getRankByName($aircraft['rank']);
            $aircraft['minrank'] = $rank->rankid;
            unset($aircraft['rank']);
            # Does this aircraft exist?
            $ac_info = OperationsData::getAircraftByReg($aircraft['registration']);
            if ($ac_info) {
                echo "Editing {$aircraft['name']} - {$aircraft['registration']}<br>";
                $aircraft['id'] = $ac_info->id;
                OperationsData::editAircraft($aircraft);
                $updated++;
            } else {
                echo "Adding {$aircraft['name']} - {$aircraft['registration']}<br>";
                OperationsData::addAircraft($aircraft);
                $added++;
            }
            $total++;
        }
        unlink($new_name);
        echo "The import process is complete, added {$added} aircraft, updated {$updated}, for a total of {$total}<br />";
    }
开发者ID:rallin,项目名称:phpVMS,代码行数:71,代码来源:Import.php

示例5: FilePIREPForm

 /**
  * 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');
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:48,代码来源:PIREPS.php


注:本文中的OperationsData::getAllAircraft方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。