本文整理匯總了PHP中Spotter::getRealTimeData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Spotter::getRealTimeData方法的具體用法?PHP Spotter::getRealTimeData怎麽用?PHP Spotter::getRealTimeData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Spotter
的用法示例。
在下文中一共展示了Spotter::getRealTimeData方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Spotter
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
header('Content-Type: text/javascript');
$Spotter = new Spotter();
$spotter_array = $Spotter->getRealTimeData();
print '{';
print '"airline_logo": "';
if (@getimagesize('http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png')) {
print 'http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png';
}
print '",';
print '"body": "' . $spotter_array[0]['ident'] . ' - ' . $spotter_array[0]['airline_name'] . ' | ' . $spotter_array[0]['aircraft_name'] . ' (' . $spotter_array[0]['aircraft_type'] . ') | ' . $spotter_array[0]['departure_airport'] . ' - ' . $spotter_array[0]['arrival_airport'] . '",';
print '"url": "http://www.barriespotter.com/flightid/' . $spotter_array[0]['spotter_id'] . '",';
print '"html": "';
if (!empty($spotter_array)) {
print '<a href=\\"http://www.barriespotter.com/flightid/' . $spotter_array[0]['spotter_id'] . '\\">';
if (@getimagesize('http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png')) {
print '<img src=\\"http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png\\" width=\\"50px\\" /> ';
}
print $spotter_array[0]['ident'] . ' - ' . $spotter_array[0]['airline_name'] . ' | ' . $spotter_array[0]['aircraft_name'] . ' (' . $spotter_array[0]['aircraft_type'] . ') | ' . $spotter_array[0]['departure_airport'] . ' - ' . $spotter_array[0]['arrival_airport'] . '</a>';
}
print '"';
print '}';
示例2: header
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
header('Content-Type: text/javascript');
$spotter_array = Spotter::getRealTimeData($_GET['q']);
$output = '{';
$output .= '"flights": [';
foreach ($spotter_array as $spotter_item) {
$output .= '{';
$output .= '"flight_id": "' . $spotter_item['spotter_id'] . '",';
$output .= '"html": "';
$output .= '<tr id=\\"table-tr-' . $spotter_item['spotter_id'] . '\\" style=\\"display:none;\\">';
if ($_GET['image'] == "true") {
if ($spotter_item['image'] != "") {
$output .= '<td class=\\"aircraft_image\\">';
$output .= '<img src=\\"' . $spotter_item['image'] . '\\" alt=\\"Click to see more information about this flight\\" title=\\"Click to see more information about this flight\\" />';
$output .= '</td>';
} else {
$output .= '<td class=\\"aircraft_image\\">';
$output .= '<img src=\\"' . $globalURL . '/images/placeholder.png\\" alt=\\"Click to see more information about this flight\\" title=\\"Click to see more information about this flight\\" />';
$output .= '</td>';
}
}
if ($globalIVAO && @getimagesize($globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.gif')) {
$output .= '<td class=\\"logo\\">';
$output .= '<img src=\\"' . $globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.gif\\" />';
$output .= '</td>';
} elseif (@getimagesize($globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.png')) {
$output .= '<td class=\\"logo\\">';
$output .= '<img src=\\"' . $globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.png\\" />';
示例3: header
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
header('Content-Type: text/javascript');
$spotter_array = Spotter::getRealTimeData();
print '{';
print '"airline_logo": "';
if (@getimagesize('http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png')) {
print 'http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png';
}
print '",';
print '"body": "' . $spotter_array[0]['ident'] . ' - ' . $spotter_array[0]['airline_name'] . ' | ' . $spotter_array[0]['aircraft_name'] . ' (' . $spotter_array[0]['aircraft_type'] . ') | ' . $spotter_array[0]['departure_airport'] . ' - ' . $spotter_array[0]['arrival_airport'] . '",';
print '"url": "http://www.barriespotter.com/flightid/' . $spotter_array[0]['spotter_id'] . '",';
print '"html": "';
if (!empty($spotter_array)) {
print '<a href=\\"http://www.barriespotter.com/flightid/' . $spotter_array[0]['spotter_id'] . '\\">';
if (@getimagesize('http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png')) {
print '<img src=\\"http://www.barriespotter.com/images/airlines/' . $spotter_array[0]['airline_icao'] . '.png\\" width=\\"50px\\" /> ';
}
print $spotter_array[0]['ident'] . ' - ' . $spotter_array[0]['airline_name'] . ' | ' . $spotter_array[0]['aircraft_name'] . ' (' . $spotter_array[0]['aircraft_type'] . ') | ' . $spotter_array[0]['departure_airport'] . ' - ' . $spotter_array[0]['arrival_airport'] . '</a>';
}
print '"';
print '}';
示例4: Spotter
<?php
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
header('Content-Type: text/javascript');
$Spotter = new Spotter();
$spotter_array = $Spotter->getRealTimeData($_GET['q']);
$output = '{';
$output .= '"flights": [';
foreach ($spotter_array as $spotter_item) {
$output .= '{';
$output .= '"flight_id": "' . $spotter_item['spotter_id'] . '",';
$output .= '"html": "';
$output .= '<tr id=\\"table-tr-' . $spotter_item['spotter_id'] . '\\" style=\\"display:none;\\">';
if ($_GET['image'] == "true") {
if ($spotter_item['image'] != "") {
$output .= '<td class=\\"aircraft_image\\">';
$output .= '<img src=\\"' . $spotter_item['image'] . '\\" alt=\\"Click to see more information about this flight\\" title=\\"Click to see more information about this flight\\" />';
$output .= '</td>';
} else {
$output .= '<td class=\\"aircraft_image\\">';
$output .= '<img src=\\"' . $globalURL . '/images/placeholder.png\\" alt=\\"Click to see more information about this flight\\" title=\\"Click to see more information about this flight\\" />';
$output .= '</td>';
}
}
if ($globalIVAO && @getimagesize($globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.gif')) {
$output .= '<td class=\\"logo\\">';
$output .= '<img src=\\"' . $globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.gif\\" />';
$output .= '</td>';
} elseif (@getimagesize($globalURL . '/images/airlines/' . $spotter_item['airline_icao'] . '.png')) {
$output .= '<td class=\\"logo\\">';