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


PHP Spotter::getAllAirportInfo方法代码示例

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


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

示例1: Spotter

<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
require 'require/class.METAR.php';
$Spotter = new Spotter();
if (isset($_GET['airport_icao'])) {
    $icao = filter_input(INPUT_GET, 'airport_icao', FILTER_SANITIZE_STRING);
    $spotter_array = $Spotter->getAllAirportInfo($icao);
    if (isset($globalMETAR) && $globalMETAR) {
        $METAR = new METAR();
        $metar_info = $METAR->getMETAR($icao);
        //print_r($metar_info);
        if (isset($metar_info[0]['metar'])) {
            $metar_parse = $METAR->parse($metar_info[0]['metar']);
        }
        //print_r($metar_parse);
    }
}
?>
<div class="alldetails">
<button type="button" class="close">&times;</button>
<?php 
$spotter_item = $spotter_array[0];
//print_r($spotter_item);
date_default_timezone_set('UTC');
if (isset($spotter_item['image_thumb']) && $spotter_item['image_thumb'] != "") {
    $image = $spotter_item['image_thumb'];
}
print '<div class="top">';
if (isset($image)) {
开发者ID:linuxpronl,项目名称:FlightAirMap,代码行数:31,代码来源:airport-data.php

示例2: ksort

<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$spotter_array = Spotter::getSpotterDataByAirport($_GET['airport'], "0,1", "");
$airport_array = Spotter::getAllAirportInfo($_GET['airport']);
if (!empty($airport_array)) {
    $title = 'Most Common Arrival Airports from ' . $airport_array[0]['city'] . ', ' . $airport_array[0]['name'] . ' (' . $airport_array[0]['icao'] . ')';
    require 'header.php';
    print '<div class="select-item">';
    print '<form action="' . $globalURL . '/airport" method="post">';
    print '<select name="airport" class="selectpicker" data-live-search="true">';
    print '<option></option>';
    $airport_names = Spotter::getAllAirportNames();
    ksort($airport_names);
    foreach ($airport_names as $airport_name) {
        if ($_GET['airport'] == $airport_name['airport_icao']) {
            print '<option value="' . $airport_name['airport_icao'] . '" selected="selected">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
        } else {
            print '<option value="' . $airport_name['airport_icao'] . '">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
        }
    }
    print '</select>';
    print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
    print '</form>';
    print '</div>';
    if ($_GET['airport'] != "NA") {
        print '<div class="info column">';
        print '<h1>' . $airport_array[0]['city'] . ', ' . $airport_array[0]['name'] . ' (' . $airport_array[0]['icao'] . ')</h1>';
        print '<div><span class="label">Name</span>' . $airport_array[0]['name'] . '</div>';
        print '<div><span class="label">City</span>' . $airport_array[0]['city'] . '</div>';
开发者ID:hzmarrou,项目名称:FlightAirMap,代码行数:31,代码来源:airport-statistics-arrival-airport.php

示例3: header

<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
if (!isset($_GET['airport'])) {
    header('Location: ' . $globalURL . '/airport');
    die;
}
$Spotter = new Spotter();
$spotter_array = $Spotter->getSpotterDataByAirport($_GET['airport'], "0,1", "");
$airport_array = $Spotter->getAllAirportInfo($_GET['airport']);
if (!empty($airport_array)) {
    $title = 'Most Common Arrival Airports from ' . $airport_array[0]['city'] . ', ' . $airport_array[0]['name'] . ' (' . $airport_array[0]['icao'] . ')';
    require 'header.php';
    print '<div class="select-item">';
    print '<form action="' . $globalURL . '/airport" method="post">';
    print '<select name="airport" class="selectpicker" data-live-search="true">';
    print '<option></option>';
    $airport_names = $Spotter->getAllAirportNames();
    ksort($airport_names);
    foreach ($airport_names as $airport_name) {
        if ($_GET['airport'] == $airport_name['airport_icao']) {
            print '<option value="' . $airport_name['airport_icao'] . '" selected="selected">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
        } else {
            print '<option value="' . $airport_name['airport_icao'] . '">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
        }
    }
    print '</select>';
    print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
    print '</form>';
    print '</div>';
开发者ID:dedevillela,项目名称:BravoHotelZulu,代码行数:31,代码来源:airport-statistics-arrival-airport.php

示例4: updateFieldsFromOtherTables

 public static function updateFieldsFromOtherTables()
 {
     global $globalDebug;
     $Connection = new Connection();
     // routes
     if ($globalDebug) {
         print "Routes...\n";
     }
     $query = "SELECT spotter_output.spotter_id, routes.FromAirport_ICAO, routes.ToAirport_ICAO FROM spotter_output, routes WHERE spotter_output.ident = routes.CallSign AND ( spotter_output.departure_airport_icao != routes.FromAirport_ICAO OR spotter_output.arrival_airport_icao != routes.ToAirport_ICAO) AND routes.FromAirport_ICAO != ''";
     $sth = Connection::$db->prepare($query);
     $sth->execute();
     while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
         $departure_airport_array = Spotter::getAllAirportInfo($row['fromairport_icao']);
         $arrival_airport_array = Spotter::getAllAirportInfo($row['toairport_icao']);
         if (count($departure_airport_array) > 0 && count($arrival_airport_array) > 0) {
             $update_query = "UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id";
             $sthu = Connection::$db->prepare($update_query);
             $sthu->execute(array(':fromicao' => $row['fromairport_icao'], ':toicao' => $row['toairport_icao'], ':spotter_id' => $row['spotter_id'], ':departure_airport_name' => $departure_airport_array[0]['name'], ':departure_airport_city' => $departure_airport_array[0]['city'], ':departure_airport_country' => $departure_airport_array[0]['country'], ':arrival_airport_name' => $arrival_airport_array[0]['name'], ':arrival_airport_city' => $arrival_airport_array[0]['city'], ':arrival_airport_country' => $arrival_airport_array[0]['country']));
         }
     }
     if ($globalDebug) {
         print "Airlines...\n";
     }
     //airlines
     $query = "SELECT spotter_output.spotter_id, spotter_output.ident FROM spotter_output WHERE spotter_output.airline_name = '' OR spotter_output.airline_name = 'Not Available'";
     $sth = Connection::$db->prepare($query);
     $sth->execute();
     while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
         if (is_numeric(substr($row['ident'], -1, 1))) {
             $airline_array = Spotter::getAllAirlineInfo(substr($row['ident'], 0, 3));
             $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id";
             $sthu = Connection::$db->prepare($update_query);
             $sthu->execute(array(':airline_name' => $airline_array[0]['name'], ':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id']));
         }
     }
     if ($globalDebug) {
         print "Remove Duplicate in aircraft_modes...\n";
     }
     //duplicate modes
     $query = "DELETE aircraft_modes FROM aircraft_modes LEFT OUTER JOIN (SELECT max(`AircraftID`) as `AircraftID`,`ModeS` FROM `aircraft_modes` group by ModeS) as KeepRows ON aircraft_modes.AircraftID = KeepRows.AircraftID WHERE KeepRows.AircraftID IS NULL";
     $sth = Connection::$db->prepare($query);
     $sth->execute();
     if ($globalDebug) {
         print "Aircraft...\n";
     }
     //aircraft
     $query = "SELECT spotter_output.spotter_id, spotter_output.aircraft_icao, spotter_output.registration FROM spotter_output WHERE spotter_output.aircraft_name = '' OR spotter_output.aircraft_name = 'Not Available'";
     $sth = Connection::$db->prepare($query);
     $sth->execute();
     while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
         if ($row['aircraft_icao'] != '') {
             $aircraft_name = Spotter::getAllAircraftInfo($row['aircraft_icao']);
             if ($row['registration'] != "") {
                 Image::addSpotterImage($row['registration']);
             }
             if (count($aircraft_name) > 0) {
                 $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id";
                 $sthu = Connection::$db->prepare($update_query);
                 $sthu->execute(array(':aircraft_name' => $aircraft_name[0]['type'], ':aircraft_manufacturer' => $aircraft_name[0]['manufacturer'], ':spotter_id' => $row['spotter_id']));
             }
         }
     }
 }
