@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | if (!isset($filter_name)) $filter_name = ''; |
26 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
26 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
27 | 27 | if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) { |
28 | 28 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
29 | 29 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $airline_info = $Spotter->getAllAirlineInfo($airline_icao); |
33 | 33 | if (isset($airline_info[0]['name'])) { |
34 | 34 | $airline_name = $airline_info[0]['name']; |
35 | - } elseif (strpos($airline_icao,'alliance_') !== FALSE) { |
|
35 | + } elseif (strpos($airline_icao, 'alliance_') !== FALSE) { |
|
36 | 36 | $alliance_name = $airline_icao; |
37 | 37 | } |
38 | 38 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $title = _("Statistics"); |
43 | 43 | } |
44 | 44 | |
45 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
46 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
45 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
46 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
47 | 47 | |
48 | 48 | require_once('header.php'); |
49 | 49 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | date_default_timezone_set('UTC'); |
75 | 75 | $lastupdate = strtotime($last_update[0]['value']); |
76 | 76 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
77 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
77 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | ?> |
@@ -86,31 +86,31 @@ discard block |
||
86 | 86 | <?php |
87 | 87 | if ($type == 'aircraft') { |
88 | 88 | ?> |
89 | - <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span> |
|
90 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
91 | - <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
92 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
89 | + <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span> |
|
90 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
91 | + <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
92 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
93 | 93 | <?php |
94 | 94 | if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
95 | 95 | ?> |
96 | - <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span> |
|
97 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
96 | + <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span> |
|
97 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
98 | 98 | <?php |
99 | 99 | } |
100 | 100 | if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
101 | 101 | ?> |
102 | - <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span> |
|
103 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
102 | + <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span> |
|
103 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
104 | 104 | <?php |
105 | 105 | } |
106 | 106 | ?> |
107 | - <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
|
108 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
107 | + <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
|
108 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
109 | 109 | <?php |
110 | 110 | if ($airline_icao == '') { |
111 | 111 | ?> |
112 | - <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span> |
|
113 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
112 | + <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span> |
|
113 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
114 | 114 | <?php |
115 | 115 | } |
116 | 116 | ?> |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | if (!(isset($globalVA) && $globalVA) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS) && !(isset($globalVAM) && $globalVAM)) { |
119 | 119 | if ($airline_icao == '' || $airline_icao == 'all') { |
120 | 120 | ?> |
121 | - <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span> |
|
122 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
121 | + <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span> |
|
122 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
123 | 123 | <?php |
124 | 124 | } |
125 | 125 | } |
@@ -127,22 +127,22 @@ discard block |
||
127 | 127 | <?php |
128 | 128 | } elseif ($type == 'marine') { |
129 | 129 | ?> |
130 | - <span><span class="badge"><?php print number_format($Marine->countOverallMarine(array(),$year,$month)); ?></span> <?php echo _("Vessels"); ?></span> |
|
131 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
132 | - <span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span> |
|
133 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
130 | + <span><span class="badge"><?php print number_format($Marine->countOverallMarine(array(), $year, $month)); ?></span> <?php echo _("Vessels"); ?></span> |
|
131 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
132 | + <span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span> |
|
133 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
134 | 134 | <?php |
135 | 135 | } elseif ($type == 'tracker') { |
136 | 136 | ?> |
137 | - <span><span class="badge"><?php print number_format($Tracker->countOverallTracker(array(),$year,$month)); ?></span> <?php echo _("Trackers"); ?></span> |
|
138 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
139 | - <span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span> |
|
140 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
137 | + <span><span class="badge"><?php print number_format($Tracker->countOverallTracker(array(), $year, $month)); ?></span> <?php echo _("Trackers"); ?></span> |
|
138 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
139 | + <span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span> |
|
140 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
141 | 141 | <?php |
142 | 142 | } |
143 | 143 | ?> |
144 | 144 | </p> |
145 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
145 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
146 | 146 | <div class="specific-stats"> |
147 | 147 | <?php |
148 | 148 | if ($type == 'aircraft') { |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | <div class="col-md-6"> |
152 | 152 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
153 | 153 | <?php |
154 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
154 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month); |
|
155 | 155 | if (count($aircraft_array) == 0) { |
156 | 156 | print _("No data available"); |
157 | 157 | } else { |
158 | 158 | print '<div id="chart1" class="chart" width="100%"></div><script>'; |
159 | 159 | $aircraft_data = ''; |
160 | - foreach($aircraft_array as $aircraft_item) { |
|
160 | + foreach ($aircraft_array as $aircraft_item) { |
|
161 | 161 | if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
162 | 162 | else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
163 | 163 | } |
@@ -186,16 +186,16 @@ discard block |
||
186 | 186 | ?> |
187 | 187 | </div> |
188 | 188 | </div> |
189 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
189 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
190 | 190 | <?php |
191 | 191 | if ($airline_icao == '' || $airline_icao == 'all') { |
192 | - $airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
|
192 | + $airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month); |
|
193 | 193 | if (count($airline_array) > 0) { |
194 | 194 | print '<div class="col-md-6">'; |
195 | 195 | print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
196 | 196 | print '<div id="chart2" class="chart" width="100%"></div><script>'; |
197 | 197 | $airline_data = ''; |
198 | - foreach($airline_array as $airline_item) { |
|
198 | + foreach ($airline_array as $airline_item) { |
|
199 | 199 | $airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
200 | 200 | } |
201 | 201 | $airline_data = substr($airline_data, 0, -1); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } |
221 | 221 | ?> |
222 | 222 | </div> |
223 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
223 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
224 | 224 | <?php |
225 | 225 | } |
226 | 226 | } |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | <div class="col-md-6"> |
233 | 233 | <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2> |
234 | 234 | <?php |
235 | - $marine_array = $Marine->countAllMarineTypes(true,0,'',array(),$year,$month); |
|
235 | + $marine_array = $Marine->countAllMarineTypes(true, 0, '', array(), $year, $month); |
|
236 | 236 | if (count($marine_array) == 0) print _("No data available"); |
237 | 237 | else { |
238 | 238 | print '<div id="chart1" class="chart" width="100%"></div><script>'; |
239 | 239 | $marine_data = ''; |
240 | - foreach($marine_array as $marine_item) { |
|
240 | + foreach ($marine_array as $marine_item) { |
|
241 | 241 | $marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],'; |
242 | 242 | } |
243 | 243 | $marine_data = substr($marine_data, 0, -1); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | ?> |
268 | 268 | </div> |
269 | 269 | </div> |
270 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
270 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
271 | 271 | <!-- </div>--> |
272 | 272 | <?php |
273 | 273 | } |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | <div class="col-md-6"> |
278 | 278 | <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2> |
279 | 279 | <?php |
280 | - $tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month); |
|
280 | + $tracker_array = $Tracker->countAllTrackerTypes(true, 0, '', array(), $year, $month); |
|
281 | 281 | if (count($tracker_array) == 0) print _("No data available"); |
282 | 282 | else { |
283 | 283 | print '<div id="chart1" class="chart" width="100%"></div><script>'; |
284 | 284 | $tracker_data = ''; |
285 | - foreach($tracker_array as $tracker_item) { |
|
285 | + foreach ($tracker_array as $tracker_item) { |
|
286 | 286 | $tracker_data .= '["'.$tracker_item['tracker_type'].'",'.$tracker_item['tracker_type_count'].'],'; |
287 | 287 | } |
288 | 288 | $tracker_data = substr($tracker_data, 0, -1); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | ?> |
313 | 313 | </div> |
314 | 314 | </div> |
315 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
315 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
316 | 316 | <!-- </div>--> |
317 | 317 | <?php |
318 | 318 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | else { |
328 | 328 | print '<div id="chart7" class="chart" width="100%"></div><script>'; |
329 | 329 | $owner_data = ''; |
330 | - foreach($owner_array as $owner_item) { |
|
330 | + foreach ($owner_array as $owner_item) { |
|
331 | 331 | $owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
332 | 332 | } |
333 | 333 | $owner_data = substr($owner_data, 0, -1); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | </div> |
348 | 348 | --> |
349 | 349 | </div> |
350 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
350 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
351 | 351 | <div class="col-md-6"> |
352 | 352 | <h2><?php echo _("Top 10 Most Common Countries Owners"); ?></h2> |
353 | 353 | <?php |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | else { |
357 | 357 | print '<div id="chart8" class="chart" width="100%"></div><script>'; |
358 | 358 | $owner_data = ''; |
359 | - foreach($countries_array as $owner_item) { |
|
359 | + foreach ($countries_array as $owner_item) { |
|
360 | 360 | $owner_data .= '["'.$owner_item['country_name'].'",'.$owner_item['country_count'].'],'; |
361 | 361 | } |
362 | 362 | $owner_data = substr($owner_data, 0, -1); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | --> |
378 | 378 | </div> |
379 | 379 | |
380 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
380 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
381 | 381 | ² </div> |
382 | 382 | <div class="row column"> |
383 | 383 | <div class="col-md-6"> |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | else { |
389 | 389 | print '<div id="chart9" class="chart" width="100%"></div><script>'; |
390 | 390 | $launch_site_data = ''; |
391 | - foreach($launch_site_array as $launch_site_item) { |
|
391 | + foreach ($launch_site_array as $launch_site_item) { |
|
392 | 392 | $launch_site_data .= '["'.$launch_site_item['launch_site'].'",'.$launch_site_item['launch_site_count'].'],'; |
393 | 393 | } |
394 | 394 | $launch_site_data = substr($launch_site_data, 0, -1); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ?> |
416 | 416 | <div class="row column"> |
417 | 417 | <?php |
418 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month); |
|
418 | + $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month); |
|
419 | 419 | //if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
420 | 420 | if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
421 | 421 | if (empty($flightover_array)) { |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | ?> |
427 | 427 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
428 | 428 | <?php |
429 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
|
429 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month); |
|
430 | 430 | if (count($pilot_array) == 0) print _("No data available"); |
431 | 431 | else { |
432 | 432 | print '<div id="chart7" class="chart" width="100%"></div><script>'; |
433 | 433 | $pilot_data = ''; |
434 | - foreach($pilot_array as $pilot_item) { |
|
434 | + foreach ($pilot_array as $pilot_item) { |
|
435 | 435 | $pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
436 | 436 | } |
437 | 437 | $pilot_data = substr($pilot_data, 0, -1); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | ?> |
453 | 453 | </div> |
454 | 454 | |
455 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
455 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
456 | 456 | <?php |
457 | 457 | } |
458 | 458 | // else { |
@@ -461,12 +461,12 @@ discard block |
||
461 | 461 | <div class="col-md-6"> |
462 | 462 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
463 | 463 | <?php |
464 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
|
464 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month); |
|
465 | 465 | if (count($owner_array) == 0) print _("No data available"); |
466 | 466 | else { |
467 | 467 | print '<div id="chart7" class="chart" width="100%"></div><script>'; |
468 | 468 | $owner_data = ''; |
469 | - foreach($owner_array as $owner_item) { |
|
469 | + foreach ($owner_array as $owner_item) { |
|
470 | 470 | $owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
471 | 471 | } |
472 | 472 | $owner_data = substr($owner_data, 0, -1); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | </div> |
486 | 486 | </div> |
487 | 487 | |
488 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
488 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
489 | 489 | <?php |
490 | 490 | } |
491 | 491 | if (!empty($flightover_array)) { |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | print '<div id="chart10" class="chart" width="100%"></div><script>'; |
500 | 500 | print 'var series = ['; |
501 | 501 | $flightover_data = ''; |
502 | - foreach($flightover_array as $flightover_item) { |
|
502 | + foreach ($flightover_array as $flightover_item) { |
|
503 | 503 | $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
504 | 504 | } |
505 | 505 | $flightover_data = substr($flightover_data, 0, -1); |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | ?> |
546 | 546 | </div> |
547 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
547 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
548 | 548 | </div> |
549 | 549 | <?php |
550 | 550 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | print '<div id="chart10" class="chart" width="100%"></div><script>'; |
561 | 561 | print 'var series = ['; |
562 | 562 | $flightover_data = ''; |
563 | - foreach($flightover_array as $flightover_item) { |
|
563 | + foreach ($flightover_array as $flightover_item) { |
|
564 | 564 | $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
565 | 565 | } |
566 | 566 | $flightover_data = substr($flightover_data, 0, -1); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | print '<div id="chart10" class="chart" width="100%"></div><script>'; |
618 | 618 | print 'var series = ['; |
619 | 619 | $flightover_data = ''; |
620 | - foreach($flightover_array as $flightover_item) { |
|
620 | + foreach ($flightover_array as $flightover_item) { |
|
621 | 621 | $flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],'; |
622 | 622 | } |
623 | 623 | $flightover_data = substr($flightover_data, 0, -1); |
@@ -667,14 +667,14 @@ discard block |
||
667 | 667 | <div class="row column"> |
668 | 668 | <div class="col-md-6"> |
669 | 669 | <?php |
670 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
670 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month); |
|
671 | 671 | if (count($airport_airport_array) > 0) { |
672 | 672 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
673 | 673 | print '<div id="chart3" class="chart" width="100%"></div><script>'; |
674 | 674 | print "\n"; |
675 | 675 | print 'var series = ['; |
676 | 676 | $airport_data = ''; |
677 | - foreach($airport_airport_array as $airport_item) { |
|
677 | + foreach ($airport_airport_array as $airport_item) { |
|
678 | 678 | $airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],'; |
679 | 679 | } |
680 | 680 | $airport_data = substr($airport_data, 0, -1); |
@@ -724,18 +724,18 @@ discard block |
||
724 | 724 | } |
725 | 725 | ?> |
726 | 726 | </div> |
727 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
727 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
728 | 728 | |
729 | 729 | <div class="col-md-6"> |
730 | 730 | <?php |
731 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
731 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month); |
|
732 | 732 | if (count($airport_airport_array2) > 0) { |
733 | 733 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
734 | 734 | print '<div id="chart4" class="chart" width="100%"></div><script>'; |
735 | 735 | print "\n"; |
736 | 736 | print 'var series = ['; |
737 | 737 | $airport_data = ''; |
738 | - foreach($airport_airport_array2 as $airport_item) |
|
738 | + foreach ($airport_airport_array2 as $airport_item) |
|
739 | 739 | { |
740 | 740 | if (isset($airport_item['airport_arrival_longitude']) && isset($airport_item['airport_arrival_latitude'])) { |
741 | 741 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | ?> |
790 | 790 | </div> |
791 | 791 | </div> |
792 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
792 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
793 | 793 | <?php |
794 | 794 | } |
795 | 795 | if ($type == 'aircraft') { |
@@ -801,18 +801,18 @@ discard block |
||
801 | 801 | <div class="col-md-6"> |
802 | 802 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
803 | 803 | <?php |
804 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
804 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
805 | 805 | if (count($year_array) == 0) print _("No data available"); |
806 | 806 | else { |
807 | 807 | print '<div id="chart8" class="chart" width="100%"></div><script>'; |
808 | 808 | $year_data = ''; |
809 | 809 | $year_cnt = ''; |
810 | - foreach($year_array as $year_item) { |
|
810 | + foreach ($year_array as $year_item) { |
|
811 | 811 | $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
812 | 812 | $year_cnt .= $year_item['date_count'].','; |
813 | 813 | } |
814 | 814 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
815 | - $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
|
815 | + $year_cnt = "['flights',".substr($year_cnt, 0, -1)."]"; |
|
816 | 816 | print 'c3.generate({ |
817 | 817 | bindto: "#chart8", |
818 | 818 | data: { x: "x", |
@@ -825,22 +825,22 @@ discard block |
||
825 | 825 | <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
826 | 826 | </div> |
827 | 827 | </div> |
828 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
828 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
829 | 829 | <div class="col-md-6"> |
830 | 830 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
831 | 831 | <?php |
832 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
832 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
833 | 833 | if (count($month_array) == 0) print _("No data available"); |
834 | 834 | else { |
835 | 835 | print '<div id="chart9" class="chart" width="100%"></div><script>'; |
836 | 836 | $month_data = ''; |
837 | 837 | $month_cnt = ''; |
838 | - foreach($month_array as $month_item) { |
|
838 | + foreach ($month_array as $month_item) { |
|
839 | 839 | $month_data .= '"'.$month_item['date_name'].'",'; |
840 | 840 | $month_cnt .= $month_item['date_count'].','; |
841 | 841 | } |
842 | 842 | $month_data = "['x',".substr($month_data, 0, -1)."]"; |
843 | - $month_cnt = "['flights',".substr($month_cnt,0,-1)."]"; |
|
843 | + $month_cnt = "['flights',".substr($month_cnt, 0, -1)."]"; |
|
844 | 844 | print 'c3.generate({ |
845 | 845 | bindto: "#chart9", |
846 | 846 | data: { x: "x", |
@@ -853,23 +853,23 @@ discard block |
||
853 | 853 | <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
854 | 854 | </div> |
855 | 855 | </div> |
856 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
856 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
857 | 857 | |
858 | 858 | <div class="col-md-6"> |
859 | 859 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
860 | 860 | <?php |
861 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
861 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
862 | 862 | if (empty($date_array)) print _("No data available"); |
863 | 863 | else { |
864 | 864 | print '<div id="chart5" class="chart" width="100%"></div><script>'; |
865 | 865 | $date_data = ''; |
866 | 866 | $date_cnt = ''; |
867 | - foreach($date_array as $date_item) { |
|
867 | + foreach ($date_array as $date_item) { |
|
868 | 868 | $date_data .= '"'.$date_item['date_name'].'",'; |
869 | 869 | $date_cnt .= $date_item['date_count'].','; |
870 | 870 | } |
871 | 871 | $date_data = "['x',".substr($date_data, 0, -1)."]"; |
872 | - $date_cnt = "['flights',".substr($date_cnt,0,-1)."]"; |
|
872 | + $date_cnt = "['flights',".substr($date_cnt, 0, -1)."]"; |
|
873 | 873 | print 'c3.generate({ |
874 | 874 | bindto: "#chart5", |
875 | 875 | data: { x: "x", |
@@ -882,22 +882,22 @@ discard block |
||
882 | 882 | <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
883 | 883 | </div> |
884 | 884 | </div> |
885 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
885 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
886 | 886 | <div class="col-md-6"> |
887 | 887 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
888 | 888 | <?php |
889 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
889 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
890 | 890 | if (empty($hour_array)) print _("No data available"); |
891 | 891 | else { |
892 | 892 | print '<div id="chart6" class="chart" width="100%"></div><script>'; |
893 | 893 | $hour_data = ''; |
894 | 894 | $hour_cnt = ''; |
895 | - foreach($hour_array as $hour_item) { |
|
895 | + foreach ($hour_array as $hour_item) { |
|
896 | 896 | $hour_data .= '"'.$hour_item['hour_name'].':00",'; |
897 | 897 | $hour_cnt .= $hour_item['hour_count'].','; |
898 | 898 | } |
899 | 899 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
900 | - $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
900 | + $hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
901 | 901 | print 'c3.generate({ |
902 | 902 | bindto: "#chart6", |
903 | 903 | data: { |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
911 | 911 | </div> |
912 | 912 | </div> |
913 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
913 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
914 | 914 | </div> |
915 | 915 | <?php |
916 | 916 | } |
@@ -926,18 +926,18 @@ discard block |
||
926 | 926 | <div class="col-md-6"> |
927 | 927 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
928 | 928 | <?php |
929 | - $year_array = $Marine->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
929 | + $year_array = $Marine->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
930 | 930 | if (count($year_array) == 0) print _("No data available"); |
931 | 931 | else { |
932 | 932 | print '<div id="chart8" class="chart" width="100%"></div><script>'; |
933 | 933 | $year_data = ''; |
934 | 934 | $year_cnt = ''; |
935 | - foreach($year_array as $year_item) { |
|
935 | + foreach ($year_array as $year_item) { |
|
936 | 936 | $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
937 | 937 | $year_cnt .= $year_item['date_count'].','; |
938 | 938 | } |
939 | 939 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
940 | - $year_cnt = "['vessels',".substr($year_cnt,0,-1)."]"; |
|
940 | + $year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]"; |
|
941 | 941 | print 'c3.generate({ |
942 | 942 | bindto: "#chart8", |
943 | 943 | data: { x: "x", |
@@ -951,22 +951,22 @@ discard block |
||
951 | 951 | </div> |
952 | 952 | </div> |
953 | 953 | |
954 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
954 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
955 | 955 | <div class="col-md-6"> |
956 | 956 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
957 | 957 | <?php |
958 | - $month_array = $Marine->countAllDatesLastMonth($airline_icao,$filter_name); |
|
958 | + $month_array = $Marine->countAllDatesLastMonth($airline_icao, $filter_name); |
|
959 | 959 | if (count($month_array) == 0) print _("No data available"); |
960 | 960 | else { |
961 | 961 | print '<div id="chart9" class="chart" width="100%"></div><script>'; |
962 | 962 | $month_data = ''; |
963 | 963 | $month_cnt = ''; |
964 | - foreach($month_array as $month_item) { |
|
964 | + foreach ($month_array as $month_item) { |
|
965 | 965 | $month_data .= '"'.$month_item['date_name'].'",'; |
966 | 966 | $month_cnt .= $month_item['date_count'].','; |
967 | 967 | } |
968 | 968 | $month_data = "['x',".substr($month_data, 0, -1)."]"; |
969 | - $month_cnt = "['vessels',".substr($month_cnt,0,-1)."]"; |
|
969 | + $month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]"; |
|
970 | 970 | print 'c3.generate({ |
971 | 971 | bindto: "#chart9", |
972 | 972 | data: { x: "x", |
@@ -979,23 +979,23 @@ discard block |
||
979 | 979 | <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
980 | 980 | </div> |
981 | 981 | </div> |
982 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
982 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
983 | 983 | |
984 | 984 | <div class="col-md-6"> |
985 | 985 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
986 | 986 | <?php |
987 | - $date_array = $Marine->countAllDatesLast7Days($airline_icao,$filter_name); |
|
987 | + $date_array = $Marine->countAllDatesLast7Days($airline_icao, $filter_name); |
|
988 | 988 | if (empty($date_array)) print _("No data available"); |
989 | 989 | else { |
990 | 990 | print '<div id="chart5" class="chart" width="100%"></div><script>'; |
991 | 991 | $date_data = ''; |
992 | 992 | $date_cnt = ''; |
993 | - foreach($date_array as $date_item) { |
|
993 | + foreach ($date_array as $date_item) { |
|
994 | 994 | $date_data .= '"'.$date_item['date_name'].'",'; |
995 | 995 | $date_cnt .= $date_item['date_count'].','; |
996 | 996 | } |
997 | 997 | $date_data = "['x',".substr($date_data, 0, -1)."]"; |
998 | - $date_cnt = "['vessels',".substr($date_cnt,0,-1)."]"; |
|
998 | + $date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]"; |
|
999 | 999 | print 'c3.generate({ |
1000 | 1000 | bindto: "#chart5", |
1001 | 1001 | data: { x: "x", |
@@ -1008,22 +1008,22 @@ discard block |
||
1008 | 1008 | <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1009 | 1009 | </div> |
1010 | 1010 | </div> |
1011 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1011 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1012 | 1012 | <div class="col-md-6"> |
1013 | 1013 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
1014 | 1014 | <?php |
1015 | - $hour_array = $Marine->countAllHours('hour',true,$airline_icao,$filter_name); |
|
1015 | + $hour_array = $Marine->countAllHours('hour', true, $airline_icao, $filter_name); |
|
1016 | 1016 | if (empty($hour_array)) print _("No data available"); |
1017 | 1017 | else { |
1018 | 1018 | print '<div id="chart6" class="chart" width="100%"></div><script>'; |
1019 | 1019 | $hour_data = ''; |
1020 | 1020 | $hour_cnt = ''; |
1021 | - foreach($hour_array as $hour_item) { |
|
1021 | + foreach ($hour_array as $hour_item) { |
|
1022 | 1022 | $hour_data .= '"'.$hour_item['hour_name'].':00",'; |
1023 | 1023 | $hour_cnt .= $hour_item['hour_count'].','; |
1024 | 1024 | } |
1025 | 1025 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
1026 | - $hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]"; |
|
1026 | + $hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]"; |
|
1027 | 1027 | print 'c3.generate({ |
1028 | 1028 | bindto: "#chart6", |
1029 | 1029 | data: { |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1037 | 1037 | </div> |
1038 | 1038 | </div> |
1039 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1039 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1040 | 1040 | </div> |
1041 | 1041 | <?php |
1042 | 1042 | } |
@@ -1058,12 +1058,12 @@ discard block |
||
1058 | 1058 | print '<div id="chart8" class="chart" width="100%"></div><script>'; |
1059 | 1059 | $year_data = ''; |
1060 | 1060 | $year_cnt = ''; |
1061 | - foreach($year_array as $year_item) { |
|
1061 | + foreach ($year_array as $year_item) { |
|
1062 | 1062 | $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
1063 | 1063 | $year_cnt .= $year_item['date_count'].','; |
1064 | 1064 | } |
1065 | 1065 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
1066 | - $year_cnt = "['trackers',".substr($year_cnt,0,-1)."]"; |
|
1066 | + $year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]"; |
|
1067 | 1067 | print 'c3.generate({ |
1068 | 1068 | bindto: "#chart8", |
1069 | 1069 | data: { x: "x", |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | </div> |
1078 | 1078 | </div> |
1079 | 1079 | |
1080 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1080 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1081 | 1081 | <div class="col-md-6"> |
1082 | 1082 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
1083 | 1083 | <?php |
@@ -1087,12 +1087,12 @@ discard block |
||
1087 | 1087 | print '<div id="chart9" class="chart" width="100%"></div><script>'; |
1088 | 1088 | $month_data = ''; |
1089 | 1089 | $month_cnt = ''; |
1090 | - foreach($month_array as $month_item) { |
|
1090 | + foreach ($month_array as $month_item) { |
|
1091 | 1091 | $month_data .= '"'.$month_item['date_name'].'",'; |
1092 | 1092 | $month_cnt .= $month_item['date_count'].','; |
1093 | 1093 | } |
1094 | 1094 | $month_data = "['x',".substr($month_data, 0, -1)."]"; |
1095 | - $month_cnt = "['trackers',".substr($month_cnt,0,-1)."]"; |
|
1095 | + $month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]"; |
|
1096 | 1096 | print 'c3.generate({ |
1097 | 1097 | bindto: "#chart9", |
1098 | 1098 | data: { x: "x", |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | <a href="<?php print $globalURL; ?>/tracker/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1106 | 1106 | </div> |
1107 | 1107 | </div> |
1108 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1108 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1109 | 1109 | |
1110 | 1110 | <div class="col-md-6"> |
1111 | 1111 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
@@ -1116,12 +1116,12 @@ discard block |
||
1116 | 1116 | print '<div id="chart5" class="chart" width="100%"></div><script>'; |
1117 | 1117 | $date_data = ''; |
1118 | 1118 | $date_cnt = ''; |
1119 | - foreach($date_array as $date_item) { |
|
1119 | + foreach ($date_array as $date_item) { |
|
1120 | 1120 | $date_data .= '"'.$date_item['date_name'].'",'; |
1121 | 1121 | $date_cnt .= $date_item['date_count'].','; |
1122 | 1122 | } |
1123 | 1123 | $date_data = "['x',".substr($date_data, 0, -1)."]"; |
1124 | - $date_cnt = "['trackers',".substr($date_cnt,0,-1)."]"; |
|
1124 | + $date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]"; |
|
1125 | 1125 | print 'c3.generate({ |
1126 | 1126 | bindto: "#chart5", |
1127 | 1127 | data: { x: "x", |
@@ -1134,22 +1134,22 @@ discard block |
||
1134 | 1134 | <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1135 | 1135 | </div> |
1136 | 1136 | </div> |
1137 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1137 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1138 | 1138 | <div class="col-md-6"> |
1139 | 1139 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
1140 | 1140 | <?php |
1141 | - $hour_array = $Tracker->countAllHours('hour',true); |
|
1141 | + $hour_array = $Tracker->countAllHours('hour', true); |
|
1142 | 1142 | if (empty($hour_array)) print _("No data available"); |
1143 | 1143 | else { |
1144 | 1144 | print '<div id="chart6" class="chart" width="100%"></div><script>'; |
1145 | 1145 | $hour_data = ''; |
1146 | 1146 | $hour_cnt = ''; |
1147 | - foreach($hour_array as $hour_item) { |
|
1147 | + foreach ($hour_array as $hour_item) { |
|
1148 | 1148 | $hour_data .= '"'.$hour_item['hour_name'].':00",'; |
1149 | 1149 | $hour_cnt .= $hour_item['hour_count'].','; |
1150 | 1150 | } |
1151 | 1151 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
1152 | - $hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]"; |
|
1152 | + $hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]"; |
|
1153 | 1153 | print 'c3.generate({ |
1154 | 1154 | bindto: "#chart6", |
1155 | 1155 | data: { |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1163 | 1163 | </div> |
1164 | 1164 | </div> |
1165 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1165 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1166 | 1166 | </div> |
1167 | 1167 | <?php |
1168 | 1168 | } |
@@ -1184,12 +1184,12 @@ discard block |
||
1184 | 1184 | print '<div id="chart21" class="chart" width="100%"></div><script>'; |
1185 | 1185 | $year_data = ''; |
1186 | 1186 | $year_cnt = ''; |
1187 | - foreach($year_array as $year_item) { |
|
1187 | + foreach ($year_array as $year_item) { |
|
1188 | 1188 | $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
1189 | 1189 | $year_cnt .= $year_item['date_count'].','; |
1190 | 1190 | } |
1191 | 1191 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
1192 | - $year_cnt = "['satellite',".substr($year_cnt,0,-1)."]"; |
|
1192 | + $year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]"; |
|
1193 | 1193 | print 'c3.generate({ |
1194 | 1194 | bindto: "#chart21", |
1195 | 1195 | data: { x: "x", |
@@ -1205,7 +1205,7 @@ discard block |
||
1205 | 1205 | --> |
1206 | 1206 | </div> |
1207 | 1207 | |
1208 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1208 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1209 | 1209 | <div class="col-md-6"> |
1210 | 1210 | <h2><?php echo _("Busiest Launch Years of the last 10 Years"); ?></h2> |
1211 | 1211 | <?php |
@@ -1215,12 +1215,12 @@ discard block |
||
1215 | 1215 | print '<div id="chart22" class="chart" width="100%"></div><script>'; |
1216 | 1216 | $year_data = ''; |
1217 | 1217 | $year_cnt = ''; |
1218 | - foreach($year_array as $year_item) { |
|
1218 | + foreach ($year_array as $year_item) { |
|
1219 | 1219 | $year_data .= '"'.$year_item['year_name'].'-01-01'.'",'; |
1220 | 1220 | $year_cnt .= $year_item['date_count'].','; |
1221 | 1221 | } |
1222 | 1222 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
1223 | - $year_cnt = "['satellite',".substr($year_cnt,0,-1)."]"; |
|
1223 | + $year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]"; |
|
1224 | 1224 | print 'c3.generate({ |
1225 | 1225 | bindto: "#chart22", |
1226 | 1226 | data: { x: "x", |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | --> |
1237 | 1237 | </div> |
1238 | 1238 | |
1239 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1239 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1240 | 1240 | </div> |
1241 | 1241 | <?php |
1242 | 1242 | } |
@@ -1258,12 +1258,12 @@ discard block |
||
1258 | 1258 | print '<div id="chart32" class="chart" width="100%"></div><script>'; |
1259 | 1259 | $year_data = ''; |
1260 | 1260 | $year_cnt = ''; |
1261 | - foreach($year_array as $year_item) { |
|
1261 | + foreach ($year_array as $year_item) { |
|
1262 | 1262 | $year_data .= '"'.$year_item['year'].'-01-01",'; |
1263 | 1263 | $year_cnt .= $year_item['count'].','; |
1264 | 1264 | } |
1265 | 1265 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
1266 | - $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
|
1266 | + $year_cnt = "['flights',".substr($year_cnt, 0, -1)."]"; |
|
1267 | 1267 | print 'c3.generate({ |
1268 | 1268 | bindto: "#chart32", |
1269 | 1269 | data: { x: "x", |
@@ -1276,7 +1276,7 @@ discard block |
||
1276 | 1276 | <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1277 | 1277 | </div> |
1278 | 1278 | </div> |
1279 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1279 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1280 | 1280 | |
1281 | 1281 | <div class="row column"> |
1282 | 1282 | <div class="col-md-6"> |
@@ -1288,12 +1288,12 @@ discard block |
||
1288 | 1288 | print '<div id="chart33" class="chart" width="100%"></div><script>'; |
1289 | 1289 | $year_data = ''; |
1290 | 1290 | $year_cnt = ''; |
1291 | - foreach($year_array as $year_item) { |
|
1291 | + foreach ($year_array as $year_item) { |
|
1292 | 1292 | $year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",'; |
1293 | 1293 | $year_cnt .= $year_item['count'].','; |
1294 | 1294 | } |
1295 | 1295 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
1296 | - $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
|
1296 | + $year_cnt = "['flights',".substr($year_cnt, 0, -1)."]"; |
|
1297 | 1297 | print 'c3.generate({ |
1298 | 1298 | bindto: "#chart33", |
1299 | 1299 | data: { x: "x", |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
1307 | 1307 | </div> |
1308 | 1308 | </div> |
1309 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1309 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1310 | 1310 | <br/> |
1311 | 1311 | <?php |
1312 | 1312 | } |
@@ -1320,19 +1320,19 @@ discard block |
||
1320 | 1320 | //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
1321 | 1321 | if ($year == '' && $month == '') { |
1322 | 1322 | if ($type == 'aircraft') { |
1323 | - $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
1323 | + $polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d')); |
|
1324 | 1324 | } elseif ($type == 'marine') { |
1325 | - $polar = $Stats->getStatsSource('polar_marine',date('Y'),date('m'),date('d')); |
|
1325 | + $polar = $Stats->getStatsSource('polar_marine', date('Y'), date('m'), date('d')); |
|
1326 | 1326 | } elseif ($type == 'tracker') { |
1327 | - $polar = $Stats->getStatsSource('polar_tracker',date('Y'),date('m'),date('d')); |
|
1327 | + $polar = $Stats->getStatsSource('polar_tracker', date('Y'), date('m'), date('d')); |
|
1328 | 1328 | } |
1329 | 1329 | } else { |
1330 | 1330 | if ($type == 'aircraft') { |
1331 | - $polar = $Stats->getStatsSource('polar',$year,$month); |
|
1331 | + $polar = $Stats->getStatsSource('polar', $year, $month); |
|
1332 | 1332 | } elseif ($type == 'marine') { |
1333 | - $polar = $Stats->getStatsSource('polar_marine',$year,$month); |
|
1333 | + $polar = $Stats->getStatsSource('polar_marine', $year, $month); |
|
1334 | 1334 | } elseif ($type == 'tracker') { |
1335 | - $polar = $Stats->getStatsSource('polar_tracker',$year,$month); |
|
1335 | + $polar = $Stats->getStatsSource('polar_tracker', $year, $month); |
|
1336 | 1336 | } |
1337 | 1337 | } |
1338 | 1338 | if (!empty($polar)) { |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | unset($polar_data); |
1342 | 1342 | $Spotter = new Spotter(); |
1343 | 1343 | $data = json_decode($eachpolar['source_data']); |
1344 | - foreach($data as $value => $key) { |
|
1344 | + foreach ($data as $value => $key) { |
|
1345 | 1345 | $direction = $Spotter->parseDirection(($value*22.5)); |
1346 | 1346 | $distance = $key; |
1347 | 1347 | $unit = 'km'; |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | ?> |
1362 | 1362 | <div class="col-md-6"> |
1363 | 1363 | <h4><?php print $eachpolar['source_name']; ?></h4> |
1364 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
1364 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
1365 | 1365 | <script> |
1366 | 1366 | (function() { |
1367 | 1367 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | color: color, |
1386 | 1386 | unit: '<?php echo $unit; ?>' |
1387 | 1387 | }; |
1388 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
1388 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
1389 | 1389 | })(); |
1390 | 1390 | </script> |
1391 | 1391 | </div> |
@@ -1400,19 +1400,19 @@ discard block |
||
1400 | 1400 | //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
1401 | 1401 | if ($year == '' && $month == '') { |
1402 | 1402 | if ($type == 'aircraft') { |
1403 | - $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
1403 | + $msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d')); |
|
1404 | 1404 | } elseif ($type == 'marine') { |
1405 | - $msg = $Stats->getStatsSource('msg_marine',date('Y'),date('m'),date('d')); |
|
1405 | + $msg = $Stats->getStatsSource('msg_marine', date('Y'), date('m'), date('d')); |
|
1406 | 1406 | } elseif ($type == 'tracker') { |
1407 | - $msg = $Stats->getStatsSource('msg_tracker',date('Y'),date('m'),date('d')); |
|
1407 | + $msg = $Stats->getStatsSource('msg_tracker', date('Y'), date('m'), date('d')); |
|
1408 | 1408 | } |
1409 | 1409 | } else { |
1410 | 1410 | if ($type == 'aircraft') { |
1411 | - $msg = $Stats->getStatsSource('msg',$year,$month); |
|
1411 | + $msg = $Stats->getStatsSource('msg', $year, $month); |
|
1412 | 1412 | } elseif ($type == 'marine') { |
1413 | - $msg = $Stats->getStatsSource('msg_marine',$year,$month); |
|
1413 | + $msg = $Stats->getStatsSource('msg_marine', $year, $month); |
|
1414 | 1414 | } elseif ($type == 'tracker') { |
1415 | - $msg = $Stats->getStatsSource('msg_tracker',$year,$month); |
|
1415 | + $msg = $Stats->getStatsSource('msg_tracker', $year, $month); |
|
1416 | 1416 | } |
1417 | 1417 | } |
1418 | 1418 | if (!empty($msg)) { |
@@ -1420,13 +1420,13 @@ discard block |
||
1420 | 1420 | foreach ($msg as $eachmsg) { |
1421 | 1421 | //$eachmsg = $msg[0]; |
1422 | 1422 | $data = $eachmsg['source_data']; |
1423 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
1423 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
1424 | 1424 | else $max = 500; |
1425 | 1425 | ?> |
1426 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
1426 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
1427 | 1427 | <script> |
1428 | 1428 | var g = new JustGage({ |
1429 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
1429 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
1430 | 1430 | value: <?php echo $data; ?>, |
1431 | 1431 | min: 0, |
1432 | 1432 | max: <?php print $max; ?>, |
@@ -1448,19 +1448,19 @@ discard block |
||
1448 | 1448 | //$hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
1449 | 1449 | if ($year == '' && $month == '') { |
1450 | 1450 | if ($type == 'aircraft') { |
1451 | - $hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d')); |
|
1451 | + $hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d')); |
|
1452 | 1452 | } elseif ($type == 'marine') { |
1453 | - $hist = $Stats->getStatsSource('hist_marine',date('Y'),date('m'),date('d')); |
|
1453 | + $hist = $Stats->getStatsSource('hist_marine', date('Y'), date('m'), date('d')); |
|
1454 | 1454 | } elseif ($type == 'tracker') { |
1455 | - $hist = $Stats->getStatsSource('hist_tracker',date('Y'),date('m'),date('d')); |
|
1455 | + $hist = $Stats->getStatsSource('hist_tracker', date('Y'), date('m'), date('d')); |
|
1456 | 1456 | } |
1457 | 1457 | } else { |
1458 | 1458 | if ($type == 'aircraft') { |
1459 | - $hist = $Stats->getStatsSource('hist',$year,$month); |
|
1459 | + $hist = $Stats->getStatsSource('hist', $year, $month); |
|
1460 | 1460 | } elseif ($type == 'marine') { |
1461 | - $hist = $Stats->getStatsSource('hist_marine',$year,$month); |
|
1461 | + $hist = $Stats->getStatsSource('hist_marine', $year, $month); |
|
1462 | 1462 | } elseif ($type == 'tracker') { |
1463 | - $hist = $Stats->getStatsSource('hist_tracker',$year,$month); |
|
1463 | + $hist = $Stats->getStatsSource('hist_tracker', $year, $month); |
|
1464 | 1464 | } |
1465 | 1465 | } |
1466 | 1466 | foreach ($hist as $hists) { |
@@ -1470,7 +1470,7 @@ discard block |
||
1470 | 1470 | $source = $hists['source_name']; |
1471 | 1471 | $hist_array = json_decode($hists['source_data']); |
1472 | 1472 | $unit = 'km'; |
1473 | - foreach($hist_array as $distance => $nb) { |
|
1473 | + foreach ($hist_array as $distance => $nb) { |
|
1474 | 1474 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
1475 | 1475 | $distance = round($distance*0.539957); |
1476 | 1476 | $unit = 'nm'; |
@@ -1490,18 +1490,18 @@ discard block |
||
1490 | 1490 | $nb_data = "['flights',".substr($nb_data, 0, -1)."]"; |
1491 | 1491 | ?> |
1492 | 1492 | <div class="col-md-6"> |
1493 | - <h2><?php echo sprintf(_("Distance for %s"),$source); ?></h2> |
|
1493 | + <h2><?php echo sprintf(_("Distance for %s"), $source); ?></h2> |
|
1494 | 1494 | <?php |
1495 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>'; |
|
1495 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>'; |
|
1496 | 1496 | print 'c3.generate({ |
1497 | - bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'", |
|
1497 | + bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'", |
|
1498 | 1498 | data: { x: "x", |
1499 | 1499 | columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
1500 | 1500 | axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});'; |
1501 | 1501 | print '</script>'; |
1502 | 1502 | ?> |
1503 | 1503 | </div> |
1504 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
1504 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
1505 | 1505 | <?php |
1506 | 1506 | } |
1507 | 1507 | ?> |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
7 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
6 | +$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
7 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
8 | 8 | if (isset($_GET['sort'])) $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
9 | 9 | else $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1"); |
10 | 10 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | if (!empty($spotter_array)) |
14 | 14 | { |
15 | - $title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"),$registration); |
|
15 | + $title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"), $registration); |
|
16 | 16 | require_once('header.php'); |
17 | 17 | |
18 | 18 | print '<div class="info column">'; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | print '<div class="column">'; |
27 | 27 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
28 | 28 | |
29 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>'; |
|
29 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>'; |
|
30 | 30 | $airport_airport_array = $Spotter->countAllDepartureAirportsByRegistration($registration); |
31 | 31 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
32 | 32 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | print '<script>'; |
36 | 36 | print 'var series = ['; |
37 | 37 | $airport_data = ''; |
38 | - foreach($airport_airport_array as $airport_item) |
|
38 | + foreach ($airport_airport_array as $airport_item) |
|
39 | 39 | { |
40 | 40 | if (isset($airport_item['airport_arrival_latitude']) && isset($airport_item['airport_arrival_longitude'])) { |
41 | 41 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | print '</thead>'; |
92 | 92 | print '<tbody>'; |
93 | 93 | $i = 1; |
94 | - foreach($airport_airport_array as $airport_item) |
|
94 | + foreach ($airport_airport_array as $airport_item) |
|
95 | 95 | { |
96 | 96 | print '<tr>'; |
97 | 97 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | require_once(dirname(__FILE__).'/class.Image.php'); |
5 | 5 | $global_query = "SELECT tracker_output.* FROM tracker_output"; |
6 | 6 | |
7 | -class Tracker{ |
|
7 | +class Tracker { |
|
8 | 8 | public $db; |
9 | 9 | |
10 | 10 | public function __construct($dbc = null) { |
@@ -19,33 +19,33 @@ discard block |
||
19 | 19 | * @return Array the SQL part |
20 | 20 | */ |
21 | 21 | |
22 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
22 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
23 | 23 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
24 | 24 | $filters = array(); |
25 | 25 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
26 | 26 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
27 | 27 | $filters = $globalStatsFilters[$globalFilterName]; |
28 | 28 | } else { |
29 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
29 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | if (isset($filter[0]['source'])) { |
33 | - $filters = array_merge($filters,$filter); |
|
33 | + $filters = array_merge($filters, $filter); |
|
34 | 34 | } |
35 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
35 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
36 | 36 | $filter_query_join = ''; |
37 | 37 | $filter_query_where = ''; |
38 | - foreach($filters as $flt) { |
|
38 | + foreach ($filters as $flt) { |
|
39 | 39 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
40 | 40 | if (isset($flt['source'])) { |
41 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','",$flt['idents'])."') AND tracker_output.format_source IN ('".implode("','",$flt['source'])."')) spfi ON spfi.famtrackid = tracker_output.famtrackid"; |
|
41 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','", $flt['idents'])."') AND tracker_output.format_source IN ('".implode("','", $flt['source'])."')) spfi ON spfi.famtrackid = tracker_output.famtrackid"; |
|
42 | 42 | } else { |
43 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','",$flt['idents'])."')) spfi ON spfi.famtrackid = tracker_output.famtrackid"; |
|
43 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','", $flt['idents'])."')) spfi ON spfi.famtrackid = tracker_output.famtrackid"; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
47 | 47 | if (isset($filter['source']) && !empty($filter['source'])) { |
48 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
48 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
49 | 49 | } |
50 | 50 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
51 | 51 | $filter_query_where .= " AND ident = '".$filter['ident']."'"; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
75 | 75 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
76 | 76 | if ($filter_query_where != '') { |
77 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
77 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
78 | 78 | } |
79 | 79 | $filter_query = $filter_query_join.$filter_query_where; |
80 | 80 | return $filter_query; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return Array the tracker information |
90 | 90 | * |
91 | 91 | */ |
92 | - public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
|
92 | + public function getDataFromDB($query, $params = array(), $limitQuery = '', $schedules = false) |
|
93 | 93 | { |
94 | 94 | date_default_timezone_set('UTC'); |
95 | 95 | if (!is_string($query)) |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | $sth = $this->db->prepare($query.$limitQuery); |
110 | 110 | $sth->execute($params); |
111 | 111 | } catch (PDOException $e) { |
112 | - printf("Invalid query : %s\nWhole query: %s\n",$e->getMessage(), $query.$limitQuery); |
|
112 | + printf("Invalid query : %s\nWhole query: %s\n", $e->getMessage(), $query.$limitQuery); |
|
113 | 113 | exit(); |
114 | 114 | } |
115 | 115 | |
116 | 116 | $num_rows = 0; |
117 | 117 | $tracker_array = array(); |
118 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
118 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
119 | 119 | { |
120 | 120 | $num_rows++; |
121 | 121 | $temp_array = array(); |
@@ -171,17 +171,17 @@ discard block |
||
171 | 171 | { |
172 | 172 | $temp_array['date'] = "about ".$dateArray['hours']." hours ago"; |
173 | 173 | } else { |
174 | - $temp_array['date'] = date("M j Y, g:i a",strtotime($row['date']." UTC")); |
|
174 | + $temp_array['date'] = date("M j Y, g:i a", strtotime($row['date']." UTC")); |
|
175 | 175 | } |
176 | 176 | $temp_array['date_minutes_past'] = $dateArray['minutes']; |
177 | - $temp_array['date_iso_8601'] = date("c",strtotime($row['date']." UTC")); |
|
178 | - $temp_array['date_rfc_2822'] = date("r",strtotime($row['date']." UTC")); |
|
177 | + $temp_array['date_iso_8601'] = date("c", strtotime($row['date']." UTC")); |
|
178 | + $temp_array['date_rfc_2822'] = date("r", strtotime($row['date']." UTC")); |
|
179 | 179 | $temp_array['date_unix'] = strtotime($row['date']." UTC"); |
180 | 180 | if (isset($row['last_seen']) && $row['last_seen'] != '') { |
181 | 181 | if (strtotime($row['last_seen']) > strtotime($row['date'])) { |
182 | 182 | $temp_array['duration'] = strtotime($row['last_seen']) - strtotime($row['date']); |
183 | - $temp_array['last_seen_date_iso_8601'] = date("c",strtotime($row['last_seen']." UTC")); |
|
184 | - $temp_array['last_seen_date_rfc_2822'] = date("r",strtotime($row['last_seen']." UTC")); |
|
183 | + $temp_array['last_seen_date_iso_8601'] = date("c", strtotime($row['last_seen']." UTC")); |
|
184 | + $temp_array['last_seen_date_rfc_2822'] = date("r", strtotime($row['last_seen']." UTC")); |
|
185 | 185 | $temp_array['last_seen_date_unix'] = strtotime($row['last_seen']." UTC"); |
186 | 186 | } |
187 | 187 | } |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | { |
219 | 219 | $limit_array = explode(",", $limit); |
220 | 220 | |
221 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
222 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
221 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
222 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
223 | 223 | |
224 | 224 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
225 | 225 | { |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | $orderby_query = " ORDER BY tracker_output.date DESC"; |
237 | 237 | } |
238 | 238 | |
239 | - $query = $global_query.$filter_query." ".$orderby_query; |
|
239 | + $query = $global_query.$filter_query." ".$orderby_query; |
|
240 | 240 | |
241 | - $tracker_array = $this->getDataFromDB($query, array(),$limit_query,true); |
|
241 | + $tracker_array = $this->getDataFromDB($query, array(), $limit_query, true); |
|
242 | 242 | |
243 | 243 | return $tracker_array; |
244 | 244 | } |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | if ($id == '') return array(); |
258 | 258 | $additional_query = "tracker_output.famtrackid = :id"; |
259 | 259 | $query_values = array(':id' => $id); |
260 | - $query = $global_query." WHERE ".$additional_query." "; |
|
261 | - $tracker_array = $this->getDataFromDB($query,$query_values); |
|
260 | + $query = $global_query." WHERE ".$additional_query." "; |
|
261 | + $tracker_array = $this->getDataFromDB($query, $query_values); |
|
262 | 262 | return $tracker_array; |
263 | 263 | } |
264 | 264 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $query_values = array(); |
278 | 278 | $limit_query = ''; |
279 | 279 | $additional_query = ''; |
280 | - $filter_query = $this->getFilter($filter,true,true); |
|
280 | + $filter_query = $this->getFilter($filter, true, true); |
|
281 | 281 | if ($ident != "") |
282 | 282 | { |
283 | 283 | if (!is_string($ident)) |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | { |
294 | 294 | $limit_array = explode(",", $limit); |
295 | 295 | |
296 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
297 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
296 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
297 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
298 | 298 | |
299 | 299 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
300 | 300 | { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | return $tracker_array; |
319 | 319 | } |
320 | 320 | |
321 | - public function getTrackerDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
|
321 | + public function getTrackerDataByDate($date = '', $limit = '', $sort = '', $filter = array()) |
|
322 | 322 | { |
323 | 323 | global $global_query, $globalTimezone, $globalDBdriver; |
324 | 324 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $limit_query = ''; |
327 | 327 | $additional_query = ''; |
328 | 328 | |
329 | - $filter_query = $this->getFilter($filter,true,true); |
|
329 | + $filter_query = $this->getFilter($filter, true, true); |
|
330 | 330 | |
331 | 331 | if ($date != "") |
332 | 332 | { |
@@ -352,8 +352,8 @@ discard block |
||
352 | 352 | { |
353 | 353 | $limit_array = explode(",", $limit); |
354 | 354 | |
355 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
356 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
355 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
356 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
357 | 357 | |
358 | 358 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
359 | 359 | { |
@@ -384,11 +384,11 @@ discard block |
||
384 | 384 | * @return Array list of source name |
385 | 385 | * |
386 | 386 | */ |
387 | - public function getAllSourceName($type = '',$filters = array()) |
|
387 | + public function getAllSourceName($type = '', $filters = array()) |
|
388 | 388 | { |
389 | - $filter_query = $this->getFilter($filters,true,true); |
|
389 | + $filter_query = $this->getFilter($filters, true, true); |
|
390 | 390 | $query_values = array(); |
391 | - $query = "SELECT DISTINCT tracker_output.source_name |
|
391 | + $query = "SELECT DISTINCT tracker_output.source_name |
|
392 | 392 | FROM tracker_output".$filter_query." tracker_output.source_name <> ''"; |
393 | 393 | if ($type != '') { |
394 | 394 | $query_values = array(':type' => $type); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $source_array = array(); |
404 | 404 | $temp_array = array(); |
405 | 405 | |
406 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
406 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
407 | 407 | { |
408 | 408 | $temp_array['source_name'] = $row['source_name']; |
409 | 409 | $source_array[] = $temp_array; |
@@ -420,8 +420,8 @@ discard block |
||
420 | 420 | */ |
421 | 421 | public function getAllIdents($filters = array()) |
422 | 422 | { |
423 | - $filter_query = $this->getFilter($filters,true,true); |
|
424 | - $query = "SELECT DISTINCT tracker_output.ident |
|
423 | + $filter_query = $this->getFilter($filters, true, true); |
|
424 | + $query = "SELECT DISTINCT tracker_output.ident |
|
425 | 425 | FROM tracker_output".$filter_query." tracker_output.ident <> '' |
426 | 426 | ORDER BY tracker_output.date ASC LIMIT 700 OFFSET 0"; |
427 | 427 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | $ident_array = array(); |
432 | 432 | $temp_array = array(); |
433 | 433 | |
434 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
434 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
435 | 435 | { |
436 | 436 | $temp_array['ident'] = $row['ident']; |
437 | 437 | $ident_array[] = $temp_array; |
@@ -456,12 +456,12 @@ discard block |
||
456 | 456 | } else $offset = '+00:00'; |
457 | 457 | |
458 | 458 | if ($globalDBdriver == 'mysql') { |
459 | - $query = "SELECT DISTINCT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) as date |
|
459 | + $query = "SELECT DISTINCT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) as date |
|
460 | 460 | FROM tracker_output |
461 | 461 | WHERE tracker_output.date <> '' |
462 | 462 | ORDER BY tracker_output.date ASC LIMIT 0,100"; |
463 | 463 | } else { |
464 | - $query = "SELECT DISTINCT to_char(tracker_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
464 | + $query = "SELECT DISTINCT to_char(tracker_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
465 | 465 | FROM tracker_output |
466 | 466 | WHERE tracker_output.date <> '' |
467 | 467 | ORDER BY tracker_output.date ASC LIMIT 0,100"; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $date_array = array(); |
474 | 474 | $temp_array = array(); |
475 | 475 | |
476 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
476 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
477 | 477 | { |
478 | 478 | $temp_array['date'] = $row['date']; |
479 | 479 | |
@@ -492,11 +492,11 @@ discard block |
||
492 | 492 | * @return String success or false |
493 | 493 | * |
494 | 494 | */ |
495 | - public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
|
495 | + public function updateIdentTrackerData($famtrackid = '', $ident = '', $fromsource = NULL) |
|
496 | 496 | { |
497 | 497 | |
498 | 498 | $query = 'UPDATE tracker_output SET ident = :ident WHERE famtrackid = :famtrackid'; |
499 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident); |
|
499 | + $query_values = array(':famtrackid' => $famtrackid, ':ident' => $ident); |
|
500 | 500 | |
501 | 501 | try { |
502 | 502 | $sth = $this->db->prepare($query); |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
521 | 521 | { |
522 | 522 | $query = 'UPDATE tracker_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_seen = :last_seen, last_ground_speed = :last_ground_speed WHERE famtrackid = :famtrackid'; |
523 | - $query_values = array(':famtrackid' => $famtrackid,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident); |
|
523 | + $query_values = array(':famtrackid' => $famtrackid, ':last_latitude' => $latitude, ':last_longitude' => $longitude, ':last_altitude' => $altitude, ':last_ground_speed' => $groundspeed, ':last_seen' => $date, ':ident' => $ident); |
|
524 | 524 | |
525 | 525 | try { |
526 | 526 | $sth = $this->db->prepare($query); |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | * @param String $verticalrate vertival rate of flight |
561 | 561 | * @return String success or false |
562 | 562 | */ |
563 | - public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
|
563 | + public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '', $format_source = '', $source_name = '') |
|
564 | 564 | { |
565 | 565 | global $globalURL; |
566 | 566 | |
@@ -628,21 +628,21 @@ discard block |
||
628 | 628 | } |
629 | 629 | |
630 | 630 | |
631 | - if ($date == "" || strtotime($date) < time()-20*60) |
|
631 | + if ($date == "" || strtotime($date) < time() - 20*60) |
|
632 | 632 | { |
633 | 633 | $date = date("Y-m-d H:i:s", time()); |
634 | 634 | } |
635 | 635 | |
636 | - $famtrackid = filter_var($famtrackid,FILTER_SANITIZE_STRING); |
|
637 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
638 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
639 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
640 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
641 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
642 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
643 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
644 | - $comment = filter_var($comment,FILTER_SANITIZE_STRING); |
|
645 | - $type = filter_var($type,FILTER_SANITIZE_STRING); |
|
636 | + $famtrackid = filter_var($famtrackid, FILTER_SANITIZE_STRING); |
|
637 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
638 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
639 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
640 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
641 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
642 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
643 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
644 | + $comment = filter_var($comment, FILTER_SANITIZE_STRING); |
|
645 | + $type = filter_var($type, FILTER_SANITIZE_STRING); |
|
646 | 646 | |
647 | 647 | if ($latitude == '' && $longitude == '') { |
648 | 648 | $latitude = 0; |
@@ -650,10 +650,10 @@ discard block |
||
650 | 650 | } |
651 | 651 | if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
652 | 652 | if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
653 | - $query = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) |
|
653 | + $query = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) |
|
654 | 654 | VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:speed,:date,:format_source, :source_name,:comment,:type)"; |
655 | 655 | |
656 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':speed' => $groundspeed,':date' => $date,':format_source' => $format_source, ':source_name' => $source_name,':comment' => $comment,':type' => $type); |
|
656 | + $query_values = array(':famtrackid' => $famtrackid, ':ident' => $ident, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':heading' => $heading, ':speed' => $groundspeed, ':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':comment' => $comment, ':type' => $type); |
|
657 | 657 | |
658 | 658 | try { |
659 | 659 | |
@@ -679,13 +679,13 @@ discard block |
||
679 | 679 | { |
680 | 680 | global $globalDBdriver, $globalTimezone; |
681 | 681 | if ($globalDBdriver == 'mysql') { |
682 | - $query = "SELECT tracker_output.ident FROM tracker_output |
|
682 | + $query = "SELECT tracker_output.ident FROM tracker_output |
|
683 | 683 | WHERE tracker_output.ident = :ident |
684 | 684 | AND tracker_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
685 | 685 | AND tracker_output.date < UTC_TIMESTAMP()"; |
686 | 686 | $query_data = array(':ident' => $ident); |
687 | 687 | } else { |
688 | - $query = "SELECT tracker_output.ident FROM tracker_output |
|
688 | + $query = "SELECT tracker_output.ident FROM tracker_output |
|
689 | 689 | WHERE tracker_output.ident = :ident |
690 | 690 | AND tracker_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
691 | 691 | AND tracker_output.date < now() AT TIME ZONE 'UTC'"; |
@@ -694,8 +694,8 @@ discard block |
||
694 | 694 | |
695 | 695 | $sth = $this->db->prepare($query); |
696 | 696 | $sth->execute($query_data); |
697 | - $ident_result=''; |
|
698 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
697 | + $ident_result = ''; |
|
698 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
699 | 699 | { |
700 | 700 | $ident_result = $row['ident']; |
701 | 701 | } |
@@ -721,8 +721,8 @@ discard block |
||
721 | 721 | return false; |
722 | 722 | } else { |
723 | 723 | $q_array = explode(" ", $q); |
724 | - foreach ($q_array as $q_item){ |
|
725 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
724 | + foreach ($q_array as $q_item) { |
|
725 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
726 | 726 | $additional_query .= " AND ("; |
727 | 727 | $additional_query .= "(tracker_output.ident like '%".$q_item."%')"; |
728 | 728 | $additional_query .= ")"; |
@@ -730,11 +730,11 @@ discard block |
||
730 | 730 | } |
731 | 731 | } |
732 | 732 | if ($globalDBdriver == 'mysql') { |
733 | - $query = "SELECT tracker_output.* FROM tracker_output |
|
733 | + $query = "SELECT tracker_output.* FROM tracker_output |
|
734 | 734 | WHERE tracker_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
735 | 735 | AND tracker_output.date < UTC_TIMESTAMP()"; |
736 | 736 | } else { |
737 | - $query = "SELECT tracker_output.* FROM tracker_output |
|
737 | + $query = "SELECT tracker_output.* FROM tracker_output |
|
738 | 738 | WHERE tracker_output.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
739 | 739 | AND tracker_output.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
740 | 740 | } |
@@ -748,16 +748,16 @@ discard block |
||
748 | 748 | * @return Array the airline country list |
749 | 749 | * |
750 | 750 | */ |
751 | - public function countAllTrackerOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
751 | + public function countAllTrackerOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
752 | 752 | { |
753 | 753 | global $globalDBdriver, $globalArchive; |
754 | 754 | //$filter_query = $this->getFilter($filters,true,true); |
755 | - $Connection= new Connection($this->db); |
|
755 | + $Connection = new Connection($this->db); |
|
756 | 756 | if (!$Connection->tableExists('countries')) return array(); |
757 | 757 | if (!isset($globalArchive) || $globalArchive !== TRUE) { |
758 | 758 | require_once('class.TrackerLive.php'); |
759 | 759 | $TrackerLive = new TrackerLive($this->db); |
760 | - $filter_query = $TrackerLive->getFilter($filters,true,true); |
|
760 | + $filter_query = $TrackerLive->getFilter($filters, true, true); |
|
761 | 761 | $filter_query .= " over_country IS NOT NULL AND over_country <> ''"; |
762 | 762 | if ($olderthanmonths > 0) { |
763 | 763 | if ($globalDBdriver == 'mysql') { |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } else { |
778 | 778 | require_once('class.TrackerArchive.php'); |
779 | 779 | $TrackerArchive = new TrackerArchive($this->db); |
780 | - $filter_query = $TrackerArchive->getFilter($filters,true,true); |
|
780 | + $filter_query = $TrackerArchive->getFilter($filters, true, true); |
|
781 | 781 | $filter_query .= " over_country IS NOT NULL AND over_country <> ''"; |
782 | 782 | if ($olderthanmonths > 0) { |
783 | 783 | if ($globalDBdriver == 'mysql') { |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $flight_array = array(); |
806 | 806 | $temp_array = array(); |
807 | 807 | |
808 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
808 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
809 | 809 | { |
810 | 810 | $temp_array['tracker_count'] = $row['nb']; |
811 | 811 | $temp_array['tracker_country'] = $row['name']; |
@@ -822,11 +822,11 @@ discard block |
||
822 | 822 | * @return Array the callsign list |
823 | 823 | * |
824 | 824 | */ |
825 | - public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
|
825 | + public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
826 | 826 | { |
827 | 827 | global $globalDBdriver; |
828 | - $filter_query = $this->getFilter($filters,true,true); |
|
829 | - $query = "SELECT DISTINCT tracker_output.ident, COUNT(tracker_output.ident) AS callsign_icao_count |
|
828 | + $filter_query = $this->getFilter($filters, true, true); |
|
829 | + $query = "SELECT DISTINCT tracker_output.ident, COUNT(tracker_output.ident) AS callsign_icao_count |
|
830 | 830 | FROM tracker_output".$filter_query." tracker_output.ident <> ''"; |
831 | 831 | if ($olderthanmonths > 0) { |
832 | 832 | if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
@@ -840,28 +840,28 @@ discard block |
||
840 | 840 | if ($year != '') { |
841 | 841 | if ($globalDBdriver == 'mysql') { |
842 | 842 | $query .= " AND YEAR(tracker_output.date) = :year"; |
843 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
843 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
844 | 844 | } else { |
845 | 845 | $query .= " AND EXTRACT(YEAR FROM tracker_output.date) = :year"; |
846 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
846 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
847 | 847 | } |
848 | 848 | } |
849 | 849 | if ($month != '') { |
850 | 850 | if ($globalDBdriver == 'mysql') { |
851 | 851 | $query .= " AND MONTH(tracker_output.date) = :month"; |
852 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
852 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
853 | 853 | } else { |
854 | 854 | $query .= " AND EXTRACT(MONTH FROM tracker_output.date) = :month"; |
855 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
855 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
856 | 856 | } |
857 | 857 | } |
858 | 858 | if ($day != '') { |
859 | 859 | if ($globalDBdriver == 'mysql') { |
860 | 860 | $query .= " AND DAY(tracker_output.date) = :day"; |
861 | - $query_values = array_merge($query_values,array(':day' => $day)); |
|
861 | + $query_values = array_merge($query_values, array(':day' => $day)); |
|
862 | 862 | } else { |
863 | 863 | $query .= " AND EXTRACT(DAY FROM tracker_output.date) = :day"; |
864 | - $query_values = array_merge($query_values,array(':day' => $day)); |
|
864 | + $query_values = array_merge($query_values, array(':day' => $day)); |
|
865 | 865 | } |
866 | 866 | } |
867 | 867 | $query .= " GROUP BY tracker_output.ident ORDER BY callsign_icao_count DESC"; |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | $callsign_array = array(); |
874 | 874 | $temp_array = array(); |
875 | 875 | |
876 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
876 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
877 | 877 | { |
878 | 878 | $temp_array['callsign_icao'] = $row['ident']; |
879 | 879 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | $date_array = array(); |
926 | 926 | $temp_array = array(); |
927 | 927 | |
928 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
928 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
929 | 929 | { |
930 | 930 | $temp_array['date_name'] = $row['date_name']; |
931 | 931 | $temp_array['date_count'] = $row['date_count']; |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | $datetime = new DateTime(); |
952 | 952 | $offset = $datetime->format('P'); |
953 | 953 | } else $offset = '+00:00'; |
954 | - $filter_query = $this->getFilter($filters,true,true); |
|
954 | + $filter_query = $this->getFilter($filters, true, true); |
|
955 | 955 | if ($globalDBdriver == 'mysql') { |
956 | 956 | $query = "SELECT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
957 | 957 | FROM tracker_output".$filter_query." tracker_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)"; |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | $date_array = array(); |
973 | 973 | $temp_array = array(); |
974 | 974 | |
975 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
975 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
976 | 976 | { |
977 | 977 | $temp_array['date_name'] = $row['date_name']; |
978 | 978 | $temp_array['date_count'] = $row['date_count']; |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | $datetime = new DateTime(); |
998 | 998 | $offset = $datetime->format('P'); |
999 | 999 | } else $offset = '+00:00'; |
1000 | - $filter_query = $this->getFilter($filters,true,true); |
|
1000 | + $filter_query = $this->getFilter($filters, true, true); |
|
1001 | 1001 | if ($globalDBdriver == 'mysql') { |
1002 | 1002 | $query = "SELECT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
1003 | 1003 | FROM tracker_output".$filter_query." tracker_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH)"; |
@@ -1018,7 +1018,7 @@ discard block |
||
1018 | 1018 | $date_array = array(); |
1019 | 1019 | $temp_array = array(); |
1020 | 1020 | |
1021 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1021 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1022 | 1022 | { |
1023 | 1023 | $temp_array['date_name'] = $row['date_name']; |
1024 | 1024 | $temp_array['date_count'] = $row['date_count']; |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | $date_array = array(); |
1066 | 1066 | $temp_array = array(); |
1067 | 1067 | |
1068 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1068 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1069 | 1069 | { |
1070 | 1070 | $temp_array['month_name'] = $row['month_name']; |
1071 | 1071 | $temp_array['year_name'] = $row['year_name']; |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | $datetime = new DateTime(); |
1095 | 1095 | $offset = $datetime->format('P'); |
1096 | 1096 | } else $offset = '+00:00'; |
1097 | - $filter_query = $this->getFilter($filters,true,true); |
|
1097 | + $filter_query = $this->getFilter($filters, true, true); |
|
1098 | 1098 | if ($globalDBdriver == 'mysql') { |
1099 | 1099 | $query = "SELECT MONTH(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count |
1100 | 1100 | FROM tracker_output".$filter_query." tracker_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | $date_array = array(); |
1116 | 1116 | $temp_array = array(); |
1117 | 1117 | |
1118 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1118 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1119 | 1119 | { |
1120 | 1120 | $temp_array['year_name'] = $row['year_name']; |
1121 | 1121 | $temp_array['month_name'] = $row['month_name']; |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | * @return Array the hour list |
1136 | 1136 | * |
1137 | 1137 | */ |
1138 | - public function countAllHours($orderby,$filters = array()) |
|
1138 | + public function countAllHours($orderby, $filters = array()) |
|
1139 | 1139 | { |
1140 | 1140 | global $globalTimezone, $globalDBdriver; |
1141 | 1141 | if ($globalTimezone != '') { |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | $hour_array = array(); |
1184 | 1184 | $temp_array = array(); |
1185 | 1185 | |
1186 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1186 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1187 | 1187 | { |
1188 | 1188 | $temp_array['hour_name'] = $row['hour_name']; |
1189 | 1189 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -1205,8 +1205,8 @@ discard block |
||
1205 | 1205 | public function countAllHoursByDate($date, $filters = array()) |
1206 | 1206 | { |
1207 | 1207 | global $globalTimezone, $globalDBdriver; |
1208 | - $filter_query = $this->getFilter($filters,true,true); |
|
1209 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
1208 | + $filter_query = $this->getFilter($filters, true, true); |
|
1209 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
1210 | 1210 | if ($globalTimezone != '') { |
1211 | 1211 | date_default_timezone_set($globalTimezone); |
1212 | 1212 | $datetime = new DateTime($date); |
@@ -1214,12 +1214,12 @@ discard block |
||
1214 | 1214 | } else $offset = '+00:00'; |
1215 | 1215 | |
1216 | 1216 | if ($globalDBdriver == 'mysql') { |
1217 | - $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1217 | + $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1218 | 1218 | FROM tracker_output".$filter_query." DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) = :date |
1219 | 1219 | GROUP BY hour_name |
1220 | 1220 | ORDER BY hour_name ASC"; |
1221 | 1221 | } else { |
1222 | - $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1222 | + $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1223 | 1223 | FROM tracker_output".$filter_query." to_char(tracker_output.date AT TIME ZONE INTERVAL :offset, 'YYYY-mm-dd') = :date |
1224 | 1224 | GROUP BY hour_name |
1225 | 1225 | ORDER BY hour_name ASC"; |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | $hour_array = array(); |
1232 | 1232 | $temp_array = array(); |
1233 | 1233 | |
1234 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1234 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1235 | 1235 | { |
1236 | 1236 | $temp_array['hour_name'] = $row['hour_name']; |
1237 | 1237 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -1253,8 +1253,8 @@ discard block |
||
1253 | 1253 | public function countAllHoursByIdent($ident, $filters = array()) |
1254 | 1254 | { |
1255 | 1255 | global $globalTimezone, $globalDBdriver; |
1256 | - $filter_query = $this->getFilter($filters,true,true); |
|
1257 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
1256 | + $filter_query = $this->getFilter($filters, true, true); |
|
1257 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
1258 | 1258 | if ($globalTimezone != '') { |
1259 | 1259 | date_default_timezone_set($globalTimezone); |
1260 | 1260 | $datetime = new DateTime(); |
@@ -1262,12 +1262,12 @@ discard block |
||
1262 | 1262 | } else $offset = '+00:00'; |
1263 | 1263 | |
1264 | 1264 | if ($globalDBdriver == 'mysql') { |
1265 | - $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1265 | + $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1266 | 1266 | FROM tracker_output".$filter_query." tracker_output.ident = :ident |
1267 | 1267 | GROUP BY hour_name |
1268 | 1268 | ORDER BY hour_name ASC"; |
1269 | 1269 | } else { |
1270 | - $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1270 | + $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1271 | 1271 | FROM tracker_output".$filter_query." tracker_output.ident = :ident |
1272 | 1272 | GROUP BY hour_name |
1273 | 1273 | ORDER BY hour_name ASC"; |
@@ -1275,12 +1275,12 @@ discard block |
||
1275 | 1275 | |
1276 | 1276 | |
1277 | 1277 | $sth = $this->db->prepare($query); |
1278 | - $sth->execute(array(':ident' => $ident,':offset' => $offset)); |
|
1278 | + $sth->execute(array(':ident' => $ident, ':offset' => $offset)); |
|
1279 | 1279 | |
1280 | 1280 | $hour_array = array(); |
1281 | 1281 | $temp_array = array(); |
1282 | 1282 | |
1283 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1283 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1284 | 1284 | { |
1285 | 1285 | $temp_array['hour_name'] = $row['hour_name']; |
1286 | 1286 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -1299,33 +1299,33 @@ discard block |
||
1299 | 1299 | * @return Integer the number of trackers |
1300 | 1300 | * |
1301 | 1301 | */ |
1302 | - public function countOverallTracker($filters = array(),$year = '',$month = '') |
|
1302 | + public function countOverallTracker($filters = array(), $year = '', $month = '') |
|
1303 | 1303 | { |
1304 | 1304 | global $globalDBdriver; |
1305 | 1305 | //$queryi = "SELECT COUNT(tracker_output.tracker_id) AS flight_count FROM tracker_output"; |
1306 | - $queryi = "SELECT COUNT(DISTINCT tracker_output.ident) AS tracker_count FROM tracker_output"; |
|
1306 | + $queryi = "SELECT COUNT(DISTINCT tracker_output.ident) AS tracker_count FROM tracker_output"; |
|
1307 | 1307 | $query_values = array(); |
1308 | 1308 | $query = ''; |
1309 | 1309 | if ($year != '') { |
1310 | 1310 | if ($globalDBdriver == 'mysql') { |
1311 | 1311 | $query .= " AND YEAR(tracker_output.date) = :year"; |
1312 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1312 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1313 | 1313 | } else { |
1314 | 1314 | $query .= " AND EXTRACT(YEAR FROM tracker_output.date) = :year"; |
1315 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1315 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1316 | 1316 | } |
1317 | 1317 | } |
1318 | 1318 | if ($month != '') { |
1319 | 1319 | if ($globalDBdriver == 'mysql') { |
1320 | 1320 | $query .= " AND MONTH(tracker_output.date) = :month"; |
1321 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1321 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1322 | 1322 | } else { |
1323 | 1323 | $query .= " AND EXTRACT(MONTH FROM tracker_output.date) = :month"; |
1324 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1324 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1325 | 1325 | } |
1326 | 1326 | } |
1327 | 1327 | if (empty($query_values)) $queryi .= $this->getFilter($filters); |
1328 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
1328 | + else $queryi .= $this->getFilter($filters, true, true).substr($query, 4); |
|
1329 | 1329 | |
1330 | 1330 | $sth = $this->db->prepare($queryi); |
1331 | 1331 | $sth->execute($query_values); |
@@ -1338,32 +1338,32 @@ discard block |
||
1338 | 1338 | * @return Integer the number of flights |
1339 | 1339 | * |
1340 | 1340 | */ |
1341 | - public function countOverallTrackerTypes($filters = array(),$year = '',$month = '') |
|
1341 | + public function countOverallTrackerTypes($filters = array(), $year = '', $month = '') |
|
1342 | 1342 | { |
1343 | 1343 | global $globalDBdriver; |
1344 | - $queryi = "SELECT COUNT(DISTINCT tracker_output.type) AS tracker_count FROM tracker_output"; |
|
1344 | + $queryi = "SELECT COUNT(DISTINCT tracker_output.type) AS tracker_count FROM tracker_output"; |
|
1345 | 1345 | $query_values = array(); |
1346 | 1346 | $query = ''; |
1347 | 1347 | if ($year != '') { |
1348 | 1348 | if ($globalDBdriver == 'mysql') { |
1349 | 1349 | $query .= " AND YEAR(tracker_output.date) = :year"; |
1350 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1350 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1351 | 1351 | } else { |
1352 | 1352 | $query .= " AND EXTRACT(YEAR FROM tracker_output.date) = :year"; |
1353 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1353 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1354 | 1354 | } |
1355 | 1355 | } |
1356 | 1356 | if ($month != '') { |
1357 | 1357 | if ($globalDBdriver == 'mysql') { |
1358 | 1358 | $query .= " AND MONTH(tracker_output.date) = :month"; |
1359 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1359 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1360 | 1360 | } else { |
1361 | 1361 | $query .= " AND EXTRACT(MONTH FROM tracker_output.date) = :month"; |
1362 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1362 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1363 | 1363 | } |
1364 | 1364 | } |
1365 | 1365 | if (empty($query_values)) $queryi .= $this->getFilter($filters); |
1366 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
1366 | + else $queryi .= $this->getFilter($filters, true, true).substr($query, 4); |
|
1367 | 1367 | |
1368 | 1368 | $sth = $this->db->prepare($queryi); |
1369 | 1369 | $sth->execute($query_values); |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | public function countAllHoursFromToday($filters = array()) |
1381 | 1381 | { |
1382 | 1382 | global $globalTimezone, $globalDBdriver; |
1383 | - $filter_query = $this->getFilter($filters,true,true); |
|
1383 | + $filter_query = $this->getFilter($filters, true, true); |
|
1384 | 1384 | if ($globalTimezone != '') { |
1385 | 1385 | date_default_timezone_set($globalTimezone); |
1386 | 1386 | $datetime = new DateTime(); |
@@ -1388,12 +1388,12 @@ discard block |
||
1388 | 1388 | } else $offset = '+00:00'; |
1389 | 1389 | |
1390 | 1390 | if ($globalDBdriver == 'mysql') { |
1391 | - $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1391 | + $query = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
1392 | 1392 | FROM tracker_output".$filter_query." DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) = CURDATE() |
1393 | 1393 | GROUP BY hour_name |
1394 | 1394 | ORDER BY hour_name ASC"; |
1395 | 1395 | } else { |
1396 | - $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1396 | + $query = "SELECT EXTRACT(HOUR FROM tracker_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
1397 | 1397 | FROM tracker_output".$filter_query." to_char(tracker_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = CAST(NOW() AS date) |
1398 | 1398 | GROUP BY hour_name |
1399 | 1399 | ORDER BY hour_name ASC"; |
@@ -1405,7 +1405,7 @@ discard block |
||
1405 | 1405 | $hour_array = array(); |
1406 | 1406 | $temp_array = array(); |
1407 | 1407 | |
1408 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1408 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1409 | 1409 | { |
1410 | 1410 | $temp_array['hour_name'] = $row['hour_name']; |
1411 | 1411 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -1424,9 +1424,9 @@ discard block |
||
1424 | 1424 | */ |
1425 | 1425 | public function getTrackerIDBasedOnFamTrackID($famtrackid) |
1426 | 1426 | { |
1427 | - $famtrackid = filter_var($famtrackid,FILTER_SANITIZE_STRING); |
|
1427 | + $famtrackid = filter_var($famtrackid, FILTER_SANITIZE_STRING); |
|
1428 | 1428 | |
1429 | - $query = "SELECT tracker_output.tracker_id |
|
1429 | + $query = "SELECT tracker_output.tracker_id |
|
1430 | 1430 | FROM tracker_output |
1431 | 1431 | WHERE tracker_output.famtrackid = '".$famtrackid."'"; |
1432 | 1432 | |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | $sth = $this->db->prepare($query); |
1435 | 1435 | $sth->execute(); |
1436 | 1436 | |
1437 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1437 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1438 | 1438 | { |
1439 | 1439 | return $row['tracker_id']; |
1440 | 1440 | } |
@@ -1459,23 +1459,23 @@ discard block |
||
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | $current_date = date("Y-m-d H:i:s"); |
1462 | - $date = date("Y-m-d H:i:s",strtotime($dateString." UTC")); |
|
1462 | + $date = date("Y-m-d H:i:s", strtotime($dateString." UTC")); |
|
1463 | 1463 | |
1464 | 1464 | $diff = abs(strtotime($current_date) - strtotime($date)); |
1465 | 1465 | |
1466 | - $time_array['years'] = floor($diff / (365*60*60*24)); |
|
1466 | + $time_array['years'] = floor($diff/(365*60*60*24)); |
|
1467 | 1467 | $years = $time_array['years']; |
1468 | 1468 | |
1469 | - $time_array['months'] = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); |
|
1469 | + $time_array['months'] = floor(($diff - $years*365*60*60*24)/(30*60*60*24)); |
|
1470 | 1470 | $months = $time_array['months']; |
1471 | 1471 | |
1472 | - $time_array['days'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); |
|
1472 | + $time_array['days'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24)/(60*60*24)); |
|
1473 | 1473 | $days = $time_array['days']; |
1474 | - $time_array['hours'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); |
|
1474 | + $time_array['hours'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/(60*60)); |
|
1475 | 1475 | $hours = $time_array['hours']; |
1476 | - $time_array['minutes'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60); |
|
1476 | + $time_array['minutes'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/60); |
|
1477 | 1477 | $minutes = $time_array['minutes']; |
1478 | - $time_array['seconds'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
1478 | + $time_array['seconds'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
1479 | 1479 | |
1480 | 1480 | return $time_array; |
1481 | 1481 | } |
@@ -1498,63 +1498,63 @@ discard block |
||
1498 | 1498 | $temp_array['direction_degree'] = $direction; |
1499 | 1499 | $temp_array['direction_shortname'] = "N"; |
1500 | 1500 | $temp_array['direction_fullname'] = "North"; |
1501 | - } elseif ($direction >= 22.5 && $direction < 45){ |
|
1501 | + } elseif ($direction >= 22.5 && $direction < 45) { |
|
1502 | 1502 | $temp_array['direction_degree'] = $direction; |
1503 | 1503 | $temp_array['direction_shortname'] = "NNE"; |
1504 | 1504 | $temp_array['direction_fullname'] = "North-Northeast"; |
1505 | - } elseif ($direction >= 45 && $direction < 67.5){ |
|
1505 | + } elseif ($direction >= 45 && $direction < 67.5) { |
|
1506 | 1506 | $temp_array['direction_degree'] = $direction; |
1507 | 1507 | $temp_array['direction_shortname'] = "NE"; |
1508 | 1508 | $temp_array['direction_fullname'] = "Northeast"; |
1509 | - } elseif ($direction >= 67.5 && $direction < 90){ |
|
1509 | + } elseif ($direction >= 67.5 && $direction < 90) { |
|
1510 | 1510 | $temp_array['direction_degree'] = $direction; |
1511 | 1511 | $temp_array['direction_shortname'] = "ENE"; |
1512 | 1512 | $temp_array['direction_fullname'] = "East-Northeast"; |
1513 | - } elseif ($direction >= 90 && $direction < 112.5){ |
|
1513 | + } elseif ($direction >= 90 && $direction < 112.5) { |
|
1514 | 1514 | $temp_array['direction_degree'] = $direction; |
1515 | 1515 | $temp_array['direction_shortname'] = "E"; |
1516 | 1516 | $temp_array['direction_fullname'] = "East"; |
1517 | - } elseif ($direction >= 112.5 && $direction < 135){ |
|
1517 | + } elseif ($direction >= 112.5 && $direction < 135) { |
|
1518 | 1518 | $temp_array['direction_degree'] = $direction; |
1519 | 1519 | $temp_array['direction_shortname'] = "ESE"; |
1520 | 1520 | $temp_array['direction_fullname'] = "East-Southeast"; |
1521 | - } elseif ($direction >= 135 && $direction < 157.5){ |
|
1521 | + } elseif ($direction >= 135 && $direction < 157.5) { |
|
1522 | 1522 | $temp_array['direction_degree'] = $direction; |
1523 | 1523 | $temp_array['direction_shortname'] = "SE"; |
1524 | 1524 | $temp_array['direction_fullname'] = "Southeast"; |
1525 | - } elseif ($direction >= 157.5 && $direction < 180){ |
|
1525 | + } elseif ($direction >= 157.5 && $direction < 180) { |
|
1526 | 1526 | $temp_array['direction_degree'] = $direction; |
1527 | 1527 | $temp_array['direction_shortname'] = "SSE"; |
1528 | 1528 | $temp_array['direction_fullname'] = "South-Southeast"; |
1529 | - } elseif ($direction >= 180 && $direction < 202.5){ |
|
1529 | + } elseif ($direction >= 180 && $direction < 202.5) { |
|
1530 | 1530 | $temp_array['direction_degree'] = $direction; |
1531 | 1531 | $temp_array['direction_shortname'] = "S"; |
1532 | 1532 | $temp_array['direction_fullname'] = "South"; |
1533 | - } elseif ($direction >= 202.5 && $direction < 225){ |
|
1533 | + } elseif ($direction >= 202.5 && $direction < 225) { |
|
1534 | 1534 | $temp_array['direction_degree'] = $direction; |
1535 | 1535 | $temp_array['direction_shortname'] = "SSW"; |
1536 | 1536 | $temp_array['direction_fullname'] = "South-Southwest"; |
1537 | - } elseif ($direction >= 225 && $direction < 247.5){ |
|
1537 | + } elseif ($direction >= 225 && $direction < 247.5) { |
|
1538 | 1538 | $temp_array['direction_degree'] = $direction; |
1539 | 1539 | $temp_array['direction_shortname'] = "SW"; |
1540 | 1540 | $temp_array['direction_fullname'] = "Southwest"; |
1541 | - } elseif ($direction >= 247.5 && $direction < 270){ |
|
1541 | + } elseif ($direction >= 247.5 && $direction < 270) { |
|
1542 | 1542 | $temp_array['direction_degree'] = $direction; |
1543 | 1543 | $temp_array['direction_shortname'] = "WSW"; |
1544 | 1544 | $temp_array['direction_fullname'] = "West-Southwest"; |
1545 | - } elseif ($direction >= 270 && $direction < 292.5){ |
|
1545 | + } elseif ($direction >= 270 && $direction < 292.5) { |
|
1546 | 1546 | $temp_array['direction_degree'] = $direction; |
1547 | 1547 | $temp_array['direction_shortname'] = "W"; |
1548 | 1548 | $temp_array['direction_fullname'] = "West"; |
1549 | - } elseif ($direction >= 292.5 && $direction < 315){ |
|
1549 | + } elseif ($direction >= 292.5 && $direction < 315) { |
|
1550 | 1550 | $temp_array['direction_degree'] = $direction; |
1551 | 1551 | $temp_array['direction_shortname'] = "WNW"; |
1552 | 1552 | $temp_array['direction_fullname'] = "West-Northwest"; |
1553 | - } elseif ($direction >= 315 && $direction < 337.5){ |
|
1553 | + } elseif ($direction >= 315 && $direction < 337.5) { |
|
1554 | 1554 | $temp_array['direction_degree'] = $direction; |
1555 | 1555 | $temp_array['direction_shortname'] = "NW"; |
1556 | 1556 | $temp_array['direction_fullname'] = "Northwest"; |
1557 | - } elseif ($direction >= 337.5 && $direction < 360){ |
|
1557 | + } elseif ($direction >= 337.5 && $direction < 360) { |
|
1558 | 1558 | $temp_array['direction_degree'] = $direction; |
1559 | 1559 | $temp_array['direction_shortname'] = "NNW"; |
1560 | 1560 | $temp_array['direction_fullname'] = "North-Northwest"; |
@@ -1571,11 +1571,11 @@ discard block |
||
1571 | 1571 | * @param Float $longitude longitute of the flight |
1572 | 1572 | * @return String the countrie |
1573 | 1573 | */ |
1574 | - public function getCountryFromLatitudeLongitude($latitude,$longitude) |
|
1574 | + public function getCountryFromLatitudeLongitude($latitude, $longitude) |
|
1575 | 1575 | { |
1576 | 1576 | global $globalDBdriver, $globalDebug; |
1577 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1578 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1577 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1578 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1579 | 1579 | |
1580 | 1580 | $Connection = new Connection($this->db); |
1581 | 1581 | if (!$Connection->tableExists('countries')) return ''; |
@@ -1615,7 +1615,7 @@ discard block |
||
1615 | 1615 | public function getCountryFromISO2($iso2) |
1616 | 1616 | { |
1617 | 1617 | global $globalDBdriver, $globalDebug; |
1618 | - $iso2 = filter_var($iso2,FILTER_SANITIZE_STRING); |
|
1618 | + $iso2 = filter_var($iso2, FILTER_SANITIZE_STRING); |
|
1619 | 1619 | |
1620 | 1620 | $Connection = new Connection($this->db); |
1621 | 1621 | if (!$Connection->tableExists('countries')) return ''; |
@@ -1644,11 +1644,11 @@ discard block |
||
1644 | 1644 | * @return Array the vessel type list |
1645 | 1645 | * |
1646 | 1646 | */ |
1647 | - public function countAllTrackerTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
|
1647 | + public function countAllTrackerTypes($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
1648 | 1648 | { |
1649 | 1649 | global $globalDBdriver; |
1650 | - $filter_query = $this->getFilter($filters,true,true); |
|
1651 | - $query = "SELECT tracker_output.type AS tracker_type, COUNT(tracker_output.type) AS tracker_type_count |
|
1650 | + $filter_query = $this->getFilter($filters, true, true); |
|
1651 | + $query = "SELECT tracker_output.type AS tracker_type, COUNT(tracker_output.type) AS tracker_type_count |
|
1652 | 1652 | FROM tracker_output ".$filter_query." tracker_output.type <> ''"; |
1653 | 1653 | if ($olderthanmonths > 0) { |
1654 | 1654 | if ($globalDBdriver == 'mysql') { |
@@ -1668,28 +1668,28 @@ discard block |
||
1668 | 1668 | if ($year != '') { |
1669 | 1669 | if ($globalDBdriver == 'mysql') { |
1670 | 1670 | $query .= " AND YEAR(tracker_output.date) = :year"; |
1671 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1671 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1672 | 1672 | } else { |
1673 | 1673 | $query .= " AND EXTRACT(YEAR FROM tracker_output.date) = :year"; |
1674 | - $query_values = array_merge($query_values,array(':year' => $year)); |
|
1674 | + $query_values = array_merge($query_values, array(':year' => $year)); |
|
1675 | 1675 | } |
1676 | 1676 | } |
1677 | 1677 | if ($month != '') { |
1678 | 1678 | if ($globalDBdriver == 'mysql') { |
1679 | 1679 | $query .= " AND MONTH(tracker_output.date) = :month"; |
1680 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1680 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1681 | 1681 | } else { |
1682 | 1682 | $query .= " AND EXTRACT(MONTH FROM tracker_output.date) = :month"; |
1683 | - $query_values = array_merge($query_values,array(':month' => $month)); |
|
1683 | + $query_values = array_merge($query_values, array(':month' => $month)); |
|
1684 | 1684 | } |
1685 | 1685 | } |
1686 | 1686 | if ($day != '') { |
1687 | 1687 | if ($globalDBdriver == 'mysql') { |
1688 | 1688 | $query .= " AND DAY(tracker_output.date) = :day"; |
1689 | - $query_values = array_merge($query_values,array(':day' => $day)); |
|
1689 | + $query_values = array_merge($query_values, array(':day' => $day)); |
|
1690 | 1690 | } else { |
1691 | 1691 | $query .= " AND EXTRACT(DAY FROM tracker_output.date) = :day"; |
1692 | - $query_values = array_merge($query_values,array(':day' => $day)); |
|
1692 | + $query_values = array_merge($query_values, array(':day' => $day)); |
|
1693 | 1693 | } |
1694 | 1694 | } |
1695 | 1695 | $query .= " GROUP BY tracker_output.type ORDER BY tracker_type_count DESC"; |
@@ -1698,7 +1698,7 @@ discard block |
||
1698 | 1698 | $sth->execute($query_values); |
1699 | 1699 | $tracker_array = array(); |
1700 | 1700 | $temp_array = array(); |
1701 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1701 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1702 | 1702 | { |
1703 | 1703 | $temp_array['tracker_type'] = $row['tracker_type']; |
1704 | 1704 | $temp_array['tracker_type_count'] = $row['tracker_type_count']; |
@@ -1713,13 +1713,13 @@ discard block |
||
1713 | 1713 | * @return Array the tracker information |
1714 | 1714 | * |
1715 | 1715 | */ |
1716 | - public function searchTrackerData($q = '', $callsign = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
|
1716 | + public function searchTrackerData($q = '', $callsign = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '', $origLat = '', $origLon = '', $dist = '', $filters = array()) |
|
1717 | 1717 | { |
1718 | 1718 | global $globalTimezone, $globalDBdriver; |
1719 | 1719 | date_default_timezone_set('UTC'); |
1720 | 1720 | $query_values = array(); |
1721 | 1721 | $additional_query = ''; |
1722 | - $filter_query = $this->getFilter($filters,true,true); |
|
1722 | + $filter_query = $this->getFilter($filters, true, true); |
|
1723 | 1723 | if ($q != "") |
1724 | 1724 | { |
1725 | 1725 | if (!is_string($q)) |
@@ -1727,8 +1727,8 @@ discard block |
||
1727 | 1727 | return false; |
1728 | 1728 | } else { |
1729 | 1729 | $q_array = explode(" ", $q); |
1730 | - foreach ($q_array as $q_item){ |
|
1731 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
1730 | + foreach ($q_array as $q_item) { |
|
1731 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
1732 | 1732 | $additional_query .= " AND ("; |
1733 | 1733 | if (is_int($q_item)) $additional_query .= "(tracker_output.tracker_id = '".$q_item."') OR "; |
1734 | 1734 | $additional_query .= "(tracker_output.ident like '%".$q_item."%') OR "; |
@@ -1738,20 +1738,20 @@ discard block |
||
1738 | 1738 | } |
1739 | 1739 | if ($callsign != "") |
1740 | 1740 | { |
1741 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
1741 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
1742 | 1742 | if (!is_string($callsign)) |
1743 | 1743 | { |
1744 | 1744 | return false; |
1745 | 1745 | } else { |
1746 | 1746 | $additional_query .= " AND tracker_output.ident = :callsign"; |
1747 | - $query_values = array_merge($query_values,array(':callsign' => $callsign)); |
|
1747 | + $query_values = array_merge($query_values, array(':callsign' => $callsign)); |
|
1748 | 1748 | } |
1749 | 1749 | } |
1750 | 1750 | if ($date_posted != "") |
1751 | 1751 | { |
1752 | 1752 | $date_array = explode(",", $date_posted); |
1753 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
1754 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
1753 | + $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
1754 | + $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
1755 | 1755 | if ($globalTimezone != '') { |
1756 | 1756 | date_default_timezone_set($globalTimezone); |
1757 | 1757 | $datetime = new DateTime(); |
@@ -1778,8 +1778,8 @@ discard block |
||
1778 | 1778 | if ($limit != "") |
1779 | 1779 | { |
1780 | 1780 | $limit_array = explode(",", $limit); |
1781 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1782 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1781 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
1782 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1783 | 1783 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
1784 | 1784 | { |
1785 | 1785 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
@@ -1797,22 +1797,22 @@ discard block |
||
1797 | 1797 | } |
1798 | 1798 | } |
1799 | 1799 | if ($origLat != "" && $origLon != "" && $dist != "") { |
1800 | - $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
1800 | + $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
1801 | 1801 | if ($globalDBdriver == 'mysql') { |
1802 | - $query="SELECT tracker_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - tracker_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(tracker_archive.latitude*pi()/180)*POWER(SIN(($origLon-tracker_archive.longitude)*pi()/180/2),2))) as distance |
|
1802 | + $query = "SELECT tracker_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - tracker_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(tracker_archive.latitude*pi()/180)*POWER(SIN(($origLon-tracker_archive.longitude)*pi()/180/2),2))) as distance |
|
1803 | 1803 | FROM tracker_archive,tracker_output".$filter_query." tracker_output.famtrackid = tracker_archive.famtrackid AND tracker_output.ident <> '' ".$additional_query."AND tracker_archive.longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and tracker_archive.latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
1804 | 1804 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - tracker_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(tracker_archive.latitude*pi()/180)*POWER(SIN(($origLon-tracker_archive.longitude)*pi()/180/2),2)))) < $dist".$orderby_query; |
1805 | 1805 | } else { |
1806 | - $query="SELECT tracker_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(tracker_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(tracker_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
1806 | + $query = "SELECT tracker_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(tracker_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(tracker_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
1807 | 1807 | FROM tracker_archive,tracker_output".$filter_query." tracker_output.famtrackid = tracker_archive.famtrackid AND tracker_output.ident <> '' ".$additional_query."AND CAST(tracker_archive.longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(tracker_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
1808 | 1808 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(tracker_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(tracker_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$filter_query.$orderby_query; |
1809 | 1809 | } |
1810 | 1810 | } else { |
1811 | - $query = "SELECT tracker_output.* FROM tracker_output".$filter_query." tracker_output.ident <> '' |
|
1811 | + $query = "SELECT tracker_output.* FROM tracker_output".$filter_query." tracker_output.ident <> '' |
|
1812 | 1812 | ".$additional_query." |
1813 | 1813 | ".$orderby_query; |
1814 | 1814 | } |
1815 | - $tracker_array = $this->getDataFromDB($query, $query_values,$limit_query); |
|
1815 | + $tracker_array = $this->getDataFromDB($query, $query_values, $limit_query); |
|
1816 | 1816 | return $tracker_array; |
1817 | 1817 | } |
1818 | 1818 | |
@@ -1837,7 +1837,7 @@ discard block |
||
1837 | 1837 | curl_close($ch); |
1838 | 1838 | $bitly_data = json_decode($bitly_data); |
1839 | 1839 | $bitly_url = ''; |
1840 | - if ($bitly_data->status_txt = "OK"){ |
|
1840 | + if ($bitly_data->status_txt = "OK") { |
|
1841 | 1841 | $bitly_url = $bitly_data->data->url; |
1842 | 1842 | } |
1843 | 1843 | return $bitly_url; |
@@ -1845,7 +1845,7 @@ discard block |
||
1845 | 1845 | |
1846 | 1846 | public function getOrderBy() |
1847 | 1847 | { |
1848 | - $orderby = array("type_asc" => array("key" => "type_asc", "value" => "Type - ASC", "sql" => "ORDER BY tracker_output.type ASC"), "type_desc" => array("key" => "type_desc", "value" => "Type - DESC", "sql" => "ORDER BY tracker_output.type DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY tracker_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY tracker_output.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY tracker_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY tracker_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY tracker_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY tracker_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY tracker_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY tracker_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY tracker_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY tracker_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY tracker_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY tracker_output.date DESC"),"distance_asc" => array("key" => "distance_asc","value" => "Distance - ASC","sql" => "ORDER BY distance ASC"),"distance_desc" => array("key" => "distance_desc","value" => "Distance - DESC","sql" => "ORDER BY distance DESC")); |
|
1848 | + $orderby = array("type_asc" => array("key" => "type_asc", "value" => "Type - ASC", "sql" => "ORDER BY tracker_output.type ASC"), "type_desc" => array("key" => "type_desc", "value" => "Type - DESC", "sql" => "ORDER BY tracker_output.type DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY tracker_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY tracker_output.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY tracker_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY tracker_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY tracker_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY tracker_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY tracker_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY tracker_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY tracker_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY tracker_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY tracker_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY tracker_output.date DESC"), "distance_asc" => array("key" => "distance_asc", "value" => "Distance - ASC", "sql" => "ORDER BY distance ASC"), "distance_desc" => array("key" => "distance_desc", "value" => "Distance - DESC", "sql" => "ORDER BY distance DESC")); |
|
1849 | 1849 | |
1850 | 1850 | return $orderby; |
1851 | 1851 |
@@ -7,21 +7,21 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING)); |
|
10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING)); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | $alliance = false; |
13 | -if (strpos($airline,'alliance_') !== FALSE) { |
|
13 | +if (strpos($airline, 'alliance_') !== FALSE) { |
|
14 | 14 | $alliance = true; |
15 | 15 | } else { |
16 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
16 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!empty($spotter_array) || $alliance === true) |
20 | 20 | { |
21 | 21 | if ($alliance) { |
22 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); |
|
22 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); |
|
23 | 23 | } else { |
24 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
24 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
25 | 25 | } |
26 | 26 | require_once('header.php'); |
27 | 27 | print '<div class="select-item">'; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $alliances = $Spotter->getAllAllianceNames(); |
32 | 32 | if (!empty($alliances)) { |
33 | 33 | foreach ($alliances as $al) { |
34 | - if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { |
|
35 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
34 | + if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { |
|
35 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
36 | 36 | } else { |
37 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; |
|
37 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | print '<option disabled>─────────────────</option>'; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $Stats = new Stats(); |
43 | 43 | $airline_names = $Stats->getAllAirlineNames(); |
44 | 44 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
45 | - foreach($airline_names as $airline_name) |
|
45 | + foreach ($airline_names as $airline_name) |
|
46 | 46 | { |
47 | - if($_GET['airline'] == $airline_name['airline_icao']) |
|
47 | + if ($_GET['airline'] == $airline_name['airline_icao']) |
|
48 | 48 | { |
49 | 49 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
50 | 50 | } else { |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | print '</div>'; |
79 | 79 | } else { |
80 | 80 | print '<div class="info column">'; |
81 | - print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; |
|
82 | - if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) |
|
81 | + print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; |
|
82 | + if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) |
|
83 | 83 | { |
84 | - print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; |
|
84 | + print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; |
|
85 | 85 | } |
86 | - print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; |
|
86 | + print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; |
|
87 | 87 | print '</div>'; |
88 | 88 | } |
89 | 89 | } else { |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | print '<div class="column">'; |
95 | 95 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
96 | 96 | if ($alliance) { |
97 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; |
|
97 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; |
|
98 | 98 | } else { |
99 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
99 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
100 | 100 | } |
101 | 101 | /* |
102 | 102 | if ($alliance) { |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirline($airline); |
106 | 106 | } |
107 | 107 | */ |
108 | - $airport_country_array = $Stats->countAllArrivalCountries(true,$airline); |
|
108 | + $airport_country_array = $Stats->countAllArrivalCountries(true, $airline); |
|
109 | 109 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
110 | 110 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
111 | 111 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
112 | 112 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
113 | 113 | print 'var series = ['; |
114 | 114 | $country_data = ''; |
115 | - foreach($airport_country_array as $airport_item) |
|
115 | + foreach ($airport_country_array as $airport_item) |
|
116 | 116 | { |
117 | 117 | $country_data .= '[ "'.$airport_item['airport_arrival_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
118 | 118 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | print '</thead>'; |
161 | 161 | print '<tbody>'; |
162 | 162 | $i = 1; |
163 | - foreach($airport_country_array as $airport_item) |
|
163 | + foreach ($airport_country_array as $airport_item) |
|
164 | 164 | { |
165 | 165 | print '<tr>'; |
166 | 166 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,21 +7,21 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING)); |
|
10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING)); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | $alliance = false; |
13 | -if (strpos($airline,'alliance_') !== FALSE) { |
|
13 | +if (strpos($airline, 'alliance_') !== FALSE) { |
|
14 | 14 | $alliance = true; |
15 | 15 | } else { |
16 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
16 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!empty($spotter_array) || $alliance === true) |
20 | 20 | { |
21 | 21 | if ($alliance) { |
22 | - $title = sprintf(_("Most Common Departure Airports by Country from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); |
|
22 | + $title = sprintf(_("Most Common Departure Airports by Country from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); |
|
23 | 23 | } else { |
24 | - $title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
24 | + $title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
25 | 25 | } |
26 | 26 | require_once('header.php'); |
27 | 27 | print '<div class="select-item">'; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $alliances = $Spotter->getAllAllianceNames(); |
32 | 32 | if (!empty($alliances)) { |
33 | 33 | foreach ($alliances as $al) { |
34 | - if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { |
|
35 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
34 | + if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { |
|
35 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
36 | 36 | } else { |
37 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; |
|
37 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | print '<option disabled>──────────────────</option>'; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $Stats = new Stats(); |
43 | 43 | $airline_names = $Stats->getAllAirlineNames(); |
44 | 44 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
45 | - foreach($airline_names as $airline_name) |
|
45 | + foreach ($airline_names as $airline_name) |
|
46 | 46 | { |
47 | - if($airline == $airline_name['airline_icao']) |
|
47 | + if ($airline == $airline_name['airline_icao']) |
|
48 | 48 | { |
49 | 49 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
50 | 50 | } else { |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | print '</div>'; |
79 | 79 | } else { |
80 | 80 | print '<div class="info column">'; |
81 | - print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; |
|
82 | - if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) |
|
81 | + print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; |
|
82 | + if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) |
|
83 | 83 | { |
84 | - print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; |
|
84 | + print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; |
|
85 | 85 | } |
86 | - print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; |
|
86 | + print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; |
|
87 | 87 | print '</div>'; |
88 | 88 | } |
89 | 89 | } else { |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | print '<div class="column">'; |
95 | 95 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
96 | 96 | if ($alliance) { |
97 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; |
|
97 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; |
|
98 | 98 | } else { |
99 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
99 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
100 | 100 | } |
101 | 101 | /* |
102 | 102 | if ($alliance) { |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByAirline($airline); |
106 | 106 | } |
107 | 107 | */ |
108 | - $airport_country_array = $Stats->countAllDepartureCountries(true,$airline); |
|
108 | + $airport_country_array = $Stats->countAllDepartureCountries(true, $airline); |
|
109 | 109 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
110 | 110 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
111 | 111 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
112 | 112 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
113 | 113 | print 'var series = ['; |
114 | 114 | $country_data = ''; |
115 | - foreach($airport_country_array as $airport_item) |
|
115 | + foreach ($airport_country_array as $airport_item) |
|
116 | 116 | { |
117 | 117 | $country_data .= '[ "'.$airport_item['airport_departure_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
118 | 118 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | print '</thead>'; |
160 | 160 | print '<tbody>'; |
161 | 161 | $i = 1; |
162 | - foreach($airport_country_array as $airport_item) |
|
162 | + foreach ($airport_country_array as $airport_item) |
|
163 | 163 | { |
164 | 164 | print '<tr>'; |
165 | 165 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | //require_once('require/class.SpotterLive.php'); |
8 | 8 | require_once('require/class.SpotterArchive.php'); |
9 | 9 | |
10 | -if (!isset($_GET['owner'])){ |
|
10 | +if (!isset($_GET['owner'])) { |
|
11 | 11 | header('Location: '.$globalURL.''); |
12 | 12 | } else { |
13 | 13 | $Spotter = new Spotter(); |
14 | 14 | $SpotterArchive = new SpotterArchive(); |
15 | 15 | //$Translation = new Translation(); |
16 | 16 | //calculuation for the pagination |
17 | - if(!isset($_GET['limit'])) |
|
17 | + if (!isset($_GET['limit'])) |
|
18 | 18 | { |
19 | 19 | $limit_start = 0; |
20 | 20 | $limit_end = 25; |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | } else { |
23 | 23 | $limit_explode = explode(",", $_GET['limit']); |
24 | 24 | if (isset($limit_explode[1])) { |
25 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
26 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
25 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
26 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
27 | 27 | } else { |
28 | 28 | $limit_start = 0; |
29 | 29 | $limit_end = 25; |
@@ -40,29 +40,29 @@ discard block |
||
40 | 40 | |
41 | 41 | $page_url = $globalURL.'/owner/'.$_GET['owner']; |
42 | 42 | |
43 | - $owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
44 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
45 | - $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
46 | - $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
43 | + $owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
44 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
45 | + $year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
46 | + $month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
47 | 47 | $filter = array(); |
48 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
49 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
48 | + if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
49 | + if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
50 | 50 | if ($sort != '') |
51 | 51 | { |
52 | - $spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
|
52 | + $spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter); |
|
53 | 53 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
54 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
|
54 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter); |
|
55 | 55 | } |
56 | 56 | } else { |
57 | - $spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter); |
|
57 | + $spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, '', $filter); |
|
58 | 58 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
59 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter); |
|
59 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, '', $filter); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | if (!empty($spotter_array)) |
64 | 64 | { |
65 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']); |
|
65 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['aircraft_owner']); |
|
66 | 66 | //$ident = $spotter_array[0]['ident']; |
67 | 67 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
68 | 68 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -122,23 +122,23 @@ discard block |
||
122 | 122 | $Stats = new Stats(); |
123 | 123 | if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner); |
124 | 124 | else $flights = 0; |
125 | - if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter); |
|
125 | + if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner, $filter); |
|
126 | 126 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
127 | - $aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter)); |
|
127 | + $aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner, $filter)); |
|
128 | 128 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
129 | - $aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner,$filter)); |
|
129 | + $aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner, $filter)); |
|
130 | 130 | print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>'; |
131 | - $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner,$filter)); |
|
131 | + $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner, $filter)); |
|
132 | 132 | print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>'; |
133 | - $airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter)); |
|
133 | + $airlines = count($Spotter->countAllAirlinesByOwner($owner, $filter)); |
|
134 | 134 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
135 | - $duration = $Spotter->getFlightDurationByOwner($owner,$filter); |
|
135 | + $duration = $Spotter->getFlightDurationByOwner($owner, $filter); |
|
136 | 136 | if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
137 | 137 | print '</div>'; |
138 | 138 | |
139 | 139 | include('owner-sub-menu.php'); |
140 | 140 | print '<div class="table column">'; |
141 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
141 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
142 | 142 | |
143 | 143 | include('table-output.php'); |
144 | 144 | print '<div class="pagination">'; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['country'])){ |
|
6 | +if (!isset($_GET['country'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | if (isset($limit_explode[1])) { |
19 | 19 | $limit_start = $limit_explode[0]; |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $limit_previous_1 = $limit_start - $absolute_difference; |
33 | 33 | $limit_previous_2 = $limit_end - $absolute_difference; |
34 | 34 | |
35 | - $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
35 | + $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
36 | 36 | |
37 | 37 | $page_url = $globalURL.'/country/'.$_GET['country']; |
38 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
38 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
39 | 39 | if ($country == 'Na') { |
40 | 40 | $spotter_array = array(); |
41 | 41 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | if (!empty($spotter_array)) |
50 | 50 | { |
51 | - $title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); |
|
51 | + $title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); |
|
52 | 52 | |
53 | 53 | require_once('header.php'); |
54 | 54 | print '<div class="select-item">'; |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
57 | 57 | print '<option></option>'; |
58 | 58 | $all_countries = $Spotter->getAllCountries(); |
59 | - foreach($all_countries as $all_country) |
|
59 | + foreach ($all_countries as $all_country) |
|
60 | 60 | { |
61 | - if($country == $all_country['country']) |
|
61 | + if ($country == $all_country['country']) |
|
62 | 62 | { |
63 | 63 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
64 | 64 | } else { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($_GET['country'] != "NA") |
74 | 74 | { |
75 | 75 | print '<div class="info column">'; |
76 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
76 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
77 | 77 | print '</div>'; |
78 | 78 | } else { |
79 | 79 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | include('country-sub-menu.php'); |
83 | 83 | print '<div class="table column">'; |
84 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."),$country).'</p>'; |
|
84 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."), $country).'</p>'; |
|
85 | 85 | |
86 | 86 | include('table-output.php'); |
87 | 87 | print '<div class="pagination">'; |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,38 +20,38 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
25 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
25 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) { |
40 | 40 | $limit_start = 0; |
41 | 41 | $limit_end = 25; |
42 | 42 | $absolute_difference = 25; |
43 | 43 | } else { |
44 | - if ($_GET['number_results'] > 1000){ |
|
44 | + if ($_GET['number_results'] > 1000) { |
|
45 | 45 | $_GET['number_results'] = 1000; |
46 | 46 | } |
47 | 47 | $limit_start = 0; |
48 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
49 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
48 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
49 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
50 | 50 | } |
51 | -} else { |
|
51 | +} else { |
|
52 | 52 | $limit_explode = explode(",", $_GET['limit']); |
53 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
54 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
53 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
54 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -68,23 +68,23 @@ discard block |
||
68 | 68 | |
69 | 69 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
70 | 70 | else $sort = ''; |
71 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
72 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
73 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
74 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
75 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
76 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
77 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
78 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
79 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
80 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
81 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
82 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
83 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
85 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
86 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
71 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
72 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
73 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
74 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
75 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
76 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
77 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
78 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
79 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
80 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
81 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
82 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
83 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
85 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
86 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
88 | 88 | |
89 | 89 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
90 | 90 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $output .= '</Style>'; |
113 | 113 | |
114 | 114 | if (!empty($spotter_array)) { |
115 | - foreach($spotter_array as $spotter_item) { |
|
115 | + foreach ($spotter_array as $spotter_item) { |
|
116 | 116 | $altitude = $spotter_item['altitude'].'00'; |
117 | 117 | if ($spotter_item['waypoints'] != '') { |
118 | 118 | //waypoint plotting |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
124 | 124 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
125 | 125 | foreach ($waypoint_pieces as $waypoint_coordinate) { |
126 | - if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
126 | + if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
127 | 127 | } |
128 | 128 | $output .= '</coordinates>'; |
129 | 129 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $output .= ' ]]></description>'; |
168 | 168 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
169 | 169 | $output .= '<Point>'; |
170 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
170 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
171 | 171 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
172 | 172 | $output .= '</Point>'; |
173 | 173 | $output .= '</Placemark>'; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $output .= ' ]]></description>'; |
209 | 209 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
210 | 210 | $output .= '<Point>'; |
211 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
211 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
212 | 212 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
213 | 213 | $output .= '</Point>'; |
214 | 214 | $output .= '</Placemark>'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $output .= ' ]]></description>'; |
253 | 253 | $output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>'; |
254 | 254 | $output .= '<Point>'; |
255 | - $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
255 | + $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
256 | 256 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
257 | 257 | $output .= '</Point>'; |
258 | 258 | $output .= '</Placemark>'; |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['pilot_name']); |
|
21 | + $title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['pilot_name']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | include('pilot-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Routes").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
32 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
33 | 33 | |
34 | - $route_array = $Spotter->countAllRoutesByPilot($pilot,$filter); |
|
34 | + $route_array = $Spotter->countAllRoutesByPilot($pilot, $filter); |
|
35 | 35 | if (!empty($route_array)) |
36 | 36 | { |
37 | 37 | print '<div class="table-responsive">'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | print '</thead>'; |
47 | 47 | print '<tbody>'; |
48 | 48 | $i = 1; |
49 | - foreach($route_array as $route_item) |
|
49 | + foreach ($route_array as $route_item) |
|
50 | 50 | { |
51 | 51 | print '<tr>'; |
52 | 52 | print '<td><strong>'.$i.'</strong></td>'; |