本文整理汇总了PHP中Spotter::getAllAirlineNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Spotter::getAllAirlineNames方法的具体用法?PHP Spotter::getAllAirlineNames怎么用?PHP Spotter::getAllAirlineNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spotter
的用法示例。
在下文中一共展示了Spotter::getAllAirlineNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$spotter_array = Spotter::getSpotterDataByAirline($_GET['airline'], "0,1", "");
if (!empty($spotter_array)) {
$title = 'Most Common Aircraft from ' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')';
require 'header.php';
print '<div class="select-item">';
print '<form action="' . $globalURL . '/airline" method="post">';
print '<select name="airline" class="selectpicker" data-live-search="true">';
print '<option></option>';
$airline_names = Spotter::getAllAirlineNames();
foreach ($airline_names as $airline_name) {
if ($_GET['airline'] == $airline_name['airline_icao']) {
print '<option value="' . $airline_name['airline_icao'] . '" selected="selected">' . $airline_name['airline_name'] . ' (' . $airline_name['airline_icao'] . ')</option>';
} else {
print '<option value="' . $airline_name['airline_icao'] . '">' . $airline_name['airline_name'] . ' (' . $airline_name['airline_icao'] . ')</option>';
}
}
print '</select>';
print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
print '</form>';
print '</div>';
if ($_GET['airline'] != "NA") {
print '<div class="info column">';
print '<h1>' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')</h1>';
if ($globalIVAO && @getimagesize($globalURL . '/images/airlines/' . $spotter_array[0]['airline_icao'] . '.gif')) {
print '<img src="' . $globalURL . '/images/airlines/' . $spotter_array[0]['airline_icao'] . '.gif" alt="' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')" title="' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')" class="logo" />';
} elseif (@getimagesize($globalURL . '/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png')) {
print '<img src="' . $globalURL . '/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png" alt="' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')" title="' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')" class="logo" />';
示例2: header
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
if (isset($_POST['airline'])) {
header('Location: ' . $globalURL . '/airline/' . $_POST['airline']);
} else {
$title = "Airlines";
require 'header.php';
$Spotter = new Spotter();
print '<div class="column">';
print '<h1>Airlines</h1>';
if (isset($_POST['airline_type'])) {
$airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING);
$airline_names = $Spotter->getAllAirlineNames($airline_type);
} else {
$airline_names = $Spotter->getAllAirlineNames();
$airline_type = 'all';
}
print '<div class="select-item"><form action="' . $globalURL . '/airline" method="post"><select name="airline_type" class="selectpicker" data-live-search="true">';
print '<option value="all"';
if ($airline_type == 'all') {
print 'selected="selected" ';
}
print '>All</option><option value="passenger"';
if ($airline_type == 'passenger') {
print 'selected="selected" ';
}
print '>Passenger</option><option value="cargo"';
if ($airline_type == 'cargo') {
print 'selected="selected" ';
示例3: header
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
if (!isset($_GET['airline'])) {
header('Location: ' . $globalURL . '/airline');
die;
}
$Spotter = new Spotter();
$spotter_array = $Spotter->getSpotterDataByAirline($_GET['airline'], "0,1", "");
if (!empty($spotter_array)) {
$title = 'Most Common Time of Day from ' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')';
require 'header.php';
print '<div class="select-item">';
print '<form action="' . $globalURL . '/airline" method="post">';
print '<select name="airline" class="selectpicker" data-live-search="true">';
print '<option></option>';
$airline_names = $Spotter->getAllAirlineNames();
foreach ($airline_names as $airline_name) {
if ($_GET['airline'] == $airline_name['airline_icao']) {
print '<option value="' . $airline_name['airline_icao'] . '" selected="selected">' . $airline_name['airline_name'] . ' (' . $airline_name['airline_icao'] . ')</option>';
} else {
print '<option value="' . $airline_name['airline_icao'] . '">' . $airline_name['airline_name'] . ' (' . $airline_name['airline_icao'] . ')</option>';
}
}
print '</select>';
print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
print '</form>';
print '</div>';
if ($_GET['airline'] != "NA") {
print '<div class="info column">';
print '<h1>' . $spotter_array[0]['airline_name'] . ' (' . $spotter_array[0]['airline_icao'] . ')</h1>';
if ($globalIVAO && @getimagesize($globalURL . '/images/airlines/' . $spotter_array[0]['airline_icao'] . '.gif')) {