@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
49 | 49 | if (isset($globalTimezone)) { |
50 | 50 | date_default_timezone_set($globalTimezone); |
51 | - } else date_default_timezone_set('UTC'); |
|
51 | + } else { |
|
52 | + date_default_timezone_set('UTC'); |
|
53 | + } |
|
52 | 54 | |
53 | 55 | if (is_array($all_data) && count($all_data) > 1) { |
54 | 56 | print '<br/>'; |
@@ -327,9 +329,13 @@ discard block |
||
327 | 329 | print '<div>'; |
328 | 330 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
329 | 331 | { |
330 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
331 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
332 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
332 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
333 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
334 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
335 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
336 | + } else { |
|
337 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
338 | + } |
|
333 | 339 | } else { |
334 | 340 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
335 | 341 | { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
3 | 3 | if ($id == "") |
4 | 4 | { |
5 | 5 | header('Location: /'); |
@@ -16,30 +16,30 @@ discard block |
||
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - if(isset($spotter_array[0]['flightaware_id'])) { |
|
19 | + if (isset($spotter_array[0]['flightaware_id'])) { |
|
20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
21 | 21 | } |
22 | - if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
22 | + if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
23 | 23 | $latitude = $spotter_array[0]['last_latitude']; |
24 | - } elseif(isset($spotter_array[0]['latitude'])) { |
|
24 | + } elseif (isset($spotter_array[0]['latitude'])) { |
|
25 | 25 | $latitude = $spotter_array[0]['latitude']; |
26 | 26 | } |
27 | - if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
27 | + if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
28 | 28 | $longitude = $spotter_array[0]['last_longitude']; |
29 | - } elseif(isset($spotter_array[0]['longitude'])) { |
|
29 | + } elseif (isset($spotter_array[0]['longitude'])) { |
|
30 | 30 | $longitude = $spotter_array[0]['longitude']; |
31 | 31 | } |
32 | 32 | $title = ''; |
33 | - if(isset($spotter_array[0]['ident'])) { |
|
33 | + if (isset($spotter_array[0]['ident'])) { |
|
34 | 34 | $title .= $spotter_array[0]['ident']; |
35 | 35 | } |
36 | - if(isset($spotter_array[0]['airline_name'])) { |
|
36 | + if (isset($spotter_array[0]['airline_name'])) { |
|
37 | 37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
38 | 38 | } |
39 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
39 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
40 | 40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
41 | 41 | } |
42 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
42 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
43 | 43 | $title .= ' - '.$spotter_array[0]['registration']; |
44 | 44 | } |
45 | 45 | //$facebook_meta_image = $spotter_array[0]['image']; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $altitude_data = ''; |
60 | 60 | $hour_data = ''; |
61 | 61 | $speed_data = ''; |
62 | - foreach($all_data as $data) |
|
62 | + foreach ($all_data as $data) |
|
63 | 63 | { |
64 | 64 | $hour_data .= '"'.$data['date'].'",'; |
65 | 65 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $speed_data .= $speed.','; |
88 | 88 | } |
89 | 89 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
90 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
91 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
90 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
91 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
92 | 92 | print 'c3.generate({ |
93 | 93 | bindto: "#chart", |
94 | 94 | data: { |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
135 | 135 | } |
136 | 136 | } |
137 | - if(isset($spotter_array[0]['ident'])) { |
|
137 | + if (isset($spotter_array[0]['ident'])) { |
|
138 | 138 | print $spotter_array[0]['ident']; |
139 | 139 | } |
140 | - if(isset($spotter_array[0]['airline_name'])) { |
|
140 | + if (isset($spotter_array[0]['airline_name'])) { |
|
141 | 141 | print ' - '.$spotter_array[0]['airline_name']; |
142 | 142 | } |
143 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
143 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
144 | 144 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
145 | 145 | } |
146 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
146 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
147 | 147 | print ' - '.$spotter_array[0]['registration']; |
148 | 148 | } |
149 | 149 | print '</h1>'; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | print '</div>'; |
298 | 298 | */ |
299 | 299 | |
300 | - foreach($spotter_array as $spotter_item) |
|
300 | + foreach ($spotter_array as $spotter_item) |
|
301 | 301 | { |
302 | 302 | print '<div class="details">'; |
303 | 303 | print '<h3>'._("Flight Information").'</h3>'; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
398 | 398 | if ($spotter_item['departure_airport_time'] > 2460) { |
399 | 399 | print '<div class="time">'; |
400 | - print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
|
400 | + print 'at '.date('H:m', $spotter_item['departure_airport_time']); |
|
401 | 401 | print '</div>'; |
402 | 402 | } else { |
403 | 403 | print '<div class="time">'; |
@@ -547,19 +547,19 @@ discard block |
||
547 | 547 | if (count($departure_airport_info) > 0) { |
548 | 548 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
549 | 549 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
550 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
550 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
551 | 551 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
552 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
552 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
553 | 553 | } else { |
554 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
554 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
555 | 555 | } |
556 | 556 | } else { |
557 | 557 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
558 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
558 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
559 | 559 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
560 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
560 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
561 | 561 | } else { |
562 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
562 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 | } |
@@ -575,19 +575,19 @@ discard block |
||
575 | 575 | if (count($arrival_airport_info) > 0) { |
576 | 576 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
577 | 577 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
578 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
578 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
579 | 579 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
580 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
580 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
581 | 581 | } else { |
582 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
582 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
583 | 583 | } |
584 | 584 | } else { |
585 | 585 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
586 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
586 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
587 | 587 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
588 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
588 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
589 | 589 | } else { |
590 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
590 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
591 | 591 | } |
592 | 592 | } |
593 | 593 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | print '<div class="last-flights">'; |
607 | 607 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>'; |
608 | 608 | $hide_th_links = true; |
609 | - $spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", ""); |
|
609 | + $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,5", ""); |
|
610 | 610 | include('table-output.php'); |
611 | 611 | print '<div class="more">'; |
612 | 612 | print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $metar_info = $METAR->getMETAR($airport_icao); |
49 | 49 | //print_r($metar_info); |
50 | 50 | if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
51 | - //print_r($metar_parse); |
|
51 | + //print_r($metar_parse); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $airport = $airport_icao; |
33 | 33 | $page_url = $globalURL.'/airport/'.$airport_icao; |
34 | 34 | |
35 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
35 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
36 | 36 | if ($sort != '') { |
37 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort); |
|
38 | 38 | } else { |
39 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
39 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
40 | 40 | } |
41 | 41 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | //print_r($metar_parse); |
52 | 52 | } |
53 | 53 | |
54 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
54 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
55 | 55 | |
56 | 56 | require_once('header.php'); |
57 | 57 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | $airport_names = $Stats->getAllAirportNames(); |
64 | 64 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
65 | 65 | ksort($airport_names); |
66 | - foreach($airport_names as $airport_name) |
|
66 | + foreach ($airport_names as $airport_name) |
|
67 | 67 | { |
68 | - if($airport_icao == $airport_name['airport_icao']) |
|
68 | + if ($airport_icao == $airport_name['airport_icao']) |
|
69 | 69 | { |
70 | 70 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
71 | 71 | } else { |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | $date_data = ''; |
112 | 112 | $departure_data = ''; |
113 | 113 | $arrival_data = ''; |
114 | - foreach($all_data as $data) |
|
114 | + foreach ($all_data as $data) |
|
115 | 115 | { |
116 | 116 | $date_data .= '"'.$data['date'].'",'; |
117 | 117 | $departure_data .= $data['departure'].','; |
118 | 118 | $arrival_data .= $data['arrival'].','; |
119 | 119 | } |
120 | - $date_data = "['x',".substr($date_data,0,-1)."]"; |
|
121 | - $departure_data = "['departure',".substr($departure_data,0,-1)."]"; |
|
122 | - $arrival_data = "['arrival',".substr($arrival_data,0,-1)."]"; |
|
120 | + $date_data = "['x',".substr($date_data, 0, -1)."]"; |
|
121 | + $departure_data = "['departure',".substr($departure_data, 0, -1)."]"; |
|
122 | + $arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]"; |
|
123 | 123 | print 'c3.generate({ |
124 | 124 | bindto: "#chart", |
125 | 125 | data: { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
177 | 177 | } |
178 | 178 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
179 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
179 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
180 | 180 | print _("Humidity:").' '.$humidity.'%'." - "; |
181 | 181 | } |
182 | 182 | if (isset($metar_parse['QNH'])) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | print '<div class="table column">'; |
193 | 193 | if ($airport_array[0]['iata'] != "NA") |
194 | 194 | { |
195 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
195 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
196 | 196 | } |
197 | 197 | include('table-output.php'); |
198 | 198 | print '<div class="pagination">'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -47,7 +47,9 @@ discard block |
||
47 | 47 | $METAR = new METAR(); |
48 | 48 | $metar_info = $METAR->getMETAR($airport_icao); |
49 | 49 | //print_r($metar_info); |
50 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
50 | + if (isset($metar_info[0]['metar'])) { |
|
51 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
52 | + } |
|
51 | 53 | //print_r($metar_parse); |
52 | 54 | } |
53 | 55 | |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | print '<option></option>'; |
62 | 64 | $Stats = new Stats(); |
63 | 65 | $airport_names = $Stats->getAllAirportNames(); |
64 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
65 | 69 | ksort($airport_names); |
66 | 70 | foreach($airport_names as $airport_name) |
67 | 71 | { |
@@ -95,7 +99,9 @@ discard block |
||
95 | 99 | print '</div>'; |
96 | 100 | print '<div><span class="label">'._("Coordinates").'</span><a href="http://maps.google.ca/maps?z=10&t=k&q='.$airport_array[0]['latitude'].','.$airport_array[0]['longitude'].'" target="_blank">Google Map<i class="fa fa-angle-double-right"></i></a></div>'; |
97 | 101 | print '<div><span class="label">'._("Live Air Traffic").'</span><a href="http://www.liveatc.net/search/?icao='.$airport_array[0]['icao'].'" target="_blank">LiveATC.net<i class="fa fa-angle-double-right"></i></a></div>'; |
98 | - if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>'; |
|
102 | + if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') { |
|
103 | + print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>'; |
|
104 | + } |
|
99 | 105 | print '</div>'; |
100 | 106 | |
101 | 107 | $Stats = new Stats(); |
@@ -103,7 +109,9 @@ discard block |
||
103 | 109 | // Use spotter also |
104 | 110 | if (isset($globalTimezone)) { |
105 | 111 | date_default_timezone_set($globalTimezone); |
106 | - } else date_default_timezone_set('UTC'); |
|
112 | + } else { |
|
113 | + date_default_timezone_set('UTC'); |
|
114 | + } |
|
107 | 115 | if (count($all_data) > 0) { |
108 | 116 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
109 | 117 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
8 | 8 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
9 | 9 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
10 | 10 | |
11 | 11 | if (!empty($spotter_array)) |
12 | 12 | { |
13 | - $title = sprintf(_("Most Common Time of Day of aircraft with registration %s"),$registration); |
|
13 | + $title = sprintf(_("Most Common Time of Day of aircraft with registration %s"), $registration); |
|
14 | 14 | require_once('header.php'); |
15 | 15 | |
16 | 16 | print '<div class="info column">'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | include('registration-sub-menu.php'); |
24 | 24 | print '<div class="column">'; |
25 | 25 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
26 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."),$registration).'</p>'; |
|
26 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."), $registration).'</p>'; |
|
27 | 27 | |
28 | 28 | $hour_array = $Spotter->countAllHoursByRegistration($registration); |
29 | 29 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | $hour_data = ''; |
34 | 34 | $hour_cnt = ''; |
35 | 35 | $last = 0; |
36 | - foreach($hour_array as $hour_item) |
|
36 | + foreach ($hour_array as $hour_item) |
|
37 | 37 | { |
38 | - while($last != $hour_item['hour_name']) { |
|
38 | + while ($last != $hour_item['hour_name']) { |
|
39 | 39 | $hour_data .= '"'.$last.':00",'; |
40 | 40 | $hour_cnt .= '0,'; |
41 | 41 | $last++; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $hour_cnt .= $hour_item['hour_count'].','; |
46 | 46 | } |
47 | 47 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
48 | - $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
48 | + $hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
49 | 49 | print 'c3.generate({ |
50 | 50 | bindto: "#chartHour", |
51 | 51 | data: { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($hour_array as $hour_item) |
|
71 | + foreach ($hour_array as $hour_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td>'.$hour_item['hour_name'].':00</td>'; |
@@ -4,13 +4,13 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | 6 | $Spotter = new Spotter(); |
7 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
8 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
9 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
7 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
8 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
9 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
10 | 10 | |
11 | 11 | if (!empty($spotter_array)) |
12 | 12 | { |
13 | - $title = sprintf(_("Most Common Departure Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | + $title = sprintf(_("Most Common Departure Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
14 | 14 | |
15 | 15 | require_once('header.php'); |
16 | 16 | print '<div class="select-item">'; |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
29 | 29 | print '<br />'; |
30 | 30 | print '<div class="info column">'; |
31 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
31 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
32 | 32 | print '</div>'; |
33 | 33 | |
34 | 34 | include('date-sub-menu.php'); |
35 | 35 | print '<div class="column">'; |
36 | 36 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
37 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
37 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
38 | 38 | $airport_airport_array = $Spotter->countAllDepartureAirportsByDate($date); |
39 | 39 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
40 | 40 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | print '<script>'; |
44 | 44 | print 'var series = ['; |
45 | 45 | $airport_data = ''; |
46 | - foreach($airport_airport_array as $airport_item) |
|
46 | + foreach ($airport_airport_array as $airport_item) |
|
47 | 47 | { |
48 | 48 | $airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],'; |
49 | 49 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | print '</thead>'; |
99 | 99 | print '<tbody>'; |
100 | 100 | $i = 1; |
101 | - foreach($airport_airport_array as $airport_item) |
|
101 | + foreach ($airport_airport_array as $airport_item) |
|
102 | 102 | { |
103 | 103 | print '<tr>'; |
104 | 104 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | require_once('require/class.Spotter.php'); |
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | $Spotter = new Spotter(); |
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | -$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING); |
|
13 | -$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | +$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING); |
|
13 | +$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort); |
15 | 15 | |
16 | 16 | if (!empty($spotter_array)) |
17 | 17 | { |
18 | - $title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
18 | + $title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="info column">'; |
21 | 21 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | include('route-sub-menu.php'); |
27 | 27 | print '<div class="column">'; |
28 | 28 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
29 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
29 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
30 | 30 | |
31 | 31 | $airline_array = $Spotter->countAllAirlineCountriesByRoute($departure_airport, $arrival_airport); |
32 | 32 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
36 | 36 | print 'var series = ['; |
37 | 37 | $country_data = ''; |
38 | - foreach($airline_array as $airline_item) |
|
38 | + foreach ($airline_array as $airline_item) |
|
39 | 39 | { |
40 | 40 | $country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airline_item['airline_country_count'].'],'; |
41 | 41 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | print '</thead>'; |
83 | 83 | print '<tbody>'; |
84 | 84 | $i = 1; |
85 | - foreach($airline_array as $airline_item) |
|
85 | + foreach ($airline_array as $airline_item) |
|
86 | 86 | { |
87 | 87 | print '<tr>'; |
88 | 88 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Arrival Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | require_once('header.php'); |
14 | 14 | print '<div class="select-item">'; |
15 | 15 | print '<form action="'.$globalURL.'/date" method="post" class="form-inline">'; |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
27 | 27 | print '<br />'; |
28 | 28 | print '<div class="info column">'; |
29 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
29 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
30 | 30 | print '</div>'; |
31 | 31 | |
32 | 32 | include('date-sub-menu.php'); |
33 | 33 | print '<div class="column">'; |
34 | 34 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
35 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
35 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | 36 | |
37 | 37 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByDate($date); |
38 | 38 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
42 | 42 | print 'var series = ['; |
43 | 43 | $country_data = ''; |
44 | - foreach($airport_country_array as $airport_item) |
|
44 | + foreach ($airport_country_array as $airport_item) |
|
45 | 45 | { |
46 | 46 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
47 | 47 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | print '</thead>'; |
90 | 90 | print '<tbody>'; |
91 | 91 | $i = 1; |
92 | - foreach($airport_country_array as $airport_item) |
|
92 | + foreach ($airport_country_array as $airport_item) |
|
93 | 93 | { |
94 | 94 | print '<tr>'; |
95 | 95 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Time of Day on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Time of Day on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | require_once('header.php'); |
14 | 14 | print '<div class="select-item">'; |
15 | 15 | print '<form action="'.$globalURL.'/date" method="post" class="form-inline">'; |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
27 | 27 | print '<br />'; |
28 | 28 | print '<div class="info column">'; |
29 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
29 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
30 | 30 | print '</div>'; |
31 | 31 | |
32 | 32 | include('date-sub-menu.php'); |
33 | 33 | print '<div class="column">'; |
34 | 34 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
35 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
35 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | 36 | |
37 | 37 | $hour_array = $Spotter->countAllHoursByDate($date); |
38 | 38 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $hour_data = ''; |
43 | 43 | $hour_cnt = ''; |
44 | 44 | $last = 0; |
45 | - foreach($hour_array as $hour_item) |
|
45 | + foreach ($hour_array as $hour_item) |
|
46 | 46 | { |
47 | - while($last != $hour_item['hour_name']) { |
|
47 | + while ($last != $hour_item['hour_name']) { |
|
48 | 48 | $hour_data .= '"'.$last.':00",'; |
49 | 49 | $hour_cnt .= '0,'; |
50 | 50 | $last++; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $hour_cnt .= $hour_item['hour_count'].','; |
55 | 55 | } |
56 | 56 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
57 | - $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
57 | + $hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
58 | 58 | print 'c3.generate({ |
59 | 59 | bindto: "#chartHour", |
60 | 60 | data: { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | print '</thead>'; |
80 | 80 | print '<tbody>'; |
81 | 81 | $i = 1; |
82 | - foreach($hour_array as $hour_item) |
|
82 | + foreach ($hour_array as $hour_item) |
|
83 | 83 | { |
84 | 84 | print '<tr>'; |
85 | 85 | print '<td>'.$hour_item['hour_name'].':00</td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | |
14 | 14 | require_once('header.php'); |
15 | 15 | print '<div class="select-item">'; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
28 | 28 | print '<br />'; |
29 | 29 | print '<div class="info column">'; |
30 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
30 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
31 | 31 | print '</div>'; |
32 | 32 | |
33 | 33 | include('date-sub-menu.php'); |
34 | 34 | print '<div class="column">'; |
35 | 35 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
36 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
37 | 37 | $airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date); |
38 | 38 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
39 | 39 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | print '<script>'; |
43 | 43 | print 'var series = ['; |
44 | 44 | $airport_data = ''; |
45 | - foreach($airport_airport_array as $airport_item) |
|
45 | + foreach ($airport_airport_array as $airport_item) |
|
46 | 46 | { |
47 | 47 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
48 | 48 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | print '</thead>'; |
98 | 98 | print '<tbody>'; |
99 | 99 | $i = 1; |
100 | - foreach($airport_airport_array as $airport_item) |
|
100 | + foreach ($airport_airport_array as $airport_item) |
|
101 | 101 | { |
102 | 102 | print '<tr>'; |
103 | 103 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $title = _("Unknown Date"); |
123 | 123 | require_once('header.php'); |
124 | 124 | print '<h1>'._("Error").'</h1>'; |
125 | - print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>'; |
|
125 | + print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | require_once('footer.php'); |
@@ -177,7 +177,7 @@ |
||
177 | 177 | } else { |
178 | 178 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
179 | 179 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
180 | - $(".archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
180 | + $(".archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
181 | 181 | } |
182 | 182 | function TrackericonColor(color) { |
183 | 183 | document.cookie = 'TrackerIconColor='+color.substring(1)+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -90,7 +90,12 @@ discard block |
||
90 | 90 | <?php |
91 | 91 | } else { |
92 | 92 | ?> |
93 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
93 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
94 | + print $globalMapRefresh*2000; |
|
95 | +} else { |
|
96 | + print '60000'; |
|
97 | +} |
|
98 | +?>)) { |
|
94 | 99 | viewer.dataSources.get(dsn).entities.remove(entity); |
95 | 100 | czmldstracker.entities.removeById(entityid); |
96 | 101 | } |
@@ -173,7 +178,12 @@ discard block |
||
173 | 178 | function(){ |
174 | 179 | updateTrackerData(); |
175 | 180 | } |
176 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
181 | + ,<?php if (isset($globalMapRefresh)) { |
|
182 | + print $globalMapRefresh*1000; |
|
183 | +} else { |
|
184 | + print '30000'; |
|
185 | +} |
|
186 | +?>); |
|
177 | 187 | } else { |
178 | 188 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
179 | 189 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
@@ -98,21 +98,21 @@ discard block |
||
98 | 98 | var entityid = entity.id; |
99 | 99 | var lastupdateentity = entity.properties.valueOf('lastupdate')._lastupdate._value; |
100 | 100 | <?php |
101 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
101 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
102 | 102 | ?> |
103 | 103 | if (lastupdateentity != lastupdatetracker) { |
104 | 104 | viewer.dataSources.get(dsn).entities.remove(entity); |
105 | 105 | czmldstracker.entities.removeById(entityid); |
106 | 106 | } |
107 | 107 | <?php |
108 | - } else { |
|
108 | + } else { |
|
109 | 109 | ?> |
110 | 110 | if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
111 | 111 | viewer.dataSources.get(dsn).entities.remove(entity); |
112 | 112 | czmldstracker.entities.removeById(entityid); |
113 | 113 | } |
114 | 114 | <?php |
115 | - } |
|
115 | + } |
|
116 | 116 | ?> |
117 | 117 | } |
118 | 118 | } |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | function updateTrackerData() { |
146 | 146 | lastupdatetracker = Date.now(); |
147 | 147 | <?php |
148 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
148 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
149 | 149 | ?> |
150 | 150 | var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&coord='+bbox()+'&update=' + lastupdatetracker); |
151 | 151 | <?php |
152 | - } else { |
|
152 | + } else { |
|
153 | 153 | ?> |
154 | 154 | var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&update=' + lastupdatetracker); |
155 | 155 | <?php |
156 | - } |
|
156 | + } |
|
157 | 157 | ?> |
158 | 158 | livetrackerdata.then(function (data) { |
159 | 159 | displayTrackerData(data); |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
210 | 210 | camera.moveEnd.addEventListener(function() { |
211 | 211 | <?php |
212 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
212 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
213 | 213 | ?> |
214 | 214 | if (typeof archive == 'undefined' || archive == false) { |
215 | 215 | updateTrackerData(); |
216 | 216 | } |
217 | 217 | <?php |
218 | - } |
|
218 | + } |
|
219 | 219 | ?> |
220 | 220 | }); |
221 | 221 |