2 require_once('require/class.Connection.php');
3 require_once('require/class.Spotter.php');
4 require_once('require/class.Language.php');
5 $Spotter = new Spotter();
10 <meta charset
="UTF-8">
11 <title
>Spotter TV
</title
>
12 <meta name
="viewport" content
="width=device-width, initial-scale=1, maximum-scale=1">
13 <link rel
="shortcut icon" type
="image/x-icon" href
="<?php print $globalURL; ?>/favicon.ico">
14 <link rel
="apple-touch-icon" href
="<?php print $globalURL; ?>/images/touch-icon.png">
15 <link href
='http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel
='stylesheet' type
='text/css'>
17 <script type
="text/javascript" src
="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script
>
18 <script type
="text/javascript" src
="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script
>
20 <link rel
="stylesheet" href
="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
21 <script type
="text/javascript" src
="http://code.jquery.com/jquery-latest.min.js"></script
>
22 <script type
="text/javascript" src
="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script
>
23 <link href
="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel
="stylesheet">
24 <link type
="text/css" rel
="stylesheet" href
="<?php print $globalURL; ?>/css/style-tv.css?<?php print time(); ?>" />
30 if (isset($_GET['q']))
32 $q = filter_input(INPUT_GET
,'q',FILTER_SANITIZE_STRING
);
33 $spotter_array = $Spotter->searchSpotterData($q, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "0,10", "", "");
35 $spotter_array = $Spotter->getLatestSpotterData("0,10", "");
38 print '<div class="table-responsive">';
39 print '<table id="table-tv">';
41 foreach ($spotter_array as $spotter_item)
43 if (isset($globalTimezone)) {
44 date_default_timezone_set($globalTimezone);
46 date_default_timezone_set('UTC');
49 if (isset($_GET['image']) && $_GET['image'] == "true")
51 if ($spotter_item['image'] != "")
53 print '<td class="aircraft_image">';
54 print '<img src="'.$spotter_item['image'].'" alt="'._("Click to see more information about this flight").'" title="'._("Click to see more information about this flight").'" />';
57 print '<td class="aircraft_image">';
58 print '<img src="'.$globalURL.'/images/placeholder.png" alt="'._("Click to see more information about this flight").'" title="'._("Click to see more information about this flight").'" />';
62 if ($globalIVAO && (@getimagesize
('images/airlines/'.$spotter_item['airline_icao'].'.gif') || @getimagesize
($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.gif')))
64 print '<td class="logo">';
65 print '<img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.gif" />';
67 } elseif (@getimagesize
('images/airlines/'.$spotter_item['airline_icao'].'.png') || @getimagesize
($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png'))
69 print '<td class="logo">';
70 print '<img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png" />';
73 print '<td class="logo-no-image">';
74 if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != "")
76 print $spotter_item['airline_name'];
82 print '<td class="info">';
83 print '<div class="flight">';
84 print $spotter_item['departure_airport_city'].' ('.$spotter_item['departure_airport'].') <i class="fa fa-arrow-right"></i> '.$spotter_item['arrival_airport_city'].' ('.$spotter_item['arrival_airport'].')';
86 print '<div class="other1">';
87 if ($spotter_item['registration'] != "")
89 print '<span><i class="fa fa-align-justify"></i> '.$spotter_item['registration'].'</span>';
91 if ($spotter_item['aircraft_name'] != "")
93 print '<span><i class="fa fa-plane"></i> '.$spotter_item['aircraft_name'].'</span>';
95 if ($spotter_item['aircraft_type'] != "")
97 print '<span><i class="fa fa-plane"></i> '.$spotter_item['aircraft_type'].'</span>';
100 print '<span><i class="fa fa-calendar"></i> '.date("r", strtotime($spotter_item['date_iso_8601'])).'</span>';
102 print '<div class="other2">';
103 print '<span><i class="fa fa-arrow-up"></i> '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'];
104 if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') {
105 print ' ('.$spotter_item['departure_airport_time'].')';
108 print '<span><i class="fa fa-arrow-down"></i> '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'];
109 if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') {
110 print ' ('.$spotter_item['arrival_airport_time'].')';
114 print '<div class="other3">';
115 if ($spotter_item['ident'] != "")
117 print '<span><i class="fa fa-th-list"></i> '.$spotter_item['ident'].'</span>';
119 if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != "")
121 print '<span><i class="fa fa-align-justify"></i> '.$spotter_item['airline_name'].'</span>';
123 if ($spotter_item['airline_country'] != "")
125 print '<span><i class="fa fa-globe"></i> '.$spotter_item['airline_country'].'</span>';
137 $
( document
).ready(function() {
139 //loads the notification system every 16 seconds
140 setInterval( getNewDataTV
, 16000 );
142 //changes the information every 10 seconds
143 setInterval( changeInformation
, 10000 );
146 function getNewDataTV()
150 if (isset($_GET['image']) && isset($_GET['q'])) {
151 $image = filter_input(INPUT_GET
,'image',FILTER_SANITIZE_STRING
);
152 $q = filter_input(INPUT_GET
,'q',FILTER_SANITIZE_STRING
);
154 $
.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+
"&image=<?php print $image; ?>&q=<?php print $q; ?>", function( data
) {
156 } elseif (isset($_GET['image'])) {
157 $image = filter_input(INPUT_GET
,'image',FILTER_SANITIZE_STRING
);
159 $
.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+
"&image=<?php print $image; ?>", function( data
) {
161 } elseif (isset($_GET['q'])) {
162 $q = filter_input(INPUT_GET
,'q',FILTER_SANITIZE_STRING
);
164 $
.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+
"&q=<?php print $q; ?>", function( data
) {
168 $
.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+
"", function( data
) {
172 $
.each(data
.flights
, function(i
, item
) {
175 $
('#table-tv').prepend(item
.html
);
176 $
('#table-tr-'+item
.flight_id
).fadeIn();
177 $
('#table-tv tr:last').remove();
185 function changeInformation()
190 $
('.other1').fadeOut( "slow", function() {
191 $
('.other2').fadeIn();
194 } else if (other_i
== 2)
197 $
('.other2').fadeOut( "slow", function() {
198 $
('.other3').fadeIn();
201 } else if (other_i
== 3)
204 $
('.other3').fadeOut( "slow", function() {
205 $
('.other1').fadeIn();