當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Spotter::getRealTimeData方法代碼示例

本文整理匯總了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 '}';
開發者ID:dedevillela,項目名稱:BravoHotelZulu,代碼行數:25,代碼來源:getLatestData.php

示例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\\" />';
開發者ID:hzmarrou,項目名稱:FlightAirMap,代碼行數:31,代碼來源:getLatestData-tv.php

示例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 '}';
開發者ID:hzmarrou,項目名稱:FlightAirMap,代碼行數:24,代碼來源:getLatestData.php

示例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\\">';
開發者ID:linuxpronl,項目名稱:FlightAirMap,代碼行數:31,代碼來源:getLatestData-tv.php


注:本文中的Spotter::getRealTimeData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。