开发者ID:kletellier,项目名称:FlightAirMap,代码行数:63,代码来源:class.Spotter.php

示例5: getArchiveAcarsData

 /**
  * Get Archive ACARS data from DB
  *
  * @return Array Return ACARS data in array
  */
 public function getArchiveAcarsData($limit = '', $label = '')
 {
     global $globalURL, $globalDBdriver;
     $Image = new Image();
     $Spotter = new Spotter();
     $Translation = new Translation();
     date_default_timezone_set('UTC');
     $limit_query = '';
     if ($limit != "") {
         $limit_array = explode(",", $limit);
         $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT);
         $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT);
         if ($limit_array[0] >= 0 && $limit_array[1] >= 0) {
             //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
             $limit_query = " LIMIT " . $limit_array[1] . " OFFSET " . $limit_array[0];
         }
     }
     //$query = "SELECT *, name as airline_name FROM acars_live a, spotter_image i, airlines l WHERE i.registration = a.registration AND l.icao = a.airline_icao AND l.icao != '' ORDER BY acars_live_id DESC LIMIT 25";
     if ($label != '') {
         if ($label == 'undefined') {
             $query = "SELECT * FROM acars_archive WHERE label NOT IN (SELECT label FROM acars_label) ORDER BY acars_archive_id DESC" . $limit_query;
             $query_values = array();
         } else {
             $query = "SELECT * FROM acars_archive WHERE label = :label ORDER BY acars_archive_id DESC" . $limit_query;
             $query_values = array(':label' => $label);
         }
     } else {
         $query = "SELECT * FROM acars_archive ORDER BY acars_archive_id DESC" . $limit_query;
         $query_values = array();
     }
     try {
         $sth = $this->db->prepare($query);
         $sth->execute($query_values);
     } catch (PDOException $e) {
         return "error : " . $e->getMessage();
     }
     $i = 0;
     while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
         $data = array();
         if ($row['registration'] != '') {
             $image_array = $Image->getSpotterImage($row['registration']);
             if (count($image_array) > 0) {
                 $data = array_merge($data, array('image_thumbnail' => $image_array[0]['image_thumbnail'], 'image_copyright' => $image_array[0]['image_copyright'], 'image_source' => $image_array[0]['image_source'], 'image_source_website' => $image_array[0]['image_source_website']));
             } else {
                 $data = array_merge($data, array('image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
             }
         } else {
             $data = array_merge($data, array('image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
         }
         $icao = '';
         if ($row['registration'] == '') {
             $row['registration'] = 'NA';
         }
         if ($row['ident'] == '') {
             $row['ident'] = 'NA';
         }
         $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 2));
         if (isset($identicao[0])) {
             if (substr($row['ident'], 0, 2) == 'AF') {
                 if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags" => FILTER_FLAG_ALLOW_OCTAL))) {
                     $icao = $row['ident'];
                 } else {
                     $icao = 'AFR' . ltrim(substr($row['ident'], 2), '0');
                 }
             } else {
                 $icao = $identicao[0]['icao'] . ltrim(substr($row['ident'], 2), '0');
             }
             $data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name']));
         } else {
             $icao = $row['ident'];
         }
         $icao = $Translation->checkTranslation($icao);
         $decode = json_decode($row['decode'], true);
         $found = false;
         if ($decode != '' && array_key_exists('Departure airport', $decode)) {
             $airport_info = $Spotter->getAllAirportInfo($decode['Departure airport']);
             if (isset($airport_info[0]['icao'])) {
                 $decode['Departure airport'] = '<a href="' . $globalURL . '/airport/' . $airport_info[0]['icao'] . '">' . $airport_info[0]['city'] . ',' . $airport_info[0]['country'] . ' (' . $airport_info[0]['icao'] . ')</a>';
             }
             $found = true;
         }
         if ($decode != '' && array_key_exists('Arrival airport', $decode)) {
             $airport_info = $Spotter->getAllAirportInfo($decode['Arrival airport']);
             if (isset($airport_info[0]['icao'])) {
                 $decode['Arrival airport'] = '<a href="' . $globalURL . '/airport/' . $airport_info[0]['icao'] . '">' . $airport_info[0]['city'] . ',' . $airport_info[0]['country'] . ' (' . $airport_info[0]['icao'] . ')</a>';
             }
             $found = true;
         }
         if ($decode != '' && array_key_exists('Airport/Waypoint name', $decode)) {
             $airport_info = $Spotter->getAllAirportInfo($decode['Airport/Waypoint name']);
             if (isset($airport_info[0]['icao'])) {
                 $decode['Airport/Waypoint name'] = '<a href="' . $globalURL . '/airport/' . $airport_info[0]['icao'] . '">' . $airport_info[0]['city'] . ',' . $airport_info[0]['country'] . ' (' . $airport_info[0]['icao'] . ')</a>';
                 $found = true;
             }
         }
//.........这里部分代码省略.........
开发者ID:linuxpronl,项目名称:FlightAirMap,代码行数:101,代码来源:class.ACARS.php

示例6: substr

         }
     }
     if (isset($output_history)) {
         $output_history = substr($output_history, 0, -1);
         $output_history .= ']}},';
         $output .= $output_history;
         unset($prev_alt);
         unset($output_history);
     }
 }
 if (isset($_GET['history']) && $_GET['history'] == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && (isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true" || !isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || isset($globalMapRoute) && $globalMapRoute))) {
     $output_air = '{"type": "Feature","properties": {"callsign": "' . $spotter_item['ident'] . '","type": "route"},"geometry": {"type": "LineString","coordinates": [';
     if (isset($spotter_item['departure_airport_latitude'])) {
         $output_air .= '[' . $spotter_item['departure_airport_longitude'] . ',' . $spotter_item['departure_airport_latitude'] . '],';
     } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
         $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
         //print_r($dairport);
         //echo $spotter_item['departure_airport'];
         if (isset($dairport[0]['latitude'])) {
             $output_air .= '[' . $dairport[0]['longitude'] . ',' . $dairport[0]['latitude'] . '],';
         }
     }
     if (isset($spotter_item['arrival_airport_latitude'])) {
         $output_air .= '[' . $spotter_item['arrival_airport_longitude'] . ',' . $spotter_item['arrival_airport_latitude'] . ']';
     } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
         //print_r($aairport);
         $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
         if (isset($aairport[0]['latitude'])) {
             $output_air .= '[' . $aairport[0]['longitude'] . ',' . $aairport[0]['latitude'] . ']';
         }
     }
