-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathgetLatestData.php
35 lines (29 loc) · 1.53 KB
/
getLatestData.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once('require/class.Connection.php');
require_once('require/class.Spotter.php');
require_once('require/class.Language.php');
header('Content-Type: text/javascript');
$Spotter = new Spotter();
$spotter_array = $Spotter->getRealTimeData();
print '{';
print '"airline_logo": "';
if (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
{
print 'http://'.$_SERVER['REMOTE_ADDR'].'/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://'.$_SERVER['REMOTE_ADDR'].'/flightid/'.$spotter_array[0]['spotter_id'].'",';
print '"html": "';
if (!empty($spotter_array))
{
print '<a href=\"http://'.$_SERVER['REMOTE_ADDR'].'/'.$spotter_array[0]['spotter_id'].'\">';
if (@getimagesize('http://'.$_SERVER['REMOTE_ADDR'].'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
{
print '<img src=\"http://'.$_SERVER['REMOTE_ADDR'].'/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 '}';
?>