开发者ID:linuxpronl,项目名称:FlightAirMap,代码行数:31,代码来源:live-geojson.php

示例7: explode

     $limit_explode = explode(",", $_GET['limit']);
     $limit_start = $limit_explode[0];
     $limit_end = $limit_explode[1];
 }
 $absolute_difference = abs($limit_start - $limit_end);
 $limit_next = $limit_end + $absolute_difference;
 $limit_previous_1 = $limit_start - $absolute_difference;
 $limit_previous_2 = $limit_end - $absolute_difference;
 $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
 $page_url = $globalURL . '/airport/' . $airport_icao;
 if (isset($_GET['sort'])) {
     $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start . "," . $absolute_difference, $_GET['sort']);
 } else {
     $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start . "," . $absolute_difference, '');
 }
 $airport_array = $Spotter->getAllAirportInfo($airport_icao);
 if (!empty($airport_array)) {
     if (isset($globalMETAR) && $globalMETAR) {
         $METAR = new METAR();
         $metar_info = $METAR->getMETAR($airport_icao);
         //print_r($metar_info);
         if (isset($metar_info[0]['metar'])) {
             $metar_parse = $METAR->parse($metar_info[0]['metar']);
         }
         //print_r($metar_parse);
     }
     $title = 'Detailed View for ' . $airport_array[0]['city'] . ', ' . $airport_array[0]['name'] . ' (' . $airport_array[0]['icao'] . ')';
     require 'header.php';
     print '<div class="select-item">';
     print '<form action="' . $globalURL . '/airport" method="post">';
     print '<select name="airport" class="selectpicker" data-live-search="true">';
开发者ID:linuxpronl,项目名称:FlightAirMap,代码行数:31,代码来源:airport-detailed.php


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