|
@@ -4,7 +4,7 @@ discard block |
|
|
block discarded – undo |
|
4
|
4
|
require_once(dirname(__FILE__).'/class.Image.php'); |
|
5
|
5
|
$global_query = "SELECT spotter_output.* FROM spotter_output"; |
|
6
|
6
|
|
|
7
|
|
-class Spotter{ |
|
|
7
|
+class Spotter { |
|
8
|
8
|
public $aircraft_correct_icaotype = array('CL64' => 'CL60', |
|
9
|
9
|
'F9LX' => 'F900', |
|
10
|
10
|
'K35T' => 'K35R', |
|
@@ -59,45 +59,45 @@ discard block |
|
|
block discarded – undo |
|
59
|
59
|
* @param Array $filter the filter |
|
60
|
60
|
* @return Array the SQL part |
|
61
|
61
|
*/ |
|
62
|
|
- public function getFilter($filter = array(),$where = false,$and = false) { |
|
|
62
|
+ public function getFilter($filter = array(), $where = false, $and = false) { |
|
63
|
63
|
global $globalFilter, $globalStatsFilters, $globalFilterName; |
|
64
|
64
|
$filters = array(); |
|
65
|
65
|
if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
|
66
|
66
|
if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
|
67
|
67
|
$filters = $globalStatsFilters[$globalFilterName]; |
|
68
|
68
|
} else { |
|
69
|
|
- $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
|
69
|
+ $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
70
|
70
|
} |
|
71
|
71
|
} |
|
72
|
|
- if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
|
72
|
+ if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
73
|
73
|
$filter_query_join = ''; |
|
74
|
74
|
$filter_query_where = ''; |
|
75
|
|
- foreach($filters as $flt) { |
|
|
75
|
+ foreach ($filters as $flt) { |
|
76
|
76
|
if (isset($flt['airlines']) && !empty($flt['airlines'])) { |
|
77
|
77
|
if ($flt['airlines'][0] != '') { |
|
78
|
78
|
if (isset($flt['source'])) { |
|
79
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
79
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
80
|
80
|
} else { |
|
81
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
81
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
82
|
82
|
} |
|
83
|
83
|
} |
|
84
|
84
|
} |
|
85
|
85
|
if (isset($flt['pilots_id']) && !empty($flt['pilots_id'])) { |
|
86
|
86
|
if (isset($flt['source'])) { |
|
87
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
87
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
88
|
88
|
} else { |
|
89
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
89
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
90
|
90
|
} |
|
91
|
91
|
} |
|
92
|
92
|
if ((isset($flt['airlines']) && empty($flt['airlines']) && isset($flt['pilots_id']) && empty($flt['pilots_id'])) || (!isset($flt['airlines']) && !isset($flt['pilots_id']))) { |
|
93
|
93
|
if (isset($flt['source'])) { |
|
94
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','",$flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
94
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','", $flt['source'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
95
|
95
|
} |
|
96
|
96
|
} |
|
97
|
97
|
} |
|
98
|
98
|
if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
99
|
99
|
if ($filter['airlines'][0] != '') { |
|
100
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
100
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
101
|
101
|
} |
|
102
|
102
|
} |
|
103
|
103
|
if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
@@ -107,19 +107,19 @@ discard block |
|
|
block discarded – undo |
|
107
|
107
|
$filter_query_join .= " INNER JOIN (SELECT icao FROM airlines WHERE alliance = '".$filter['alliance']."') sal ON sal.icao = spotter_output.airline_icao "; |
|
108
|
108
|
} |
|
109
|
109
|
if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
|
110
|
|
- $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
|
110
|
+ $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
111
|
111
|
} |
|
112
|
112
|
if (isset($filter['source']) && !empty($filter['source'])) { |
|
113
|
|
- $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
|
113
|
+ $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
114
|
114
|
} |
|
115
|
115
|
if (isset($filter['ident']) && !empty($filter['ident'])) { |
|
116
|
116
|
$filter_query_where = " WHERE ident = '".$filter['ident']."'"; |
|
117
|
117
|
} |
|
118
|
118
|
if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
119
|
119
|
if ($filter_query_where == '') { |
|
120
|
|
- $filter_query_where = " WHERE format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
|
120
|
+ $filter_query_where = " WHERE format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
121
|
121
|
} else { |
|
122
|
|
- $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
|
122
|
+ $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
123
|
123
|
} |
|
124
|
124
|
} |
|
125
|
125
|
if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
@@ -137,7 +137,7 @@ discard block |
|
|
block discarded – undo |
|
137
|
137
|
* @return Array the spotter information |
|
138
|
138
|
* |
|
139
|
139
|
*/ |
|
140
|
|
- public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
|
|
140
|
+ public function getDataFromDB($query, $params = array(), $limitQuery = '', $schedules = false) |
|
141
|
141
|
{ |
|
142
|
142
|
global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM; |
|
143
|
143
|
$Image = new Image($this->db); |
|
@@ -167,7 +167,7 @@ discard block |
|
|
block discarded – undo |
|
167
|
167
|
$sth = $this->db->prepare($query.$limitQuery); |
|
168
|
168
|
$sth->execute($params); |
|
169
|
169
|
} catch (PDOException $e) { |
|
170
|
|
- printf("Invalid query : %s\nWhole query: %s\n",$e->getMessage(), $query.$limitQuery); |
|
|
170
|
+ printf("Invalid query : %s\nWhole query: %s\n", $e->getMessage(), $query.$limitQuery); |
|
171
|
171
|
exit(); |
|
172
|
172
|
} |
|
173
|
173
|
|
|
@@ -177,7 +177,7 @@ discard block |
|
|
block discarded – undo |
|
177
|
177
|
$spotter_array = array(); |
|
178
|
178
|
|
|
179
|
179
|
|
|
180
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
180
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
181
|
181
|
{ |
|
182
|
182
|
$num_rows++; |
|
183
|
183
|
$temp_array = array(); |
|
@@ -222,7 +222,7 @@ discard block |
|
|
block discarded – undo |
|
222
|
222
|
if (isset($row['route_stop'])) { |
|
223
|
223
|
$temp_array['route_stop'] = $row['route_stop']; |
|
224
|
224
|
if ($row['route_stop'] != '') { |
|
225
|
|
- $allroute = explode(' ',$row['route_stop']); |
|
|
225
|
+ $allroute = explode(' ', $row['route_stop']); |
|
226
|
226
|
|
|
227
|
227
|
foreach ($allroute as $route) { |
|
228
|
228
|
$route_airport_array = $this->getAllAirportInfo($route); |
|
@@ -277,11 +277,11 @@ discard block |
|
|
block discarded – undo |
|
277
|
277
|
{ |
|
278
|
278
|
$temp_array['date'] = "about ".$dateArray['hours']." hours ago"; |
|
279
|
279
|
} else { |
|
280
|
|
- $temp_array['date'] = date("M j Y, g:i a",strtotime($row['date']." UTC")); |
|
|
280
|
+ $temp_array['date'] = date("M j Y, g:i a", strtotime($row['date']." UTC")); |
|
281
|
281
|
} |
|
282
|
282
|
$temp_array['date_minutes_past'] = $dateArray['minutes']; |
|
283
|
|
- $temp_array['date_iso_8601'] = date("c",strtotime($row['date']." UTC")); |
|
284
|
|
- $temp_array['date_rfc_2822'] = date("r",strtotime($row['date']." UTC")); |
|
|
283
|
+ $temp_array['date_iso_8601'] = date("c", strtotime($row['date']." UTC")); |
|
|
284
|
+ $temp_array['date_rfc_2822'] = date("r", strtotime($row['date']." UTC")); |
|
285
|
285
|
$temp_array['date_unix'] = strtotime($row['date']." UTC"); |
|
286
|
286
|
} |
|
287
|
287
|
|
|
@@ -315,9 +315,9 @@ discard block |
|
|
block discarded – undo |
|
315
|
315
|
if (!isset($row['airline_name']) || $row['airline_name'] == '') { |
|
316
|
316
|
if (!is_numeric(substr($row['ident'], 0, 3))) { |
|
317
|
317
|
if (is_numeric(substr($row['ident'], 2, 1))) { |
|
318
|
|
- $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 2),$fromsource); |
|
|
318
|
+ $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 2), $fromsource); |
|
319
|
319
|
} elseif (is_numeric(substr($row['ident'], 3, 1))) { |
|
320
|
|
- $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
|
|
320
|
+ $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3), $fromsource); |
|
321
|
321
|
} else { |
|
322
|
322
|
$airline_array = $this->getAllAirlineInfo('NA'); |
|
323
|
323
|
} |
|
@@ -354,7 +354,7 @@ discard block |
|
|
block discarded – undo |
|
354
|
354
|
} |
|
355
|
355
|
} |
|
356
|
356
|
if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') { |
|
357
|
|
- $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'],3)); |
|
|
357
|
+ $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'], 3)); |
|
358
|
358
|
//$acars_array = ACARS->getLiveAcarsData('BA40YL'); |
|
359
|
359
|
if (count($acars_array) > 0) { |
|
360
|
360
|
$temp_array['acars'] = $acars_array; |
|
@@ -371,11 +371,11 @@ discard block |
|
|
block discarded – undo |
|
371
|
371
|
$temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
|
372
|
372
|
} |
|
373
|
373
|
|
|
374
|
|
- if($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
|
|
374
|
+ if ($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
|
375
|
375
|
{ |
|
376
|
376
|
if ($globalIVAO) { |
|
377
|
|
- if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
378
|
|
- else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
|
377
|
+ if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type'], $temp_array['airline_icao']); |
|
|
378
|
+ else $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type']); |
|
379
|
379
|
} else $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
380
|
380
|
if (count($image_array) > 0) { |
|
381
|
381
|
$temp_array['image'] = $image_array[0]['image']; |
|
@@ -399,7 +399,7 @@ discard block |
|
|
block discarded – undo |
|
399
|
399
|
$temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
|
400
|
400
|
} |
|
401
|
401
|
|
|
402
|
|
- if ((!isset($globalIVAO) || ! $globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
|
402
|
+ if ((!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
403
|
403
|
if ($schedules === true) { |
|
404
|
404
|
$schedule_array = $Schedule->getSchedule($temp_array['ident']); |
|
405
|
405
|
//print_r($schedule_array); |
|
@@ -481,12 +481,12 @@ discard block |
|
|
block discarded – undo |
|
481
|
481
|
if (isset($row['squawk'])) { |
|
482
|
482
|
$temp_array['squawk'] = $row['squawk']; |
|
483
|
483
|
if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
|
484
|
|
- $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
|
485
|
|
- if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
|
484
|
+ $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['country_iso2']); |
|
|
485
|
+ if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
486
|
486
|
} elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
|
487
|
|
- $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
|
488
|
|
- if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
489
|
|
- } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
|
487
|
+ $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['over_country']); |
|
|
488
|
+ if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
|
489
|
+ } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
490
|
490
|
} |
|
491
|
491
|
|
|
492
|
492
|
$temp_array['query_number_rows'] = $num_rows; |
|
@@ -505,7 +505,7 @@ discard block |
|
|
block discarded – undo |
|
505
|
505
|
* @return Array the spotter information |
|
506
|
506
|
* |
|
507
|
507
|
*/ |
|
508
|
|
- public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
|
|
508
|
+ public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '', $pilot_id = '', $pilot_name = '', $altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '', $origLat = '', $origLon = '', $dist = '', $filters = array()) |
|
509
|
509
|
{ |
|
510
|
510
|
global $globalTimezone, $globalDBdriver; |
|
511
|
511
|
require_once(dirname(__FILE__).'/class.Translation.php'); |
|
@@ -515,7 +515,7 @@ discard block |
|
|
block discarded – undo |
|
515
|
515
|
|
|
516
|
516
|
$query_values = array(); |
|
517
|
517
|
$additional_query = ''; |
|
518
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
518
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
519
|
519
|
if ($q != "") |
|
520
|
520
|
{ |
|
521
|
521
|
if (!is_string($q)) |
|
@@ -523,8 +523,8 @@ discard block |
|
|
block discarded – undo |
|
523
|
523
|
return false; |
|
524
|
524
|
} else { |
|
525
|
525
|
$q_array = explode(" ", $q); |
|
526
|
|
- foreach ($q_array as $q_item){ |
|
527
|
|
- $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
|
526
|
+ foreach ($q_array as $q_item) { |
|
|
527
|
+ $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
528
|
528
|
$additional_query .= " AND ("; |
|
529
|
529
|
if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
530
|
530
|
$additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
|
@@ -556,37 +556,37 @@ discard block |
|
|
block discarded – undo |
|
556
|
556
|
|
|
557
|
557
|
if ($registration != "") |
|
558
|
558
|
{ |
|
559
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
559
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
560
|
560
|
if (!is_string($registration)) |
|
561
|
561
|
{ |
|
562
|
562
|
return false; |
|
563
|
563
|
} else { |
|
564
|
564
|
$additional_query .= " AND spotter_output.registration = :registration"; |
|
565
|
|
- $query_values = array_merge($query_values,array(':registration' => $registration)); |
|
|
565
|
+ $query_values = array_merge($query_values, array(':registration' => $registration)); |
|
566
|
566
|
} |
|
567
|
567
|
} |
|
568
|
568
|
|
|
569
|
569
|
if ($aircraft_icao != "") |
|
570
|
570
|
{ |
|
571
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
|
571
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
572
|
572
|
if (!is_string($aircraft_icao)) |
|
573
|
573
|
{ |
|
574
|
574
|
return false; |
|
575
|
575
|
} else { |
|
576
|
576
|
$additional_query .= " AND spotter_output.aircraft_icao = :aircraft_icao"; |
|
577
|
|
- $query_values = array_merge($query_values,array(':aircraft_icao' => $aircraft_icao)); |
|
|
577
|
+ $query_values = array_merge($query_values, array(':aircraft_icao' => $aircraft_icao)); |
|
578
|
578
|
} |
|
579
|
579
|
} |
|
580
|
580
|
|
|
581
|
581
|
if ($aircraft_manufacturer != "") |
|
582
|
582
|
{ |
|
583
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
|
583
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
584
|
584
|
if (!is_string($aircraft_manufacturer)) |
|
585
|
585
|
{ |
|
586
|
586
|
return false; |
|
587
|
587
|
} else { |
|
588
|
588
|
$additional_query .= " AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer"; |
|
589
|
|
- $query_values = array_merge($query_values,array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
|
589
|
+ $query_values = array_merge($query_values, array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
590
|
590
|
} |
|
591
|
591
|
} |
|
592
|
592
|
|
|
@@ -602,25 +602,25 @@ discard block |
|
|
block discarded – undo |
|
602
|
602
|
|
|
603
|
603
|
if ($airline_icao != "") |
|
604
|
604
|
{ |
|
605
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
|
605
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
606
|
606
|
if (!is_string($airline_icao)) |
|
607
|
607
|
{ |
|
608
|
608
|
return false; |
|
609
|
609
|
} else { |
|
610
|
610
|
$additional_query .= " AND spotter_output.airline_icao = :airline_icao"; |
|
611
|
|
- $query_values = array_merge($query_values,array(':airline_icao' => $airline_icao)); |
|
|
611
|
+ $query_values = array_merge($query_values, array(':airline_icao' => $airline_icao)); |
|
612
|
612
|
} |
|
613
|
613
|
} |
|
614
|
614
|
|
|
615
|
615
|
if ($airline_country != "") |
|
616
|
616
|
{ |
|
617
|
|
- $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
|
617
|
+ $airline_country = filter_var($airline_country, FILTER_SANITIZE_STRING); |
|
618
|
618
|
if (!is_string($airline_country)) |
|
619
|
619
|
{ |
|
620
|
620
|
return false; |
|
621
|
621
|
} else { |
|
622
|
622
|
$additional_query .= " AND spotter_output.airline_country = :airline_country"; |
|
623
|
|
- $query_values = array_merge($query_values,array(':airline_country' => $airline_country)); |
|
|
623
|
+ $query_values = array_merge($query_values, array(':airline_country' => $airline_country)); |
|
624
|
624
|
} |
|
625
|
625
|
} |
|
626
|
626
|
|
|
@@ -647,31 +647,31 @@ discard block |
|
|
block discarded – undo |
|
647
|
647
|
|
|
648
|
648
|
if ($airport != "") |
|
649
|
649
|
{ |
|
650
|
|
- $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
|
650
|
+ $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
651
|
651
|
if (!is_string($airport)) |
|
652
|
652
|
{ |
|
653
|
653
|
return false; |
|
654
|
654
|
} else { |
|
655
|
655
|
$additional_query .= " AND (spotter_output.departure_airport_icao = :airport OR spotter_output.arrival_airport_icao = :airport)"; |
|
656
|
|
- $query_values = array_merge($query_values,array(':airport' => $airport)); |
|
|
656
|
+ $query_values = array_merge($query_values, array(':airport' => $airport)); |
|
657
|
657
|
} |
|
658
|
658
|
} |
|
659
|
659
|
|
|
660
|
660
|
if ($airport_country != "") |
|
661
|
661
|
{ |
|
662
|
|
- $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
|
662
|
+ $airport_country = filter_var($airport_country, FILTER_SANITIZE_STRING); |
|
663
|
663
|
if (!is_string($airport_country)) |
|
664
|
664
|
{ |
|
665
|
665
|
return false; |
|
666
|
666
|
} else { |
|
667
|
667
|
$additional_query .= " AND (spotter_output.departure_airport_country = :airport_country OR spotter_output.arrival_airport_country = :airport_country)"; |
|
668
|
|
- $query_values = array_merge($query_values,array(':airport_country' => $airport_country)); |
|
|
668
|
+ $query_values = array_merge($query_values, array(':airport_country' => $airport_country)); |
|
669
|
669
|
} |
|
670
|
670
|
} |
|
671
|
671
|
|
|
672
|
672
|
if ($callsign != "") |
|
673
|
673
|
{ |
|
674
|
|
- $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
|
674
|
+ $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
675
|
675
|
if (!is_string($callsign)) |
|
676
|
676
|
{ |
|
677
|
677
|
return false; |
|
@@ -679,79 +679,79 @@ discard block |
|
|
block discarded – undo |
|
679
|
679
|
$translate = $Translation->ident2icao($callsign); |
|
680
|
680
|
if ($translate != $callsign) { |
|
681
|
681
|
$additional_query .= " AND (spotter_output.ident = :callsign OR spotter_output.ident = :translate)"; |
|
682
|
|
- $query_values = array_merge($query_values,array(':callsign' => $callsign,':translate' => $translate)); |
|
|
682
|
+ $query_values = array_merge($query_values, array(':callsign' => $callsign, ':translate' => $translate)); |
|
683
|
683
|
} else { |
|
684
|
684
|
$additional_query .= " AND spotter_output.ident = :callsign"; |
|
685
|
|
- $query_values = array_merge($query_values,array(':callsign' => $callsign)); |
|
|
685
|
+ $query_values = array_merge($query_values, array(':callsign' => $callsign)); |
|
686
|
686
|
} |
|
687
|
687
|
} |
|
688
|
688
|
} |
|
689
|
689
|
|
|
690
|
690
|
if ($owner != "") |
|
691
|
691
|
{ |
|
692
|
|
- $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
|
692
|
+ $owner = filter_var($owner, FILTER_SANITIZE_STRING); |
|
693
|
693
|
if (!is_string($owner)) |
|
694
|
694
|
{ |
|
695
|
695
|
return false; |
|
696
|
696
|
} else { |
|
697
|
697
|
$additional_query .= " AND spotter_output.owner_name = :owner"; |
|
698
|
|
- $query_values = array_merge($query_values,array(':owner' => $owner)); |
|
|
698
|
+ $query_values = array_merge($query_values, array(':owner' => $owner)); |
|
699
|
699
|
} |
|
700
|
700
|
} |
|
701
|
701
|
|
|
702
|
702
|
if ($pilot_name != "") |
|
703
|
703
|
{ |
|
704
|
|
- $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
|
704
|
+ $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
705
|
705
|
if (!is_string($pilot_name)) |
|
706
|
706
|
{ |
|
707
|
707
|
return false; |
|
708
|
708
|
} else { |
|
709
|
709
|
$additional_query .= " AND spotter_output.pilot_name = :pilot_name"; |
|
710
|
|
- $query_values = array_merge($query_values,array(':pilot_name' => $pilot_name)); |
|
|
710
|
+ $query_values = array_merge($query_values, array(':pilot_name' => $pilot_name)); |
|
711
|
711
|
} |
|
712
|
712
|
} |
|
713
|
713
|
|
|
714
|
714
|
if ($pilot_id != "") |
|
715
|
715
|
{ |
|
716
|
|
- $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
|
716
|
+ $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_NUMBER_INT); |
|
717
|
717
|
if (!is_string($pilot_id)) |
|
718
|
718
|
{ |
|
719
|
719
|
return false; |
|
720
|
720
|
} else { |
|
721
|
721
|
$additional_query .= " AND spotter_output.pilot_id = :pilot_id"; |
|
722
|
|
- $query_values = array_merge($query_values,array(':pilot_id' => $pilot_id)); |
|
|
722
|
+ $query_values = array_merge($query_values, array(':pilot_id' => $pilot_id)); |
|
723
|
723
|
} |
|
724
|
724
|
} |
|
725
|
725
|
|
|
726
|
726
|
if ($departure_airport_route != "") |
|
727
|
727
|
{ |
|
728
|
|
- $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
|
728
|
+ $departure_airport_route = filter_var($departure_airport_route, FILTER_SANITIZE_STRING); |
|
729
|
729
|
if (!is_string($departure_airport_route)) |
|
730
|
730
|
{ |
|
731
|
731
|
return false; |
|
732
|
732
|
} else { |
|
733
|
733
|
$additional_query .= " AND spotter_output.departure_airport_icao = :departure_airport_route"; |
|
734
|
|
- $query_values = array_merge($query_values,array(':departure_airport_route' => $departure_airport_route)); |
|
|
734
|
+ $query_values = array_merge($query_values, array(':departure_airport_route' => $departure_airport_route)); |
|
735
|
735
|
} |
|
736
|
736
|
} |
|
737
|
737
|
|
|
738
|
738
|
if ($arrival_airport_route != "") |
|
739
|
739
|
{ |
|
740
|
|
- $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
|
740
|
+ $arrival_airport_route = filter_var($arrival_airport_route, FILTER_SANITIZE_STRING); |
|
741
|
741
|
if (!is_string($arrival_airport_route)) |
|
742
|
742
|
{ |
|
743
|
743
|
return false; |
|
744
|
744
|
} else { |
|
745
|
745
|
$additional_query .= " AND spotter_output.arrival_airport_icao = :arrival_airport_route"; |
|
746
|
|
- $query_values = array_merge($query_values,array(':arrival_airport_route' => $arrival_airport_route)); |
|
|
746
|
+ $query_values = array_merge($query_values, array(':arrival_airport_route' => $arrival_airport_route)); |
|
747
|
747
|
} |
|
748
|
748
|
} |
|
749
|
749
|
|
|
750
|
750
|
if ($altitude != "") |
|
751
|
751
|
{ |
|
752
|
752
|
$altitude_array = explode(",", $altitude); |
|
753
|
|
- $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
754
|
|
- $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
|
753
|
+ $altitude_array[0] = filter_var($altitude_array[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
754
|
+ $altitude_array[1] = filter_var($altitude_array[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
755
|
755
|
|
|
756
|
756
|
if ($altitude_array[1] != "") |
|
757
|
757
|
{ |
|
@@ -767,8 +767,8 @@ discard block |
|
|
block discarded – undo |
|
767
|
767
|
if ($date_posted != "") |
|
768
|
768
|
{ |
|
769
|
769
|
$date_array = explode(",", $date_posted); |
|
770
|
|
- $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
771
|
|
- $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
|
770
|
+ $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
|
771
|
+ $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
772
|
772
|
|
|
773
|
773
|
if ($globalTimezone != '') { |
|
774
|
774
|
date_default_timezone_set($globalTimezone); |
|
@@ -799,8 +799,8 @@ discard block |
|
|
block discarded – undo |
|
799
|
799
|
{ |
|
800
|
800
|
$limit_array = explode(",", $limit); |
|
801
|
801
|
|
|
802
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
803
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
802
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
803
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
804
|
804
|
|
|
805
|
805
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
806
|
806
|
{ |
|
@@ -829,23 +829,23 @@ discard block |
|
|
block discarded – undo |
|
829
|
829
|
|
|
830
|
830
|
|
|
831
|
831
|
if ($origLat != "" && $origLon != "" && $dist != "") { |
|
832
|
|
- $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
|
832
|
+ $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
833
|
833
|
|
|
834
|
834
|
if ($globalDBdriver == 'mysql') { |
|
835
|
|
- $query="SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
|
835
|
+ $query = "SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
836
|
836
|
FROM spotter_archive,spotter_output".$filter_query." spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND spotter_archive.longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and spotter_archive.latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
|
837
|
837
|
AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2)))) < $dist".$orderby_query; |
|
838
|
838
|
} else { |
|
839
|
|
- $query="SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
|
839
|
+ $query = "SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
840
|
840
|
FROM spotter_archive,spotter_output".$filter_query." spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND CAST(spotter_archive.longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(spotter_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
|
841
|
841
|
AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$filter_query.$orderby_query; |
|
842
|
842
|
} |
|
843
|
843
|
} else { |
|
844
|
|
- $query = "SELECT spotter_output.* FROM spotter_output".$filter_query." spotter_output.ident <> '' |
|
|
844
|
+ $query = "SELECT spotter_output.* FROM spotter_output".$filter_query." spotter_output.ident <> '' |
|
845
|
845
|
".$additional_query." |
|
846
|
846
|
".$orderby_query; |
|
847
|
847
|
} |
|
848
|
|
- $spotter_array = $this->getDataFromDB($query, $query_values,$limit_query); |
|
|
848
|
+ $spotter_array = $this->getDataFromDB($query, $query_values, $limit_query); |
|
849
|
849
|
return $spotter_array; |
|
850
|
850
|
} |
|
851
|
851
|
|
|
@@ -868,8 +868,8 @@ discard block |
|
|
block discarded – undo |
|
868
|
868
|
{ |
|
869
|
869
|
$limit_array = explode(",", $limit); |
|
870
|
870
|
|
|
871
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
872
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
871
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
872
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
873
|
873
|
|
|
874
|
874
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
875
|
875
|
{ |
|
@@ -886,9 +886,9 @@ discard block |
|
|
block discarded – undo |
|
886
|
886
|
$orderby_query = " ORDER BY spotter_output.date DESC"; |
|
887
|
887
|
} |
|
888
|
888
|
|
|
889
|
|
- $query = $global_query.$filter_query." ".$orderby_query; |
|
|
889
|
+ $query = $global_query.$filter_query." ".$orderby_query; |
|
890
|
890
|
|
|
891
|
|
- $spotter_array = $this->getDataFromDB($query, array(),$limit_query,true); |
|
|
891
|
+ $spotter_array = $this->getDataFromDB($query, array(), $limit_query, true); |
|
892
|
892
|
|
|
893
|
893
|
return $spotter_array; |
|
894
|
894
|
} |
|
@@ -934,34 +934,34 @@ discard block |
|
|
block discarded – undo |
|
934
|
934
|
{ |
|
935
|
935
|
return false; |
|
936
|
936
|
} else { |
|
937
|
|
- if ($interval == "30m"){ |
|
|
937
|
+ if ($interval == "30m") { |
|
938
|
938
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) <= $this_output.date '; |
|
939
|
|
- } else if ($interval == "1h"){ |
|
|
939
|
+ } else if ($interval == "1h") { |
|
940
|
940
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) <= $this_output.date '; |
|
941
|
|
- } else if ($interval == "3h"){ |
|
|
941
|
+ } else if ($interval == "3h") { |
|
942
|
942
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 3 HOUR) <= $this_output.date '; |
|
943
|
|
- } else if ($interval == "6h"){ |
|
|
943
|
+ } else if ($interval == "6h") { |
|
944
|
944
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 6 HOUR) <= $this_output.date '; |
|
945
|
|
- } else if ($interval == "12h"){ |
|
|
945
|
+ } else if ($interval == "12h") { |
|
946
|
946
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 12 HOUR) <= $this_output.date '; |
|
947
|
|
- } else if ($interval == "24h"){ |
|
|
947
|
+ } else if ($interval == "24h") { |
|
948
|
948
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 24 HOUR) <= $this_output.date '; |
|
949
|
|
- } else if ($interval == "7d"){ |
|
|
949
|
+ } else if ($interval == "7d") { |
|
950
|
950
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY) <= $this_output.date '; |
|
951
|
|
- } else if ($interval == "30d"){ |
|
|
951
|
+ } else if ($interval == "30d") { |
|
952
|
952
|
$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 DAY) <= $this_output.date '; |
|
953
|
953
|
} |
|
954
|
954
|
} |
|
955
|
955
|
} |
|
956
|
956
|
|
|
957
|
|
- $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
|
957
|
+ $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
958
|
958
|
WHERE spotter_output.latitude <> '' |
|
959
|
959
|
AND spotter_output.longitude <> '' |
|
960
|
960
|
".$additional_query." |
|
961
|
961
|
HAVING distance < :radius |
|
962
|
962
|
ORDER BY distance"; |
|
963
|
963
|
|
|
964
|
|
- $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius),$limit_query); |
|
|
964
|
+ $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius), $limit_query); |
|
965
|
965
|
|
|
966
|
966
|
return $spotter_array; |
|
967
|
967
|
} |
|
@@ -973,21 +973,21 @@ discard block |
|
|
block discarded – undo |
|
973
|
973
|
* @return Array the spotter information |
|
974
|
974
|
* |
|
975
|
975
|
*/ |
|
976
|
|
- public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
|
|
976
|
+ public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '', $filter = array()) |
|
977
|
977
|
{ |
|
978
|
978
|
global $global_query; |
|
979
|
979
|
|
|
980
|
980
|
date_default_timezone_set('UTC'); |
|
981
|
981
|
|
|
982
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
982
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
983
|
983
|
|
|
984
|
984
|
$limit_query = ''; |
|
985
|
985
|
if ($limit != "") |
|
986
|
986
|
{ |
|
987
|
987
|
$limit_array = explode(",", $limit); |
|
988
|
988
|
|
|
989
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
990
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
989
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
990
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
991
|
991
|
|
|
992
|
992
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
993
|
993
|
{ |
|
@@ -1004,7 +1004,7 @@ discard block |
|
|
block discarded – undo |
|
1004
|
1004
|
$orderby_query = " ORDER BY spotter_output.date DESC "; |
|
1005
|
1005
|
} |
|
1006
|
1006
|
|
|
1007
|
|
- $query = $global_query." ".$filter_query." spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
|
1007
|
+ $query = $global_query." ".$filter_query." spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
1008
|
1008
|
|
|
1009
|
1009
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1010
|
1010
|
|
|
@@ -1023,15 +1023,15 @@ discard block |
|
|
block discarded – undo |
|
1023
|
1023
|
global $global_query; |
|
1024
|
1024
|
|
|
1025
|
1025
|
date_default_timezone_set('UTC'); |
|
1026
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1026
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1027
|
1027
|
|
|
1028
|
1028
|
$limit_query = ''; |
|
1029
|
1029
|
if ($limit != "") |
|
1030
|
1030
|
{ |
|
1031
|
1031
|
$limit_array = explode(",", $limit); |
|
1032
|
1032
|
|
|
1033
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1034
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1033
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1034
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1035
|
1035
|
|
|
1036
|
1036
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1037
|
1037
|
{ |
|
@@ -1048,7 +1048,7 @@ discard block |
|
|
block discarded – undo |
|
1048
|
1048
|
$orderby_query = " ORDER BY spotter_output.date DESC "; |
|
1049
|
1049
|
} |
|
1050
|
1050
|
|
|
1051
|
|
- $query = $global_query." ".$filter_query." spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
|
1051
|
+ $query = $global_query." ".$filter_query." spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
1052
|
1052
|
|
|
1053
|
1053
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1054
|
1054
|
|
|
@@ -1062,20 +1062,20 @@ discard block |
|
|
block discarded – undo |
|
1062
|
1062
|
* @return Array the spotter information |
|
1063
|
1063
|
* |
|
1064
|
1064
|
*/ |
|
1065
|
|
- public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
|
|
1065
|
+ public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '', $filter = array()) |
|
1066
|
1066
|
{ |
|
1067
|
1067
|
global $global_query; |
|
1068
|
1068
|
|
|
1069
|
1069
|
date_default_timezone_set('UTC'); |
|
1070
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1070
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1071
|
1071
|
|
|
1072
|
1072
|
$limit_query = ''; |
|
1073
|
1073
|
if ($limit != "") |
|
1074
|
1074
|
{ |
|
1075
|
1075
|
$limit_array = explode(",", $limit); |
|
1076
|
1076
|
|
|
1077
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1078
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1077
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1078
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1079
|
1079
|
|
|
1080
|
1080
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1081
|
1081
|
{ |
|
@@ -1092,7 +1092,7 @@ discard block |
|
|
block discarded – undo |
|
1092
|
1092
|
$orderby_query = " ORDER BY spotter_output.date DESC "; |
|
1093
|
1093
|
} |
|
1094
|
1094
|
|
|
1095
|
|
- $query = $global_query." ".$filter_query." spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
|
1095
|
+ $query = $global_query." ".$filter_query." spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
1096
|
1096
|
|
|
1097
|
1097
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1098
|
1098
|
|
|
@@ -1112,7 +1112,7 @@ discard block |
|
|
block discarded – undo |
|
1112
|
1112
|
|
|
1113
|
1113
|
date_default_timezone_set('UTC'); |
|
1114
|
1114
|
|
|
1115
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1115
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1116
|
1116
|
|
|
1117
|
1117
|
$limit_query = ''; |
|
1118
|
1118
|
|
|
@@ -1120,8 +1120,8 @@ discard block |
|
|
block discarded – undo |
|
1120
|
1120
|
{ |
|
1121
|
1121
|
$limit_array = explode(",", $limit); |
|
1122
|
1122
|
|
|
1123
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1124
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1123
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1124
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1125
|
1125
|
|
|
1126
|
1126
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1127
|
1127
|
{ |
|
@@ -1138,7 +1138,7 @@ discard block |
|
|
block discarded – undo |
|
1138
|
1138
|
$orderby_query = " ORDER BY spotter_output.date DESC "; |
|
1139
|
1139
|
} |
|
1140
|
1140
|
|
|
1141
|
|
- $query = $global_query." ".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
|
1141
|
+ $query = $global_query." ".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
1142
|
1142
|
|
|
1143
|
1143
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1144
|
1144
|
|
|
@@ -1157,14 +1157,14 @@ discard block |
|
|
block discarded – undo |
|
1157
|
1157
|
global $global_query; |
|
1158
|
1158
|
|
|
1159
|
1159
|
date_default_timezone_set('UTC'); |
|
1160
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1160
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1161
|
1161
|
$limit_query = ''; |
|
1162
|
1162
|
if ($limit != "") |
|
1163
|
1163
|
{ |
|
1164
|
1164
|
$limit_array = explode(",", $limit); |
|
1165
|
1165
|
|
|
1166
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1167
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1166
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1167
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1168
|
1168
|
|
|
1169
|
1169
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1170
|
1170
|
{ |
|
@@ -1181,7 +1181,7 @@ discard block |
|
|
block discarded – undo |
|
1181
|
1181
|
$orderby_query = " ORDER BY spotter_output.date DESC "; |
|
1182
|
1182
|
} |
|
1183
|
1183
|
|
|
1184
|
|
- $query = $global_query.$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
|
1184
|
+ $query = $global_query.$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
1185
|
1185
|
|
|
1186
|
1186
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1187
|
1187
|
|
|
@@ -1205,9 +1205,9 @@ discard block |
|
|
block discarded – undo |
|
1205
|
1205
|
$query_values = array(':id' => $id); |
|
1206
|
1206
|
|
|
1207
|
1207
|
//$query = $global_query." WHERE spotter_output.ident <> '' ".$additional_query." "; |
|
1208
|
|
- $query = $global_query." WHERE ".$additional_query." "; |
|
|
1208
|
+ $query = $global_query." WHERE ".$additional_query." "; |
|
1209
|
1209
|
|
|
1210
|
|
- $spotter_array = $this->getDataFromDB($query,$query_values); |
|
|
1210
|
+ $spotter_array = $this->getDataFromDB($query, $query_values); |
|
1211
|
1211
|
|
|
1212
|
1212
|
return $spotter_array; |
|
1213
|
1213
|
} |
|
@@ -1245,8 +1245,8 @@ discard block |
|
|
block discarded – undo |
|
1245
|
1245
|
{ |
|
1246
|
1246
|
$limit_array = explode(",", $limit); |
|
1247
|
1247
|
|
|
1248
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1249
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1248
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1249
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1250
|
1250
|
|
|
1251
|
1251
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1252
|
1252
|
{ |
|
@@ -1287,7 +1287,7 @@ discard block |
|
|
block discarded – undo |
|
1287
|
1287
|
$query_values = array(); |
|
1288
|
1288
|
$limit_query = ''; |
|
1289
|
1289
|
$additional_query = ''; |
|
1290
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1290
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1291
|
1291
|
|
|
1292
|
1292
|
if ($aircraft_type != "") |
|
1293
|
1293
|
{ |
|
@@ -1304,8 +1304,8 @@ discard block |
|
|
block discarded – undo |
|
1304
|
1304
|
{ |
|
1305
|
1305
|
$limit_array = explode(",", $limit); |
|
1306
|
1306
|
|
|
1307
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1308
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1307
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1308
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1309
|
1309
|
|
|
1310
|
1310
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1311
|
1311
|
{ |
|
@@ -1361,8 +1361,8 @@ discard block |
|
|
block discarded – undo |
|
1361
|
1361
|
{ |
|
1362
|
1362
|
$limit_array = explode(",", $limit); |
|
1363
|
1363
|
|
|
1364
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1365
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1364
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1365
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1366
|
1366
|
|
|
1367
|
1367
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1368
|
1368
|
{ |
|
@@ -1378,7 +1378,7 @@ discard block |
|
|
block discarded – undo |
|
1378
|
1378
|
} else { |
|
1379
|
1379
|
$orderby_query = " ORDER BY spotter_output.date DESC"; |
|
1380
|
1380
|
} |
|
1381
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1381
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1382
|
1382
|
|
|
1383
|
1383
|
//$query = $global_query.$filter_query." spotter_output.ident <> '' ".$additional_query." ".$orderby_query; |
|
1384
|
1384
|
$query = $global_query.$filter_query." ".$additional_query." ".$orderby_query; |
|
@@ -1397,7 +1397,7 @@ discard block |
|
|
block discarded – undo |
|
1397
|
1397
|
* @return Array the spotter information |
|
1398
|
1398
|
* |
|
1399
|
1399
|
*/ |
|
1400
|
|
- public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array()) |
|
|
1400
|
+ public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '', $filters = array()) |
|
1401
|
1401
|
{ |
|
1402
|
1402
|
global $global_query; |
|
1403
|
1403
|
|
|
@@ -1406,7 +1406,7 @@ discard block |
|
|
block discarded – undo |
|
1406
|
1406
|
$query_values = array(); |
|
1407
|
1407
|
$limit_query = ''; |
|
1408
|
1408
|
$additional_query = ''; |
|
1409
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
1409
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
1410
|
1410
|
|
|
1411
|
1411
|
if ($airline != "") |
|
1412
|
1412
|
{ |
|
@@ -1423,8 +1423,8 @@ discard block |
|
|
block discarded – undo |
|
1423
|
1423
|
{ |
|
1424
|
1424
|
$limit_array = explode(",", $limit); |
|
1425
|
1425
|
|
|
1426
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1427
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1426
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1427
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1428
|
1428
|
|
|
1429
|
1429
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1430
|
1430
|
{ |
|
@@ -1454,7 +1454,7 @@ discard block |
|
|
block discarded – undo |
|
1454
|
1454
|
* @return Array the spotter information |
|
1455
|
1455
|
* |
|
1456
|
1456
|
*/ |
|
1457
|
|
- public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
|
|
1457
|
+ public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '', $filters = array()) |
|
1458
|
1458
|
{ |
|
1459
|
1459
|
global $global_query; |
|
1460
|
1460
|
|
|
@@ -1462,7 +1462,7 @@ discard block |
|
|
block discarded – undo |
|
1462
|
1462
|
$query_values = array(); |
|
1463
|
1463
|
$limit_query = ''; |
|
1464
|
1464
|
$additional_query = ''; |
|
1465
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
1465
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
1466
|
1466
|
|
|
1467
|
1467
|
if ($airport != "") |
|
1468
|
1468
|
{ |
|
@@ -1479,8 +1479,8 @@ discard block |
|
|
block discarded – undo |
|
1479
|
1479
|
{ |
|
1480
|
1480
|
$limit_array = explode(",", $limit); |
|
1481
|
1481
|
|
|
1482
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1483
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1482
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1483
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1484
|
1484
|
|
|
1485
|
1485
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1486
|
1486
|
{ |
|
@@ -1512,7 +1512,7 @@ discard block |
|
|
block discarded – undo |
|
1512
|
1512
|
* @return Array the spotter information |
|
1513
|
1513
|
* |
|
1514
|
1514
|
*/ |
|
1515
|
|
- public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
|
|
1515
|
+ public function getSpotterDataByDate($date = '', $limit = '', $sort = '', $filter = array()) |
|
1516
|
1516
|
{ |
|
1517
|
1517
|
global $global_query, $globalTimezone, $globalDBdriver; |
|
1518
|
1518
|
|
|
@@ -1520,7 +1520,7 @@ discard block |
|
|
block discarded – undo |
|
1520
|
1520
|
$limit_query = ''; |
|
1521
|
1521
|
$additional_query = ''; |
|
1522
|
1522
|
|
|
1523
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1523
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1524
|
1524
|
|
|
1525
|
1525
|
if ($date != "") |
|
1526
|
1526
|
{ |
|
@@ -1549,8 +1549,8 @@ discard block |
|
|
block discarded – undo |
|
1549
|
1549
|
{ |
|
1550
|
1550
|
$limit_array = explode(",", $limit); |
|
1551
|
1551
|
|
|
1552
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1553
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1552
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1553
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1554
|
1554
|
|
|
1555
|
1555
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1556
|
1556
|
{ |
|
@@ -1580,7 +1580,7 @@ discard block |
|
|
block discarded – undo |
|
1580
|
1580
|
* @return Array the spotter information |
|
1581
|
1581
|
* |
|
1582
|
1582
|
*/ |
|
1583
|
|
- public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array()) |
|
|
1583
|
+ public function getSpotterDataByCountry($country = '', $limit = '', $sort = '', $filters = array()) |
|
1584
|
1584
|
{ |
|
1585
|
1585
|
global $global_query; |
|
1586
|
1586
|
|
|
@@ -1589,7 +1589,7 @@ discard block |
|
|
block discarded – undo |
|
1589
|
1589
|
$query_values = array(); |
|
1590
|
1590
|
$limit_query = ''; |
|
1591
|
1591
|
$additional_query = ''; |
|
1592
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
1592
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
1593
|
1593
|
if ($country != "") |
|
1594
|
1594
|
{ |
|
1595
|
1595
|
if (!is_string($country)) |
|
@@ -1606,8 +1606,8 @@ discard block |
|
|
block discarded – undo |
|
1606
|
1606
|
{ |
|
1607
|
1607
|
$limit_array = explode(",", $limit); |
|
1608
|
1608
|
|
|
1609
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1610
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1609
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1610
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1611
|
1611
|
|
|
1612
|
1612
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1613
|
1613
|
{ |
|
@@ -1647,7 +1647,7 @@ discard block |
|
|
block discarded – undo |
|
1647
|
1647
|
$query_values = array(); |
|
1648
|
1648
|
$additional_query = ''; |
|
1649
|
1649
|
$limit_query = ''; |
|
1650
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
1650
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
1651
|
1651
|
|
|
1652
|
1652
|
if ($aircraft_manufacturer != "") |
|
1653
|
1653
|
{ |
|
@@ -1664,8 +1664,8 @@ discard block |
|
|
block discarded – undo |
|
1664
|
1664
|
{ |
|
1665
|
1665
|
$limit_array = explode(",", $limit); |
|
1666
|
1666
|
|
|
1667
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1668
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1667
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1668
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1669
|
1669
|
|
|
1670
|
1670
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1671
|
1671
|
{ |
|
@@ -1707,14 +1707,14 @@ discard block |
|
|
block discarded – undo |
|
1707
|
1707
|
$query_values = array(); |
|
1708
|
1708
|
$additional_query = ''; |
|
1709
|
1709
|
$limit_query = ''; |
|
1710
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
1710
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
1711
|
1711
|
if ($departure_airport_icao != "") |
|
1712
|
1712
|
{ |
|
1713
|
1713
|
if (!is_string($departure_airport_icao)) |
|
1714
|
1714
|
{ |
|
1715
|
1715
|
return false; |
|
1716
|
1716
|
} else { |
|
1717
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
|
1717
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
1718
|
1718
|
$additional_query .= " AND (spotter_output.departure_airport_icao = :departure_airport_icao)"; |
|
1719
|
1719
|
//$additional_query .= " AND (spotter_output.departure_airport_icao = :departure_airport_icao AND spotter_output.real_departure_airport_icao IS NULL) OR spotter_output.real_departure_airport_icao = :departure_airport_icao"; |
|
1720
|
1720
|
$query_values = array(':departure_airport_icao' => $departure_airport_icao); |
|
@@ -1727,10 +1727,10 @@ discard block |
|
|
block discarded – undo |
|
1727
|
1727
|
{ |
|
1728
|
1728
|
return false; |
|
1729
|
1729
|
} else { |
|
1730
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
1730
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
1731
|
1731
|
$additional_query .= " AND (spotter_output.arrival_airport_icao = :arrival_airport_icao)"; |
|
1732
|
1732
|
//$additional_query .= " AND ((spotter_output.arrival_airport_icao = :arrival_airport_icao AND spotter_output.real_arrival_airport_icao IS NULL) OR spotter_output.real_arrival_airport_icao = :arrival_airport_icao)"; |
|
1733
|
|
- $query_values = array_merge($query_values,array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
1733
|
+ $query_values = array_merge($query_values, array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
1734
|
1734
|
} |
|
1735
|
1735
|
} |
|
1736
|
1736
|
|
|
@@ -1738,8 +1738,8 @@ discard block |
|
|
block discarded – undo |
|
1738
|
1738
|
{ |
|
1739
|
1739
|
$limit_array = explode(",", $limit); |
|
1740
|
1740
|
|
|
1741
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1742
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1741
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1742
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1743
|
1743
|
|
|
1744
|
1744
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1745
|
1745
|
{ |
|
@@ -1778,15 +1778,15 @@ discard block |
|
|
block discarded – undo |
|
1778
|
1778
|
global $global_query; |
|
1779
|
1779
|
|
|
1780
|
1780
|
date_default_timezone_set('UTC'); |
|
1781
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
|
1781
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
1782
|
1782
|
$limit_query = ''; |
|
1783
|
1783
|
|
|
1784
|
1784
|
if ($limit != "") |
|
1785
|
1785
|
{ |
|
1786
|
1786
|
$limit_array = explode(",", $limit); |
|
1787
|
1787
|
|
|
1788
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1789
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
1788
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
1789
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1790
|
1790
|
|
|
1791
|
1791
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1792
|
1792
|
{ |
|
@@ -1803,7 +1803,7 @@ discard block |
|
|
block discarded – undo |
|
1803
|
1803
|
$orderby_query = " ORDER BY spotter_output.date DESC"; |
|
1804
|
1804
|
} |
|
1805
|
1805
|
|
|
1806
|
|
- $query = $global_query.$filter_query." spotter_output.highlight <> '' ".$orderby_query; |
|
|
1806
|
+ $query = $global_query.$filter_query." spotter_output.highlight <> '' ".$orderby_query; |
|
1807
|
1807
|
|
|
1808
|
1808
|
$spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
1809
|
1809
|
|
|
@@ -1816,19 +1816,19 @@ discard block |
|
|
block discarded – undo |
|
1816
|
1816
|
* @return String the highlight text |
|
1817
|
1817
|
* |
|
1818
|
1818
|
*/ |
|
1819
|
|
- public function getHighlightByRegistration($registration,$filter = array()) |
|
|
1819
|
+ public function getHighlightByRegistration($registration, $filter = array()) |
|
1820
|
1820
|
{ |
|
1821
|
1821
|
global $global_query; |
|
1822
|
1822
|
|
|
1823
|
1823
|
date_default_timezone_set('UTC'); |
|
1824
|
|
- $filter_query = $this->getFilter($filter,true,true); |
|
1825
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
1824
|
+ $filter_query = $this->getFilter($filter, true, true); |
|
|
1825
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
1826
|
1826
|
|
|
1827
|
|
- $query = $global_query.$filter_query." spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
|
1827
|
+ $query = $global_query.$filter_query." spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
1828
|
1828
|
$sth = $this->db->prepare($query); |
|
1829
|
1829
|
$sth->execute(array(':registration' => $registration)); |
|
1830
|
1830
|
|
|
1831
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
1831
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1832
|
1832
|
{ |
|
1833
|
1833
|
$highlight = $row['highlight']; |
|
1834
|
1834
|
} |
|
@@ -1844,14 +1844,14 @@ discard block |
|
|
block discarded – undo |
|
1844
|
1844
|
* @return String usage |
|
1845
|
1845
|
* |
|
1846
|
1846
|
*/ |
|
1847
|
|
- public function getSquawkUsage($squawk = '',$country = 'FR') |
|
|
1847
|
+ public function getSquawkUsage($squawk = '', $country = 'FR') |
|
1848
|
1848
|
{ |
|
1849
|
1849
|
|
|
1850
|
|
- $squawk = filter_var($squawk,FILTER_SANITIZE_STRING); |
|
1851
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
|
1850
|
+ $squawk = filter_var($squawk, FILTER_SANITIZE_STRING); |
|
|
1851
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
1852
|
1852
|
|
|
1853
|
1853
|
$query = "SELECT squawk.* FROM squawk WHERE squawk.code = :squawk AND squawk.country = :country LIMIT 1"; |
|
1854
|
|
- $query_values = array(':squawk' => ltrim($squawk,'0'), ':country' => $country); |
|
|
1854
|
+ $query_values = array(':squawk' => ltrim($squawk, '0'), ':country' => $country); |
|
1855
|
1855
|
|
|
1856
|
1856
|
$sth = $this->db->prepare($query); |
|
1857
|
1857
|
$sth->execute($query_values); |
|
@@ -1873,9 +1873,9 @@ discard block |
|
|
block discarded – undo |
|
1873
|
1873
|
public function getAirportIcao($airport_iata = '') |
|
1874
|
1874
|
{ |
|
1875
|
1875
|
|
|
1876
|
|
- $airport_iata = filter_var($airport_iata,FILTER_SANITIZE_STRING); |
|
|
1876
|
+ $airport_iata = filter_var($airport_iata, FILTER_SANITIZE_STRING); |
|
1877
|
1877
|
|
|
1878
|
|
- $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
|
1878
|
+ $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
1879
|
1879
|
$query_values = array(':airport' => $airport_iata); |
|
1880
|
1880
|
|
|
1881
|
1881
|
$sth = $this->db->prepare($query); |
|
@@ -1897,12 +1897,12 @@ discard block |
|
|
block discarded – undo |
|
1897
|
1897
|
* @return Float distance to the airport |
|
1898
|
1898
|
* |
|
1899
|
1899
|
*/ |
|
1900
|
|
- public function getAirportDistance($airport_icao,$latitude,$longitude) |
|
|
1900
|
+ public function getAirportDistance($airport_icao, $latitude, $longitude) |
|
1901
|
1901
|
{ |
|
1902
|
1902
|
|
|
1903
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
|
1903
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
1904
|
1904
|
|
|
1905
|
|
- $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
|
1905
|
+ $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
1906
|
1906
|
$query_values = array(':airport' => $airport_icao); |
|
1907
|
1907
|
$sth = $this->db->prepare($query); |
|
1908
|
1908
|
$sth->execute($query_values); |
|
@@ -1912,7 +1912,7 @@ discard block |
|
|
block discarded – undo |
|
1912
|
1912
|
$airport_latitude = $row['latitude']; |
|
1913
|
1913
|
$airport_longitude = $row['longitude']; |
|
1914
|
1914
|
$Common = new Common(); |
|
1915
|
|
- return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
|
|
1915
|
+ return $Common->distance($latitude, $longitude, $airport_latitude, $airport_longitude); |
|
1916
|
1916
|
} else return ''; |
|
1917
|
1917
|
} |
|
1918
|
1918
|
|
|
@@ -1926,11 +1926,11 @@ discard block |
|
|
block discarded – undo |
|
1926
|
1926
|
public function getAllAirportInfo($airport = '') |
|
1927
|
1927
|
{ |
|
1928
|
1928
|
|
|
1929
|
|
- $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
|
1929
|
+ $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
1930
|
1930
|
|
|
1931
|
1931
|
$query_values = array(); |
|
1932
|
1932
|
if ($airport == 'NA') { |
|
1933
|
|
- return array(array('name' => 'Not available','city' => 'N/A', 'country' => 'N/A','iata' => 'NA','icao' => 'NA','altitude' => NULL,'latitude' => 0,'longitude' => 0,'type' => 'NA','home_link' => '','wikipedia_link' => '','image_thumb' => '', 'image' => '')); |
|
|
1933
|
+ return array(array('name' => 'Not available', 'city' => 'N/A', 'country' => 'N/A', 'iata' => 'NA', 'icao' => 'NA', 'altitude' => NULL, 'latitude' => 0, 'longitude' => 0, 'type' => 'NA', 'home_link' => '', 'wikipedia_link' => '', 'image_thumb' => '', 'image' => '')); |
|
1934
|
1934
|
} elseif ($airport == '') { |
|
1935
|
1935
|
$query = "SELECT airport.name, airport.city, airport.country, airport.iata, airport.icao, airport.latitude, airport.longitude, airport.altitude, airport.type, airport.home_link, airport.wikipedia_link, airport.image_thumb, airport.image FROM airport"; |
|
1936
|
1936
|
} else { |
|
@@ -1978,14 +1978,14 @@ discard block |
|
|
block discarded – undo |
|
1978
|
1978
|
{ |
|
1979
|
1979
|
$lst_countries = ''; |
|
1980
|
1980
|
foreach ($countries as $country) { |
|
1981
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
|
1981
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
1982
|
1982
|
if ($lst_countries == '') { |
|
1983
|
1983
|
$lst_countries = "'".$country."'"; |
|
1984
|
1984
|
} else { |
|
1985
|
1985
|
$lst_countries .= ",'".$country."'"; |
|
1986
|
1986
|
} |
|
1987
|
1987
|
} |
|
1988
|
|
- $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
|
1988
|
+ $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
1989
|
1989
|
|
|
1990
|
1990
|
$sth = $this->db->prepare($query); |
|
1991
|
1991
|
$sth->execute(); |
|
@@ -1993,7 +1993,7 @@ discard block |
|
|
block discarded – undo |
|
1993
|
1993
|
$airport_array = array(); |
|
1994
|
1994
|
$temp_array = array(); |
|
1995
|
1995
|
|
|
1996
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
1996
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1997
|
1997
|
{ |
|
1998
|
1998
|
$temp_array['name'] = $row['name']; |
|
1999
|
1999
|
$temp_array['city'] = $row['city']; |
|
@@ -2021,10 +2021,10 @@ discard block |
|
|
block discarded – undo |
|
2021
|
2021
|
{ |
|
2022
|
2022
|
global $globalDBdriver; |
|
2023
|
2023
|
if (is_array($coord)) { |
|
2024
|
|
- $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2025
|
|
- $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2026
|
|
- $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2027
|
|
- $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
|
2024
|
+ $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2025
|
+ $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2026
|
+ $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2027
|
+ $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
2028
|
2028
|
} else return array(); |
|
2029
|
2029
|
if ($globalDBdriver == 'mysql') { |
|
2030
|
2030
|
$query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
|
@@ -2036,7 +2036,7 @@ discard block |
|
|
block discarded – undo |
|
2036
|
2036
|
|
|
2037
|
2037
|
$airport_array = array(); |
|
2038
|
2038
|
|
|
2039
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2039
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2040
|
2040
|
{ |
|
2041
|
2041
|
$temp_array = $row; |
|
2042
|
2042
|
|
|
@@ -2056,13 +2056,13 @@ discard block |
|
|
block discarded – undo |
|
2056
|
2056
|
public function getAllWaypointsInfobyCoord($coord) |
|
2057
|
2057
|
{ |
|
2058
|
2058
|
if (is_array($coord)) { |
|
2059
|
|
- $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2060
|
|
- $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2061
|
|
- $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
2062
|
|
- $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
|
2059
|
+ $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2060
|
+ $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2061
|
+ $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
2062
|
+ $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
2063
|
2063
|
} else return array(); |
|
2064
|
2064
|
//$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
|
2065
|
|
- $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
|
2065
|
+ $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
2066
|
2066
|
//$query = "SELECT waypoints.* FROM waypoints"; |
|
2067
|
2067
|
//$query = "SELECT waypoints.* FROM waypoints INNER JOIN (SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") w ON w.name_end = waypoints.name_begin OR w.name_begin = waypoints.name_begin OR w.name_begin = waypoints.name_end OR w.name_end = waypoints.name_end"; |
|
2068
|
2068
|
//$query = "SELECT * FROM waypoints LEFT JOIN waypoints w ON waypoints.name_end = w.name_begin WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
|
@@ -2074,7 +2074,7 @@ discard block |
|
|
block discarded – undo |
|
2074
|
2074
|
|
|
2075
|
2075
|
$waypoints_array = array(); |
|
2076
|
2076
|
|
|
2077
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2077
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2078
|
2078
|
{ |
|
2079
|
2079
|
$temp_array = $row; |
|
2080
|
2080
|
|
|
@@ -2096,10 +2096,10 @@ discard block |
|
|
block discarded – undo |
|
2096
|
2096
|
{ |
|
2097
|
2097
|
global $globalUseRealAirlines; |
|
2098
|
2098
|
if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
|
2099
|
|
- $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
|
|
2099
|
+ $airline_icao = strtoupper(filter_var($airline_icao, FILTER_SANITIZE_STRING)); |
|
2100
|
2100
|
if ($airline_icao == 'NA') { |
|
2101
|
2101
|
$airline_array = array(); |
|
2102
|
|
- $airline_array[] = array('name' => 'Not Available','iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
|
2102
|
+ $airline_array[] = array('name' => 'Not Available', 'iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
2103
|
2103
|
return $airline_array; |
|
2104
|
2104
|
} else { |
|
2105
|
2105
|
if (strlen($airline_icao) == 2) { |
|
@@ -2120,7 +2120,7 @@ discard block |
|
|
block discarded – undo |
|
2120
|
2120
|
if ($fromsource === NULL) { |
|
2121
|
2121
|
$sth->execute(array(':airline_icao' => $airline_icao)); |
|
2122
|
2122
|
} else { |
|
2123
|
|
- $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
|
|
2123
|
+ $sth->execute(array(':airline_icao' => $airline_icao, ':fromsource' => $fromsource)); |
|
2124
|
2124
|
} |
|
2125
|
2125
|
/* |
|
2126
|
2126
|
$airline_array = array(); |
|
@@ -2162,13 +2162,13 @@ discard block |
|
|
block discarded – undo |
|
2162
|
2162
|
{ |
|
2163
|
2163
|
global $globalUseRealAirlines; |
|
2164
|
2164
|
if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
|
2165
|
|
- $airline_name = strtolower(filter_var($airline_name,FILTER_SANITIZE_STRING)); |
|
2166
|
|
- $query = "SELECT airlines.name, airlines.iata, airlines.icao, airlines.callsign, airlines.country, airlines.type FROM airlines WHERE lower(airlines.name) = :airline_name AND airlines.active = 'Y' AND airlines.forsource IS NULL LIMIT 1"; |
|
|
2165
|
+ $airline_name = strtolower(filter_var($airline_name, FILTER_SANITIZE_STRING)); |
|
|
2166
|
+ $query = "SELECT airlines.name, airlines.iata, airlines.icao, airlines.callsign, airlines.country, airlines.type FROM airlines WHERE lower(airlines.name) = :airline_name AND airlines.active = 'Y' AND airlines.forsource IS NULL LIMIT 1"; |
|
2167
|
2167
|
$sth = $this->db->prepare($query); |
|
2168
|
2168
|
if ($fromsource === NULL) { |
|
2169
|
2169
|
$sth->execute(array(':airline_name' => $airline_name)); |
|
2170
|
2170
|
} else { |
|
2171
|
|
- $sth->execute(array(':airline_name' => $airline_name,':fromsource' => $fromsource)); |
|
|
2171
|
+ $sth->execute(array(':airline_name' => $airline_name, ':fromsource' => $fromsource)); |
|
2172
|
2172
|
} |
|
2173
|
2173
|
$result = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
2174
|
2174
|
if (empty($result) && $fromsource !== NULL) { |
|
@@ -2193,12 +2193,12 @@ discard block |
|
|
block discarded – undo |
|
2193
|
2193
|
*/ |
|
2194
|
2194
|
public function getAllAircraftInfo($aircraft_type) |
|
2195
|
2195
|
{ |
|
2196
|
|
- $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
|
2196
|
+ $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
2197
|
2197
|
|
|
2198
|
2198
|
if ($aircraft_type == 'NA') { |
|
2199
|
|
- return array(array('icao' => 'NA','type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
|
2199
|
+ return array(array('icao' => 'NA', 'type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
2200
|
2200
|
} |
|
2201
|
|
- $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow, aircraft.official_page, aircraft.aircraft_description, aircraft.engine_type, aircraft.engine_count, aircraft.wake_category FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
|
2201
|
+ $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow, aircraft.official_page, aircraft.aircraft_description, aircraft.engine_type, aircraft.engine_count, aircraft.wake_category FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
2202
|
2202
|
|
|
2203
|
2203
|
$sth = $this->db->prepare($query); |
|
2204
|
2204
|
$sth->execute(array(':aircraft_type' => $aircraft_type)); |
|
@@ -2230,7 +2230,7 @@ discard block |
|
|
block discarded – undo |
|
2230
|
2230
|
*/ |
|
2231
|
2231
|
public function getAircraftIcao($aircraft_type) |
|
2232
|
2232
|
{ |
|
2233
|
|
- $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
|
2233
|
+ $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
2234
|
2234
|
$all_aircraft = array('737-300' => 'B733', |
|
2235
|
2235
|
'777-200' => 'B772', |
|
2236
|
2236
|
'777-200ER' => 'B772', |
|
@@ -2242,10 +2242,10 @@ discard block |
|
|
block discarded – undo |
|
2242
|
2242
|
'A380' => 'A388'); |
|
2243
|
2243
|
if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
|
2244
|
2244
|
|
|
2245
|
|
- $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
|
2245
|
+ $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
2246
|
2246
|
$aircraft_type = strtoupper($aircraft_type); |
|
2247
|
2247
|
$sth = $this->db->prepare($query); |
|
2248
|
|
- $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
|
|
2248
|
+ $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%', ':aircraft_type' => $aircraft_type,)); |
|
2249
|
2249
|
$result = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
2250
|
2250
|
if (isset($result[0]['icao'])) return $result[0]['icao']; |
|
2251
|
2251
|
else return ''; |
|
@@ -2260,9 +2260,9 @@ discard block |
|
|
block discarded – undo |
|
2260
|
2260
|
*/ |
|
2261
|
2261
|
public function getAllAircraftType($aircraft_modes) |
|
2262
|
2262
|
{ |
|
2263
|
|
- $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
|
2263
|
+ $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
2264
|
2264
|
|
|
2265
|
|
- $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
|
2265
|
+ $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
2266
|
2266
|
|
|
2267
|
2267
|
$sth = $this->db->prepare($query); |
|
2268
|
2268
|
$sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
|
@@ -2285,9 +2285,9 @@ discard block |
|
|
block discarded – undo |
|
2285
|
2285
|
*/ |
|
2286
|
2286
|
public function getAllAircraftTypeByRegistration($registration) |
|
2287
|
2287
|
{ |
|
2288
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
2288
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
2289
|
2289
|
|
|
2290
|
|
- $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.registration = :registration ORDER BY FirstCreated DESC LIMIT 1"; |
|
|
2290
|
+ $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.registration = :registration ORDER BY FirstCreated DESC LIMIT 1"; |
|
2291
|
2291
|
|
|
2292
|
2292
|
$sth = $this->db->prepare($query); |
|
2293
|
2293
|
$sth->execute(array(':registration' => $registration)); |
|
@@ -2308,9 +2308,9 @@ discard block |
|
|
block discarded – undo |
|
2308
|
2308
|
*/ |
|
2309
|
2309
|
public function getAllIDByRegistration($registration) |
|
2310
|
2310
|
{ |
|
2311
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
2311
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
2312
|
2312
|
|
|
2313
|
|
- $query = "SELECT spotter_id,flightaware_id, date FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
|
2313
|
+ $query = "SELECT spotter_id,flightaware_id, date FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
2314
|
2314
|
|
|
2315
|
2315
|
$sth = $this->db->prepare($query); |
|
2316
|
2316
|
$sth->execute(array(':registration' => $registration)); |
|
@@ -2318,7 +2318,7 @@ discard block |
|
|
block discarded – undo |
|
2318
|
2318
|
$idarray = array(); |
|
2319
|
2319
|
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
2320
|
2320
|
$date = $row['date']; |
|
2321
|
|
- $idarray[$date] = array('flightaware_id' => $row['flightaware_id'],'spotter_id' => $row['spotter_id']); |
|
|
2321
|
+ $idarray[$date] = array('flightaware_id' => $row['flightaware_id'], 'spotter_id' => $row['spotter_id']); |
|
2322
|
2322
|
} |
|
2323
|
2323
|
return $idarray; |
|
2324
|
2324
|
} |
|
@@ -2332,8 +2332,8 @@ discard block |
|
|
block discarded – undo |
|
2332
|
2332
|
*/ |
|
2333
|
2333
|
public function getOperator($operator) |
|
2334
|
2334
|
{ |
|
2335
|
|
- $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
|
2336
|
|
- $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
|
2335
|
+ $operator = filter_var($operator, FILTER_SANITIZE_STRING); |
|
|
2336
|
+ $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
2337
|
2337
|
|
|
2338
|
2338
|
$sth = $this->db->prepare($query); |
|
2339
|
2339
|
$sth->execute(array(':operator' => $operator)); |
|
@@ -2354,9 +2354,9 @@ discard block |
|
|
block discarded – undo |
|
2354
|
2354
|
*/ |
|
2355
|
2355
|
public function getRouteInfo($callsign) |
|
2356
|
2356
|
{ |
|
2357
|
|
- $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
|
2357
|
+ $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
2358
|
2358
|
if ($callsign == '') return array(); |
|
2359
|
|
- $query = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1"; |
|
|
2359
|
+ $query = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1"; |
|
2360
|
2360
|
|
|
2361
|
2361
|
$sth = $this->db->prepare($query); |
|
2362
|
2362
|
$sth->execute(array(':callsign' => $callsign)); |
|
@@ -2377,9 +2377,9 @@ discard block |
|
|
block discarded – undo |
|
2377
|
2377
|
*/ |
|
2378
|
2378
|
public function getAircraftInfoByRegistration($registration) |
|
2379
|
2379
|
{ |
|
2380
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
2380
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
2381
|
2381
|
|
|
2382
|
|
- $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
|
2382
|
+ $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
2383
|
2383
|
|
|
2384
|
2384
|
$sth = $this->db->prepare($query); |
|
2385
|
2385
|
$sth->execute(array(':registration' => $registration)); |
|
@@ -2387,7 +2387,7 @@ discard block |
|
|
block discarded – undo |
|
2387
|
2387
|
$aircraft_array = array(); |
|
2388
|
2388
|
$temp_array = array(); |
|
2389
|
2389
|
|
|
2390
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2390
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2391
|
2391
|
{ |
|
2392
|
2392
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
2393
|
2393
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
@@ -2409,7 +2409,7 @@ discard block |
|
|
block discarded – undo |
|
2409
|
2409
|
*/ |
|
2410
|
2410
|
public function getAircraftOwnerByRegistration($registration) |
|
2411
|
2411
|
{ |
|
2412
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
2412
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
2413
|
2413
|
$Connection = new Connection($this->db); |
|
2414
|
2414
|
if ($Connection->tableExists('aircraft_owner')) { |
|
2415
|
2415
|
$query = "SELECT aircraft_owner.base, aircraft_owner.owner, aircraft_owner.date_first_reg FROM aircraft_owner WHERE registration = :registration LIMIT 1"; |
|
@@ -2431,7 +2431,7 @@ discard block |
|
|
block discarded – undo |
|
2431
|
2431
|
public function getAllFlightsforSitemap() |
|
2432
|
2432
|
{ |
|
2433
|
2433
|
//$query = "SELECT spotter_output.spotter_id, spotter_output.ident, spotter_output.airline_name, spotter_output.aircraft_name, spotter_output.aircraft_icao FROM spotter_output ORDER BY LIMIT "; |
|
2434
|
|
- $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
|
2434
|
+ $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
2435
|
2435
|
|
|
2436
|
2436
|
$sth = $this->db->prepare($query); |
|
2437
|
2437
|
$sth->execute(); |
|
@@ -2478,7 +2478,7 @@ discard block |
|
|
block discarded – undo |
|
2478
|
2478
|
$manufacturer_array = array(); |
|
2479
|
2479
|
$temp_array = array(); |
|
2480
|
2480
|
|
|
2481
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2481
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2482
|
2482
|
{ |
|
2483
|
2483
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
2484
|
2484
|
|
|
@@ -2515,7 +2515,7 @@ discard block |
|
|
block discarded – undo |
|
2515
|
2515
|
$aircraft_array = array(); |
|
2516
|
2516
|
$temp_array = array(); |
|
2517
|
2517
|
|
|
2518
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2518
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2519
|
2519
|
{ |
|
2520
|
2520
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
2521
|
2521
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
@@ -2536,8 +2536,8 @@ discard block |
|
|
block discarded – undo |
|
2536
|
2536
|
*/ |
|
2537
|
2537
|
public function getAllAircraftRegistrations($filters = array()) |
|
2538
|
2538
|
{ |
|
2539
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2540
|
|
- $query = "SELECT DISTINCT spotter_output.registration |
|
|
2539
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2540
|
+ $query = "SELECT DISTINCT spotter_output.registration |
|
2541
|
2541
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' |
|
2542
|
2542
|
ORDER BY spotter_output.registration ASC"; |
|
2543
|
2543
|
|
|
@@ -2547,7 +2547,7 @@ discard block |
|
|
block discarded – undo |
|
2547
|
2547
|
$aircraft_array = array(); |
|
2548
|
2548
|
$temp_array = array(); |
|
2549
|
2549
|
|
|
2550
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2550
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2551
|
2551
|
{ |
|
2552
|
2552
|
$temp_array['registration'] = $row['registration']; |
|
2553
|
2553
|
|
|
@@ -2564,11 +2564,11 @@ discard block |
|
|
block discarded – undo |
|
2564
|
2564
|
* @return Array list of source name |
|
2565
|
2565
|
* |
|
2566
|
2566
|
*/ |
|
2567
|
|
- public function getAllSourceName($type = '',$filters = array()) |
|
|
2567
|
+ public function getAllSourceName($type = '', $filters = array()) |
|
2568
|
2568
|
{ |
|
2569
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
2569
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
2570
|
2570
|
$query_values = array(); |
|
2571
|
|
- $query = "SELECT DISTINCT spotter_output.source_name |
|
|
2571
|
+ $query = "SELECT DISTINCT spotter_output.source_name |
|
2572
|
2572
|
FROM spotter_output".$filter_query." spotter_output.source_name <> ''"; |
|
2573
|
2573
|
if ($type != '') { |
|
2574
|
2574
|
$query_values = array(':type' => $type); |
|
@@ -2583,7 +2583,7 @@ discard block |
|
|
block discarded – undo |
|
2583
|
2583
|
$source_array = array(); |
|
2584
|
2584
|
$temp_array = array(); |
|
2585
|
2585
|
|
|
2586
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2586
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2587
|
2587
|
{ |
|
2588
|
2588
|
$temp_array['source_name'] = $row['source_name']; |
|
2589
|
2589
|
$source_array[] = $temp_array; |
|
@@ -2599,11 +2599,11 @@ discard block |
|
|
block discarded – undo |
|
2599
|
2599
|
* @return Array list of airline names |
|
2600
|
2600
|
* |
|
2601
|
2601
|
*/ |
|
2602
|
|
- public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array()) |
|
|
2602
|
+ public function getAllAirlineNames($airline_type = '', $forsource = NULL, $filters = array()) |
|
2603
|
2603
|
{ |
|
2604
|
|
- global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
|
2605
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2606
|
|
- $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
|
2604
|
+ global $globalAirlinesSource, $globalVATSIM, $globalIVAO; |
|
|
2605
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2606
|
+ $airline_type = filter_var($airline_type, FILTER_SANITIZE_STRING); |
|
2607
|
2607
|
if ($airline_type == '' || $airline_type == 'all') { |
|
2608
|
2608
|
/* |
|
2609
|
2609
|
$query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
@@ -2622,7 +2622,7 @@ discard block |
|
|
block discarded – undo |
|
2622
|
2622
|
$query_data = array(':forsource' => $forsource); |
|
2623
|
2623
|
} |
|
2624
|
2624
|
} else { |
|
2625
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
|
2625
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
2626
|
2626
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
|
2627
|
2627
|
AND spotter_output.airline_type = :airline_type |
|
2628
|
2628
|
ORDER BY spotter_output.airline_icao ASC"; |
|
@@ -2635,7 +2635,7 @@ discard block |
|
|
block discarded – undo |
|
2635
|
2635
|
$airline_array = array(); |
|
2636
|
2636
|
$temp_array = array(); |
|
2637
|
2637
|
|
|
2638
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2638
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2639
|
2639
|
{ |
|
2640
|
2640
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
2641
|
2641
|
$temp_array['airline_name'] = $row['airline_name']; |
|
@@ -2652,10 +2652,10 @@ discard block |
|
|
block discarded – undo |
|
2652
|
2652
|
* @return Array list of alliance names |
|
2653
|
2653
|
* |
|
2654
|
2654
|
*/ |
|
2655
|
|
- public function getAllAllianceNames($forsource = NULL,$filters = array()) |
|
|
2655
|
+ public function getAllAllianceNames($forsource = NULL, $filters = array()) |
|
2656
|
2656
|
{ |
|
2657
|
|
- global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
|
2658
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
2657
|
+ global $globalAirlinesSource, $globalVATSIM, $globalIVAO; |
|
|
2658
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
2659
|
2659
|
if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource; |
|
2660
|
2660
|
elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim'; |
|
2661
|
2661
|
elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao'; |
|
@@ -2683,8 +2683,8 @@ discard block |
|
|
block discarded – undo |
|
2683
|
2683
|
*/ |
|
2684
|
2684
|
public function getAllAirlineCountries($filters = array()) |
|
2685
|
2685
|
{ |
|
2686
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2687
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
|
2686
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2687
|
+ $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
2688
|
2688
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' |
|
2689
|
2689
|
ORDER BY spotter_output.airline_country ASC"; |
|
2690
|
2690
|
|
|
@@ -2695,7 +2695,7 @@ discard block |
|
|
block discarded – undo |
|
2695
|
2695
|
$airline_array = array(); |
|
2696
|
2696
|
$temp_array = array(); |
|
2697
|
2697
|
|
|
2698
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2698
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2699
|
2699
|
{ |
|
2700
|
2700
|
$temp_array['airline_country'] = $row['airline_country']; |
|
2701
|
2701
|
|
|
@@ -2715,9 +2715,9 @@ discard block |
|
|
block discarded – undo |
|
2715
|
2715
|
*/ |
|
2716
|
2716
|
public function getAllAirportNames($filters = array()) |
|
2717
|
2717
|
{ |
|
2718
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
2718
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
2719
|
2719
|
$airport_array = array(); |
|
2720
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
|
2720
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
2721
|
2721
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_icao <> '' AND spotter_output.departure_airport_icao <> 'NA' |
|
2722
|
2722
|
ORDER BY spotter_output.departure_airport_city ASC"; |
|
2723
|
2723
|
|
|
@@ -2726,7 +2726,7 @@ discard block |
|
|
block discarded – undo |
|
2726
|
2726
|
$sth->execute(); |
|
2727
|
2727
|
|
|
2728
|
2728
|
$temp_array = array(); |
|
2729
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2729
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2730
|
2730
|
{ |
|
2731
|
2731
|
$temp_array['airport_icao'] = $row['airport_icao']; |
|
2732
|
2732
|
$temp_array['airport_name'] = $row['airport_name']; |
|
@@ -2736,14 +2736,14 @@ discard block |
|
|
block discarded – undo |
|
2736
|
2736
|
$airport_array[$row['airport_city'].",".$row['airport_name']] = $temp_array; |
|
2737
|
2737
|
} |
|
2738
|
2738
|
|
|
2739
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
|
2739
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
2740
|
2740
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_icao <> '' AND spotter_output.arrival_airport_icao <> 'NA' |
|
2741
|
2741
|
ORDER BY spotter_output.arrival_airport_city ASC"; |
|
2742
|
2742
|
|
|
2743
|
2743
|
$sth = $this->db->prepare($query); |
|
2744
|
2744
|
$sth->execute(); |
|
2745
|
2745
|
|
|
2746
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2746
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2747
|
2747
|
{ |
|
2748
|
2748
|
// if ($airport_array[$row['airport_city'].",".$row['airport_name']]['airport_icao'] != $row['airport_icao']) |
|
2749
|
2749
|
// { |
|
@@ -2783,21 +2783,21 @@ discard block |
|
|
block discarded – undo |
|
2783
|
2783
|
|
|
2784
|
2784
|
$temp_array = array(); |
|
2785
|
2785
|
|
|
2786
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2786
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2787
|
2787
|
{ |
|
2788
|
2788
|
$temp_array['airport_country'] = $row['airport_country']; |
|
2789
|
2789
|
|
|
2790
|
2790
|
$airport_array[$row['airport_country']] = $temp_array; |
|
2791
|
2791
|
} |
|
2792
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2793
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
|
2792
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2793
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
2794
|
2794
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' |
|
2795
|
2795
|
ORDER BY spotter_output.arrival_airport_country ASC"; |
|
2796
|
2796
|
|
|
2797
|
2797
|
$sth = $this->db->prepare($query); |
|
2798
|
2798
|
$sth->execute(); |
|
2799
|
2799
|
|
|
2800
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2800
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2801
|
2801
|
{ |
|
2802
|
2802
|
if (isset($airport_array[$row['airport_country']]['airport_country']) && $airport_array[$row['airport_country']]['airport_country'] != $row['airport_country']) |
|
2803
|
2803
|
{ |
|
@@ -2820,9 +2820,9 @@ discard block |
|
|
block discarded – undo |
|
2820
|
2820
|
*/ |
|
2821
|
2821
|
public function getAllCountries($filters = array()) |
|
2822
|
2822
|
{ |
|
2823
|
|
- $Connection= new Connection($this->db); |
|
|
2823
|
+ $Connection = new Connection($this->db); |
|
2824
|
2824
|
if ($Connection->tableExists('countries')) { |
|
2825
|
|
- $query = "SELECT countries.name AS airport_country |
|
|
2825
|
+ $query = "SELECT countries.name AS airport_country |
|
2826
|
2826
|
FROM countries |
|
2827
|
2827
|
ORDER BY countries.name ASC"; |
|
2828
|
2828
|
$sth = $this->db->prepare($query); |
|
@@ -2831,14 +2831,14 @@ discard block |
|
|
block discarded – undo |
|
2831
|
2831
|
$temp_array = array(); |
|
2832
|
2832
|
$country_array = array(); |
|
2833
|
2833
|
|
|
2834
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2834
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2835
|
2835
|
{ |
|
2836
|
2836
|
$temp_array['country'] = $row['airport_country']; |
|
2837
|
2837
|
$country_array[$row['airport_country']] = $temp_array; |
|
2838
|
2838
|
} |
|
2839
|
2839
|
} else { |
|
2840
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2841
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
|
2840
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2841
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
2842
|
2842
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' |
|
2843
|
2843
|
ORDER BY spotter_output.departure_airport_country ASC"; |
|
2844
|
2844
|
|
|
@@ -2847,20 +2847,20 @@ discard block |
|
|
block discarded – undo |
|
2847
|
2847
|
|
|
2848
|
2848
|
$temp_array = array(); |
|
2849
|
2849
|
$country_array = array(); |
|
2850
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2850
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2851
|
2851
|
{ |
|
2852
|
2852
|
$temp_array['country'] = $row['airport_country']; |
|
2853
|
2853
|
$country_array[$row['airport_country']] = $temp_array; |
|
2854
|
2854
|
} |
|
2855
|
2855
|
|
|
2856
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
|
2856
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
2857
|
2857
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' |
|
2858
|
2858
|
ORDER BY spotter_output.arrival_airport_country ASC"; |
|
2859
|
2859
|
|
|
2860
|
2860
|
$sth = $this->db->prepare($query); |
|
2861
|
2861
|
$sth->execute(); |
|
2862
|
2862
|
|
|
2863
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2863
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2864
|
2864
|
{ |
|
2865
|
2865
|
if ($country_array[$row['airport_country']]['country'] != $row['airport_country']) |
|
2866
|
2866
|
{ |
|
@@ -2870,14 +2870,14 @@ discard block |
|
|
block discarded – undo |
|
2870
|
2870
|
} |
|
2871
|
2871
|
} |
|
2872
|
2872
|
|
|
2873
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
|
2873
|
+ $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
2874
|
2874
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' |
|
2875
|
2875
|
ORDER BY spotter_output.airline_country ASC"; |
|
2876
|
2876
|
|
|
2877
|
2877
|
$sth = $this->db->prepare($query); |
|
2878
|
2878
|
$sth->execute(); |
|
2879
|
2879
|
|
|
2880
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2880
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2881
|
2881
|
{ |
|
2882
|
2882
|
if (isset($country_array[$row['airline_country']]['country']) && $country_array[$row['airline_country']]['country'] != $row['airline_country']) |
|
2883
|
2883
|
{ |
|
@@ -2901,8 +2901,8 @@ discard block |
|
|
block discarded – undo |
|
2901
|
2901
|
*/ |
|
2902
|
2902
|
public function getAllIdents($filters = array()) |
|
2903
|
2903
|
{ |
|
2904
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
2905
|
|
- $query = "SELECT DISTINCT spotter_output.ident |
|
|
2904
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
2905
|
+ $query = "SELECT DISTINCT spotter_output.ident |
|
2906
|
2906
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' |
|
2907
|
2907
|
ORDER BY spotter_output.date ASC LIMIT 700 OFFSET 0"; |
|
2908
|
2908
|
|
|
@@ -2912,7 +2912,7 @@ discard block |
|
|
block discarded – undo |
|
2912
|
2912
|
$ident_array = array(); |
|
2913
|
2913
|
$temp_array = array(); |
|
2914
|
2914
|
|
|
2915
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
2915
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
2916
|
2916
|
{ |
|
2917
|
2917
|
$temp_array['ident'] = $row['ident']; |
|
2918
|
2918
|
$ident_array[] = $temp_array; |
|
@@ -2926,9 +2926,9 @@ discard block |
|
|
block discarded – undo |
|
2926
|
2926
|
* @return Array number, icao, name and city of airports |
|
2927
|
2927
|
*/ |
|
2928
|
2928
|
|
|
2929
|
|
- public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
|
|
2929
|
+ public function getLast7DaysAirportsDeparture($airport_icao = '', $filters = array()) { |
|
2930
|
2930
|
global $globalTimezone, $globalDBdriver; |
|
2931
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
2931
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
2932
|
2932
|
if ($globalTimezone != '') { |
|
2933
|
2933
|
date_default_timezone_set($globalTimezone); |
|
2934
|
2934
|
$datetime = new DateTime(); |
|
@@ -2993,7 +2993,7 @@ discard block |
|
|
block discarded – undo |
|
2993
|
2993
|
|
|
2994
|
2994
|
public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
|
2995
|
2995
|
global $globalTimezone, $globalDBdriver; |
|
2996
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
2996
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
2997
|
2997
|
if ($globalTimezone != '') { |
|
2998
|
2998
|
date_default_timezone_set($globalTimezone); |
|
2999
|
2999
|
$datetime = new DateTime(); |
|
@@ -3077,7 +3077,7 @@ discard block |
|
|
block discarded – undo |
|
3077
|
3077
|
|
|
3078
|
3078
|
public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
|
3079
|
3079
|
global $globalTimezone, $globalDBdriver; |
|
3080
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
3080
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
3081
|
3081
|
if ($globalTimezone != '') { |
|
3082
|
3082
|
date_default_timezone_set($globalTimezone); |
|
3083
|
3083
|
$datetime = new DateTime(); |
|
@@ -3110,9 +3110,9 @@ discard block |
|
|
block discarded – undo |
|
3110
|
3110
|
* @return Array number, icao, name and city of airports |
|
3111
|
3111
|
*/ |
|
3112
|
3112
|
|
|
3113
|
|
- public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
|
|
3113
|
+ public function getLast7DaysDetectedAirportsArrival($airport_icao = '', $filters = array()) { |
|
3114
|
3114
|
global $globalTimezone, $globalDBdriver; |
|
3115
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
3115
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
3116
|
3116
|
if ($globalTimezone != '') { |
|
3117
|
3117
|
date_default_timezone_set($globalTimezone); |
|
3118
|
3118
|
$datetime = new DateTime(); |
|
@@ -3244,12 +3244,12 @@ discard block |
|
|
block discarded – undo |
|
3244
|
3244
|
} else $offset = '+00:00'; |
|
3245
|
3245
|
|
|
3246
|
3246
|
if ($globalDBdriver == 'mysql') { |
|
3247
|
|
- $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
|
3247
|
+ $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
3248
|
3248
|
FROM spotter_output |
|
3249
|
3249
|
WHERE spotter_output.date <> '' |
|
3250
|
3250
|
ORDER BY spotter_output.date ASC LIMIT 0,200"; |
|
3251
|
3251
|
} else { |
|
3252
|
|
- $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
|
3252
|
+ $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
3253
|
3253
|
FROM spotter_output |
|
3254
|
3254
|
WHERE spotter_output.date <> '' |
|
3255
|
3255
|
ORDER BY spotter_output.date ASC LIMIT 0,200"; |
|
@@ -3261,7 +3261,7 @@ discard block |
|
|
block discarded – undo |
|
3261
|
3261
|
$date_array = array(); |
|
3262
|
3262
|
$temp_array = array(); |
|
3263
|
3263
|
|
|
3264
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3264
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3265
|
3265
|
{ |
|
3266
|
3266
|
$temp_array['date'] = $row['date']; |
|
3267
|
3267
|
|
|
@@ -3281,7 +3281,7 @@ discard block |
|
|
block discarded – undo |
|
3281
|
3281
|
*/ |
|
3282
|
3282
|
public function getAllRoutes() |
|
3283
|
3283
|
{ |
|
3284
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao |
|
|
3284
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao |
|
3285
|
3285
|
FROM spotter_output |
|
3286
|
3286
|
WHERE spotter_output.ident <> '' |
|
3287
|
3287
|
GROUP BY route |
|
@@ -3292,7 +3292,7 @@ discard block |
|
|
block discarded – undo |
|
3292
|
3292
|
|
|
3293
|
3293
|
$routes_array = array(); |
|
3294
|
3294
|
$temp_array = array(); |
|
3295
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3295
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3296
|
3296
|
{ |
|
3297
|
3297
|
$temp_array['route'] = $row['route']; |
|
3298
|
3298
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -3311,21 +3311,21 @@ discard block |
|
|
block discarded – undo |
|
3311
|
3311
|
* @return String success or false |
|
3312
|
3312
|
* |
|
3313
|
3313
|
*/ |
|
3314
|
|
- public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
|
|
3314
|
+ public function updateIdentSpotterData($flightaware_id = '', $ident = '', $fromsource = NULL) |
|
3315
|
3315
|
{ |
|
3316
|
3316
|
if (!is_numeric(substr($ident, 0, 3))) |
|
3317
|
3317
|
{ |
|
3318
|
3318
|
if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) { |
|
3319
|
|
- $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2),$fromsource); |
|
|
3319
|
+ $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2), $fromsource); |
|
3320
|
3320
|
} elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) { |
|
3321
|
|
- $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3),$fromsource); |
|
|
3321
|
+ $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3), $fromsource); |
|
3322
|
3322
|
} else { |
|
3323
|
3323
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3324
|
3324
|
} |
|
3325
|
3325
|
if (count($airline_array) == 0) { |
|
3326
|
3326
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3327
|
3327
|
} |
|
3328
|
|
- if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
|
3328
|
+ if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
3329
|
3329
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3330
|
3330
|
} |
|
3331
|
3331
|
} else { |
|
@@ -3338,7 +3338,7 @@ discard block |
|
|
block discarded – undo |
|
3338
|
3338
|
|
|
3339
|
3339
|
|
|
3340
|
3340
|
$query = 'UPDATE spotter_output SET ident = :ident, airline_name = :airline_name, airline_icao = :airline_icao, airline_country = :airline_country, airline_type = :airline_type WHERE flightaware_id = :flightaware_id'; |
|
3341
|
|
- $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type); |
|
|
3341
|
+ $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type); |
|
3342
|
3342
|
|
|
3343
|
3343
|
try { |
|
3344
|
3344
|
$sth = $this->db->prepare($query); |
|
@@ -3359,11 +3359,11 @@ discard block |
|
|
block discarded – undo |
|
3359
|
3359
|
* @return String success or false |
|
3360
|
3360
|
* |
|
3361
|
3361
|
*/ |
|
3362
|
|
- public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
|
|
3362
|
+ public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '', $arrival_airport_time = '') |
|
3363
|
3363
|
{ |
|
3364
|
3364
|
if ($groundspeed == '') $groundspeed = NULL; |
|
3365
|
3365
|
$query = 'UPDATE spotter_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_ground = :last_ground, last_seen = :last_seen, real_arrival_airport_icao = :real_arrival_airport_icao, real_arrival_airport_time = :real_arrival_airport_time, last_ground_speed = :last_ground_speed WHERE flightaware_id = :flightaware_id'; |
|
3366
|
|
- $query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident); |
|
|
3366
|
+ $query_values = array(':flightaware_id' => $flightaware_id, ':real_arrival_airport_icao' => $arrival_airport_icao, ':last_latitude' => $latitude, ':last_longitude' => $longitude, ':last_altitude' => $altitude, ':last_ground_speed' => $groundspeed, ':last_seen' => $date, ':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident); |
|
3367
|
3367
|
|
|
3368
|
3368
|
try { |
|
3369
|
3369
|
$sth = $this->db->prepare($query); |
|
@@ -3403,7 +3403,7 @@ discard block |
|
|
block discarded – undo |
|
3403
|
3403
|
* @param String $verticalrate vertival rate of flight |
|
3404
|
3404
|
* @return String success or false |
|
3405
|
3405
|
*/ |
|
3406
|
|
- public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '',$squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false,$format_source = '', $source_name = '') |
|
|
3406
|
+ public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '', $pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false, $format_source = '', $source_name = '') |
|
3407
|
3407
|
{ |
|
3408
|
3408
|
global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
|
3409
|
3409
|
|
|
@@ -3427,13 +3427,13 @@ discard block |
|
|
block discarded – undo |
|
3427
|
3427
|
if ($ModeS != '') { |
|
3428
|
3428
|
$timeelapsed = microtime(true); |
|
3429
|
3429
|
$registration = $this->getAircraftRegistrationBymodeS($ModeS); |
|
3430
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3430
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3431
|
3431
|
} else { |
|
3432
|
|
- $myhex = explode('-',$flightaware_id); |
|
|
3432
|
+ $myhex = explode('-', $flightaware_id); |
|
3433
|
3433
|
if (count($myhex) > 0) { |
|
3434
|
3434
|
$timeelapsed = microtime(true); |
|
3435
|
3435
|
$registration = $this->getAircraftRegistrationBymodeS($myhex[0]); |
|
3436
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3436
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3437
|
3437
|
} |
|
3438
|
3438
|
} |
|
3439
|
3439
|
} |
|
@@ -3455,24 +3455,24 @@ discard block |
|
|
block discarded – undo |
|
3455
|
3455
|
{ |
|
3456
|
3456
|
$timeelapsed = microtime(true); |
|
3457
|
3457
|
if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) { |
|
3458
|
|
- $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2),$fromsource); |
|
|
3458
|
+ $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2), $fromsource); |
|
3459
|
3459
|
} elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) { |
|
3460
|
|
- $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3),$fromsource); |
|
|
3460
|
+ $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3), $fromsource); |
|
3461
|
3461
|
} else { |
|
3462
|
3462
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3463
|
3463
|
} |
|
3464
|
3464
|
if (count($airline_array) == 0) { |
|
3465
|
3465
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3466
|
3466
|
} |
|
3467
|
|
- if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
|
3467
|
+ if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
3468
|
3468
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3469
|
3469
|
} |
|
3470
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3470
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3471
|
3471
|
|
|
3472
|
3472
|
} else { |
|
3473
|
3473
|
$timeelapsed = microtime(true); |
|
3474
|
3474
|
$airline_array = $this->getAllAirlineInfo("NA"); |
|
3475
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3475
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3476
|
3476
|
} |
|
3477
|
3477
|
} |
|
3478
|
3478
|
} else $airline_array = array(); |
|
@@ -3489,27 +3489,27 @@ discard block |
|
|
block discarded – undo |
|
3489
|
3489
|
{ |
|
3490
|
3490
|
$timeelapsed = microtime(true); |
|
3491
|
3491
|
$aircraft_array = $this->getAllAircraftInfo("NA"); |
|
3492
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3492
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3493
|
3493
|
} else { |
|
3494
|
3494
|
$timeelapsed = microtime(true); |
|
3495
|
3495
|
$aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
|
3496
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3496
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3497
|
3497
|
} |
|
3498
|
3498
|
} |
|
3499
|
3499
|
} else { |
|
3500
|
3500
|
if ($ModeS != '') { |
|
3501
|
3501
|
$timeelapsed = microtime(true); |
|
3502
|
3502
|
$aircraft_icao = $this->getAllAircraftType($ModeS); |
|
3503
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3503
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3504
|
3504
|
if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
|
3505
|
3505
|
{ |
|
3506
|
3506
|
$timeelapsed = microtime(true); |
|
3507
|
3507
|
$aircraft_array = $this->getAllAircraftInfo("NA"); |
|
3508
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3508
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3509
|
3509
|
} else { |
|
3510
|
3510
|
$timeelapsed = microtime(true); |
|
3511
|
3511
|
$aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
|
3512
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3512
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3513
|
3513
|
} |
|
3514
|
3514
|
} |
|
3515
|
3515
|
} |
|
@@ -3525,7 +3525,7 @@ discard block |
|
|
block discarded – undo |
|
3525
|
3525
|
} else { |
|
3526
|
3526
|
$timeelapsed = microtime(true); |
|
3527
|
3527
|
$departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
|
3528
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3528
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3529
|
3529
|
} |
|
3530
|
3530
|
} |
|
3531
|
3531
|
|
|
@@ -3540,7 +3540,7 @@ discard block |
|
|
block discarded – undo |
|
3540
|
3540
|
} else { |
|
3541
|
3541
|
$timeelapsed = microtime(true); |
|
3542
|
3542
|
$arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
|
3543
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3543
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3544
|
3544
|
} |
|
3545
|
3545
|
} |
|
3546
|
3546
|
|
|
@@ -3603,7 +3603,7 @@ discard block |
|
|
block discarded – undo |
|
3603
|
3603
|
{ |
|
3604
|
3604
|
$timeelapsed = microtime(true); |
|
3605
|
3605
|
$image_array = $Image->getSpotterImage($registration); |
|
3606
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3606
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3607
|
3607
|
if (!isset($image_array[0]['registration'])) |
|
3608
|
3608
|
{ |
|
3609
|
3609
|
//echo "Add image !!!! \n"; |
|
@@ -3611,7 +3611,7 @@ discard block |
|
|
block discarded – undo |
|
3611
|
3611
|
} |
|
3612
|
3612
|
$timeelapsed = microtime(true); |
|
3613
|
3613
|
$owner_info = $this->getAircraftOwnerByRegistration($registration); |
|
3614
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3614
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3615
|
3615
|
if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
3616
|
3616
|
} |
|
3617
|
3617
|
|
|
@@ -3619,33 +3619,33 @@ discard block |
|
|
block discarded – undo |
|
3619
|
3619
|
{ |
|
3620
|
3620
|
if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3621
|
3621
|
else $airline_icao = ''; |
|
3622
|
|
- $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
|
3622
|
+ $image_array = $Image->getSpotterImage('', $aircraft_icao, $airline_icao); |
|
3623
|
3623
|
if (!isset($image_array[0]['registration'])) |
|
3624
|
3624
|
{ |
|
3625
|
3625
|
//echo "Add image !!!! \n"; |
|
3626
|
|
- $Image->addSpotterImage('',$aircraft_icao,$airline_icao); |
|
|
3626
|
+ $Image->addSpotterImage('', $aircraft_icao, $airline_icao); |
|
3627
|
3627
|
} |
|
3628
|
3628
|
} |
|
3629
|
3629
|
|
|
3630
|
|
- $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
3631
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
3632
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
3633
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
3634
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
3635
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
3636
|
|
- $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
3637
|
|
- $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
3638
|
|
- $waypoints = filter_var($waypoints,FILTER_SANITIZE_STRING); |
|
3639
|
|
- $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
3640
|
|
- $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
3641
|
|
- $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
3642
|
|
- $squawk = filter_var($squawk,FILTER_SANITIZE_NUMBER_INT); |
|
3643
|
|
- $route_stop = filter_var($route_stop,FILTER_SANITIZE_STRING); |
|
3644
|
|
- $ModeS = filter_var($ModeS,FILTER_SANITIZE_STRING); |
|
3645
|
|
- $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_STRING); |
|
3646
|
|
- $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
3647
|
|
- $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
3648
|
|
- $verticalrate = filter_var($verticalrate,FILTER_SANITIZE_NUMBER_INT); |
|
|
3630
|
+ $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
|
3631
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
3632
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
|
3633
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
3634
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
3635
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
|
3636
|
+ $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
3637
|
+ $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
3638
|
+ $waypoints = filter_var($waypoints, FILTER_SANITIZE_STRING); |
|
|
3639
|
+ $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
3640
|
+ $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
|
3641
|
+ $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
3642
|
+ $squawk = filter_var($squawk, FILTER_SANITIZE_NUMBER_INT); |
|
|
3643
|
+ $route_stop = filter_var($route_stop, FILTER_SANITIZE_STRING); |
|
|
3644
|
+ $ModeS = filter_var($ModeS, FILTER_SANITIZE_STRING); |
|
|
3645
|
+ $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_STRING); |
|
|
3646
|
+ $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
|
3647
|
+ $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
|
3648
|
+ $verticalrate = filter_var($verticalrate, FILTER_SANITIZE_NUMBER_INT); |
|
3649
|
3649
|
|
|
3650
|
3650
|
if (count($airline_array) == 0) |
|
3651
|
3651
|
{ |
|
@@ -3673,7 +3673,7 @@ discard block |
|
|
block discarded – undo |
|
3673
|
3673
|
if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3674
|
3674
|
if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3675
|
3675
|
if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3676
|
|
- $query = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) |
|
|
3676
|
+ $query = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) |
|
3677
|
3677
|
VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name,:departure_airport_city,:departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date, :departure_airport_time, :arrival_airport_time, :squawk, :route_stop, :highlight, :ModeS, :pilot_id, :pilot_name, :verticalrate, :owner_name,:ground, :format_source, :source_name)"; |
|
3678
|
3678
|
|
|
3679
|
3679
|
$airline_name = $airline_array[0]['name']; |
|
@@ -3683,7 +3683,7 @@ discard block |
|
|
block discarded – undo |
|
3683
|
3683
|
if ($airline_type == '') { |
|
3684
|
3684
|
$timeelapsed = microtime(true); |
|
3685
|
3685
|
$airline_type = $this->getAircraftTypeBymodeS($ModeS); |
|
3686
|
|
- if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
|
3686
|
+ if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
3687
|
3687
|
} |
|
3688
|
3688
|
if ($airline_type == null) $airline_type = ''; |
|
3689
|
3689
|
$aircraft_type = $aircraft_array[0]['type']; |
|
@@ -3695,7 +3695,7 @@ discard block |
|
|
block discarded – undo |
|
3695
|
3695
|
$arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3696
|
3696
|
$arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3697
|
3697
|
$arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3698
|
|
- $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date,':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name); |
|
|
3698
|
+ $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':registration' => $registration, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type, ':aircraft_icao' => $aircraft_icao, ':aircraft_type' => $aircraft_type, ':aircraft_manufacturer' => $aircraft_manufacturer, ':departure_airport_icao' => $departure_airport_icao, ':departure_airport_name' => $departure_airport_name, ':departure_airport_city' => $departure_airport_city, ':departure_airport_country' => $departure_airport_country, ':arrival_airport_icao' => $arrival_airport_icao, ':arrival_airport_name' => $arrival_airport_name, ':arrival_airport_city' => $arrival_airport_city, ':arrival_airport_country' => $arrival_airport_country, ':latitude' => $latitude, ':longitude' => $longitude, ':waypoints' => $waypoints, ':altitude' => $altitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':departure_airport_time' => $departure_airport_time, ':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name); |
|
3699
|
3699
|
|
|
3700
|
3700
|
try { |
|
3701
|
3701
|
|
|
@@ -3721,13 +3721,13 @@ discard block |
|
|
block discarded – undo |
|
3721
|
3721
|
{ |
|
3722
|
3722
|
global $globalDBdriver, $globalTimezone; |
|
3723
|
3723
|
if ($globalDBdriver == 'mysql') { |
|
3724
|
|
- $query = "SELECT spotter_output.ident FROM spotter_output |
|
|
3724
|
+ $query = "SELECT spotter_output.ident FROM spotter_output |
|
3725
|
3725
|
WHERE spotter_output.ident = :ident |
|
3726
|
3726
|
AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
|
3727
|
3727
|
AND spotter_output.date < UTC_TIMESTAMP()"; |
|
3728
|
3728
|
$query_data = array(':ident' => $ident); |
|
3729
|
3729
|
} else { |
|
3730
|
|
- $query = "SELECT spotter_output.ident FROM spotter_output |
|
|
3730
|
+ $query = "SELECT spotter_output.ident FROM spotter_output |
|
3731
|
3731
|
WHERE spotter_output.ident = :ident |
|
3732
|
3732
|
AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
|
3733
|
3733
|
AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
|
@@ -3736,8 +3736,8 @@ discard block |
|
|
block discarded – undo |
|
3736
|
3736
|
|
|
3737
|
3737
|
$sth = $this->db->prepare($query); |
|
3738
|
3738
|
$sth->execute($query_data); |
|
3739
|
|
- $ident_result=''; |
|
3740
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3739
|
+ $ident_result = ''; |
|
|
3740
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3741
|
3741
|
{ |
|
3742
|
3742
|
$ident_result = $row['ident']; |
|
3743
|
3743
|
} |
|
@@ -3763,8 +3763,8 @@ discard block |
|
|
block discarded – undo |
|
3763
|
3763
|
return false; |
|
3764
|
3764
|
} else { |
|
3765
|
3765
|
$q_array = explode(" ", $q); |
|
3766
|
|
- foreach ($q_array as $q_item){ |
|
3767
|
|
- $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
|
3766
|
+ foreach ($q_array as $q_item) { |
|
|
3767
|
+ $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
3768
|
3768
|
$additional_query .= " AND ("; |
|
3769
|
3769
|
$additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
|
3770
|
3770
|
$additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
|
@@ -3779,11 +3779,11 @@ discard block |
|
|
block discarded – undo |
|
3779
|
3779
|
} |
|
3780
|
3780
|
} |
|
3781
|
3781
|
if ($globalDBdriver == 'mysql') { |
|
3782
|
|
- $query = "SELECT spotter_output.* FROM spotter_output |
|
|
3782
|
+ $query = "SELECT spotter_output.* FROM spotter_output |
|
3783
|
3783
|
WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
|
3784
|
3784
|
AND spotter_output.date < UTC_TIMESTAMP()"; |
|
3785
|
3785
|
} else { |
|
3786
|
|
- $query = "SELECT spotter_output.* FROM spotter_output |
|
|
3786
|
+ $query = "SELECT spotter_output.* FROM spotter_output |
|
3787
|
3787
|
WHERE spotter_output.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
|
3788
|
3788
|
AND spotter_output.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
|
3789
|
3789
|
} |
|
@@ -3800,11 +3800,11 @@ discard block |
|
|
block discarded – undo |
|
3800
|
3800
|
* @return Array the airline list |
|
3801
|
3801
|
* |
|
3802
|
3802
|
*/ |
|
3803
|
|
- public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '') |
|
|
3803
|
+ public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
3804
|
3804
|
{ |
|
3805
|
3805
|
global $globalDBdriver; |
|
3806
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
3807
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
3806
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
3807
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
3808
|
3808
|
FROM spotter_output".$filter_query." spotter_output.airline_name <> '' AND spotter_output.airline_icao <> 'NA'"; |
|
3809
|
3809
|
if ($olderthanmonths > 0) { |
|
3810
|
3810
|
if ($globalDBdriver == 'mysql') { |
|
@@ -3824,28 +3824,28 @@ discard block |
|
|
block discarded – undo |
|
3824
|
3824
|
if ($year != '') { |
|
3825
|
3825
|
if ($globalDBdriver == 'mysql') { |
|
3826
|
3826
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
3827
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
3827
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
3828
|
3828
|
} else { |
|
3829
|
3829
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
3830
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
3830
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
3831
|
3831
|
} |
|
3832
|
3832
|
} |
|
3833
|
3833
|
if ($month != '') { |
|
3834
|
3834
|
if ($globalDBdriver == 'mysql') { |
|
3835
|
3835
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
3836
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
3836
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
3837
|
3837
|
} else { |
|
3838
|
3838
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
3839
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
3839
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
3840
|
3840
|
} |
|
3841
|
3841
|
} |
|
3842
|
3842
|
if ($day != '') { |
|
3843
|
3843
|
if ($globalDBdriver == 'mysql') { |
|
3844
|
3844
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
3845
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
3845
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
3846
|
3846
|
} else { |
|
3847
|
3847
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
3848
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
3848
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
3849
|
3849
|
} |
|
3850
|
3850
|
} |
|
3851
|
3851
|
$query .= " GROUP BY spotter_output.airline_name,spotter_output.airline_icao, spotter_output.airline_country ORDER BY airline_count DESC"; |
|
@@ -3855,7 +3855,7 @@ discard block |
|
|
block discarded – undo |
|
3855
|
3855
|
$sth->execute($query_values); |
|
3856
|
3856
|
$airline_array = array(); |
|
3857
|
3857
|
$temp_array = array(); |
|
3858
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3858
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3859
|
3859
|
{ |
|
3860
|
3860
|
$temp_array['airline_name'] = $row['airline_name']; |
|
3861
|
3861
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -3872,11 +3872,11 @@ discard block |
|
|
block discarded – undo |
|
3872
|
3872
|
* @return Array the pilots list |
|
3873
|
3873
|
* |
|
3874
|
3874
|
*/ |
|
3875
|
|
- public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '') |
|
|
3875
|
+ public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
3876
|
3876
|
{ |
|
3877
|
3877
|
global $globalDBdriver; |
|
3878
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
3879
|
|
- $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
|
|
3878
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
3879
|
+ $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
|
3880
|
3880
|
FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' "; |
|
3881
|
3881
|
if ($olderthanmonths > 0) { |
|
3882
|
3882
|
if ($globalDBdriver == 'mysql') { |
|
@@ -3896,28 +3896,28 @@ discard block |
|
|
block discarded – undo |
|
3896
|
3896
|
if ($year != '') { |
|
3897
|
3897
|
if ($globalDBdriver == 'mysql') { |
|
3898
|
3898
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
3899
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
3899
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
3900
|
3900
|
} else { |
|
3901
|
3901
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
3902
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
3902
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
3903
|
3903
|
} |
|
3904
|
3904
|
} |
|
3905
|
3905
|
if ($month != '') { |
|
3906
|
3906
|
if ($globalDBdriver == 'mysql') { |
|
3907
|
3907
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
3908
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
3908
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
3909
|
3909
|
} else { |
|
3910
|
3910
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
3911
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
3911
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
3912
|
3912
|
} |
|
3913
|
3913
|
} |
|
3914
|
3914
|
if ($day != '') { |
|
3915
|
3915
|
if ($globalDBdriver == 'mysql') { |
|
3916
|
3916
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
3917
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
3917
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
3918
|
3918
|
} else { |
|
3919
|
3919
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
3920
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
3920
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
3921
|
3921
|
} |
|
3922
|
3922
|
} |
|
3923
|
3923
|
|
|
@@ -3929,7 +3929,7 @@ discard block |
|
|
block discarded – undo |
|
3929
|
3929
|
$sth->execute($query_values); |
|
3930
|
3930
|
$airline_array = array(); |
|
3931
|
3931
|
$temp_array = array(); |
|
3932
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3932
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3933
|
3933
|
{ |
|
3934
|
3934
|
$temp_array['pilot_name'] = $row['pilot_name']; |
|
3935
|
3935
|
$temp_array['pilot_id'] = $row['pilot_id']; |
|
@@ -3949,7 +3949,7 @@ discard block |
|
|
block discarded – undo |
|
3949
|
3949
|
public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
3950
|
3950
|
{ |
|
3951
|
3951
|
global $globalDBdriver; |
|
3952
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
|
|
3952
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
|
3953
|
3953
|
FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
|
3954
|
3954
|
if ($olderthanmonths > 0) { |
|
3955
|
3955
|
if ($globalDBdriver == 'mysql') { |
|
@@ -3975,7 +3975,7 @@ discard block |
|
|
block discarded – undo |
|
3975
|
3975
|
$airline_array = array(); |
|
3976
|
3976
|
$temp_array = array(); |
|
3977
|
3977
|
|
|
3978
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
3978
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
3979
|
3979
|
{ |
|
3980
|
3980
|
$temp_array['pilot_name'] = $row['pilot_name']; |
|
3981
|
3981
|
$temp_array['pilot_id'] = $row['pilot_id']; |
|
@@ -3993,11 +3993,11 @@ discard block |
|
|
block discarded – undo |
|
3993
|
3993
|
* @return Array the pilots list |
|
3994
|
3994
|
* |
|
3995
|
3995
|
*/ |
|
3996
|
|
- public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
|
|
3996
|
+ public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
3997
|
3997
|
{ |
|
3998
|
3998
|
global $globalDBdriver; |
|
3999
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4000
|
|
- $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
|
3999
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4000
|
+ $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
4001
|
4001
|
FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL"; |
|
4002
|
4002
|
if ($olderthanmonths > 0) { |
|
4003
|
4003
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4017,28 +4017,28 @@ discard block |
|
|
block discarded – undo |
|
4017
|
4017
|
if ($year != '') { |
|
4018
|
4018
|
if ($globalDBdriver == 'mysql') { |
|
4019
|
4019
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
4020
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4020
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4021
|
4021
|
} else { |
|
4022
|
4022
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
4023
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4023
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4024
|
4024
|
} |
|
4025
|
4025
|
} |
|
4026
|
4026
|
if ($month != '') { |
|
4027
|
4027
|
if ($globalDBdriver == 'mysql') { |
|
4028
|
4028
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
4029
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4029
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4030
|
4030
|
} else { |
|
4031
|
4031
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
4032
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4032
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4033
|
4033
|
} |
|
4034
|
4034
|
} |
|
4035
|
4035
|
if ($day != '') { |
|
4036
|
4036
|
if ($globalDBdriver == 'mysql') { |
|
4037
|
4037
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
4038
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4038
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4039
|
4039
|
} else { |
|
4040
|
4040
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
4041
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4041
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4042
|
4042
|
} |
|
4043
|
4043
|
} |
|
4044
|
4044
|
$query .= " GROUP BY spotter_output.owner_name ORDER BY owner_count DESC"; |
|
@@ -4048,7 +4048,7 @@ discard block |
|
|
block discarded – undo |
|
4048
|
4048
|
$sth->execute($query_values); |
|
4049
|
4049
|
$airline_array = array(); |
|
4050
|
4050
|
$temp_array = array(); |
|
4051
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4051
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4052
|
4052
|
{ |
|
4053
|
4053
|
$temp_array['owner_name'] = $row['owner_name']; |
|
4054
|
4054
|
$temp_array['owner_count'] = $row['owner_count']; |
|
@@ -4063,11 +4063,11 @@ discard block |
|
|
block discarded – undo |
|
4063
|
4063
|
* @return Array the pilots list |
|
4064
|
4064
|
* |
|
4065
|
4065
|
*/ |
|
4066
|
|
- public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
|
4066
|
+ public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
4067
|
4067
|
{ |
|
4068
|
4068
|
global $globalDBdriver; |
|
4069
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4070
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
|
4069
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4070
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
4071
|
4071
|
FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
|
4072
|
4072
|
if ($olderthanmonths > 0) { |
|
4073
|
4073
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4093,7 +4093,7 @@ discard block |
|
|
block discarded – undo |
|
4093
|
4093
|
$airline_array = array(); |
|
4094
|
4094
|
$temp_array = array(); |
|
4095
|
4095
|
|
|
4096
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4096
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4097
|
4097
|
{ |
|
4098
|
4098
|
$temp_array['owner_name'] = $row['owner_name']; |
|
4099
|
4099
|
$temp_array['owner_count'] = $row['owner_count']; |
|
@@ -4109,11 +4109,11 @@ discard block |
|
|
block discarded – undo |
|
4109
|
4109
|
* @return Array the airline list |
|
4110
|
4110
|
* |
|
4111
|
4111
|
*/ |
|
4112
|
|
- public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
|
|
4112
|
+ public function countAllAirlinesByAircraft($aircraft_icao, $filters = array()) |
|
4113
|
4113
|
{ |
|
4114
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
4115
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4116
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4114
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
4115
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4116
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4117
|
4117
|
FROM spotter_output".$filter_query." spotter_output.airline_name <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
4118
|
4118
|
GROUP BY spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country |
|
4119
|
4119
|
ORDER BY airline_count DESC"; |
|
@@ -4125,7 +4125,7 @@ discard block |
|
|
block discarded – undo |
|
4125
|
4125
|
$airline_array = array(); |
|
4126
|
4126
|
$temp_array = array(); |
|
4127
|
4127
|
|
|
4128
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4128
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4129
|
4129
|
{ |
|
4130
|
4130
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4131
|
4131
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4145,11 +4145,11 @@ discard block |
|
|
block discarded – undo |
|
4145
|
4145
|
* @return Array the airline country list |
|
4146
|
4146
|
* |
|
4147
|
4147
|
*/ |
|
4148
|
|
- public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
|
|
4148
|
+ public function countAllAirlineCountriesByAircraft($aircraft_icao, $filters = array()) |
|
4149
|
4149
|
{ |
|
4150
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
4151
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4152
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4150
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
4151
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4152
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4153
|
4153
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
4154
|
4154
|
GROUP BY spotter_output.airline_country |
|
4155
|
4155
|
ORDER BY airline_country_count DESC |
|
@@ -4162,7 +4162,7 @@ discard block |
|
|
block discarded – undo |
|
4162
|
4162
|
$airline_country_array = array(); |
|
4163
|
4163
|
$temp_array = array(); |
|
4164
|
4164
|
|
|
4165
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4165
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4166
|
4166
|
{ |
|
4167
|
4167
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4168
|
4168
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4181,11 +4181,11 @@ discard block |
|
|
block discarded – undo |
|
4181
|
4181
|
* @return Array the airline list |
|
4182
|
4182
|
* |
|
4183
|
4183
|
*/ |
|
4184
|
|
- public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
|
|
4184
|
+ public function countAllAirlinesByAirport($airport_icao, $filters = array()) |
|
4185
|
4185
|
{ |
|
4186
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
4187
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4188
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4186
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
4187
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4188
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4189
|
4189
|
FROM spotter_output".$filter_query." spotter_output.airline_name <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
|
4190
|
4190
|
GROUP BY spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country |
|
4191
|
4191
|
ORDER BY airline_count DESC"; |
|
@@ -4197,7 +4197,7 @@ discard block |
|
|
block discarded – undo |
|
4197
|
4197
|
$airline_array = array(); |
|
4198
|
4198
|
$temp_array = array(); |
|
4199
|
4199
|
|
|
4200
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4200
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4201
|
4201
|
{ |
|
4202
|
4202
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4203
|
4203
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4216,11 +4216,11 @@ discard block |
|
|
block discarded – undo |
|
4216
|
4216
|
* @return Array the airline country list |
|
4217
|
4217
|
* |
|
4218
|
4218
|
*/ |
|
4219
|
|
- public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
|
|
4219
|
+ public function countAllAirlineCountriesByAirport($airport_icao, $filters = array()) |
|
4220
|
4220
|
{ |
|
4221
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
4222
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4223
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4221
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
4222
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4223
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4224
|
4224
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
|
4225
|
4225
|
GROUP BY spotter_output.airline_country |
|
4226
|
4226
|
ORDER BY airline_country_count DESC |
|
@@ -4233,7 +4233,7 @@ discard block |
|
|
block discarded – undo |
|
4233
|
4233
|
$airline_country_array = array(); |
|
4234
|
4234
|
$temp_array = array(); |
|
4235
|
4235
|
|
|
4236
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4236
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4237
|
4237
|
{ |
|
4238
|
4238
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4239
|
4239
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4250,11 +4250,11 @@ discard block |
|
|
block discarded – undo |
|
4250
|
4250
|
* @return Array the airline list |
|
4251
|
4251
|
* |
|
4252
|
4252
|
*/ |
|
4253
|
|
- public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
4253
|
+ public function countAllAirlinesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
4254
|
4254
|
{ |
|
4255
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
4256
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4257
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4255
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
4256
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4257
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4258
|
4258
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
4259
|
4259
|
GROUP BY spotter_output.airline_name |
|
4260
|
4260
|
ORDER BY airline_count DESC"; |
|
@@ -4265,7 +4265,7 @@ discard block |
|
|
block discarded – undo |
|
4265
|
4265
|
$airline_array = array(); |
|
4266
|
4266
|
$temp_array = array(); |
|
4267
|
4267
|
|
|
4268
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4268
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4269
|
4269
|
{ |
|
4270
|
4270
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4271
|
4271
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4285,11 +4285,11 @@ discard block |
|
|
block discarded – undo |
|
4285
|
4285
|
* @return Array the airline country list |
|
4286
|
4286
|
* |
|
4287
|
4287
|
*/ |
|
4288
|
|
- public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
4288
|
+ public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
4289
|
4289
|
{ |
|
4290
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
4291
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4292
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4290
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
4291
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4292
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4293
|
4293
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
4294
|
4294
|
GROUP BY spotter_output.airline_country |
|
4295
|
4295
|
ORDER BY airline_country_count DESC |
|
@@ -4302,7 +4302,7 @@ discard block |
|
|
block discarded – undo |
|
4302
|
4302
|
$airline_country_array = array(); |
|
4303
|
4303
|
$temp_array = array(); |
|
4304
|
4304
|
|
|
4305
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4305
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4306
|
4306
|
{ |
|
4307
|
4307
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4308
|
4308
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4318,11 +4318,11 @@ discard block |
|
|
block discarded – undo |
|
4318
|
4318
|
* @return Array the airline list |
|
4319
|
4319
|
* |
|
4320
|
4320
|
*/ |
|
4321
|
|
- public function countAllAirlinesByDate($date,$filters = array()) |
|
|
4321
|
+ public function countAllAirlinesByDate($date, $filters = array()) |
|
4322
|
4322
|
{ |
|
4323
|
4323
|
global $globalTimezone, $globalDBdriver; |
|
4324
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4325
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
4324
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4325
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
4326
|
4326
|
if ($globalTimezone != '') { |
|
4327
|
4327
|
date_default_timezone_set($globalTimezone); |
|
4328
|
4328
|
$datetime = new DateTime($date); |
|
@@ -4330,12 +4330,12 @@ discard block |
|
|
block discarded – undo |
|
4330
|
4330
|
} else $offset = '+00:00'; |
|
4331
|
4331
|
|
|
4332
|
4332
|
if ($globalDBdriver == 'mysql') { |
|
4333
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4333
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4334
|
4334
|
FROM spotter_output".$filter_query." DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
4335
|
4335
|
GROUP BY spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country |
|
4336
|
4336
|
ORDER BY airline_count DESC"; |
|
4337
|
4337
|
} else { |
|
4338
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4338
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4339
|
4339
|
FROM spotter_output".$filter_query." to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
4340
|
4340
|
GROUP BY spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country |
|
4341
|
4341
|
ORDER BY airline_count DESC"; |
|
@@ -4346,7 +4346,7 @@ discard block |
|
|
block discarded – undo |
|
4346
|
4346
|
|
|
4347
|
4347
|
$airline_array = array(); |
|
4348
|
4348
|
$temp_array = array(); |
|
4349
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4349
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4350
|
4350
|
{ |
|
4351
|
4351
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4352
|
4352
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4366,11 +4366,11 @@ discard block |
|
|
block discarded – undo |
|
4366
|
4366
|
* @return Array the airline country list |
|
4367
|
4367
|
* |
|
4368
|
4368
|
*/ |
|
4369
|
|
- public function countAllAirlineCountriesByDate($date,$filters = array()) |
|
|
4369
|
+ public function countAllAirlineCountriesByDate($date, $filters = array()) |
|
4370
|
4370
|
{ |
|
4371
|
4371
|
global $globalTimezone, $globalDBdriver; |
|
4372
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4373
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
4372
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4373
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
4374
|
4374
|
if ($globalTimezone != '') { |
|
4375
|
4375
|
date_default_timezone_set($globalTimezone); |
|
4376
|
4376
|
$datetime = new DateTime($date); |
|
@@ -4378,13 +4378,13 @@ discard block |
|
|
block discarded – undo |
|
4378
|
4378
|
} else $offset = '+00:00'; |
|
4379
|
4379
|
|
|
4380
|
4380
|
if ($globalDBdriver == 'mysql') { |
|
4381
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4381
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4382
|
4382
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
4383
|
4383
|
GROUP BY spotter_output.airline_country |
|
4384
|
4384
|
ORDER BY airline_country_count DESC |
|
4385
|
4385
|
LIMIT 10 OFFSET 0"; |
|
4386
|
4386
|
} else { |
|
4387
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4387
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4388
|
4388
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
4389
|
4389
|
GROUP BY spotter_output.airline_country |
|
4390
|
4390
|
ORDER BY airline_country_count DESC |
|
@@ -4396,7 +4396,7 @@ discard block |
|
|
block discarded – undo |
|
4396
|
4396
|
|
|
4397
|
4397
|
$airline_country_array = array(); |
|
4398
|
4398
|
$temp_array = array(); |
|
4399
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4399
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4400
|
4400
|
{ |
|
4401
|
4401
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4402
|
4402
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4413,11 +4413,11 @@ discard block |
|
|
block discarded – undo |
|
4413
|
4413
|
* @return Array the airline list |
|
4414
|
4414
|
* |
|
4415
|
4415
|
*/ |
|
4416
|
|
- public function countAllAirlinesByIdent($ident,$filters = array()) |
|
|
4416
|
+ public function countAllAirlinesByIdent($ident, $filters = array()) |
|
4417
|
4417
|
{ |
|
4418
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
4419
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4420
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4418
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
4419
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4420
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4421
|
4421
|
FROM spotter_output".$filter_query." spotter_output.ident = :ident |
|
4422
|
4422
|
GROUP BY spotter_output.airline_name |
|
4423
|
4423
|
ORDER BY airline_count DESC"; |
|
@@ -4429,7 +4429,7 @@ discard block |
|
|
block discarded – undo |
|
4429
|
4429
|
$airline_array = array(); |
|
4430
|
4430
|
$temp_array = array(); |
|
4431
|
4431
|
|
|
4432
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4432
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4433
|
4433
|
{ |
|
4434
|
4434
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4435
|
4435
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4447,25 +4447,25 @@ discard block |
|
|
block discarded – undo |
|
4447
|
4447
|
* @return Array the airline list |
|
4448
|
4448
|
* |
|
4449
|
4449
|
*/ |
|
4450
|
|
- public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
|
|
4450
|
+ public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
4451
|
4451
|
{ |
|
4452
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4453
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
4454
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
4452
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4453
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
4454
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
4455
|
4455
|
|
|
4456
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4456
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4457
|
4457
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
4458
|
4458
|
GROUP BY spotter_output.airline_name |
|
4459
|
4459
|
ORDER BY airline_count DESC"; |
|
4460
|
4460
|
|
|
4461
|
4461
|
|
|
4462
|
4462
|
$sth = $this->db->prepare($query); |
|
4463
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
4463
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
4464
|
4464
|
|
|
4465
|
4465
|
$airline_array = array(); |
|
4466
|
4466
|
$temp_array = array(); |
|
4467
|
4467
|
|
|
4468
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4468
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4469
|
4469
|
{ |
|
4470
|
4470
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4471
|
4471
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4483,13 +4483,13 @@ discard block |
|
|
block discarded – undo |
|
4483
|
4483
|
* @return Array the airline country list |
|
4484
|
4484
|
* |
|
4485
|
4485
|
*/ |
|
4486
|
|
- public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
|
|
4486
|
+ public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
4487
|
4487
|
{ |
|
4488
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4489
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
4490
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
4488
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4489
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
4490
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
4491
|
4491
|
|
|
4492
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4492
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4493
|
4493
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
4494
|
4494
|
GROUP BY spotter_output.airline_country |
|
4495
|
4495
|
ORDER BY airline_country_count DESC |
|
@@ -4497,11 +4497,11 @@ discard block |
|
|
block discarded – undo |
|
4497
|
4497
|
|
|
4498
|
4498
|
|
|
4499
|
4499
|
$sth = $this->db->prepare($query); |
|
4500
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
4500
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
4501
|
4501
|
|
|
4502
|
4502
|
$airline_country_array = array(); |
|
4503
|
4503
|
$temp_array = array(); |
|
4504
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4504
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4505
|
4505
|
{ |
|
4506
|
4506
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4507
|
4507
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4519,11 +4519,11 @@ discard block |
|
|
block discarded – undo |
|
4519
|
4519
|
* @return Array the airline list |
|
4520
|
4520
|
* |
|
4521
|
4521
|
*/ |
|
4522
|
|
- public function countAllAirlinesByCountry($country,$filters = array()) |
|
|
4522
|
+ public function countAllAirlinesByCountry($country, $filters = array()) |
|
4523
|
4523
|
{ |
|
4524
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
4525
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4526
|
|
- $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
|
4524
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
4525
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4526
|
+ $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
4527
|
4527
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
4528
|
4528
|
GROUP BY spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country |
|
4529
|
4529
|
ORDER BY airline_count DESC"; |
|
@@ -4534,7 +4534,7 @@ discard block |
|
|
block discarded – undo |
|
4534
|
4534
|
|
|
4535
|
4535
|
$airline_array = array(); |
|
4536
|
4536
|
$temp_array = array(); |
|
4537
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4537
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4538
|
4538
|
{ |
|
4539
|
4539
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4540
|
4540
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
@@ -4553,11 +4553,11 @@ discard block |
|
|
block discarded – undo |
|
4553
|
4553
|
* @return Array the airline country list |
|
4554
|
4554
|
* |
|
4555
|
4555
|
*/ |
|
4556
|
|
- public function countAllAirlineCountriesByCountry($country,$filters = array()) |
|
|
4556
|
+ public function countAllAirlineCountriesByCountry($country, $filters = array()) |
|
4557
|
4557
|
{ |
|
4558
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4559
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
4560
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4558
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4559
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
4560
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4561
|
4561
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
4562
|
4562
|
GROUP BY spotter_output.airline_country |
|
4563
|
4563
|
ORDER BY airline_country_count DESC |
|
@@ -4569,7 +4569,7 @@ discard block |
|
|
block discarded – undo |
|
4569
|
4569
|
|
|
4570
|
4570
|
$airline_country_array = array(); |
|
4571
|
4571
|
$temp_array = array(); |
|
4572
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4572
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4573
|
4573
|
{ |
|
4574
|
4574
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4575
|
4575
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4589,35 +4589,35 @@ discard block |
|
|
block discarded – undo |
|
4589
|
4589
|
public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
|
4590
|
4590
|
{ |
|
4591
|
4591
|
global $globalDBdriver; |
|
4592
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4593
|
|
- $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
|
4592
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4593
|
+ $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
4594
|
4594
|
FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND spotter_output.airline_country <> 'NA'"; |
|
4595
|
4595
|
$query_values = array(); |
|
4596
|
4596
|
if ($year != '') { |
|
4597
|
4597
|
if ($globalDBdriver == 'mysql') { |
|
4598
|
4598
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
4599
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4599
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4600
|
4600
|
} else { |
|
4601
|
4601
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
4602
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4602
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4603
|
4603
|
} |
|
4604
|
4604
|
} |
|
4605
|
4605
|
if ($month != '') { |
|
4606
|
4606
|
if ($globalDBdriver == 'mysql') { |
|
4607
|
4607
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
4608
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4608
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4609
|
4609
|
} else { |
|
4610
|
4610
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
4611
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4611
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4612
|
4612
|
} |
|
4613
|
4613
|
} |
|
4614
|
4614
|
if ($day != '') { |
|
4615
|
4615
|
if ($globalDBdriver == 'mysql') { |
|
4616
|
4616
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
4617
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4617
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4618
|
4618
|
} else { |
|
4619
|
4619
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
4620
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4620
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4621
|
4621
|
} |
|
4622
|
4622
|
} |
|
4623
|
4623
|
$query .= " GROUP BY spotter_output.airline_country |
|
@@ -4629,7 +4629,7 @@ discard block |
|
|
block discarded – undo |
|
4629
|
4629
|
|
|
4630
|
4630
|
$airline_array = array(); |
|
4631
|
4631
|
$temp_array = array(); |
|
4632
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4632
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4633
|
4633
|
{ |
|
4634
|
4634
|
$temp_array['airline_country_count'] = $row['airline_country_count']; |
|
4635
|
4635
|
$temp_array['airline_country'] = $row['airline_country']; |
|
@@ -4645,11 +4645,11 @@ discard block |
|
|
block discarded – undo |
|
4645
|
4645
|
* @return Array the airline country list |
|
4646
|
4646
|
* |
|
4647
|
4647
|
*/ |
|
4648
|
|
- public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
|
4648
|
+ public function countAllFlightOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
4649
|
4649
|
{ |
|
4650
|
4650
|
global $globalDBdriver; |
|
4651
|
4651
|
//$filter_query = $this->getFilter($filters,true,true); |
|
4652
|
|
- $Connection= new Connection($this->db); |
|
|
4652
|
+ $Connection = new Connection($this->db); |
|
4653
|
4653
|
if (!$Connection->tableExists('countries')) return array(); |
|
4654
|
4654
|
/* |
|
4655
|
4655
|
$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
|
@@ -4664,7 +4664,7 @@ discard block |
|
|
block discarded – undo |
|
4664
|
4664
|
*/ |
|
4665
|
4665
|
require_once('class.SpotterLive.php'); |
|
4666
|
4666
|
$SpotterLive = new SpotterLive(); |
|
4667
|
|
- $filter_query = $SpotterLive->getFilter($filters,true,true); |
|
|
4667
|
+ $filter_query = $SpotterLive->getFilter($filters, true, true); |
|
4668
|
4668
|
$filter_query .= ' over_country IS NOT NULL'; |
|
4669
|
4669
|
if ($olderthanmonths > 0) { |
|
4670
|
4670
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4691,7 +4691,7 @@ discard block |
|
|
block discarded – undo |
|
4691
|
4691
|
$flight_array = array(); |
|
4692
|
4692
|
$temp_array = array(); |
|
4693
|
4693
|
|
|
4694
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4694
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4695
|
4695
|
{ |
|
4696
|
4696
|
$temp_array['flight_count'] = $row['nb']; |
|
4697
|
4697
|
$temp_array['flight_country'] = $row['name']; |
|
@@ -4709,11 +4709,11 @@ discard block |
|
|
block discarded – undo |
|
4709
|
4709
|
* @return Array the aircraft list |
|
4710
|
4710
|
* |
|
4711
|
4711
|
*/ |
|
4712
|
|
- public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
|
|
4712
|
+ public function countAllAircraftTypes($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
4713
|
4713
|
{ |
|
4714
|
4714
|
global $globalDBdriver; |
|
4715
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4716
|
|
- $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
|
4715
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4716
|
+ $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
4717
|
4717
|
FROM spotter_output ".$filter_query." spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> ''"; |
|
4718
|
4718
|
if ($olderthanmonths > 0) { |
|
4719
|
4719
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4733,28 +4733,28 @@ discard block |
|
|
block discarded – undo |
|
4733
|
4733
|
if ($year != '') { |
|
4734
|
4734
|
if ($globalDBdriver == 'mysql') { |
|
4735
|
4735
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
4736
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4736
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4737
|
4737
|
} else { |
|
4738
|
4738
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
4739
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4739
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4740
|
4740
|
} |
|
4741
|
4741
|
} |
|
4742
|
4742
|
if ($month != '') { |
|
4743
|
4743
|
if ($globalDBdriver == 'mysql') { |
|
4744
|
4744
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
4745
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4745
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4746
|
4746
|
} else { |
|
4747
|
4747
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
4748
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4748
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4749
|
4749
|
} |
|
4750
|
4750
|
} |
|
4751
|
4751
|
if ($day != '') { |
|
4752
|
4752
|
if ($globalDBdriver == 'mysql') { |
|
4753
|
4753
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
4754
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4754
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4755
|
4755
|
} else { |
|
4756
|
4756
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
4757
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4757
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4758
|
4758
|
} |
|
4759
|
4759
|
} |
|
4760
|
4760
|
|
|
@@ -4766,7 +4766,7 @@ discard block |
|
|
block discarded – undo |
|
4766
|
4766
|
|
|
4767
|
4767
|
$aircraft_array = array(); |
|
4768
|
4768
|
$temp_array = array(); |
|
4769
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4769
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4770
|
4770
|
{ |
|
4771
|
4771
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
4772
|
4772
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -4783,11 +4783,11 @@ discard block |
|
|
block discarded – undo |
|
4783
|
4783
|
* @return Array the aircraft list |
|
4784
|
4784
|
* |
|
4785
|
4785
|
*/ |
|
4786
|
|
- public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '') |
|
|
4786
|
+ public function countAllAircraftTypesByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
4787
|
4787
|
{ |
|
4788
|
4788
|
global $globalDBdriver; |
|
4789
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4790
|
|
- $query = "SELECT spotter_output.airline_icao, spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
|
4789
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4790
|
+ $query = "SELECT spotter_output.airline_icao, spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
4791
|
4791
|
FROM spotter_output".$filter_query." spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao <>'' AND spotter_output.airline_icao <> 'NA' "; |
|
4792
|
4792
|
if ($olderthanmonths > 0) { |
|
4793
|
4793
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4807,28 +4807,28 @@ discard block |
|
|
block discarded – undo |
|
4807
|
4807
|
if ($year != '') { |
|
4808
|
4808
|
if ($globalDBdriver == 'mysql') { |
|
4809
|
4809
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
4810
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4810
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4811
|
4811
|
} else { |
|
4812
|
4812
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
4813
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
4813
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
4814
|
4814
|
} |
|
4815
|
4815
|
} |
|
4816
|
4816
|
if ($month != '') { |
|
4817
|
4817
|
if ($globalDBdriver == 'mysql') { |
|
4818
|
4818
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
4819
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4819
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4820
|
4820
|
} else { |
|
4821
|
4821
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
4822
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
4822
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
4823
|
4823
|
} |
|
4824
|
4824
|
} |
|
4825
|
4825
|
if ($day != '') { |
|
4826
|
4826
|
if ($globalDBdriver == 'mysql') { |
|
4827
|
4827
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
4828
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4828
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4829
|
4829
|
} else { |
|
4830
|
4830
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
4831
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
4831
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
4832
|
4832
|
} |
|
4833
|
4833
|
} |
|
4834
|
4834
|
|
|
@@ -4840,7 +4840,7 @@ discard block |
|
|
block discarded – undo |
|
4840
|
4840
|
|
|
4841
|
4841
|
$aircraft_array = array(); |
|
4842
|
4842
|
$temp_array = array(); |
|
4843
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4843
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4844
|
4844
|
{ |
|
4845
|
4845
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
4846
|
4846
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
@@ -4858,11 +4858,11 @@ discard block |
|
|
block discarded – undo |
|
4858
|
4858
|
* @return Array the aircraft list |
|
4859
|
4859
|
* |
|
4860
|
4860
|
*/ |
|
4861
|
|
- public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
|
4861
|
+ public function countAllAircraftTypesByMonths($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
4862
|
4862
|
{ |
|
4863
|
4863
|
global $globalDBdriver; |
|
4864
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4865
|
|
- $query = "SELECT EXTRACT(month from spotter_output.date) as month, EXTRACT(year from spotter_output.date) as year,spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
|
4864
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4865
|
+ $query = "SELECT EXTRACT(month from spotter_output.date) as month, EXTRACT(year from spotter_output.date) as year,spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
4866
|
4866
|
FROM spotter_output".$filter_query." spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao <>'' AND spotter_output.airline_icao <> 'NA' "; |
|
4867
|
4867
|
if ($olderthanmonths > 0) { |
|
4868
|
4868
|
if ($globalDBdriver == 'mysql') { |
|
@@ -4887,7 +4887,7 @@ discard block |
|
|
block discarded – undo |
|
4887
|
4887
|
|
|
4888
|
4888
|
$aircraft_array = array(); |
|
4889
|
4889
|
$temp_array = array(); |
|
4890
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4890
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4891
|
4891
|
{ |
|
4892
|
4892
|
//$temp_array['airline_icao'] = $row['airline_icao']; |
|
4893
|
4893
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
@@ -4906,13 +4906,13 @@ discard block |
|
|
block discarded – undo |
|
4906
|
4906
|
* @return Array the aircraft list |
|
4907
|
4907
|
* |
|
4908
|
4908
|
*/ |
|
4909
|
|
- public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
|
|
4909
|
+ public function countAllAircraftRegistrationByAircraft($aircraft_icao, $filters = array()) |
|
4910
|
4910
|
{ |
|
4911
|
4911
|
$Image = new Image($this->db); |
|
4912
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4913
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
|
4912
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4913
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
4914
|
4914
|
|
|
4915
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
4915
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
4916
|
4916
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
4917
|
4917
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
4918
|
4918
|
ORDER BY registration_count DESC"; |
|
@@ -4923,14 +4923,14 @@ discard block |
|
|
block discarded – undo |
|
4923
|
4923
|
$aircraft_array = array(); |
|
4924
|
4924
|
$temp_array = array(); |
|
4925
|
4925
|
|
|
4926
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4926
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4927
|
4927
|
{ |
|
4928
|
4928
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
4929
|
4929
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
4930
|
4930
|
$temp_array['registration'] = $row['registration']; |
|
4931
|
4931
|
$temp_array['airline_name'] = $row['airline_name']; |
|
4932
|
4932
|
$temp_array['image_thumbnail'] = ""; |
|
4933
|
|
- if($row['registration'] != "") |
|
|
4933
|
+ if ($row['registration'] != "") |
|
4934
|
4934
|
{ |
|
4935
|
4935
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
4936
|
4936
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -4949,11 +4949,11 @@ discard block |
|
|
block discarded – undo |
|
4949
|
4949
|
* @return Array the aircraft list |
|
4950
|
4950
|
* |
|
4951
|
4951
|
*/ |
|
4952
|
|
- public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
|
|
4952
|
+ public function countAllAircraftTypesByAirline($airline_icao, $filters = array()) |
|
4953
|
4953
|
{ |
|
4954
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
4955
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
4956
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
4954
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
4955
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
4956
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
4957
|
4957
|
FROM spotter_output".$filter_query." spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao = :airline_icao |
|
4958
|
4958
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
4959
|
4959
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -4964,7 +4964,7 @@ discard block |
|
|
block discarded – undo |
|
4964
|
4964
|
$aircraft_array = array(); |
|
4965
|
4965
|
$temp_array = array(); |
|
4966
|
4966
|
|
|
4967
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
4967
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
4968
|
4968
|
{ |
|
4969
|
4969
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
4970
|
4970
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -4982,13 +4982,13 @@ discard block |
|
|
block discarded – undo |
|
4982
|
4982
|
* @return Array the aircraft list |
|
4983
|
4983
|
* |
|
4984
|
4984
|
*/ |
|
4985
|
|
- public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
|
|
4985
|
+ public function countAllAircraftRegistrationByAirline($airline_icao, $filters = array()) |
|
4986
|
4986
|
{ |
|
4987
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
4987
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
4988
|
4988
|
$Image = new Image($this->db); |
|
4989
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
|
4989
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
4990
|
4990
|
|
|
4991
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
4991
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
4992
|
4992
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND spotter_output.airline_icao = :airline_icao |
|
4993
|
4993
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
4994
|
4994
|
ORDER BY registration_count DESC"; |
|
@@ -4998,14 +4998,14 @@ discard block |
|
|
block discarded – undo |
|
4998
|
4998
|
|
|
4999
|
4999
|
$aircraft_array = array(); |
|
5000
|
5000
|
$temp_array = array(); |
|
5001
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5001
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5002
|
5002
|
{ |
|
5003
|
5003
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5004
|
5004
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5005
|
5005
|
$temp_array['registration'] = $row['registration']; |
|
5006
|
5006
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5007
|
5007
|
$temp_array['image_thumbnail'] = ""; |
|
5008
|
|
- if($row['registration'] != "") |
|
|
5008
|
+ if ($row['registration'] != "") |
|
5009
|
5009
|
{ |
|
5010
|
5010
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5011
|
5011
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5024,11 +5024,11 @@ discard block |
|
|
block discarded – undo |
|
5024
|
5024
|
* @return Array the aircraft list |
|
5025
|
5025
|
* |
|
5026
|
5026
|
*/ |
|
5027
|
|
- public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
|
|
5027
|
+ public function countAllAircraftManufacturerByAirline($airline_icao, $filters = array()) |
|
5028
|
5028
|
{ |
|
5029
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5030
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
5031
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5029
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5030
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
5031
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5032
|
5032
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.airline_icao = :airline_icao |
|
5033
|
5033
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5034
|
5034
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
@@ -5039,7 +5039,7 @@ discard block |
|
|
block discarded – undo |
|
5039
|
5039
|
$aircraft_array = array(); |
|
5040
|
5040
|
$temp_array = array(); |
|
5041
|
5041
|
|
|
5042
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5042
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5043
|
5043
|
{ |
|
5044
|
5044
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5045
|
5045
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5056,12 +5056,12 @@ discard block |
|
|
block discarded – undo |
|
5056
|
5056
|
* @return Array the aircraft list |
|
5057
|
5057
|
* |
|
5058
|
5058
|
*/ |
|
5059
|
|
- public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
|
|
5059
|
+ public function countAllAircraftTypesByAirport($airport_icao, $filters = array()) |
|
5060
|
5060
|
{ |
|
5061
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5062
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
|
5061
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5062
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
5063
|
5063
|
|
|
5064
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5064
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5065
|
5065
|
FROM spotter_output".$filter_query." spotter_output.aircraft_icao <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
5066
|
5066
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
5067
|
5067
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -5071,7 +5071,7 @@ discard block |
|
|
block discarded – undo |
|
5071
|
5071
|
|
|
5072
|
5072
|
$aircraft_array = array(); |
|
5073
|
5073
|
$temp_array = array(); |
|
5074
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5074
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5075
|
5075
|
{ |
|
5076
|
5076
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5077
|
5077
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5089,13 +5089,13 @@ discard block |
|
|
block discarded – undo |
|
5089
|
5089
|
* @return Array the aircraft list |
|
5090
|
5090
|
* |
|
5091
|
5091
|
*/ |
|
5092
|
|
- public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
|
|
5092
|
+ public function countAllAircraftRegistrationByAirport($airport_icao, $filters = array()) |
|
5093
|
5093
|
{ |
|
5094
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5094
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5095
|
5095
|
$Image = new Image($this->db); |
|
5096
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
|
5096
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
5097
|
5097
|
|
|
5098
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5098
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5099
|
5099
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
5100
|
5100
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5101
|
5101
|
ORDER BY registration_count DESC"; |
|
@@ -5105,14 +5105,14 @@ discard block |
|
|
block discarded – undo |
|
5105
|
5105
|
|
|
5106
|
5106
|
$aircraft_array = array(); |
|
5107
|
5107
|
$temp_array = array(); |
|
5108
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5108
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5109
|
5109
|
{ |
|
5110
|
5110
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5111
|
5111
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5112
|
5112
|
$temp_array['registration'] = $row['registration']; |
|
5113
|
5113
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5114
|
5114
|
$temp_array['image_thumbnail'] = ""; |
|
5115
|
|
- if($row['registration'] != "") |
|
|
5115
|
+ if ($row['registration'] != "") |
|
5116
|
5116
|
{ |
|
5117
|
5117
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5118
|
5118
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5130,11 +5130,11 @@ discard block |
|
|
block discarded – undo |
|
5130
|
5130
|
* @return Array the aircraft list |
|
5131
|
5131
|
* |
|
5132
|
5132
|
*/ |
|
5133
|
|
- public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
|
|
5133
|
+ public function countAllAircraftManufacturerByAirport($airport_icao, $filters = array()) |
|
5134
|
5134
|
{ |
|
5135
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5136
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
5137
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5135
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5136
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
5137
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5138
|
5138
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
5139
|
5139
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5140
|
5140
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
@@ -5145,7 +5145,7 @@ discard block |
|
|
block discarded – undo |
|
5145
|
5145
|
|
|
5146
|
5146
|
$aircraft_array = array(); |
|
5147
|
5147
|
$temp_array = array(); |
|
5148
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5148
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5149
|
5149
|
{ |
|
5150
|
5150
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5151
|
5151
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5160,12 +5160,12 @@ discard block |
|
|
block discarded – undo |
|
5160
|
5160
|
* @return Array the aircraft list |
|
5161
|
5161
|
* |
|
5162
|
5162
|
*/ |
|
5163
|
|
- public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
5163
|
+ public function countAllAircraftTypesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
5164
|
5164
|
{ |
|
5165
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5166
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
|
5165
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5166
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
5167
|
5167
|
|
|
5168
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5168
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5169
|
5169
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
5170
|
5170
|
GROUP BY spotter_output.aircraft_name |
|
5171
|
5171
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -5174,7 +5174,7 @@ discard block |
|
|
block discarded – undo |
|
5174
|
5174
|
$sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
5175
|
5175
|
$aircraft_array = array(); |
|
5176
|
5176
|
$temp_array = array(); |
|
5177
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5177
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5178
|
5178
|
{ |
|
5179
|
5179
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5180
|
5180
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5193,11 +5193,11 @@ discard block |
|
|
block discarded – undo |
|
5193
|
5193
|
*/ |
|
5194
|
5194
|
public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
|
5195
|
5195
|
{ |
|
5196
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5196
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5197
|
5197
|
$Image = new Image($this->db); |
|
5198
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
|
5198
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
5199
|
5199
|
|
|
5200
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5200
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5201
|
5201
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
5202
|
5202
|
GROUP BY spotter_output.registration |
|
5203
|
5203
|
ORDER BY registration_count DESC"; |
|
@@ -5207,14 +5207,14 @@ discard block |
|
|
block discarded – undo |
|
5207
|
5207
|
$sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
5208
|
5208
|
$aircraft_array = array(); |
|
5209
|
5209
|
$temp_array = array(); |
|
5210
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5210
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5211
|
5211
|
{ |
|
5212
|
5212
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5213
|
5213
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5214
|
5214
|
$temp_array['registration'] = $row['registration']; |
|
5215
|
5215
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5216
|
5216
|
$temp_array['image_thumbnail'] = ""; |
|
5217
|
|
- if($row['registration'] != "") |
|
|
5217
|
+ if ($row['registration'] != "") |
|
5218
|
5218
|
{ |
|
5219
|
5219
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5220
|
5220
|
$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5231,11 +5231,11 @@ discard block |
|
|
block discarded – undo |
|
5231
|
5231
|
* @return Array the aircraft list |
|
5232
|
5232
|
* |
|
5233
|
5233
|
*/ |
|
5234
|
|
- public function countAllAircraftTypesByDate($date,$filters = array()) |
|
|
5234
|
+ public function countAllAircraftTypesByDate($date, $filters = array()) |
|
5235
|
5235
|
{ |
|
5236
|
5236
|
global $globalTimezone, $globalDBdriver; |
|
5237
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5238
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
5237
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5238
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
5239
|
5239
|
if ($globalTimezone != '') { |
|
5240
|
5240
|
date_default_timezone_set($globalTimezone); |
|
5241
|
5241
|
$datetime = new DateTime($date); |
|
@@ -5243,12 +5243,12 @@ discard block |
|
|
block discarded – undo |
|
5243
|
5243
|
} else $offset = '+00:00'; |
|
5244
|
5244
|
|
|
5245
|
5245
|
if ($globalDBdriver == 'mysql') { |
|
5246
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5246
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5247
|
5247
|
FROM spotter_output".$filter_query." DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
5248
|
5248
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
5249
|
5249
|
ORDER BY aircraft_icao_count DESC"; |
|
5250
|
5250
|
} else { |
|
5251
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5251
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5252
|
5252
|
FROM spotter_output".$filter_query." to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
5253
|
5253
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
5254
|
5254
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -5259,7 +5259,7 @@ discard block |
|
|
block discarded – undo |
|
5259
|
5259
|
|
|
5260
|
5260
|
$aircraft_array = array(); |
|
5261
|
5261
|
$temp_array = array(); |
|
5262
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5262
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5263
|
5263
|
{ |
|
5264
|
5264
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5265
|
5265
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5277,12 +5277,12 @@ discard block |
|
|
block discarded – undo |
|
5277
|
5277
|
* @return Array the aircraft list |
|
5278
|
5278
|
* |
|
5279
|
5279
|
*/ |
|
5280
|
|
- public function countAllAircraftRegistrationByDate($date,$filters = array()) |
|
|
5280
|
+ public function countAllAircraftRegistrationByDate($date, $filters = array()) |
|
5281
|
5281
|
{ |
|
5282
|
5282
|
global $globalTimezone, $globalDBdriver; |
|
5283
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5283
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5284
|
5284
|
$Image = new Image($this->db); |
|
5285
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
5285
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
5286
|
5286
|
if ($globalTimezone != '') { |
|
5287
|
5287
|
date_default_timezone_set($globalTimezone); |
|
5288
|
5288
|
$datetime = new DateTime($date); |
|
@@ -5290,12 +5290,12 @@ discard block |
|
|
block discarded – undo |
|
5290
|
5290
|
} else $offset = '+00:00'; |
|
5291
|
5291
|
|
|
5292
|
5292
|
if ($globalDBdriver == 'mysql') { |
|
5293
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5293
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5294
|
5294
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
5295
|
5295
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5296
|
5296
|
ORDER BY registration_count DESC"; |
|
5297
|
5297
|
} else { |
|
5298
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5298
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5299
|
5299
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
5300
|
5300
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5301
|
5301
|
ORDER BY registration_count DESC"; |
|
@@ -5306,14 +5306,14 @@ discard block |
|
|
block discarded – undo |
|
5306
|
5306
|
|
|
5307
|
5307
|
$aircraft_array = array(); |
|
5308
|
5308
|
$temp_array = array(); |
|
5309
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5309
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5310
|
5310
|
{ |
|
5311
|
5311
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5312
|
5312
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5313
|
5313
|
$temp_array['registration'] = $row['registration']; |
|
5314
|
5314
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5315
|
5315
|
$temp_array['image_thumbnail'] = ""; |
|
5316
|
|
- if($row['registration'] != "") |
|
|
5316
|
+ if ($row['registration'] != "") |
|
5317
|
5317
|
{ |
|
5318
|
5318
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5319
|
5319
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5332,11 +5332,11 @@ discard block |
|
|
block discarded – undo |
|
5332
|
5332
|
* @return Array the aircraft manufacturer list |
|
5333
|
5333
|
* |
|
5334
|
5334
|
*/ |
|
5335
|
|
- public function countAllAircraftManufacturerByDate($date,$filters = array()) |
|
|
5335
|
+ public function countAllAircraftManufacturerByDate($date, $filters = array()) |
|
5336
|
5336
|
{ |
|
5337
|
5337
|
global $globalTimezone, $globalDBdriver; |
|
5338
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5339
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
5338
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5339
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
5340
|
5340
|
if ($globalTimezone != '') { |
|
5341
|
5341
|
date_default_timezone_set($globalTimezone); |
|
5342
|
5342
|
$datetime = new DateTime($date); |
|
@@ -5344,12 +5344,12 @@ discard block |
|
|
block discarded – undo |
|
5344
|
5344
|
} else $offset = '+00:00'; |
|
5345
|
5345
|
|
|
5346
|
5346
|
if ($globalDBdriver == 'mysql') { |
|
5347
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5347
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5348
|
5348
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
5349
|
5349
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5350
|
5350
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
5351
|
5351
|
} else { |
|
5352
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5352
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5353
|
5353
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
5354
|
5354
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5355
|
5355
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
@@ -5361,7 +5361,7 @@ discard block |
|
|
block discarded – undo |
|
5361
|
5361
|
$aircraft_array = array(); |
|
5362
|
5362
|
$temp_array = array(); |
|
5363
|
5363
|
|
|
5364
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5364
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5365
|
5365
|
{ |
|
5366
|
5366
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5367
|
5367
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5378,11 +5378,11 @@ discard block |
|
|
block discarded – undo |
|
5378
|
5378
|
* @return Array the aircraft list |
|
5379
|
5379
|
* |
|
5380
|
5380
|
*/ |
|
5381
|
|
- public function countAllAircraftTypesByIdent($ident,$filters = array()) |
|
|
5381
|
+ public function countAllAircraftTypesByIdent($ident, $filters = array()) |
|
5382
|
5382
|
{ |
|
5383
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5384
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
5385
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5383
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5384
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
5385
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5386
|
5386
|
FROM spotter_output".$filter_query." spotter_output.ident = :ident |
|
5387
|
5387
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
5388
|
5388
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -5393,7 +5393,7 @@ discard block |
|
|
block discarded – undo |
|
5393
|
5393
|
$aircraft_array = array(); |
|
5394
|
5394
|
$temp_array = array(); |
|
5395
|
5395
|
|
|
5396
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5396
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5397
|
5397
|
{ |
|
5398
|
5398
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5399
|
5399
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5411,13 +5411,13 @@ discard block |
|
|
block discarded – undo |
|
5411
|
5411
|
* @return Array the aircraft list |
|
5412
|
5412
|
* |
|
5413
|
5413
|
*/ |
|
5414
|
|
- public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
|
|
5414
|
+ public function countAllAircraftRegistrationByIdent($ident, $filters = array()) |
|
5415
|
5415
|
{ |
|
5416
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5416
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5417
|
5417
|
$Image = new Image($this->db); |
|
5418
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
|
5418
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
5419
|
5419
|
|
|
5420
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5420
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5421
|
5421
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND spotter_output.ident = :ident |
|
5422
|
5422
|
GROUP BY spotter_output.registration,spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5423
|
5423
|
ORDER BY registration_count DESC"; |
|
@@ -5429,14 +5429,14 @@ discard block |
|
|
block discarded – undo |
|
5429
|
5429
|
$aircraft_array = array(); |
|
5430
|
5430
|
$temp_array = array(); |
|
5431
|
5431
|
|
|
5432
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5432
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5433
|
5433
|
{ |
|
5434
|
5434
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5435
|
5435
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5436
|
5436
|
$temp_array['registration'] = $row['registration']; |
|
5437
|
5437
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5438
|
5438
|
$temp_array['image_thumbnail'] = ""; |
|
5439
|
|
- if($row['registration'] != "") |
|
|
5439
|
+ if ($row['registration'] != "") |
|
5440
|
5440
|
{ |
|
5441
|
5441
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5442
|
5442
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5455,11 +5455,11 @@ discard block |
|
|
block discarded – undo |
|
5455
|
5455
|
* @return Array the aircraft manufacturer list |
|
5456
|
5456
|
* |
|
5457
|
5457
|
*/ |
|
5458
|
|
- public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
|
|
5458
|
+ public function countAllAircraftManufacturerByIdent($ident, $filters = array()) |
|
5459
|
5459
|
{ |
|
5460
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5461
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
5462
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5460
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5461
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
5462
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5463
|
5463
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.ident = :ident |
|
5464
|
5464
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5465
|
5465
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
@@ -5469,7 +5469,7 @@ discard block |
|
|
block discarded – undo |
|
5469
|
5469
|
$sth->execute(array(':ident' => $ident)); |
|
5470
|
5470
|
$aircraft_array = array(); |
|
5471
|
5471
|
$temp_array = array(); |
|
5472
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5472
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5473
|
5473
|
{ |
|
5474
|
5474
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5475
|
5475
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5485,24 +5485,24 @@ discard block |
|
|
block discarded – undo |
|
5485
|
5485
|
* @return Array the aircraft list |
|
5486
|
5486
|
* |
|
5487
|
5487
|
*/ |
|
5488
|
|
- public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
|
|
5488
|
+ public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
5489
|
5489
|
{ |
|
5490
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5491
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
5492
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
5490
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5491
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
5492
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
5493
|
5493
|
|
|
5494
|
5494
|
|
|
5495
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5495
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5496
|
5496
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
5497
|
5497
|
GROUP BY spotter_output.aircraft_name |
|
5498
|
5498
|
ORDER BY aircraft_icao_count DESC"; |
|
5499
|
5499
|
|
|
5500
|
5500
|
|
|
5501
|
5501
|
$sth = $this->db->prepare($query); |
|
5502
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
5502
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
5503
|
5503
|
$aircraft_array = array(); |
|
5504
|
5504
|
$temp_array = array(); |
|
5505
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5505
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5506
|
5506
|
{ |
|
5507
|
5507
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5508
|
5508
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5518,33 +5518,33 @@ discard block |
|
|
block discarded – undo |
|
5518
|
5518
|
* @return Array the aircraft list |
|
5519
|
5519
|
* |
|
5520
|
5520
|
*/ |
|
5521
|
|
- public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
|
|
5521
|
+ public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
5522
|
5522
|
{ |
|
5523
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5523
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5524
|
5524
|
$Image = new Image($this->db); |
|
5525
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
5526
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
5525
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
5526
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
5527
|
5527
|
|
|
5528
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5528
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5529
|
5529
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
5530
|
5530
|
GROUP BY spotter_output.registration |
|
5531
|
5531
|
ORDER BY registration_count DESC"; |
|
5532
|
5532
|
|
|
5533
|
5533
|
|
|
5534
|
5534
|
$sth = $this->db->prepare($query); |
|
5535
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
5535
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
5536
|
5536
|
|
|
5537
|
5537
|
$aircraft_array = array(); |
|
5538
|
5538
|
$temp_array = array(); |
|
5539
|
5539
|
|
|
5540
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5540
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5541
|
5541
|
{ |
|
5542
|
5542
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5543
|
5543
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5544
|
5544
|
$temp_array['registration'] = $row['registration']; |
|
5545
|
5545
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5546
|
5546
|
$temp_array['image_thumbnail'] = ""; |
|
5547
|
|
- if($row['registration'] != "") |
|
|
5547
|
+ if ($row['registration'] != "") |
|
5548
|
5548
|
{ |
|
5549
|
5549
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5550
|
5550
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5564,25 +5564,25 @@ discard block |
|
|
block discarded – undo |
|
5564
|
5564
|
* @return Array the aircraft manufacturer list |
|
5565
|
5565
|
* |
|
5566
|
5566
|
*/ |
|
5567
|
|
- public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
|
|
5567
|
+ public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
5568
|
5568
|
{ |
|
5569
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5570
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
5571
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
5569
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5570
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
5571
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
5572
|
5572
|
|
|
5573
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5573
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5574
|
5574
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
5575
|
5575
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5576
|
5576
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
5577
|
5577
|
|
|
5578
|
5578
|
|
|
5579
|
5579
|
$sth = $this->db->prepare($query); |
|
5580
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
|
5580
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
5581
|
5581
|
|
|
5582
|
5582
|
$aircraft_array = array(); |
|
5583
|
5583
|
$temp_array = array(); |
|
5584
|
5584
|
|
|
5585
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5585
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5586
|
5586
|
{ |
|
5587
|
5587
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5588
|
5588
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5602,11 +5602,11 @@ discard block |
|
|
block discarded – undo |
|
5602
|
5602
|
* @return Array the aircraft list |
|
5603
|
5603
|
* |
|
5604
|
5604
|
*/ |
|
5605
|
|
- public function countAllAircraftTypesByCountry($country,$filters = array()) |
|
|
5605
|
+ public function countAllAircraftTypesByCountry($country, $filters = array()) |
|
5606
|
5606
|
{ |
|
5607
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5608
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
5609
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
|
5607
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5608
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
5609
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
5610
|
5610
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
5611
|
5611
|
GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
|
5612
|
5612
|
ORDER BY aircraft_icao_count DESC"; |
|
@@ -5618,7 +5618,7 @@ discard block |
|
|
block discarded – undo |
|
5618
|
5618
|
$aircraft_array = array(); |
|
5619
|
5619
|
$temp_array = array(); |
|
5620
|
5620
|
|
|
5621
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5621
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5622
|
5622
|
{ |
|
5623
|
5623
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5624
|
5624
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
@@ -5637,12 +5637,12 @@ discard block |
|
|
block discarded – undo |
|
5637
|
5637
|
* @return Array the aircraft list |
|
5638
|
5638
|
* |
|
5639
|
5639
|
*/ |
|
5640
|
|
- public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
|
|
5640
|
+ public function countAllAircraftRegistrationByCountry($country, $filters = array()) |
|
5641
|
5641
|
{ |
|
5642
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5642
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5643
|
5643
|
$Image = new Image($this->db); |
|
5644
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
5645
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
|
5644
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
5645
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
5646
|
5646
|
FROM spotter_output".$filter_query." spotter_output.registration <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
|
5647
|
5647
|
GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5648
|
5648
|
ORDER BY registration_count DESC"; |
|
@@ -5654,14 +5654,14 @@ discard block |
|
|
block discarded – undo |
|
5654
|
5654
|
$aircraft_array = array(); |
|
5655
|
5655
|
$temp_array = array(); |
|
5656
|
5656
|
|
|
5657
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5657
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5658
|
5658
|
{ |
|
5659
|
5659
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
|
5660
|
5660
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5661
|
5661
|
$temp_array['registration'] = $row['registration']; |
|
5662
|
5662
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5663
|
5663
|
$temp_array['image_thumbnail'] = ""; |
|
5664
|
|
- if($row['registration'] != "") |
|
|
5664
|
+ if ($row['registration'] != "") |
|
5665
|
5665
|
{ |
|
5666
|
5666
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5667
|
5667
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5681,11 +5681,11 @@ discard block |
|
|
block discarded – undo |
|
5681
|
5681
|
* @return Array the aircraft manufacturer list |
|
5682
|
5682
|
* |
|
5683
|
5683
|
*/ |
|
5684
|
|
- public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
|
|
5684
|
+ public function countAllAircraftManufacturerByCountry($country, $filters = array()) |
|
5685
|
5685
|
{ |
|
5686
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5687
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
5688
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5686
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5687
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
5688
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5689
|
5689
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
|
5690
|
5690
|
GROUP BY spotter_output.aircraft_manufacturer |
|
5691
|
5691
|
ORDER BY aircraft_manufacturer_count DESC"; |
|
@@ -5697,7 +5697,7 @@ discard block |
|
|
block discarded – undo |
|
5697
|
5697
|
$aircraft_array = array(); |
|
5698
|
5698
|
$temp_array = array(); |
|
5699
|
5699
|
|
|
5700
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5700
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5701
|
5701
|
{ |
|
5702
|
5702
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5703
|
5703
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5716,38 +5716,38 @@ discard block |
|
|
block discarded – undo |
|
5716
|
5716
|
* @return Array the aircraft list |
|
5717
|
5717
|
* |
|
5718
|
5718
|
*/ |
|
5719
|
|
- public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '') |
|
|
5719
|
+ public function countAllAircraftManufacturers($filters = array(), $year = '', $month = '', $day = '') |
|
5720
|
5720
|
{ |
|
5721
|
5721
|
global $globalDBdriver; |
|
5722
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5723
|
|
- $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
|
5722
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5723
|
+ $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
5724
|
5724
|
FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
|
5725
|
5725
|
$query_values = array(); |
|
5726
|
5726
|
if ($year != '') { |
|
5727
|
5727
|
if ($globalDBdriver == 'mysql') { |
|
5728
|
5728
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
5729
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5729
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5730
|
5730
|
} else { |
|
5731
|
5731
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
5732
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5732
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5733
|
5733
|
} |
|
5734
|
5734
|
} |
|
5735
|
5735
|
if ($month != '') { |
|
5736
|
5736
|
if ($globalDBdriver == 'mysql') { |
|
5737
|
5737
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
5738
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5738
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5739
|
5739
|
} else { |
|
5740
|
5740
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
5741
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5741
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5742
|
5742
|
} |
|
5743
|
5743
|
} |
|
5744
|
5744
|
if ($day != '') { |
|
5745
|
5745
|
if ($globalDBdriver == 'mysql') { |
|
5746
|
5746
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
5747
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5747
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5748
|
5748
|
} else { |
|
5749
|
5749
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
5750
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5750
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5751
|
5751
|
} |
|
5752
|
5752
|
} |
|
5753
|
5753
|
$query .= " GROUP BY spotter_output.aircraft_manufacturer |
|
@@ -5761,7 +5761,7 @@ discard block |
|
|
block discarded – undo |
|
5761
|
5761
|
$manufacturer_array = array(); |
|
5762
|
5762
|
$temp_array = array(); |
|
5763
|
5763
|
|
|
5764
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5764
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5765
|
5765
|
{ |
|
5766
|
5766
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
|
5767
|
5767
|
$temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
|
@@ -5780,12 +5780,12 @@ discard block |
|
|
block discarded – undo |
|
5780
|
5780
|
* @return Array the aircraft list |
|
5781
|
5781
|
* |
|
5782
|
5782
|
*/ |
|
5783
|
|
- public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
|
|
5783
|
+ public function countAllAircraftRegistrations($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
5784
|
5784
|
{ |
|
5785
|
5785
|
global $globalDBdriver; |
|
5786
|
5786
|
$Image = new Image($this->db); |
|
5787
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5788
|
|
- $query = "SELECT DISTINCT spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
|
5787
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5788
|
+ $query = "SELECT DISTINCT spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5789
|
5789
|
FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
|
5790
|
5790
|
if ($olderthanmonths > 0) { |
|
5791
|
5791
|
if ($globalDBdriver == 'mysql') { |
|
@@ -5805,28 +5805,28 @@ discard block |
|
|
block discarded – undo |
|
5805
|
5805
|
if ($year != '') { |
|
5806
|
5806
|
if ($globalDBdriver == 'mysql') { |
|
5807
|
5807
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
5808
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5808
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5809
|
5809
|
} else { |
|
5810
|
5810
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
5811
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5811
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5812
|
5812
|
} |
|
5813
|
5813
|
} |
|
5814
|
5814
|
if ($month != '') { |
|
5815
|
5815
|
if ($globalDBdriver == 'mysql') { |
|
5816
|
5816
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
5817
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5817
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5818
|
5818
|
} else { |
|
5819
|
5819
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
5820
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5820
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5821
|
5821
|
} |
|
5822
|
5822
|
} |
|
5823
|
5823
|
if ($day != '') { |
|
5824
|
5824
|
if ($globalDBdriver == 'mysql') { |
|
5825
|
5825
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
5826
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5826
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5827
|
5827
|
} else { |
|
5828
|
5828
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
5829
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5829
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5830
|
5830
|
} |
|
5831
|
5831
|
} |
|
5832
|
5832
|
$query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
@@ -5838,7 +5838,7 @@ discard block |
|
|
block discarded – undo |
|
5838
|
5838
|
$aircraft_array = array(); |
|
5839
|
5839
|
$temp_array = array(); |
|
5840
|
5840
|
|
|
5841
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5841
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5842
|
5842
|
{ |
|
5843
|
5843
|
$temp_array['registration'] = $row['registration']; |
|
5844
|
5844
|
$temp_array['aircraft_registration_count'] = $row['aircraft_registration_count']; |
|
@@ -5846,7 +5846,7 @@ discard block |
|
|
block discarded – undo |
|
5846
|
5846
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5847
|
5847
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5848
|
5848
|
$temp_array['image_thumbnail'] = ""; |
|
5849
|
|
- if($row['registration'] != "") |
|
|
5849
|
+ if ($row['registration'] != "") |
|
5850
|
5850
|
{ |
|
5851
|
5851
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5852
|
5852
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5865,12 +5865,12 @@ discard block |
|
|
block discarded – undo |
|
5865
|
5865
|
* @return Array the aircraft list |
|
5866
|
5866
|
* |
|
5867
|
5867
|
*/ |
|
5868
|
|
- public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
|
5868
|
+ public function countAllAircraftRegistrationsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
5869
|
5869
|
{ |
|
5870
|
5870
|
global $globalDBdriver; |
|
5871
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
5871
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
5872
|
5872
|
$Image = new Image($this->db); |
|
5873
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
|
5873
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
|
5874
|
5874
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
|
5875
|
5875
|
if ($olderthanmonths > 0) { |
|
5876
|
5876
|
if ($globalDBdriver == 'mysql') { |
|
@@ -5898,7 +5898,7 @@ discard block |
|
|
block discarded – undo |
|
5898
|
5898
|
$aircraft_array = array(); |
|
5899
|
5899
|
$temp_array = array(); |
|
5900
|
5900
|
|
|
5901
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5901
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5902
|
5902
|
{ |
|
5903
|
5903
|
$temp_array['registration'] = $row['registration']; |
|
5904
|
5904
|
$temp_array['aircraft_registration_count'] = $row['aircraft_registration_count']; |
|
@@ -5907,7 +5907,7 @@ discard block |
|
|
block discarded – undo |
|
5907
|
5907
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
|
5908
|
5908
|
$temp_array['airline_name'] = $row['airline_name']; |
|
5909
|
5909
|
$temp_array['image_thumbnail'] = ""; |
|
5910
|
|
- if($row['registration'] != "") |
|
|
5910
|
+ if ($row['registration'] != "") |
|
5911
|
5911
|
{ |
|
5912
|
5912
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
5913
|
5913
|
if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
@@ -5926,11 +5926,11 @@ discard block |
|
|
block discarded – undo |
|
5926
|
5926
|
* @return Array the airport list |
|
5927
|
5927
|
* |
|
5928
|
5928
|
*/ |
|
5929
|
|
- public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
|
|
5929
|
+ public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
5930
|
5930
|
{ |
|
5931
|
5931
|
global $globalDBdriver; |
|
5932
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
5933
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
5932
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
5933
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
5934
|
5934
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
|
5935
|
5935
|
if ($olderthanmonths > 0) { |
|
5936
|
5936
|
if ($globalDBdriver == 'mysql') { |
|
@@ -5950,28 +5950,28 @@ discard block |
|
|
block discarded – undo |
|
5950
|
5950
|
if ($year != '') { |
|
5951
|
5951
|
if ($globalDBdriver == 'mysql') { |
|
5952
|
5952
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
5953
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5953
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5954
|
5954
|
} else { |
|
5955
|
5955
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
5956
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
5956
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
5957
|
5957
|
} |
|
5958
|
5958
|
} |
|
5959
|
5959
|
if ($month != '') { |
|
5960
|
5960
|
if ($globalDBdriver == 'mysql') { |
|
5961
|
5961
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
5962
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5962
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5963
|
5963
|
} else { |
|
5964
|
5964
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
5965
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
5965
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
5966
|
5966
|
} |
|
5967
|
5967
|
} |
|
5968
|
5968
|
if ($day != '') { |
|
5969
|
5969
|
if ($globalDBdriver == 'mysql') { |
|
5970
|
5970
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
5971
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5971
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5972
|
5972
|
} else { |
|
5973
|
5973
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
5974
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
5974
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
5975
|
5975
|
} |
|
5976
|
5976
|
} |
|
5977
|
5977
|
$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
@@ -5983,7 +5983,7 @@ discard block |
|
|
block discarded – undo |
|
5983
|
5983
|
|
|
5984
|
5984
|
$airport_array = array(); |
|
5985
|
5985
|
$temp_array = array(); |
|
5986
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
5986
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
5987
|
5987
|
{ |
|
5988
|
5988
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
5989
|
5989
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6002,11 +6002,11 @@ discard block |
|
|
block discarded – undo |
|
6002
|
6002
|
* @return Array the airport list |
|
6003
|
6003
|
* |
|
6004
|
6004
|
*/ |
|
6005
|
|
- public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
|
6005
|
+ public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
6006
|
6006
|
{ |
|
6007
|
6007
|
global $globalDBdriver; |
|
6008
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6009
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6008
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6009
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6010
|
6010
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' "; |
|
6011
|
6011
|
if ($olderthanmonths > 0) { |
|
6012
|
6012
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6035,7 +6035,7 @@ discard block |
|
|
block discarded – undo |
|
6035
|
6035
|
$airport_array = array(); |
|
6036
|
6036
|
$temp_array = array(); |
|
6037
|
6037
|
|
|
6038
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6038
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6039
|
6039
|
{ |
|
6040
|
6040
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
6041
|
6041
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -6055,11 +6055,11 @@ discard block |
|
|
block discarded – undo |
|
6055
|
6055
|
* @return Array the airport list |
|
6056
|
6056
|
* |
|
6057
|
6057
|
*/ |
|
6058
|
|
- public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
|
|
6058
|
+ public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
6059
|
6059
|
{ |
|
6060
|
6060
|
global $globalDBdriver; |
|
6061
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6062
|
|
- $query = "SELECT DISTINCT spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country |
|
|
6061
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6062
|
+ $query = "SELECT DISTINCT spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country |
|
6063
|
6063
|
FROM airport, spotter_output".$filter_query." spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao"; |
|
6064
|
6064
|
if ($olderthanmonths > 0) { |
|
6065
|
6065
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6079,28 +6079,28 @@ discard block |
|
|
block discarded – undo |
|
6079
|
6079
|
if ($year != '') { |
|
6080
|
6080
|
if ($globalDBdriver == 'mysql') { |
|
6081
|
6081
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
6082
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6082
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6083
|
6083
|
} else { |
|
6084
|
6084
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
6085
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6085
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6086
|
6086
|
} |
|
6087
|
6087
|
} |
|
6088
|
6088
|
if ($month != '') { |
|
6089
|
6089
|
if ($globalDBdriver == 'mysql') { |
|
6090
|
6090
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
6091
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6091
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6092
|
6092
|
} else { |
|
6093
|
6093
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
6094
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6094
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6095
|
6095
|
} |
|
6096
|
6096
|
} |
|
6097
|
6097
|
if ($day != '') { |
|
6098
|
6098
|
if ($globalDBdriver == 'mysql') { |
|
6099
|
6099
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
6100
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6100
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6101
|
6101
|
} else { |
|
6102
|
6102
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
6103
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6103
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6104
|
6104
|
} |
|
6105
|
6105
|
} |
|
6106
|
6106
|
$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
@@ -6113,7 +6113,7 @@ discard block |
|
|
block discarded – undo |
|
6113
|
6113
|
$airport_array = array(); |
|
6114
|
6114
|
$temp_array = array(); |
|
6115
|
6115
|
|
|
6116
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6116
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6117
|
6117
|
{ |
|
6118
|
6118
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6119
|
6119
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6132,11 +6132,11 @@ discard block |
|
|
block discarded – undo |
|
6132
|
6132
|
* @return Array the airport list |
|
6133
|
6133
|
* |
|
6134
|
6134
|
*/ |
|
6135
|
|
- public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
|
6135
|
+ public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
6136
|
6136
|
{ |
|
6137
|
6137
|
global $globalDBdriver; |
|
6138
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6139
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country |
|
|
6138
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6139
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country |
|
6140
|
6140
|
FROM airport, spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao "; |
|
6141
|
6141
|
if ($olderthanmonths > 0) { |
|
6142
|
6142
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6165,7 +6165,7 @@ discard block |
|
|
block discarded – undo |
|
6165
|
6165
|
$airport_array = array(); |
|
6166
|
6166
|
$temp_array = array(); |
|
6167
|
6167
|
|
|
6168
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6168
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6169
|
6169
|
{ |
|
6170
|
6170
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
6171
|
6171
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -6185,11 +6185,11 @@ discard block |
|
|
block discarded – undo |
|
6185
|
6185
|
* @return Array the airport list |
|
6186
|
6186
|
* |
|
6187
|
6187
|
*/ |
|
6188
|
|
- public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
|
|
6188
|
+ public function countAllDepartureAirportsByAirline($airline_icao, $filters = array()) |
|
6189
|
6189
|
{ |
|
6190
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6191
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
6192
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6190
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6191
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
6192
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6193
|
6193
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.airline_icao = :airline_icao AND spotter_output.departure_airport_icao <> '' |
|
6194
|
6194
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6195
|
6195
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6201,7 +6201,7 @@ discard block |
|
|
block discarded – undo |
|
6201
|
6201
|
$airport_array = array(); |
|
6202
|
6202
|
$temp_array = array(); |
|
6203
|
6203
|
|
|
6204
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6204
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6205
|
6205
|
{ |
|
6206
|
6206
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6207
|
6207
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6223,11 +6223,11 @@ discard block |
|
|
block discarded – undo |
|
6223
|
6223
|
* @return Array the airport list |
|
6224
|
6224
|
* |
|
6225
|
6225
|
*/ |
|
6226
|
|
- public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
|
|
6226
|
+ public function countAllDepartureAirportCountriesByAirline($airline_icao, $filters = array()) |
|
6227
|
6227
|
{ |
|
6228
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6229
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
6230
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6228
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6229
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
6230
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6231
|
6231
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
|
6232
|
6232
|
GROUP BY spotter_output.departure_airport_country |
|
6233
|
6233
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6239,7 +6239,7 @@ discard block |
|
|
block discarded – undo |
|
6239
|
6239
|
$airport_array = array(); |
|
6240
|
6240
|
$temp_array = array(); |
|
6241
|
6241
|
|
|
6242
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6242
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6243
|
6243
|
{ |
|
6244
|
6244
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6245
|
6245
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6258,11 +6258,11 @@ discard block |
|
|
block discarded – undo |
|
6258
|
6258
|
* @return Array the airport list |
|
6259
|
6259
|
* |
|
6260
|
6260
|
*/ |
|
6261
|
|
- public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
|
|
6261
|
+ public function countAllDepartureAirportsByAircraft($aircraft_icao, $filters = array()) |
|
6262
|
6262
|
{ |
|
6263
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6264
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
6265
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6263
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6264
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
6265
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6266
|
6266
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_icao = :aircraft_icao AND spotter_output.departure_airport_icao <> '' |
|
6267
|
6267
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6268
|
6268
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6274,7 +6274,7 @@ discard block |
|
|
block discarded – undo |
|
6274
|
6274
|
$airport_array = array(); |
|
6275
|
6275
|
$temp_array = array(); |
|
6276
|
6276
|
|
|
6277
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6277
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6278
|
6278
|
{ |
|
6279
|
6279
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6280
|
6280
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6295,11 +6295,11 @@ discard block |
|
|
block discarded – undo |
|
6295
|
6295
|
* @return Array the airport list |
|
6296
|
6296
|
* |
|
6297
|
6297
|
*/ |
|
6298
|
|
- public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
|
|
6298
|
+ public function countAllDepartureAirportCountriesByAircraft($aircraft_icao, $filters = array()) |
|
6299
|
6299
|
{ |
|
6300
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6301
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
6302
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6300
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6301
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
6302
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6303
|
6303
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
6304
|
6304
|
GROUP BY spotter_output.departure_airport_country |
|
6305
|
6305
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6311,7 +6311,7 @@ discard block |
|
|
block discarded – undo |
|
6311
|
6311
|
$airport_array = array(); |
|
6312
|
6312
|
$temp_array = array(); |
|
6313
|
6313
|
|
|
6314
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6314
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6315
|
6315
|
{ |
|
6316
|
6316
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6317
|
6317
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6329,11 +6329,11 @@ discard block |
|
|
block discarded – undo |
|
6329
|
6329
|
* @return Array the airport list |
|
6330
|
6330
|
* |
|
6331
|
6331
|
*/ |
|
6332
|
|
- public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
|
|
6332
|
+ public function countAllDepartureAirportsByRegistration($registration, $filters = array()) |
|
6333
|
6333
|
{ |
|
6334
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6335
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
6336
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6334
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6335
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
|
6336
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6337
|
6337
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.registration = :registration AND spotter_output.departure_airport_icao <> '' |
|
6338
|
6338
|
GROUP BY spotter_output.departure_airport_icao |
|
6339
|
6339
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6345,7 +6345,7 @@ discard block |
|
|
block discarded – undo |
|
6345
|
6345
|
$airport_array = array(); |
|
6346
|
6346
|
$temp_array = array(); |
|
6347
|
6347
|
|
|
6348
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6348
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6349
|
6349
|
{ |
|
6350
|
6350
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6351
|
6351
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6366,11 +6366,11 @@ discard block |
|
|
block discarded – undo |
|
6366
|
6366
|
* @return Array the airport list |
|
6367
|
6367
|
* |
|
6368
|
6368
|
*/ |
|
6369
|
|
- public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
|
|
6369
|
+ public function countAllDepartureAirportCountriesByRegistration($registration, $filters = array()) |
|
6370
|
6370
|
{ |
|
6371
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6372
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
6373
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6371
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6372
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
|
6373
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6374
|
6374
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.registration = :registration |
|
6375
|
6375
|
GROUP BY spotter_output.departure_airport_country |
|
6376
|
6376
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6382,7 +6382,7 @@ discard block |
|
|
block discarded – undo |
|
6382
|
6382
|
$airport_array = array(); |
|
6383
|
6383
|
$temp_array = array(); |
|
6384
|
6384
|
|
|
6385
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6385
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6386
|
6386
|
{ |
|
6387
|
6387
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6388
|
6388
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6400,11 +6400,11 @@ discard block |
|
|
block discarded – undo |
|
6400
|
6400
|
* @return Array the airport list |
|
6401
|
6401
|
* |
|
6402
|
6402
|
*/ |
|
6403
|
|
- public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
|
|
6403
|
+ public function countAllDepartureAirportsByAirport($airport_icao, $filters = array()) |
|
6404
|
6404
|
{ |
|
6405
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6406
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
6407
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6405
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6406
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
6407
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6408
|
6408
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao = :airport_icao AND spotter_output.departure_airport_icao <> '' |
|
6409
|
6409
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6410
|
6410
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6416,7 +6416,7 @@ discard block |
|
|
block discarded – undo |
|
6416
|
6416
|
$airport_array = array(); |
|
6417
|
6417
|
$temp_array = array(); |
|
6418
|
6418
|
|
|
6419
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6419
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6420
|
6420
|
{ |
|
6421
|
6421
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6422
|
6422
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6437,11 +6437,11 @@ discard block |
|
|
block discarded – undo |
|
6437
|
6437
|
* @return Array the airport list |
|
6438
|
6438
|
* |
|
6439
|
6439
|
*/ |
|
6440
|
|
- public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
|
|
6440
|
+ public function countAllDepartureAirportCountriesByAirport($airport_icao, $filters = array()) |
|
6441
|
6441
|
{ |
|
6442
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6443
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
6444
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6442
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6443
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
6444
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6445
|
6445
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.arrival_airport_icao = :airport_icao |
|
6446
|
6446
|
GROUP BY spotter_output.departure_airport_country |
|
6447
|
6447
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6453,7 +6453,7 @@ discard block |
|
|
block discarded – undo |
|
6453
|
6453
|
$airport_array = array(); |
|
6454
|
6454
|
$temp_array = array(); |
|
6455
|
6455
|
|
|
6456
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6456
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6457
|
6457
|
{ |
|
6458
|
6458
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6459
|
6459
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6472,11 +6472,11 @@ discard block |
|
|
block discarded – undo |
|
6472
|
6472
|
* @return Array the airport list |
|
6473
|
6473
|
* |
|
6474
|
6474
|
*/ |
|
6475
|
|
- public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
6475
|
+ public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer, $filters = array()) |
|
6476
|
6476
|
{ |
|
6477
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6478
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
6479
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6477
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6478
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
6479
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6480
|
6480
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer AND spotter_output.departure_airport_icao <> '' |
|
6481
|
6481
|
GROUP BY spotter_output.departure_airport_icao |
|
6482
|
6482
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6488,7 +6488,7 @@ discard block |
|
|
block discarded – undo |
|
6488
|
6488
|
$airport_array = array(); |
|
6489
|
6489
|
$temp_array = array(); |
|
6490
|
6490
|
|
|
6491
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6491
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6492
|
6492
|
{ |
|
6493
|
6493
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6494
|
6494
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6509,11 +6509,11 @@ discard block |
|
|
block discarded – undo |
|
6509
|
6509
|
* @return Array the airport list |
|
6510
|
6510
|
* |
|
6511
|
6511
|
*/ |
|
6512
|
|
- public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
6512
|
+ public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
6513
|
6513
|
{ |
|
6514
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6515
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
6516
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6514
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6515
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
6516
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6517
|
6517
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
6518
|
6518
|
GROUP BY spotter_output.departure_airport_country |
|
6519
|
6519
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6525,7 +6525,7 @@ discard block |
|
|
block discarded – undo |
|
6525
|
6525
|
$airport_array = array(); |
|
6526
|
6526
|
$temp_array = array(); |
|
6527
|
6527
|
|
|
6528
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6528
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6529
|
6529
|
{ |
|
6530
|
6530
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6531
|
6531
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6543,11 +6543,11 @@ discard block |
|
|
block discarded – undo |
|
6543
|
6543
|
* @return Array the airport list |
|
6544
|
6544
|
* |
|
6545
|
6545
|
*/ |
|
6546
|
|
- public function countAllDepartureAirportsByDate($date,$filters = array()) |
|
|
6546
|
+ public function countAllDepartureAirportsByDate($date, $filters = array()) |
|
6547
|
6547
|
{ |
|
6548
|
6548
|
global $globalTimezone, $globalDBdriver; |
|
6549
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6550
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
6549
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6550
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
6551
|
6551
|
if ($globalTimezone != '') { |
|
6552
|
6552
|
date_default_timezone_set($globalTimezone); |
|
6553
|
6553
|
$datetime = new DateTime($date); |
|
@@ -6555,12 +6555,12 @@ discard block |
|
|
block discarded – undo |
|
6555
|
6555
|
} else $offset = '+00:00'; |
|
6556
|
6556
|
|
|
6557
|
6557
|
if ($globalDBdriver == 'mysql') { |
|
6558
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6558
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6559
|
6559
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
6560
|
6560
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6561
|
6561
|
ORDER BY airport_departure_icao_count DESC"; |
|
6562
|
6562
|
} else { |
|
6563
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6563
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6564
|
6564
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
6565
|
6565
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6566
|
6566
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6572,7 +6572,7 @@ discard block |
|
|
block discarded – undo |
|
6572
|
6572
|
$airport_array = array(); |
|
6573
|
6573
|
$temp_array = array(); |
|
6574
|
6574
|
|
|
6575
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6575
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6576
|
6576
|
{ |
|
6577
|
6577
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6578
|
6578
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6593,11 +6593,11 @@ discard block |
|
|
block discarded – undo |
|
6593
|
6593
|
* @return Array the airport list |
|
6594
|
6594
|
* |
|
6595
|
6595
|
*/ |
|
6596
|
|
- public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
|
|
6596
|
+ public function countAllDepartureAirportCountriesByDate($date, $filters = array()) |
|
6597
|
6597
|
{ |
|
6598
|
6598
|
global $globalTimezone, $globalDBdriver; |
|
6599
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6600
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
6599
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6600
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
6601
|
6601
|
if ($globalTimezone != '') { |
|
6602
|
6602
|
date_default_timezone_set($globalTimezone); |
|
6603
|
6603
|
$datetime = new DateTime($date); |
|
@@ -6605,12 +6605,12 @@ discard block |
|
|
block discarded – undo |
|
6605
|
6605
|
} else $offset = '+00:00'; |
|
6606
|
6606
|
|
|
6607
|
6607
|
if ($globalDBdriver == 'mysql') { |
|
6608
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6608
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6609
|
6609
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
6610
|
6610
|
GROUP BY spotter_output.departure_airport_country |
|
6611
|
6611
|
ORDER BY airport_departure_country_count DESC"; |
|
6612
|
6612
|
} else { |
|
6613
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6613
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6614
|
6614
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
6615
|
6615
|
GROUP BY spotter_output.departure_airport_country |
|
6616
|
6616
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6622,7 +6622,7 @@ discard block |
|
|
block discarded – undo |
|
6622
|
6622
|
$airport_array = array(); |
|
6623
|
6623
|
$temp_array = array(); |
|
6624
|
6624
|
|
|
6625
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6625
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6626
|
6626
|
{ |
|
6627
|
6627
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6628
|
6628
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6640,11 +6640,11 @@ discard block |
|
|
block discarded – undo |
|
6640
|
6640
|
* @return Array the airport list |
|
6641
|
6641
|
* |
|
6642
|
6642
|
*/ |
|
6643
|
|
- public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
|
|
6643
|
+ public function countAllDepartureAirportsByIdent($ident, $filters = array()) |
|
6644
|
6644
|
{ |
|
6645
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6646
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
6647
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6645
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6646
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
6647
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6648
|
6648
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' AND spotter_output.ident = :ident |
|
6649
|
6649
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6650
|
6650
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6656,7 +6656,7 @@ discard block |
|
|
block discarded – undo |
|
6656
|
6656
|
$airport_array = array(); |
|
6657
|
6657
|
$temp_array = array(); |
|
6658
|
6658
|
|
|
6659
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6659
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6660
|
6660
|
{ |
|
6661
|
6661
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6662
|
6662
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6678,11 +6678,11 @@ discard block |
|
|
block discarded – undo |
|
6678
|
6678
|
* @return Array the airport list |
|
6679
|
6679
|
* |
|
6680
|
6680
|
*/ |
|
6681
|
|
- public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
|
|
6681
|
+ public function countAllDepartureAirportCountriesByIdent($ident, $filters = array()) |
|
6682
|
6682
|
{ |
|
6683
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6684
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
6685
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6683
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6684
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
6685
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6686
|
6686
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.ident = :ident |
|
6687
|
6687
|
GROUP BY spotter_output.departure_airport_country |
|
6688
|
6688
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6694,7 +6694,7 @@ discard block |
|
|
block discarded – undo |
|
6694
|
6694
|
$airport_array = array(); |
|
6695
|
6695
|
$temp_array = array(); |
|
6696
|
6696
|
|
|
6697
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6697
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6698
|
6698
|
{ |
|
6699
|
6699
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6700
|
6700
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6713,12 +6713,12 @@ discard block |
|
|
block discarded – undo |
|
6713
|
6713
|
* @return Array the airport list |
|
6714
|
6714
|
* |
|
6715
|
6715
|
*/ |
|
6716
|
|
- public function countAllDepartureAirportsByCountry($country,$filters = array()) |
|
|
6716
|
+ public function countAllDepartureAirportsByCountry($country, $filters = array()) |
|
6717
|
6717
|
{ |
|
6718
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6719
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
|
6718
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6719
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
6720
|
6720
|
|
|
6721
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
|
6721
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6722
|
6722
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
6723
|
6723
|
GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6724
|
6724
|
ORDER BY airport_departure_icao_count DESC"; |
|
@@ -6730,7 +6730,7 @@ discard block |
|
|
block discarded – undo |
|
6730
|
6730
|
$airport_array = array(); |
|
6731
|
6731
|
$temp_array = array(); |
|
6732
|
6732
|
|
|
6733
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6733
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6734
|
6734
|
{ |
|
6735
|
6735
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
6736
|
6736
|
$temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
|
@@ -6751,11 +6751,11 @@ discard block |
|
|
block discarded – undo |
|
6751
|
6751
|
* @return Array the airport list |
|
6752
|
6752
|
* |
|
6753
|
6753
|
*/ |
|
6754
|
|
- public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
|
|
6754
|
+ public function countAllDepartureAirportCountriesByCountry($country, $filters = array()) |
|
6755
|
6755
|
{ |
|
6756
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6757
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
6758
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
6756
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6757
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
6758
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
6759
|
6759
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
6760
|
6760
|
GROUP BY spotter_output.departure_airport_country |
|
6761
|
6761
|
ORDER BY airport_departure_country_count DESC"; |
|
@@ -6767,7 +6767,7 @@ discard block |
|
|
block discarded – undo |
|
6767
|
6767
|
$airport_array = array(); |
|
6768
|
6768
|
$temp_array = array(); |
|
6769
|
6769
|
|
|
6770
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6770
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6771
|
6771
|
{ |
|
6772
|
6772
|
$temp_array['departure_airport_country'] = $row['departure_airport_country']; |
|
6773
|
6773
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
@@ -6790,11 +6790,11 @@ discard block |
|
|
block discarded – undo |
|
6790
|
6790
|
* @return Array the airport list |
|
6791
|
6791
|
* |
|
6792
|
6792
|
*/ |
|
6793
|
|
- public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
|
|
6793
|
+ public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array(), $year = '', $month = '', $day = '') |
|
6794
|
6794
|
{ |
|
6795
|
6795
|
global $globalDBdriver; |
|
6796
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6797
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
6796
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6797
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6798
|
6798
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
|
6799
|
6799
|
if ($olderthanmonths > 0) { |
|
6800
|
6800
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6814,28 +6814,28 @@ discard block |
|
|
block discarded – undo |
|
6814
|
6814
|
if ($year != '') { |
|
6815
|
6815
|
if ($globalDBdriver == 'mysql') { |
|
6816
|
6816
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
6817
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6817
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6818
|
6818
|
} else { |
|
6819
|
6819
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
6820
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6820
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6821
|
6821
|
} |
|
6822
|
6822
|
} |
|
6823
|
6823
|
if ($month != '') { |
|
6824
|
6824
|
if ($globalDBdriver == 'mysql') { |
|
6825
|
6825
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
6826
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6826
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6827
|
6827
|
} else { |
|
6828
|
6828
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
6829
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6829
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6830
|
6830
|
} |
|
6831
|
6831
|
} |
|
6832
|
6832
|
if ($day != '') { |
|
6833
|
6833
|
if ($globalDBdriver == 'mysql') { |
|
6834
|
6834
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
6835
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6835
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6836
|
6836
|
} else { |
|
6837
|
6837
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
6838
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6838
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6839
|
6839
|
} |
|
6840
|
6840
|
} |
|
6841
|
6841
|
$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
@@ -6849,7 +6849,7 @@ discard block |
|
|
block discarded – undo |
|
6849
|
6849
|
$airport_array = array(); |
|
6850
|
6850
|
$temp_array = array(); |
|
6851
|
6851
|
|
|
6852
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6852
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6853
|
6853
|
{ |
|
6854
|
6854
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
6855
|
6855
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -6872,11 +6872,11 @@ discard block |
|
|
block discarded – undo |
|
6872
|
6872
|
* @return Array the airport list |
|
6873
|
6873
|
* |
|
6874
|
6874
|
*/ |
|
6875
|
|
- public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
|
|
6875
|
+ public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array()) |
|
6876
|
6876
|
{ |
|
6877
|
6877
|
global $globalDBdriver; |
|
6878
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6879
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
6878
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6879
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6880
|
6880
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' "; |
|
6881
|
6881
|
if ($olderthanmonths > 0) { |
|
6882
|
6882
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6906,7 +6906,7 @@ discard block |
|
|
block discarded – undo |
|
6906
|
6906
|
$airport_array = array(); |
|
6907
|
6907
|
$temp_array = array(); |
|
6908
|
6908
|
|
|
6909
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6909
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6910
|
6910
|
{ |
|
6911
|
6911
|
$temp_array['airline_icao'] = $row['airline_icao']; |
|
6912
|
6912
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
@@ -6931,11 +6931,11 @@ discard block |
|
|
block discarded – undo |
|
6931
|
6931
|
* @return Array the airport list |
|
6932
|
6932
|
* |
|
6933
|
6933
|
*/ |
|
6934
|
|
- public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
|
|
6934
|
+ public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array(), $year = '', $month = '', $day = '') |
|
6935
|
6935
|
{ |
|
6936
|
6936
|
global $globalDBdriver; |
|
6937
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
6938
|
|
- $query = "SELECT DISTINCT spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country |
|
|
6937
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
6938
|
+ $query = "SELECT DISTINCT spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country |
|
6939
|
6939
|
FROM airport,spotter_output".$filter_query." spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao"; |
|
6940
|
6940
|
if ($olderthanmonths > 0) { |
|
6941
|
6941
|
if ($globalDBdriver == 'mysql') { |
|
@@ -6955,28 +6955,28 @@ discard block |
|
|
block discarded – undo |
|
6955
|
6955
|
if ($year != '') { |
|
6956
|
6956
|
if ($globalDBdriver == 'mysql') { |
|
6957
|
6957
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
6958
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6958
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6959
|
6959
|
} else { |
|
6960
|
6960
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
6961
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
6961
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
6962
|
6962
|
} |
|
6963
|
6963
|
} |
|
6964
|
6964
|
if ($month != '') { |
|
6965
|
6965
|
if ($globalDBdriver == 'mysql') { |
|
6966
|
6966
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
6967
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6967
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6968
|
6968
|
} else { |
|
6969
|
6969
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
6970
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
6970
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
6971
|
6971
|
} |
|
6972
|
6972
|
} |
|
6973
|
6973
|
if ($day != '') { |
|
6974
|
6974
|
if ($globalDBdriver == 'mysql') { |
|
6975
|
6975
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
6976
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6976
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6977
|
6977
|
} else { |
|
6978
|
6978
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
6979
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
6979
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
6980
|
6980
|
} |
|
6981
|
6981
|
} |
|
6982
|
6982
|
$query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
@@ -6989,7 +6989,7 @@ discard block |
|
|
block discarded – undo |
|
6989
|
6989
|
|
|
6990
|
6990
|
$airport_array = array(); |
|
6991
|
6991
|
$temp_array = array(); |
|
6992
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
6992
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
6993
|
6993
|
{ |
|
6994
|
6994
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
6995
|
6995
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7012,11 +7012,11 @@ discard block |
|
|
block discarded – undo |
|
7012
|
7012
|
* @return Array the airport list |
|
7013
|
7013
|
* |
|
7014
|
7014
|
*/ |
|
7015
|
|
- public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
|
|
7015
|
+ public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array()) |
|
7016
|
7016
|
{ |
|
7017
|
7017
|
global $globalDBdriver; |
|
7018
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7019
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country |
|
|
7018
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7019
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country |
|
7020
|
7020
|
FROM airport,spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao "; |
|
7021
|
7021
|
if ($olderthanmonths > 0) { |
|
7022
|
7022
|
if ($globalDBdriver == 'mysql') { |
|
@@ -7046,7 +7046,7 @@ discard block |
|
|
block discarded – undo |
|
7046
|
7046
|
$airport_array = array(); |
|
7047
|
7047
|
$temp_array = array(); |
|
7048
|
7048
|
|
|
7049
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7049
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7050
|
7050
|
{ |
|
7051
|
7051
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7052
|
7052
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7072,9 +7072,9 @@ discard block |
|
|
block discarded – undo |
|
7072
|
7072
|
*/ |
|
7073
|
7073
|
public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
|
7074
|
7074
|
{ |
|
7075
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7076
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
7077
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7075
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7076
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
7077
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7078
|
7078
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.airline_icao = :airline_icao |
|
7079
|
7079
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7080
|
7080
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7085,7 +7085,7 @@ discard block |
|
|
block discarded – undo |
|
7085
|
7085
|
$airport_array = array(); |
|
7086
|
7086
|
$temp_array = array(); |
|
7087
|
7087
|
|
|
7088
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7088
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7089
|
7089
|
{ |
|
7090
|
7090
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7091
|
7091
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7106,12 +7106,12 @@ discard block |
|
|
block discarded – undo |
|
7106
|
7106
|
* @return Array the airport list |
|
7107
|
7107
|
* |
|
7108
|
7108
|
*/ |
|
7109
|
|
- public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
|
|
7109
|
+ public function countAllArrivalAirportCountriesByAirline($airline_icao, $filters = array()) |
|
7110
|
7110
|
{ |
|
7111
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7112
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
|
7111
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7112
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
7113
|
7113
|
|
|
7114
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7114
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7115
|
7115
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
|
7116
|
7116
|
GROUP BY spotter_output.arrival_airport_country |
|
7117
|
7117
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7123,7 +7123,7 @@ discard block |
|
|
block discarded – undo |
|
7123
|
7123
|
$airport_array = array(); |
|
7124
|
7124
|
$temp_array = array(); |
|
7125
|
7125
|
|
|
7126
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7126
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7127
|
7127
|
{ |
|
7128
|
7128
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7129
|
7129
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7141,11 +7141,11 @@ discard block |
|
|
block discarded – undo |
|
7141
|
7141
|
* @return Array the airport list |
|
7142
|
7142
|
* |
|
7143
|
7143
|
*/ |
|
7144
|
|
- public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
|
|
7144
|
+ public function countAllArrivalAirportsByAircraft($aircraft_icao, $filters = array()) |
|
7145
|
7145
|
{ |
|
7146
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7147
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
7148
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7146
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7147
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
7148
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7149
|
7149
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
7150
|
7150
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7151
|
7151
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7157,7 +7157,7 @@ discard block |
|
|
block discarded – undo |
|
7157
|
7157
|
$airport_array = array(); |
|
7158
|
7158
|
$temp_array = array(); |
|
7159
|
7159
|
|
|
7160
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7160
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7161
|
7161
|
{ |
|
7162
|
7162
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7163
|
7163
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7179,11 +7179,11 @@ discard block |
|
|
block discarded – undo |
|
7179
|
7179
|
* @return Array the airport list |
|
7180
|
7180
|
* |
|
7181
|
7181
|
*/ |
|
7182
|
|
- public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
|
|
7182
|
+ public function countAllArrivalAirportCountriesByAircraft($aircraft_icao, $filters = array()) |
|
7183
|
7183
|
{ |
|
7184
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7185
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
7186
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7184
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7185
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
7186
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7187
|
7187
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
7188
|
7188
|
GROUP BY spotter_output.arrival_airport_country |
|
7189
|
7189
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7195,7 +7195,7 @@ discard block |
|
|
block discarded – undo |
|
7195
|
7195
|
$airport_array = array(); |
|
7196
|
7196
|
$temp_array = array(); |
|
7197
|
7197
|
|
|
7198
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7198
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7199
|
7199
|
{ |
|
7200
|
7200
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7201
|
7201
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7213,12 +7213,12 @@ discard block |
|
|
block discarded – undo |
|
7213
|
7213
|
* @return Array the airport list |
|
7214
|
7214
|
* |
|
7215
|
7215
|
*/ |
|
7216
|
|
- public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
|
|
7216
|
+ public function countAllArrivalAirportsByRegistration($registration, $filters = array()) |
|
7217
|
7217
|
{ |
|
7218
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7219
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
7218
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7219
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
7220
|
7220
|
|
|
7221
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7221
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7222
|
7222
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.registration = :registration |
|
7223
|
7223
|
GROUP BY spotter_output.arrival_airport_icao |
|
7224
|
7224
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7230,7 +7230,7 @@ discard block |
|
|
block discarded – undo |
|
7230
|
7230
|
$airport_array = array(); |
|
7231
|
7231
|
$temp_array = array(); |
|
7232
|
7232
|
|
|
7233
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7233
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7234
|
7234
|
{ |
|
7235
|
7235
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7236
|
7236
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7251,11 +7251,11 @@ discard block |
|
|
block discarded – undo |
|
7251
|
7251
|
* @return Array the airport list |
|
7252
|
7252
|
* |
|
7253
|
7253
|
*/ |
|
7254
|
|
- public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
|
|
7254
|
+ public function countAllArrivalAirportCountriesByRegistration($registration, $filters = array()) |
|
7255
|
7255
|
{ |
|
7256
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7257
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
7258
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7256
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7257
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
|
7258
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7259
|
7259
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.registration = :registration |
|
7260
|
7260
|
GROUP BY spotter_output.arrival_airport_country |
|
7261
|
7261
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7267,7 +7267,7 @@ discard block |
|
|
block discarded – undo |
|
7267
|
7267
|
$airport_array = array(); |
|
7268
|
7268
|
$temp_array = array(); |
|
7269
|
7269
|
|
|
7270
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7270
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7271
|
7271
|
{ |
|
7272
|
7272
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7273
|
7273
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7286,11 +7286,11 @@ discard block |
|
|
block discarded – undo |
|
7286
|
7286
|
* @return Array the airport list |
|
7287
|
7287
|
* |
|
7288
|
7288
|
*/ |
|
7289
|
|
- public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
|
|
7289
|
+ public function countAllArrivalAirportsByAirport($airport_icao, $filters = array()) |
|
7290
|
7290
|
{ |
|
7291
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7292
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
7293
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7291
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7292
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
7293
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7294
|
7294
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.departure_airport_icao = :airport_icao |
|
7295
|
7295
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7296
|
7296
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7302,7 +7302,7 @@ discard block |
|
|
block discarded – undo |
|
7302
|
7302
|
$airport_array = array(); |
|
7303
|
7303
|
$temp_array = array(); |
|
7304
|
7304
|
|
|
7305
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7305
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7306
|
7306
|
{ |
|
7307
|
7307
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7308
|
7308
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7323,11 +7323,11 @@ discard block |
|
|
block discarded – undo |
|
7323
|
7323
|
* @return Array the airport list |
|
7324
|
7324
|
* |
|
7325
|
7325
|
*/ |
|
7326
|
|
- public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
|
|
7326
|
+ public function countAllArrivalAirportCountriesByAirport($airport_icao, $filters = array()) |
|
7327
|
7327
|
{ |
|
7328
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7329
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
7330
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7328
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7329
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
7330
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7331
|
7331
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.departure_airport_icao = :airport_icao |
|
7332
|
7332
|
GROUP BY spotter_output.arrival_airport_country |
|
7333
|
7333
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7339,7 +7339,7 @@ discard block |
|
|
block discarded – undo |
|
7339
|
7339
|
$airport_array = array(); |
|
7340
|
7340
|
$temp_array = array(); |
|
7341
|
7341
|
|
|
7342
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7342
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7343
|
7343
|
{ |
|
7344
|
7344
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7345
|
7345
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7357,11 +7357,11 @@ discard block |
|
|
block discarded – undo |
|
7357
|
7357
|
* @return Array the airport list |
|
7358
|
7358
|
* |
|
7359
|
7359
|
*/ |
|
7360
|
|
- public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
7360
|
+ public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer, $filters = array()) |
|
7361
|
7361
|
{ |
|
7362
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7363
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
7364
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7362
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7363
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
7364
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7365
|
7365
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
7366
|
7366
|
GROUP BY spotter_output.arrival_airport_icao |
|
7367
|
7367
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7373,7 +7373,7 @@ discard block |
|
|
block discarded – undo |
|
7373
|
7373
|
$airport_array = array(); |
|
7374
|
7374
|
$temp_array = array(); |
|
7375
|
7375
|
|
|
7376
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7376
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7377
|
7377
|
{ |
|
7378
|
7378
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7379
|
7379
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7395,11 +7395,11 @@ discard block |
|
|
block discarded – undo |
|
7395
|
7395
|
* @return Array the airport list |
|
7396
|
7396
|
* |
|
7397
|
7397
|
*/ |
|
7398
|
|
- public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
|
|
7398
|
+ public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
7399
|
7399
|
{ |
|
7400
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7401
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
7402
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7400
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7401
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
7402
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7403
|
7403
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
7404
|
7404
|
GROUP BY spotter_output.arrival_airport_country |
|
7405
|
7405
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7411,7 +7411,7 @@ discard block |
|
|
block discarded – undo |
|
7411
|
7411
|
$airport_array = array(); |
|
7412
|
7412
|
$temp_array = array(); |
|
7413
|
7413
|
|
|
7414
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7414
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7415
|
7415
|
{ |
|
7416
|
7416
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7417
|
7417
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7430,11 +7430,11 @@ discard block |
|
|
block discarded – undo |
|
7430
|
7430
|
* @return Array the airport list |
|
7431
|
7431
|
* |
|
7432
|
7432
|
*/ |
|
7433
|
|
- public function countAllArrivalAirportsByDate($date,$filters = array()) |
|
|
7433
|
+ public function countAllArrivalAirportsByDate($date, $filters = array()) |
|
7434
|
7434
|
{ |
|
7435
|
7435
|
global $globalTimezone, $globalDBdriver; |
|
7436
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7437
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
7436
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7437
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
7438
|
7438
|
if ($globalTimezone != '') { |
|
7439
|
7439
|
date_default_timezone_set($globalTimezone); |
|
7440
|
7440
|
$datetime = new DateTime($date); |
|
@@ -7442,12 +7442,12 @@ discard block |
|
|
block discarded – undo |
|
7442
|
7442
|
} else $offset = '+00:00'; |
|
7443
|
7443
|
|
|
7444
|
7444
|
if ($globalDBdriver == 'mysql') { |
|
7445
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7445
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7446
|
7446
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
7447
|
7447
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7448
|
7448
|
ORDER BY airport_arrival_icao_count DESC"; |
|
7449
|
7449
|
} else { |
|
7450
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7450
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7451
|
7451
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
7452
|
7452
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7453
|
7453
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7459,7 +7459,7 @@ discard block |
|
|
block discarded – undo |
|
7459
|
7459
|
$airport_array = array(); |
|
7460
|
7460
|
$temp_array = array(); |
|
7461
|
7461
|
|
|
7462
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7462
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7463
|
7463
|
{ |
|
7464
|
7464
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7465
|
7465
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7483,8 +7483,8 @@ discard block |
|
|
block discarded – undo |
|
7483
|
7483
|
public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
|
7484
|
7484
|
{ |
|
7485
|
7485
|
global $globalTimezone, $globalDBdriver; |
|
7486
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7487
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
7486
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7487
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
7488
|
7488
|
if ($globalTimezone != '') { |
|
7489
|
7489
|
date_default_timezone_set($globalTimezone); |
|
7490
|
7490
|
$datetime = new DateTime($date); |
|
@@ -7492,12 +7492,12 @@ discard block |
|
|
block discarded – undo |
|
7492
|
7492
|
} else $offset = '+00:00'; |
|
7493
|
7493
|
|
|
7494
|
7494
|
if ($globalDBdriver == 'mysql') { |
|
7495
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7495
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7496
|
7496
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
7497
|
7497
|
GROUP BY spotter_output.arrival_airport_country |
|
7498
|
7498
|
ORDER BY airport_arrival_country_count DESC"; |
|
7499
|
7499
|
} else { |
|
7500
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7500
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7501
|
7501
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
7502
|
7502
|
GROUP BY spotter_output.arrival_airport_country |
|
7503
|
7503
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7509,7 +7509,7 @@ discard block |
|
|
block discarded – undo |
|
7509
|
7509
|
$airport_array = array(); |
|
7510
|
7510
|
$temp_array = array(); |
|
7511
|
7511
|
|
|
7512
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7512
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7513
|
7513
|
{ |
|
7514
|
7514
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7515
|
7515
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7527,11 +7527,11 @@ discard block |
|
|
block discarded – undo |
|
7527
|
7527
|
* @return Array the airport list |
|
7528
|
7528
|
* |
|
7529
|
7529
|
*/ |
|
7530
|
|
- public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
|
|
7530
|
+ public function countAllArrivalAirportsByIdent($ident, $filters = array()) |
|
7531
|
7531
|
{ |
|
7532
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7533
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
7534
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7532
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7533
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
7534
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7535
|
7535
|
FROM spotter_output".$filter_query." WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' AND spotter_output.ident = :ident |
|
7536
|
7536
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7537
|
7537
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7543,7 +7543,7 @@ discard block |
|
|
block discarded – undo |
|
7543
|
7543
|
$airport_array = array(); |
|
7544
|
7544
|
$temp_array = array(); |
|
7545
|
7545
|
|
|
7546
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7546
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7547
|
7547
|
{ |
|
7548
|
7548
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7549
|
7549
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7566,9 +7566,9 @@ discard block |
|
|
block discarded – undo |
|
7566
|
7566
|
*/ |
|
7567
|
7567
|
public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
|
7568
|
7568
|
{ |
|
7569
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7570
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
7571
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7569
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7570
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
7571
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7572
|
7572
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.ident = :ident |
|
7573
|
7573
|
GROUP BY spotter_output.arrival_airport_country |
|
7574
|
7574
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7580,7 +7580,7 @@ discard block |
|
|
block discarded – undo |
|
7580
|
7580
|
$airport_array = array(); |
|
7581
|
7581
|
$temp_array = array(); |
|
7582
|
7582
|
|
|
7583
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7583
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7584
|
7584
|
{ |
|
7585
|
7585
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7586
|
7586
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7599,11 +7599,11 @@ discard block |
|
|
block discarded – undo |
|
7599
|
7599
|
* @return Array the airport list |
|
7600
|
7600
|
* |
|
7601
|
7601
|
*/ |
|
7602
|
|
- public function countAllArrivalAirportsByCountry($country,$filters = array()) |
|
|
7602
|
+ public function countAllArrivalAirportsByCountry($country, $filters = array()) |
|
7603
|
7603
|
{ |
|
7604
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7605
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
7606
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
|
7604
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7605
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
7606
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7607
|
7607
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
7608
|
7608
|
GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7609
|
7609
|
ORDER BY airport_arrival_icao_count DESC"; |
|
@@ -7615,7 +7615,7 @@ discard block |
|
|
block discarded – undo |
|
7615
|
7615
|
$airport_array = array(); |
|
7616
|
7616
|
$temp_array = array(); |
|
7617
|
7617
|
|
|
7618
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7618
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7619
|
7619
|
{ |
|
7620
|
7620
|
$temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
|
7621
|
7621
|
$temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
|
@@ -7636,12 +7636,12 @@ discard block |
|
|
block discarded – undo |
|
7636
|
7636
|
* @return Array the airport list |
|
7637
|
7637
|
* |
|
7638
|
7638
|
*/ |
|
7639
|
|
- public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
|
|
7639
|
+ public function countAllArrivalAirportCountriesByCountry($country, $filters = array()) |
|
7640
|
7640
|
{ |
|
7641
|
7641
|
global $globalDBdriver; |
|
7642
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7643
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
7644
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7642
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7643
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
7644
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7645
|
7645
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
7646
|
7646
|
GROUP BY spotter_output.arrival_airport_country |
|
7647
|
7647
|
ORDER BY airport_arrival_country_count DESC"; |
|
@@ -7653,7 +7653,7 @@ discard block |
|
|
block discarded – undo |
|
7653
|
7653
|
$airport_array = array(); |
|
7654
|
7654
|
$temp_array = array(); |
|
7655
|
7655
|
|
|
7656
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7656
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7657
|
7657
|
{ |
|
7658
|
7658
|
$temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
|
7659
|
7659
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
@@ -7672,38 +7672,38 @@ discard block |
|
|
block discarded – undo |
|
7672
|
7672
|
* @return Array the airport departure list |
|
7673
|
7673
|
* |
|
7674
|
7674
|
*/ |
|
7675
|
|
- public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '') |
|
|
7675
|
+ public function countAllDepartureCountries($filters = array(), $year = '', $month = '', $day = '') |
|
7676
|
7676
|
{ |
|
7677
|
7677
|
global $globalDBdriver; |
|
7678
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7679
|
|
- $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
|
7678
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7679
|
+ $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
7680
|
7680
|
FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
|
7681
|
7681
|
$query_values = array(); |
|
7682
|
7682
|
if ($year != '') { |
|
7683
|
7683
|
if ($globalDBdriver == 'mysql') { |
|
7684
|
7684
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
7685
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
7685
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
7686
|
7686
|
} else { |
|
7687
|
7687
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
7688
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
7688
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
7689
|
7689
|
} |
|
7690
|
7690
|
} |
|
7691
|
7691
|
if ($month != '') { |
|
7692
|
7692
|
if ($globalDBdriver == 'mysql') { |
|
7693
|
7693
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
7694
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
7694
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
7695
|
7695
|
} else { |
|
7696
|
7696
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
7697
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
7697
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
7698
|
7698
|
} |
|
7699
|
7699
|
} |
|
7700
|
7700
|
if ($day != '') { |
|
7701
|
7701
|
if ($globalDBdriver == 'mysql') { |
|
7702
|
7702
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
7703
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
7703
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
7704
|
7704
|
} else { |
|
7705
|
7705
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
7706
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
7706
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
7707
|
7707
|
} |
|
7708
|
7708
|
} |
|
7709
|
7709
|
$query .= " GROUP BY spotter_output.departure_airport_country |
|
@@ -7717,7 +7717,7 @@ discard block |
|
|
block discarded – undo |
|
7717
|
7717
|
$airport_array = array(); |
|
7718
|
7718
|
$temp_array = array(); |
|
7719
|
7719
|
|
|
7720
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7720
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7721
|
7721
|
{ |
|
7722
|
7722
|
$temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
|
7723
|
7723
|
$temp_array['airport_departure_country'] = $row['departure_airport_country']; |
|
@@ -7735,38 +7735,38 @@ discard block |
|
|
block discarded – undo |
|
7735
|
7735
|
* @return Array the airport arrival list |
|
7736
|
7736
|
* |
|
7737
|
7737
|
*/ |
|
7738
|
|
- public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '') |
|
|
7738
|
+ public function countAllArrivalCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
|
7739
|
7739
|
{ |
|
7740
|
7740
|
global $globalDBdriver; |
|
7741
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7742
|
|
- $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
|
7741
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7742
|
+ $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
7743
|
7743
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
|
7744
|
7744
|
$query_values = array(); |
|
7745
|
7745
|
if ($year != '') { |
|
7746
|
7746
|
if ($globalDBdriver == 'mysql') { |
|
7747
|
7747
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
7748
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
7748
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
7749
|
7749
|
} else { |
|
7750
|
7750
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
7751
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
7751
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
7752
|
7752
|
} |
|
7753
|
7753
|
} |
|
7754
|
7754
|
if ($month != '') { |
|
7755
|
7755
|
if ($globalDBdriver == 'mysql') { |
|
7756
|
7756
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
7757
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
7757
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
7758
|
7758
|
} else { |
|
7759
|
7759
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
7760
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
7760
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
7761
|
7761
|
} |
|
7762
|
7762
|
} |
|
7763
|
7763
|
if ($day != '') { |
|
7764
|
7764
|
if ($globalDBdriver == 'mysql') { |
|
7765
|
7765
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
7766
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
7766
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
7767
|
7767
|
} else { |
|
7768
|
7768
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
7769
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
7769
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
7770
|
7770
|
} |
|
7771
|
7771
|
} |
|
7772
|
7772
|
$query .= " GROUP BY spotter_output.arrival_airport_country |
|
@@ -7780,7 +7780,7 @@ discard block |
|
|
block discarded – undo |
|
7780
|
7780
|
$airport_array = array(); |
|
7781
|
7781
|
$temp_array = array(); |
|
7782
|
7782
|
|
|
7783
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7783
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7784
|
7784
|
{ |
|
7785
|
7785
|
$temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
|
7786
|
7786
|
$temp_array['airport_arrival_country'] = $row['arrival_airport_country']; |
|
@@ -7803,8 +7803,8 @@ discard block |
|
|
block discarded – undo |
|
7803
|
7803
|
*/ |
|
7804
|
7804
|
public function countAllRoutes($filters = array()) |
|
7805
|
7805
|
{ |
|
7806
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7807
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
7806
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7807
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
7808
|
7808
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' |
|
7809
|
7809
|
GROUP BY route,spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
7810
|
7810
|
ORDER BY route_count DESC |
|
@@ -7817,7 +7817,7 @@ discard block |
|
|
block discarded – undo |
|
7817
|
7817
|
$routes_array = array(); |
|
7818
|
7818
|
$temp_array = array(); |
|
7819
|
7819
|
|
|
7820
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7820
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7821
|
7821
|
{ |
|
7822
|
7822
|
$temp_array['route_count'] = $row['route_count']; |
|
7823
|
7823
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -7844,11 +7844,11 @@ discard block |
|
|
block discarded – undo |
|
7844
|
7844
|
* @return Array the route list |
|
7845
|
7845
|
* |
|
7846
|
7846
|
*/ |
|
7847
|
|
- public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
|
|
7847
|
+ public function countAllRoutesByAircraft($aircraft_icao, $filters = array()) |
|
7848
|
7848
|
{ |
|
7849
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7850
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
7851
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
7849
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7850
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
7851
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
7852
|
7852
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
|
7853
|
7853
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7854
|
7854
|
ORDER BY route_count DESC"; |
|
@@ -7859,7 +7859,7 @@ discard block |
|
|
block discarded – undo |
|
7859
|
7859
|
$routes_array = array(); |
|
7860
|
7860
|
$temp_array = array(); |
|
7861
|
7861
|
|
|
7862
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7862
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7863
|
7863
|
{ |
|
7864
|
7864
|
$temp_array['route_count'] = $row['route_count']; |
|
7865
|
7865
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -7886,9 +7886,9 @@ discard block |
|
|
block discarded – undo |
|
7886
|
7886
|
*/ |
|
7887
|
7887
|
public function countAllRoutesByRegistration($registration, $filters = array()) |
|
7888
|
7888
|
{ |
|
7889
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
7889
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
7890
|
7890
|
$registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
7891
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
7891
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
7892
|
7892
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.registration = :registration |
|
7893
|
7893
|
GROUP BY route |
|
7894
|
7894
|
ORDER BY route_count DESC"; |
|
@@ -7900,7 +7900,7 @@ discard block |
|
|
block discarded – undo |
|
7900
|
7900
|
$routes_array = array(); |
|
7901
|
7901
|
$temp_array = array(); |
|
7902
|
7902
|
|
|
7903
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7903
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7904
|
7904
|
{ |
|
7905
|
7905
|
$temp_array['route_count'] = $row['route_count']; |
|
7906
|
7906
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -7928,9 +7928,9 @@ discard block |
|
|
block discarded – undo |
|
7928
|
7928
|
*/ |
|
7929
|
7929
|
public function countAllRoutesByAirline($airline_icao, $filters = array()) |
|
7930
|
7930
|
{ |
|
7931
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7932
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
7933
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
7931
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7932
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
|
7933
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
7934
|
7934
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.airline_icao = :airline_icao |
|
7935
|
7935
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7936
|
7936
|
ORDER BY route_count DESC"; |
|
@@ -7942,7 +7942,7 @@ discard block |
|
|
block discarded – undo |
|
7942
|
7942
|
$routes_array = array(); |
|
7943
|
7943
|
$temp_array = array(); |
|
7944
|
7944
|
|
|
7945
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7945
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7946
|
7946
|
{ |
|
7947
|
7947
|
$temp_array['route_count'] = $row['route_count']; |
|
7948
|
7948
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -7970,9 +7970,9 @@ discard block |
|
|
block discarded – undo |
|
7970
|
7970
|
*/ |
|
7971
|
7971
|
public function countAllRoutesByAirport($airport_icao, $filters = array()) |
|
7972
|
7972
|
{ |
|
7973
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
7974
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
7975
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
7973
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
7974
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
|
7975
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
7976
|
7976
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
7977
|
7977
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7978
|
7978
|
ORDER BY route_count DESC"; |
|
@@ -7983,7 +7983,7 @@ discard block |
|
|
block discarded – undo |
|
7983
|
7983
|
$routes_array = array(); |
|
7984
|
7984
|
$temp_array = array(); |
|
7985
|
7985
|
|
|
7986
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
7986
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
7987
|
7987
|
{ |
|
7988
|
7988
|
$temp_array['route_count'] = $row['route_count']; |
|
7989
|
7989
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -8011,9 +8011,9 @@ discard block |
|
|
block discarded – undo |
|
8011
|
8011
|
*/ |
|
8012
|
8012
|
public function countAllRoutesByCountry($country, $filters = array()) |
|
8013
|
8013
|
{ |
|
8014
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8015
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
8016
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8014
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8015
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
|
8016
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8017
|
8017
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
8018
|
8018
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
8019
|
8019
|
ORDER BY route_count DESC"; |
|
@@ -8024,7 +8024,7 @@ discard block |
|
|
block discarded – undo |
|
8024
|
8024
|
$routes_array = array(); |
|
8025
|
8025
|
$temp_array = array(); |
|
8026
|
8026
|
|
|
8027
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8027
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8028
|
8028
|
{ |
|
8029
|
8029
|
$temp_array['route_count'] = $row['route_count']; |
|
8030
|
8030
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -8052,8 +8052,8 @@ discard block |
|
|
block discarded – undo |
|
8052
|
8052
|
public function countAllRoutesByDate($date, $filters = array()) |
|
8053
|
8053
|
{ |
|
8054
|
8054
|
global $globalTimezone, $globalDBdriver; |
|
8055
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8056
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
8055
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8056
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
8057
|
8057
|
if ($globalTimezone != '') { |
|
8058
|
8058
|
date_default_timezone_set($globalTimezone); |
|
8059
|
8059
|
$datetime = new DateTime($date); |
|
@@ -8061,12 +8061,12 @@ discard block |
|
|
block discarded – undo |
|
8061
|
8061
|
} else $offset = '+00:00'; |
|
8062
|
8062
|
|
|
8063
|
8063
|
if ($globalDBdriver == 'mysql') { |
|
8064
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8064
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8065
|
8065
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
8066
|
8066
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
8067
|
8067
|
ORDER BY route_count DESC"; |
|
8068
|
8068
|
} else { |
|
8069
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8069
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8070
|
8070
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
|
8071
|
8071
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
8072
|
8072
|
ORDER BY route_count DESC"; |
|
@@ -8078,7 +8078,7 @@ discard block |
|
|
block discarded – undo |
|
8078
|
8078
|
$routes_array = array(); |
|
8079
|
8079
|
$temp_array = array(); |
|
8080
|
8080
|
|
|
8081
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8081
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8082
|
8082
|
{ |
|
8083
|
8083
|
$temp_array['route_count'] = $row['route_count']; |
|
8084
|
8084
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -8105,9 +8105,9 @@ discard block |
|
|
block discarded – undo |
|
8105
|
8105
|
*/ |
|
8106
|
8106
|
public function countAllRoutesByIdent($ident, $filters = array()) |
|
8107
|
8107
|
{ |
|
8108
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8109
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
8110
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8108
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8109
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
|
8110
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8111
|
8111
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.ident = :ident |
|
8112
|
8112
|
GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
8113
|
8113
|
ORDER BY route_count DESC"; |
|
@@ -8119,7 +8119,7 @@ discard block |
|
|
block discarded – undo |
|
8119
|
8119
|
$routes_array = array(); |
|
8120
|
8120
|
$temp_array = array(); |
|
8121
|
8121
|
|
|
8122
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8122
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8123
|
8123
|
{ |
|
8124
|
8124
|
$temp_array['route_count'] = $row['route_count']; |
|
8125
|
8125
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -8146,9 +8146,9 @@ discard block |
|
|
block discarded – undo |
|
8146
|
8146
|
*/ |
|
8147
|
8147
|
public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
|
8148
|
8148
|
{ |
|
8149
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8150
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
8151
|
|
- $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8149
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8150
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
|
8151
|
+ $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8152
|
8152
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
8153
|
8153
|
GROUP BY route |
|
8154
|
8154
|
ORDER BY route_count DESC"; |
|
@@ -8160,7 +8160,7 @@ discard block |
|
|
block discarded – undo |
|
8160
|
8160
|
$routes_array = array(); |
|
8161
|
8161
|
$temp_array = array(); |
|
8162
|
8162
|
|
|
8163
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8163
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8164
|
8164
|
{ |
|
8165
|
8165
|
$temp_array['route_count'] = $row['route_count']; |
|
8166
|
8166
|
$temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
|
@@ -8188,8 +8188,8 @@ discard block |
|
|
block discarded – undo |
|
8188
|
8188
|
*/ |
|
8189
|
8189
|
public function countAllRoutesWithWaypoints($filters = array()) |
|
8190
|
8190
|
{ |
|
8191
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8192
|
|
- $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
|
8191
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8192
|
+ $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
8193
|
8193
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.waypoints <> '' |
|
8194
|
8194
|
GROUP BY route, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
8195
|
8195
|
ORDER BY route_count DESC |
|
@@ -8202,7 +8202,7 @@ discard block |
|
|
block discarded – undo |
|
8202
|
8202
|
$routes_array = array(); |
|
8203
|
8203
|
$temp_array = array(); |
|
8204
|
8204
|
|
|
8205
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8205
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8206
|
8206
|
{ |
|
8207
|
8207
|
$temp_array['spotter_id'] = $row['spotter_id']; |
|
8208
|
8208
|
$temp_array['route_count'] = $row['route_count']; |
|
@@ -8227,11 +8227,11 @@ discard block |
|
|
block discarded – undo |
|
8227
|
8227
|
* @return Array the callsign list |
|
8228
|
8228
|
* |
|
8229
|
8229
|
*/ |
|
8230
|
|
- public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
|
|
8230
|
+ public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array(), $year = '', $month = '', $day = '') |
|
8231
|
8231
|
{ |
|
8232
|
8232
|
global $globalDBdriver; |
|
8233
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8234
|
|
- $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
|
8233
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8234
|
+ $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
8235
|
8235
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' "; |
|
8236
|
8236
|
if ($olderthanmonths > 0) { |
|
8237
|
8237
|
if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
|
@@ -8245,28 +8245,28 @@ discard block |
|
|
block discarded – undo |
|
8245
|
8245
|
if ($year != '') { |
|
8246
|
8246
|
if ($globalDBdriver == 'mysql') { |
|
8247
|
8247
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
8248
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
8248
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
8249
|
8249
|
} else { |
|
8250
|
8250
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
8251
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
8251
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
8252
|
8252
|
} |
|
8253
|
8253
|
} |
|
8254
|
8254
|
if ($month != '') { |
|
8255
|
8255
|
if ($globalDBdriver == 'mysql') { |
|
8256
|
8256
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
8257
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
8257
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
8258
|
8258
|
} else { |
|
8259
|
8259
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
8260
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
8260
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
8261
|
8261
|
} |
|
8262
|
8262
|
} |
|
8263
|
8263
|
if ($day != '') { |
|
8264
|
8264
|
if ($globalDBdriver == 'mysql') { |
|
8265
|
8265
|
$query .= " AND DAY(spotter_output.date) = :day"; |
|
8266
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
8266
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
8267
|
8267
|
} else { |
|
8268
|
8268
|
$query .= " AND EXTRACT(DAY FROM spotter_output.date) = :day"; |
|
8269
|
|
- $query_values = array_merge($query_values,array(':day' => $day)); |
|
|
8269
|
+ $query_values = array_merge($query_values, array(':day' => $day)); |
|
8270
|
8270
|
} |
|
8271
|
8271
|
} |
|
8272
|
8272
|
$query .= " GROUP BY spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
|
@@ -8278,7 +8278,7 @@ discard block |
|
|
block discarded – undo |
|
8278
|
8278
|
$callsign_array = array(); |
|
8279
|
8279
|
$temp_array = array(); |
|
8280
|
8280
|
|
|
8281
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8281
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8282
|
8282
|
{ |
|
8283
|
8283
|
$temp_array['callsign_icao'] = $row['ident']; |
|
8284
|
8284
|
$temp_array['airline_name'] = $row['airline_name']; |
|
@@ -8300,8 +8300,8 @@ discard block |
|
|
block discarded – undo |
|
8300
|
8300
|
public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
8301
|
8301
|
{ |
|
8302
|
8302
|
global $globalDBdriver; |
|
8303
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
8304
|
|
- $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name |
|
|
8303
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
8304
|
+ $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name |
|
8305
|
8305
|
FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.airline_icao <> '' "; |
|
8306
|
8306
|
if ($olderthanmonths > 0) { |
|
8307
|
8307
|
if ($globalDBdriver == 'mysql') $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
@@ -8320,7 +8320,7 @@ discard block |
|
|
block discarded – undo |
|
8320
|
8320
|
$callsign_array = array(); |
|
8321
|
8321
|
$temp_array = array(); |
|
8322
|
8322
|
|
|
8323
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8323
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8324
|
8324
|
{ |
|
8325
|
8325
|
$temp_array['callsign_icao'] = $row['ident']; |
|
8326
|
8326
|
$temp_array['airline_name'] = $row['airline_name']; |
|
@@ -8374,7 +8374,7 @@ discard block |
|
|
block discarded – undo |
|
8374
|
8374
|
$date_array = array(); |
|
8375
|
8375
|
$temp_array = array(); |
|
8376
|
8376
|
|
|
8377
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8377
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8378
|
8378
|
{ |
|
8379
|
8379
|
$temp_array['date_name'] = $row['date_name']; |
|
8380
|
8380
|
$temp_array['date_count'] = $row['date_count']; |
|
@@ -8399,15 +8399,15 @@ discard block |
|
|
block discarded – undo |
|
8399
|
8399
|
$datetime = new DateTime(); |
|
8400
|
8400
|
$offset = $datetime->format('P'); |
|
8401
|
8401
|
} else $offset = '+00:00'; |
|
8402
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8402
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8403
|
8403
|
if ($globalDBdriver == 'mysql') { |
|
8404
|
|
- $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
|
8404
|
+ $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
8405
|
8405
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
|
8406
|
8406
|
GROUP BY spotter_output.airline_icao, date_name |
|
8407
|
8407
|
ORDER BY date_count DESC |
|
8408
|
8408
|
LIMIT 10 OFFSET 0"; |
|
8409
|
8409
|
} else { |
|
8410
|
|
- $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
|
8410
|
+ $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
8411
|
8411
|
FROM spotter_output |
|
8412
|
8412
|
WHERE spotter_output.airline_icao <> '' |
|
8413
|
8413
|
GROUP BY spotter_output.airline_icao, date_name |
|
@@ -8422,7 +8422,7 @@ discard block |
|
|
block discarded – undo |
|
8422
|
8422
|
$date_array = array(); |
|
8423
|
8423
|
$temp_array = array(); |
|
8424
|
8424
|
|
|
8425
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8425
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8426
|
8426
|
{ |
|
8427
|
8427
|
$temp_array['date_name'] = $row['date_name']; |
|
8428
|
8428
|
$temp_array['date_count'] = $row['date_count']; |
|
@@ -8448,7 +8448,7 @@ discard block |
|
|
block discarded – undo |
|
8448
|
8448
|
$datetime = new DateTime(); |
|
8449
|
8449
|
$offset = $datetime->format('P'); |
|
8450
|
8450
|
} else $offset = '+00:00'; |
|
8451
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8451
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8452
|
8452
|
if ($globalDBdriver == 'mysql') { |
|
8453
|
8453
|
$query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
8454
|
8454
|
FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)"; |
|
@@ -8469,7 +8469,7 @@ discard block |
|
|
block discarded – undo |
|
8469
|
8469
|
$date_array = array(); |
|
8470
|
8470
|
$temp_array = array(); |
|
8471
|
8471
|
|
|
8472
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8472
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8473
|
8473
|
{ |
|
8474
|
8474
|
$temp_array['date_name'] = $row['date_name']; |
|
8475
|
8475
|
$temp_array['date_count'] = $row['date_count']; |
|
@@ -8494,7 +8494,7 @@ discard block |
|
|
block discarded – undo |
|
8494
|
8494
|
$datetime = new DateTime(); |
|
8495
|
8495
|
$offset = $datetime->format('P'); |
|
8496
|
8496
|
} else $offset = '+00:00'; |
|
8497
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8497
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8498
|
8498
|
if ($globalDBdriver == 'mysql') { |
|
8499
|
8499
|
$query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
8500
|
8500
|
FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH)"; |
|
@@ -8515,7 +8515,7 @@ discard block |
|
|
block discarded – undo |
|
8515
|
8515
|
$date_array = array(); |
|
8516
|
8516
|
$temp_array = array(); |
|
8517
|
8517
|
|
|
8518
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8518
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8519
|
8519
|
{ |
|
8520
|
8520
|
$temp_array['date_name'] = $row['date_name']; |
|
8521
|
8521
|
$temp_array['date_count'] = $row['date_count']; |
|
@@ -8536,7 +8536,7 @@ discard block |
|
|
block discarded – undo |
|
8536
|
8536
|
public function countAllDatesLastMonthByAirlines($filters = array()) |
|
8537
|
8537
|
{ |
|
8538
|
8538
|
global $globalTimezone, $globalDBdriver; |
|
8539
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8539
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8540
|
8540
|
if ($globalTimezone != '') { |
|
8541
|
8541
|
date_default_timezone_set($globalTimezone); |
|
8542
|
8542
|
$datetime = new DateTime(); |
|
@@ -8544,13 +8544,13 @@ discard block |
|
|
block discarded – undo |
|
8544
|
8544
|
} else $offset = '+00:00'; |
|
8545
|
8545
|
|
|
8546
|
8546
|
if ($globalDBdriver == 'mysql') { |
|
8547
|
|
- $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
|
8547
|
+ $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
8548
|
8548
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH) |
|
8549
|
8549
|
GROUP BY spotter_output.airline_icao, date_name |
|
8550
|
8550
|
ORDER BY spotter_output.date ASC"; |
|
8551
|
8551
|
$query_data = array(':offset' => $offset); |
|
8552
|
8552
|
} else { |
|
8553
|
|
- $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
|
8553
|
+ $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
8554
|
8554
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 MONTHS' |
|
8555
|
8555
|
GROUP BY spotter_output.airline_icao, date_name |
|
8556
|
8556
|
ORDER BY date_name ASC"; |
|
@@ -8563,7 +8563,7 @@ discard block |
|
|
block discarded – undo |
|
8563
|
8563
|
$date_array = array(); |
|
8564
|
8564
|
$temp_array = array(); |
|
8565
|
8565
|
|
|
8566
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8566
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8567
|
8567
|
{ |
|
8568
|
8568
|
$temp_array['date_name'] = $row['date_name']; |
|
8569
|
8569
|
$temp_array['date_count'] = $row['date_count']; |
|
@@ -8610,7 +8610,7 @@ discard block |
|
|
block discarded – undo |
|
8610
|
8610
|
$date_array = array(); |
|
8611
|
8611
|
$temp_array = array(); |
|
8612
|
8612
|
|
|
8613
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8613
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8614
|
8614
|
{ |
|
8615
|
8615
|
$temp_array['month_name'] = $row['month_name']; |
|
8616
|
8616
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8631,7 +8631,7 @@ discard block |
|
|
block discarded – undo |
|
8631
|
8631
|
public function countAllMonthsByAirlines($filters = array()) |
|
8632
|
8632
|
{ |
|
8633
|
8633
|
global $globalTimezone, $globalDBdriver; |
|
8634
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8634
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8635
|
8635
|
if ($globalTimezone != '') { |
|
8636
|
8636
|
date_default_timezone_set($globalTimezone); |
|
8637
|
8637
|
$datetime = new DateTime(); |
|
@@ -8639,12 +8639,12 @@ discard block |
|
|
block discarded – undo |
|
8639
|
8639
|
} else $offset = '+00:00'; |
|
8640
|
8640
|
|
|
8641
|
8641
|
if ($globalDBdriver == 'mysql') { |
|
8642
|
|
- $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
|
8642
|
+ $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
8643
|
8643
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
|
8644
|
8644
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
8645
|
8645
|
ORDER BY date_count DESC"; |
|
8646
|
8646
|
} else { |
|
8647
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
|
8647
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
8648
|
8648
|
FROM spotter_output |
|
8649
|
8649
|
WHERE spotter_output.airline_icao <> '' |
|
8650
|
8650
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
@@ -8658,7 +8658,7 @@ discard block |
|
|
block discarded – undo |
|
8658
|
8658
|
$date_array = array(); |
|
8659
|
8659
|
$temp_array = array(); |
|
8660
|
8660
|
|
|
8661
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8661
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8662
|
8662
|
{ |
|
8663
|
8663
|
$temp_array['month_name'] = $row['month_name']; |
|
8664
|
8664
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8685,14 +8685,14 @@ discard block |
|
|
block discarded – undo |
|
8685
|
8685
|
$datetime = new DateTime(); |
|
8686
|
8686
|
$offset = $datetime->format('P'); |
|
8687
|
8687
|
} else $offset = '+00:00'; |
|
8688
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8688
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8689
|
8689
|
if ($globalDBdriver == 'mysql') { |
|
8690
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
|
8690
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
8691
|
8691
|
FROM spotter_output".$filter_query." spotter_output.airline_type = 'military' |
|
8692
|
8692
|
GROUP BY year_name, month_name |
|
8693
|
8693
|
ORDER BY date_count DESC"; |
|
8694
|
8694
|
} else { |
|
8695
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
|
8695
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
8696
|
8696
|
FROM spotter_output".$filter_query." spotter_output.airline_type = 'military' |
|
8697
|
8697
|
GROUP BY year_name, month_name |
|
8698
|
8698
|
ORDER BY date_count DESC"; |
|
@@ -8704,7 +8704,7 @@ discard block |
|
|
block discarded – undo |
|
8704
|
8704
|
$date_array = array(); |
|
8705
|
8705
|
$temp_array = array(); |
|
8706
|
8706
|
|
|
8707
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8707
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8708
|
8708
|
{ |
|
8709
|
8709
|
$temp_array['month_name'] = $row['month_name']; |
|
8710
|
8710
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8730,15 +8730,15 @@ discard block |
|
|
block discarded – undo |
|
8730
|
8730
|
$datetime = new DateTime(); |
|
8731
|
8731
|
$offset = $datetime->format('P'); |
|
8732
|
8732
|
} else $offset = '+00:00'; |
|
8733
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8733
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8734
|
8734
|
|
|
8735
|
8735
|
if ($globalDBdriver == 'mysql') { |
|
8736
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
|
8736
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
8737
|
8737
|
FROM spotter_output".$filter_query." owner_name <> '' |
|
8738
|
8738
|
GROUP BY year_name, month_name |
|
8739
|
8739
|
ORDER BY date_count DESC"; |
|
8740
|
8740
|
} else { |
|
8741
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
|
8741
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
8742
|
8742
|
FROM spotter_output".$filter_query." owner_name <> '' |
|
8743
|
8743
|
GROUP BY year_name, month_name |
|
8744
|
8744
|
ORDER BY date_count DESC"; |
|
@@ -8750,7 +8750,7 @@ discard block |
|
|
block discarded – undo |
|
8750
|
8750
|
$date_array = array(); |
|
8751
|
8751
|
$temp_array = array(); |
|
8752
|
8752
|
|
|
8753
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8753
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8754
|
8754
|
{ |
|
8755
|
8755
|
$temp_array['month_name'] = $row['month_name']; |
|
8756
|
8756
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8771,7 +8771,7 @@ discard block |
|
|
block discarded – undo |
|
8771
|
8771
|
public function countAllMonthsOwnersByAirlines($filters = array()) |
|
8772
|
8772
|
{ |
|
8773
|
8773
|
global $globalTimezone, $globalDBdriver; |
|
8774
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8774
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8775
|
8775
|
if ($globalTimezone != '') { |
|
8776
|
8776
|
date_default_timezone_set($globalTimezone); |
|
8777
|
8777
|
$datetime = new DateTime(); |
|
@@ -8779,12 +8779,12 @@ discard block |
|
|
block discarded – undo |
|
8779
|
8779
|
} else $offset = '+00:00'; |
|
8780
|
8780
|
|
|
8781
|
8781
|
if ($globalDBdriver == 'mysql') { |
|
8782
|
|
- $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
|
8782
|
+ $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
8783
|
8783
|
FROM spotter_output".$filter_query." owner_name <> '' AND spotter_output.airline_icao <> '' |
|
8784
|
8784
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
8785
|
8785
|
ORDER BY date_count DESC"; |
|
8786
|
8786
|
} else { |
|
8787
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
|
8787
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
8788
|
8788
|
FROM spotter_output".$filter_query." owner_name <> '' AND spotter_output.airline_icao <> '' |
|
8789
|
8789
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
8790
|
8790
|
ORDER BY date_count DESC"; |
|
@@ -8796,7 +8796,7 @@ discard block |
|
|
block discarded – undo |
|
8796
|
8796
|
$date_array = array(); |
|
8797
|
8797
|
$temp_array = array(); |
|
8798
|
8798
|
|
|
8799
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8799
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8800
|
8800
|
{ |
|
8801
|
8801
|
$temp_array['month_name'] = $row['month_name']; |
|
8802
|
8802
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8823,15 +8823,15 @@ discard block |
|
|
block discarded – undo |
|
8823
|
8823
|
$datetime = new DateTime(); |
|
8824
|
8824
|
$offset = $datetime->format('P'); |
|
8825
|
8825
|
} else $offset = '+00:00'; |
|
8826
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8826
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8827
|
8827
|
|
|
8828
|
8828
|
if ($globalDBdriver == 'mysql') { |
|
8829
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
|
8829
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
8830
|
8830
|
FROM spotter_output".$filter_query." pilot_id <> '' AND pilot_id IS NOT NULL |
|
8831
|
8831
|
GROUP BY year_name, month_name |
|
8832
|
8832
|
ORDER BY date_count DESC"; |
|
8833
|
8833
|
} else { |
|
8834
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
|
8834
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
8835
|
8835
|
FROM spotter_output".$filter_query." pilot_id <> '' AND pilot_id IS NOT NULL |
|
8836
|
8836
|
GROUP BY year_name, month_name |
|
8837
|
8837
|
ORDER BY date_count DESC"; |
|
@@ -8843,7 +8843,7 @@ discard block |
|
|
block discarded – undo |
|
8843
|
8843
|
$date_array = array(); |
|
8844
|
8844
|
$temp_array = array(); |
|
8845
|
8845
|
|
|
8846
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8846
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8847
|
8847
|
{ |
|
8848
|
8848
|
$temp_array['month_name'] = $row['month_name']; |
|
8849
|
8849
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8864,7 +8864,7 @@ discard block |
|
|
block discarded – undo |
|
8864
|
8864
|
public function countAllMonthsPilotsByAirlines($filters = array()) |
|
8865
|
8865
|
{ |
|
8866
|
8866
|
global $globalTimezone, $globalDBdriver; |
|
8867
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8867
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8868
|
8868
|
if ($globalTimezone != '') { |
|
8869
|
8869
|
date_default_timezone_set($globalTimezone); |
|
8870
|
8870
|
$datetime = new DateTime(); |
|
@@ -8872,12 +8872,12 @@ discard block |
|
|
block discarded – undo |
|
8872
|
8872
|
} else $offset = '+00:00'; |
|
8873
|
8873
|
|
|
8874
|
8874
|
if ($globalDBdriver == 'mysql') { |
|
8875
|
|
- $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
|
8875
|
+ $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
8876
|
8876
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND pilot_id <> '' AND pilot_id IS NOT NULL |
|
8877
|
8877
|
GROUP BY spotter_output.airline_icao,year_name, month_name |
|
8878
|
8878
|
ORDER BY date_count DESC"; |
|
8879
|
8879
|
} else { |
|
8880
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
|
8880
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
8881
|
8881
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND pilot_id <> '' AND pilot_id IS NOT NULL |
|
8882
|
8882
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
8883
|
8883
|
ORDER BY date_count DESC"; |
|
@@ -8889,7 +8889,7 @@ discard block |
|
|
block discarded – undo |
|
8889
|
8889
|
$date_array = array(); |
|
8890
|
8890
|
$temp_array = array(); |
|
8891
|
8891
|
|
|
8892
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8892
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8893
|
8893
|
{ |
|
8894
|
8894
|
$temp_array['month_name'] = $row['month_name']; |
|
8895
|
8895
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8911,7 +8911,7 @@ discard block |
|
|
block discarded – undo |
|
8911
|
8911
|
public function countAllMonthsAirlines($filters = array()) |
|
8912
|
8912
|
{ |
|
8913
|
8913
|
global $globalTimezone, $globalDBdriver; |
|
8914
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8914
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8915
|
8915
|
if ($globalTimezone != '') { |
|
8916
|
8916
|
date_default_timezone_set($globalTimezone); |
|
8917
|
8917
|
$datetime = new DateTime(); |
|
@@ -8919,12 +8919,12 @@ discard block |
|
|
block discarded – undo |
|
8919
|
8919
|
} else $offset = '+00:00'; |
|
8920
|
8920
|
|
|
8921
|
8921
|
if ($globalDBdriver == 'mysql') { |
|
8922
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
|
|
8922
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
|
8923
|
8923
|
FROM spotter_output".$filter_query." airline_icao <> '' |
|
8924
|
8924
|
GROUP BY year_name, month_name |
|
8925
|
8925
|
ORDER BY date_count DESC"; |
|
8926
|
8926
|
} else { |
|
8927
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
|
8927
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
8928
|
8928
|
FROM spotter_output".$filter_query." airline_icao <> '' |
|
8929
|
8929
|
GROUP BY year_name, month_name |
|
8930
|
8930
|
ORDER BY date_count DESC"; |
|
@@ -8936,7 +8936,7 @@ discard block |
|
|
block discarded – undo |
|
8936
|
8936
|
$date_array = array(); |
|
8937
|
8937
|
$temp_array = array(); |
|
8938
|
8938
|
|
|
8939
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8939
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8940
|
8940
|
{ |
|
8941
|
8941
|
$temp_array['month_name'] = $row['month_name']; |
|
8942
|
8942
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -8962,15 +8962,15 @@ discard block |
|
|
block discarded – undo |
|
8962
|
8962
|
$datetime = new DateTime(); |
|
8963
|
8963
|
$offset = $datetime->format('P'); |
|
8964
|
8964
|
} else $offset = '+00:00'; |
|
8965
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
8965
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
8966
|
8966
|
|
|
8967
|
8967
|
if ($globalDBdriver == 'mysql') { |
|
8968
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
|
8968
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
8969
|
8969
|
FROM spotter_output".$filter_query." aircraft_icao <> '' |
|
8970
|
8970
|
GROUP BY year_name, month_name |
|
8971
|
8971
|
ORDER BY date_count DESC"; |
|
8972
|
8972
|
} else { |
|
8973
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
|
8973
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
8974
|
8974
|
FROM spotter_output".$filter_query." aircraft_icao <> '' |
|
8975
|
8975
|
GROUP BY year_name, month_name |
|
8976
|
8976
|
ORDER BY date_count DESC"; |
|
@@ -8982,7 +8982,7 @@ discard block |
|
|
block discarded – undo |
|
8982
|
8982
|
$date_array = array(); |
|
8983
|
8983
|
$temp_array = array(); |
|
8984
|
8984
|
|
|
8985
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
8985
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
8986
|
8986
|
{ |
|
8987
|
8987
|
$temp_array['month_name'] = $row['month_name']; |
|
8988
|
8988
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -9004,7 +9004,7 @@ discard block |
|
|
block discarded – undo |
|
9004
|
9004
|
public function countAllMonthsAircraftsByAirlines($filters = array()) |
|
9005
|
9005
|
{ |
|
9006
|
9006
|
global $globalTimezone, $globalDBdriver; |
|
9007
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9007
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9008
|
9008
|
if ($globalTimezone != '') { |
|
9009
|
9009
|
date_default_timezone_set($globalTimezone); |
|
9010
|
9010
|
$datetime = new DateTime(); |
|
@@ -9012,12 +9012,12 @@ discard block |
|
|
block discarded – undo |
|
9012
|
9012
|
} else $offset = '+00:00'; |
|
9013
|
9013
|
|
|
9014
|
9014
|
if ($globalDBdriver == 'mysql') { |
|
9015
|
|
- $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
|
9015
|
+ $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
9016
|
9016
|
FROM spotter_output".$filter_query." aircraft_icao <> '' AND spotter_output.airline_icao <> '' |
|
9017
|
9017
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
9018
|
9018
|
ORDER BY date_count DESC"; |
|
9019
|
9019
|
} else { |
|
9020
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
|
9020
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
9021
|
9021
|
FROM spotter_output".$filter_query." aircraft_icao <> '' AND spotter_output.airline_icao <> '' |
|
9022
|
9022
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
9023
|
9023
|
ORDER BY date_count DESC"; |
|
@@ -9029,7 +9029,7 @@ discard block |
|
|
block discarded – undo |
|
9029
|
9029
|
$date_array = array(); |
|
9030
|
9030
|
$temp_array = array(); |
|
9031
|
9031
|
|
|
9032
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9032
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9033
|
9033
|
{ |
|
9034
|
9034
|
$temp_array['month_name'] = $row['month_name']; |
|
9035
|
9035
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -9056,15 +9056,15 @@ discard block |
|
|
block discarded – undo |
|
9056
|
9056
|
$datetime = new DateTime(); |
|
9057
|
9057
|
$offset = $datetime->format('P'); |
|
9058
|
9058
|
} else $offset = '+00:00'; |
|
9059
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9059
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9060
|
9060
|
|
|
9061
|
9061
|
if ($globalDBdriver == 'mysql') { |
|
9062
|
|
- $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
|
9062
|
+ $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
9063
|
9063
|
FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' |
|
9064
|
9064
|
GROUP BY year_name, month_name |
|
9065
|
9065
|
ORDER BY date_count DESC"; |
|
9066
|
9066
|
} else { |
|
9067
|
|
- $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
|
9067
|
+ $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
9068
|
9068
|
FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' |
|
9069
|
9069
|
GROUP BY year_name, month_name |
|
9070
|
9070
|
ORDER BY date_count DESC"; |
|
@@ -9076,7 +9076,7 @@ discard block |
|
|
block discarded – undo |
|
9076
|
9076
|
$date_array = array(); |
|
9077
|
9077
|
$temp_array = array(); |
|
9078
|
9078
|
|
|
9079
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9079
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9080
|
9080
|
{ |
|
9081
|
9081
|
$temp_array['month_name'] = $row['month_name']; |
|
9082
|
9082
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -9098,7 +9098,7 @@ discard block |
|
|
block discarded – undo |
|
9098
|
9098
|
public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
|
9099
|
9099
|
{ |
|
9100
|
9100
|
global $globalTimezone, $globalDBdriver; |
|
9101
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9101
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9102
|
9102
|
if ($globalTimezone != '') { |
|
9103
|
9103
|
date_default_timezone_set($globalTimezone); |
|
9104
|
9104
|
$datetime = new DateTime(); |
|
@@ -9106,12 +9106,12 @@ discard block |
|
|
block discarded – undo |
|
9106
|
9106
|
} else $offset = '+00:00'; |
|
9107
|
9107
|
|
|
9108
|
9108
|
if ($globalDBdriver == 'mysql') { |
|
9109
|
|
- $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
|
9109
|
+ $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
9110
|
9110
|
FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' |
|
9111
|
9111
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
9112
|
9112
|
ORDER BY date_count DESC"; |
|
9113
|
9113
|
} else { |
|
9114
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
|
9114
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
9115
|
9115
|
FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' |
|
9116
|
9116
|
GROUP BY spotter_output.airline_icao, year_name, month_name |
|
9117
|
9117
|
ORDER BY date_count DESC"; |
|
@@ -9123,7 +9123,7 @@ discard block |
|
|
block discarded – undo |
|
9123
|
9123
|
$date_array = array(); |
|
9124
|
9124
|
$temp_array = array(); |
|
9125
|
9125
|
|
|
9126
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9126
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9127
|
9127
|
{ |
|
9128
|
9128
|
$temp_array['month_name'] = $row['month_name']; |
|
9129
|
9129
|
$temp_array['year_name'] = $row['year_name']; |
|
@@ -9151,7 +9151,7 @@ discard block |
|
|
block discarded – undo |
|
9151
|
9151
|
$datetime = new DateTime(); |
|
9152
|
9152
|
$offset = $datetime->format('P'); |
|
9153
|
9153
|
} else $offset = '+00:00'; |
|
9154
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9154
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9155
|
9155
|
if ($globalDBdriver == 'mysql') { |
|
9156
|
9156
|
$query = "SELECT MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count |
|
9157
|
9157
|
FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
|
@@ -9172,7 +9172,7 @@ discard block |
|
|
block discarded – undo |
|
9172
|
9172
|
$date_array = array(); |
|
9173
|
9173
|
$temp_array = array(); |
|
9174
|
9174
|
|
|
9175
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9175
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9176
|
9176
|
{ |
|
9177
|
9177
|
$temp_array['year_name'] = $row['year_name']; |
|
9178
|
9178
|
$temp_array['month_name'] = $row['month_name']; |
|
@@ -9192,7 +9192,7 @@ discard block |
|
|
block discarded – undo |
|
9192
|
9192
|
* @return Array the hour list |
|
9193
|
9193
|
* |
|
9194
|
9194
|
*/ |
|
9195
|
|
- public function countAllHours($orderby,$filters = array()) |
|
|
9195
|
+ public function countAllHours($orderby, $filters = array()) |
|
9196
|
9196
|
{ |
|
9197
|
9197
|
global $globalTimezone, $globalDBdriver; |
|
9198
|
9198
|
if ($globalTimezone != '') { |
|
@@ -9240,7 +9240,7 @@ discard block |
|
|
block discarded – undo |
|
9240
|
9240
|
$hour_array = array(); |
|
9241
|
9241
|
$temp_array = array(); |
|
9242
|
9242
|
|
|
9243
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9243
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9244
|
9244
|
{ |
|
9245
|
9245
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9246
|
9246
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9260,7 +9260,7 @@ discard block |
|
|
block discarded – undo |
|
9260
|
9260
|
public function countAllHoursByAirlines($orderby, $filters = array()) |
|
9261
|
9261
|
{ |
|
9262
|
9262
|
global $globalTimezone, $globalDBdriver; |
|
9263
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9263
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9264
|
9264
|
if ($globalTimezone != '') { |
|
9265
|
9265
|
date_default_timezone_set($globalTimezone); |
|
9266
|
9266
|
$datetime = new DateTime(); |
|
@@ -9278,7 +9278,7 @@ discard block |
|
|
block discarded – undo |
|
9278
|
9278
|
} |
|
9279
|
9279
|
|
|
9280
|
9280
|
if ($globalDBdriver == 'mysql') { |
|
9281
|
|
- $query = "SELECT spotter_output.airline_icao, HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9281
|
+ $query = "SELECT spotter_output.airline_icao, HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9282
|
9282
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
|
9283
|
9283
|
GROUP BY spotter_output.airline_icao, hour_name |
|
9284
|
9284
|
".$orderby_sql; |
|
@@ -9291,7 +9291,7 @@ discard block |
|
|
block discarded – undo |
|
9291
|
9291
|
*/ |
|
9292
|
9292
|
$query_data = array(':offset' => $offset); |
|
9293
|
9293
|
} else { |
|
9294
|
|
- $query = "SELECT spotter_output.airline_icao, EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9294
|
+ $query = "SELECT spotter_output.airline_icao, EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9295
|
9295
|
FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
|
9296
|
9296
|
GROUP BY spotter_output.airline_icao, hour_name |
|
9297
|
9297
|
".$orderby_sql; |
|
@@ -9304,7 +9304,7 @@ discard block |
|
|
block discarded – undo |
|
9304
|
9304
|
$hour_array = array(); |
|
9305
|
9305
|
$temp_array = array(); |
|
9306
|
9306
|
|
|
9307
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9307
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9308
|
9308
|
{ |
|
9309
|
9309
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9310
|
9310
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9327,34 +9327,34 @@ discard block |
|
|
block discarded – undo |
|
9327
|
9327
|
public function countAllHoursByAirline($airline_icao, $filters = array()) |
|
9328
|
9328
|
{ |
|
9329
|
9329
|
global $globalTimezone, $globalDBdriver; |
|
9330
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
9330
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
9331
|
9331
|
if ($globalTimezone != '') { |
|
9332
|
9332
|
date_default_timezone_set($globalTimezone); |
|
9333
|
9333
|
$datetime = new DateTime(); |
|
9334
|
9334
|
$offset = $datetime->format('P'); |
|
9335
|
9335
|
} else $offset = '+00:00'; |
|
9336
|
9336
|
|
|
9337
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
|
9337
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
9338
|
9338
|
|
|
9339
|
9339
|
if ($globalDBdriver == 'mysql') { |
|
9340
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9340
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9341
|
9341
|
FROM spotter_output".$filter_query." spotter_output.airline_icao = :airline_icao |
|
9342
|
9342
|
GROUP BY hour_name |
|
9343
|
9343
|
ORDER BY hour_name ASC"; |
|
9344
|
9344
|
} else { |
|
9345
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9345
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9346
|
9346
|
FROM spotter_output".$filter_query." spotter_output.airline_icao = :airline_icao |
|
9347
|
9347
|
GROUP BY hour_name |
|
9348
|
9348
|
ORDER BY hour_name ASC"; |
|
9349
|
9349
|
} |
|
9350
|
9350
|
|
|
9351
|
9351
|
$sth = $this->db->prepare($query); |
|
9352
|
|
- $sth->execute(array(':airline_icao' => $airline_icao,':offset' => $offset)); |
|
|
9352
|
+ $sth->execute(array(':airline_icao' => $airline_icao, ':offset' => $offset)); |
|
9353
|
9353
|
|
|
9354
|
9354
|
$hour_array = array(); |
|
9355
|
9355
|
$temp_array = array(); |
|
9356
|
9356
|
|
|
9357
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9357
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9358
|
9358
|
{ |
|
9359
|
9359
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9360
|
9360
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9377,8 +9377,8 @@ discard block |
|
|
block discarded – undo |
|
9377
|
9377
|
public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
|
9378
|
9378
|
{ |
|
9379
|
9379
|
global $globalTimezone, $globalDBdriver; |
|
9380
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9381
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
|
9380
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9381
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
9382
|
9382
|
if ($globalTimezone != '') { |
|
9383
|
9383
|
date_default_timezone_set($globalTimezone); |
|
9384
|
9384
|
$datetime = new DateTime(); |
|
@@ -9386,24 +9386,24 @@ discard block |
|
|
block discarded – undo |
|
9386
|
9386
|
} else $offset = '+00:00'; |
|
9387
|
9387
|
|
|
9388
|
9388
|
if ($globalDBdriver == 'mysql') { |
|
9389
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9389
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9390
|
9390
|
FROM spotter_output".$filter_query." spotter_output.aircraft_icao = :aircraft_icao |
|
9391
|
9391
|
GROUP BY hour_name |
|
9392
|
9392
|
ORDER BY hour_name ASC"; |
|
9393
|
9393
|
} else { |
|
9394
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9394
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9395
|
9395
|
FROM spotter_output".$filter_query." spotter_output.aircraft_icao = :aircraft_icao |
|
9396
|
9396
|
GROUP BY hour_name |
|
9397
|
9397
|
ORDER BY hour_name ASC"; |
|
9398
|
9398
|
} |
|
9399
|
9399
|
|
|
9400
|
9400
|
$sth = $this->db->prepare($query); |
|
9401
|
|
- $sth->execute(array(':aircraft_icao' => $aircraft_icao,':offset' => $offset)); |
|
|
9401
|
+ $sth->execute(array(':aircraft_icao' => $aircraft_icao, ':offset' => $offset)); |
|
9402
|
9402
|
|
|
9403
|
9403
|
$hour_array = array(); |
|
9404
|
9404
|
$temp_array = array(); |
|
9405
|
9405
|
|
|
9406
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9406
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9407
|
9407
|
{ |
|
9408
|
9408
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9409
|
9409
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9424,8 +9424,8 @@ discard block |
|
|
block discarded – undo |
|
9424
|
9424
|
public function countAllHoursByRegistration($registration, $filters = array()) |
|
9425
|
9425
|
{ |
|
9426
|
9426
|
global $globalTimezone, $globalDBdriver; |
|
9427
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9428
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
9427
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9428
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
9429
|
9429
|
if ($globalTimezone != '') { |
|
9430
|
9430
|
date_default_timezone_set($globalTimezone); |
|
9431
|
9431
|
$datetime = new DateTime(); |
|
@@ -9433,24 +9433,24 @@ discard block |
|
|
block discarded – undo |
|
9433
|
9433
|
} else $offset = '+00:00'; |
|
9434
|
9434
|
|
|
9435
|
9435
|
if ($globalDBdriver == 'mysql') { |
|
9436
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9436
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9437
|
9437
|
FROM spotter_output".$filter_query." spotter_output.registration = :registration |
|
9438
|
9438
|
GROUP BY hour_name |
|
9439
|
9439
|
ORDER BY hour_name ASC"; |
|
9440
|
9440
|
} else { |
|
9441
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9441
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9442
|
9442
|
FROM spotter_output".$filter_query." spotter_output.registration = :registration |
|
9443
|
9443
|
GROUP BY hour_name |
|
9444
|
9444
|
ORDER BY hour_name ASC"; |
|
9445
|
9445
|
} |
|
9446
|
9446
|
|
|
9447
|
9447
|
$sth = $this->db->prepare($query); |
|
9448
|
|
- $sth->execute(array(':registration' => $registration,':offset' => $offset)); |
|
|
9448
|
+ $sth->execute(array(':registration' => $registration, ':offset' => $offset)); |
|
9449
|
9449
|
|
|
9450
|
9450
|
$hour_array = array(); |
|
9451
|
9451
|
$temp_array = array(); |
|
9452
|
9452
|
|
|
9453
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9453
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9454
|
9454
|
{ |
|
9455
|
9455
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9456
|
9456
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9471,8 +9471,8 @@ discard block |
|
|
block discarded – undo |
|
9471
|
9471
|
public function countAllHoursByAirport($airport_icao, $filters = array()) |
|
9472
|
9472
|
{ |
|
9473
|
9473
|
global $globalTimezone, $globalDBdriver; |
|
9474
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9475
|
|
- $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
|
9474
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9475
|
+ $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
9476
|
9476
|
if ($globalTimezone != '') { |
|
9477
|
9477
|
date_default_timezone_set($globalTimezone); |
|
9478
|
9478
|
$datetime = new DateTime(); |
|
@@ -9480,24 +9480,24 @@ discard block |
|
|
block discarded – undo |
|
9480
|
9480
|
} else $offset = '+00:00'; |
|
9481
|
9481
|
|
|
9482
|
9482
|
if ($globalDBdriver == 'mysql') { |
|
9483
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9483
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9484
|
9484
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
9485
|
9485
|
GROUP BY hour_name |
|
9486
|
9486
|
ORDER BY hour_name ASC"; |
|
9487
|
9487
|
} else { |
|
9488
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9488
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9489
|
9489
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
|
9490
|
9490
|
GROUP BY hour_name |
|
9491
|
9491
|
ORDER BY hour_name ASC"; |
|
9492
|
9492
|
} |
|
9493
|
9493
|
|
|
9494
|
9494
|
$sth = $this->db->prepare($query); |
|
9495
|
|
- $sth->execute(array(':airport_icao' => $airport_icao,':offset' => $offset)); |
|
|
9495
|
+ $sth->execute(array(':airport_icao' => $airport_icao, ':offset' => $offset)); |
|
9496
|
9496
|
|
|
9497
|
9497
|
$hour_array = array(); |
|
9498
|
9498
|
$temp_array = array(); |
|
9499
|
9499
|
|
|
9500
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9500
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9501
|
9501
|
{ |
|
9502
|
9502
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9503
|
9503
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9516,11 +9516,11 @@ discard block |
|
|
block discarded – undo |
|
9516
|
9516
|
* @return Array the hour list |
|
9517
|
9517
|
* |
|
9518
|
9518
|
*/ |
|
9519
|
|
- public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
|
|
9519
|
+ public function countAllHoursByManufacturer($aircraft_manufacturer, $filters = array()) |
|
9520
|
9520
|
{ |
|
9521
|
9521
|
global $globalTimezone, $globalDBdriver; |
|
9522
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9523
|
|
- $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
|
9522
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9523
|
+ $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
9524
|
9524
|
if ($globalTimezone != '') { |
|
9525
|
9525
|
date_default_timezone_set($globalTimezone); |
|
9526
|
9526
|
$datetime = new DateTime(); |
|
@@ -9528,24 +9528,24 @@ discard block |
|
|
block discarded – undo |
|
9528
|
9528
|
} else $offset = '+00:00'; |
|
9529
|
9529
|
|
|
9530
|
9530
|
if ($globalDBdriver == 'mysql') { |
|
9531
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9531
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9532
|
9532
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
9533
|
9533
|
GROUP BY hour_name |
|
9534
|
9534
|
ORDER BY hour_name ASC"; |
|
9535
|
9535
|
} else { |
|
9536
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9536
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9537
|
9537
|
FROM spotter_output".$filter_query." spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
|
9538
|
9538
|
GROUP BY hour_name |
|
9539
|
9539
|
ORDER BY hour_name ASC"; |
|
9540
|
9540
|
} |
|
9541
|
9541
|
|
|
9542
|
9542
|
$sth = $this->db->prepare($query); |
|
9543
|
|
- $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer,':offset' => $offset)); |
|
|
9543
|
+ $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer, ':offset' => $offset)); |
|
9544
|
9544
|
|
|
9545
|
9545
|
$hour_array = array(); |
|
9546
|
9546
|
$temp_array = array(); |
|
9547
|
9547
|
|
|
9548
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9548
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9549
|
9549
|
{ |
|
9550
|
9550
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9551
|
9551
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9567,8 +9567,8 @@ discard block |
|
|
block discarded – undo |
|
9567
|
9567
|
public function countAllHoursByDate($date, $filters = array()) |
|
9568
|
9568
|
{ |
|
9569
|
9569
|
global $globalTimezone, $globalDBdriver; |
|
9570
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9571
|
|
- $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
|
9570
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9571
|
+ $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
9572
|
9572
|
if ($globalTimezone != '') { |
|
9573
|
9573
|
date_default_timezone_set($globalTimezone); |
|
9574
|
9574
|
$datetime = new DateTime($date); |
|
@@ -9576,12 +9576,12 @@ discard block |
|
|
block discarded – undo |
|
9576
|
9576
|
} else $offset = '+00:00'; |
|
9577
|
9577
|
|
|
9578
|
9578
|
if ($globalDBdriver == 'mysql') { |
|
9579
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9579
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9580
|
9580
|
FROM spotter_output".$filter_query." DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
|
9581
|
9581
|
GROUP BY hour_name |
|
9582
|
9582
|
ORDER BY hour_name ASC"; |
|
9583
|
9583
|
} else { |
|
9584
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9584
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9585
|
9585
|
FROM spotter_output".$filter_query." to_char(spotter_output.date AT TIME ZONE INTERVAL :offset, 'YYYY-mm-dd') = :date |
|
9586
|
9586
|
GROUP BY hour_name |
|
9587
|
9587
|
ORDER BY hour_name ASC"; |
|
@@ -9593,7 +9593,7 @@ discard block |
|
|
block discarded – undo |
|
9593
|
9593
|
$hour_array = array(); |
|
9594
|
9594
|
$temp_array = array(); |
|
9595
|
9595
|
|
|
9596
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9596
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9597
|
9597
|
{ |
|
9598
|
9598
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9599
|
9599
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9615,8 +9615,8 @@ discard block |
|
|
block discarded – undo |
|
9615
|
9615
|
public function countAllHoursByIdent($ident, $filters = array()) |
|
9616
|
9616
|
{ |
|
9617
|
9617
|
global $globalTimezone, $globalDBdriver; |
|
9618
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9619
|
|
- $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
|
9618
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9619
|
+ $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
9620
|
9620
|
if ($globalTimezone != '') { |
|
9621
|
9621
|
date_default_timezone_set($globalTimezone); |
|
9622
|
9622
|
$datetime = new DateTime(); |
|
@@ -9624,12 +9624,12 @@ discard block |
|
|
block discarded – undo |
|
9624
|
9624
|
} else $offset = '+00:00'; |
|
9625
|
9625
|
|
|
9626
|
9626
|
if ($globalDBdriver == 'mysql') { |
|
9627
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9627
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9628
|
9628
|
FROM spotter_output".$filter_query." spotter_output.ident = :ident |
|
9629
|
9629
|
GROUP BY hour_name |
|
9630
|
9630
|
ORDER BY hour_name ASC"; |
|
9631
|
9631
|
} else { |
|
9632
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9632
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9633
|
9633
|
FROM spotter_output".$filter_query." spotter_output.ident = :ident |
|
9634
|
9634
|
GROUP BY hour_name |
|
9635
|
9635
|
ORDER BY hour_name ASC"; |
|
@@ -9637,12 +9637,12 @@ discard block |
|
|
block discarded – undo |
|
9637
|
9637
|
|
|
9638
|
9638
|
|
|
9639
|
9639
|
$sth = $this->db->prepare($query); |
|
9640
|
|
- $sth->execute(array(':ident' => $ident,':offset' => $offset)); |
|
|
9640
|
+ $sth->execute(array(':ident' => $ident, ':offset' => $offset)); |
|
9641
|
9641
|
|
|
9642
|
9642
|
$hour_array = array(); |
|
9643
|
9643
|
$temp_array = array(); |
|
9644
|
9644
|
|
|
9645
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9645
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9646
|
9646
|
{ |
|
9647
|
9647
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9648
|
9648
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9661,12 +9661,12 @@ discard block |
|
|
block discarded – undo |
|
9661
|
9661
|
* @return Array the hour list |
|
9662
|
9662
|
* |
|
9663
|
9663
|
*/ |
|
9664
|
|
- public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
|
|
9664
|
+ public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters = array()) |
|
9665
|
9665
|
{ |
|
9666
|
9666
|
global $globalTimezone, $globalDBdriver; |
|
9667
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9668
|
|
- $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
9669
|
|
- $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
|
9667
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9668
|
+ $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
|
9669
|
+ $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
9670
|
9670
|
if ($globalTimezone != '') { |
|
9671
|
9671
|
date_default_timezone_set($globalTimezone); |
|
9672
|
9672
|
$datetime = new DateTime(); |
|
@@ -9674,24 +9674,24 @@ discard block |
|
|
block discarded – undo |
|
9674
|
9674
|
} else $offset = '+00:00'; |
|
9675
|
9675
|
|
|
9676
|
9676
|
if ($globalDBdriver == 'mysql') { |
|
9677
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9677
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9678
|
9678
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
9679
|
9679
|
GROUP BY hour_name |
|
9680
|
9680
|
ORDER BY hour_name ASC"; |
|
9681
|
9681
|
} else { |
|
9682
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9682
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9683
|
9683
|
FROM spotter_output".$filter_query." (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
|
9684
|
9684
|
GROUP BY hour_name |
|
9685
|
9685
|
ORDER BY hour_name ASC"; |
|
9686
|
9686
|
} |
|
9687
|
9687
|
|
|
9688
|
9688
|
$sth = $this->db->prepare($query); |
|
9689
|
|
- $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':offset' => $offset)); |
|
|
9689
|
+ $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao, ':offset' => $offset)); |
|
9690
|
9690
|
|
|
9691
|
9691
|
$hour_array = array(); |
|
9692
|
9692
|
$temp_array = array(); |
|
9693
|
9693
|
|
|
9694
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9694
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9695
|
9695
|
{ |
|
9696
|
9696
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9697
|
9697
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9712,8 +9712,8 @@ discard block |
|
|
block discarded – undo |
|
9712
|
9712
|
public function countAllHoursByCountry($country, $filters = array()) |
|
9713
|
9713
|
{ |
|
9714
|
9714
|
global $globalTimezone, $globalDBdriver; |
|
9715
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9716
|
|
- $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
|
9715
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9716
|
+ $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
9717
|
9717
|
if ($globalTimezone != '') { |
|
9718
|
9718
|
date_default_timezone_set($globalTimezone); |
|
9719
|
9719
|
$datetime = new DateTime(); |
|
@@ -9721,24 +9721,24 @@ discard block |
|
|
block discarded – undo |
|
9721
|
9721
|
} else $offset = '+00:00'; |
|
9722
|
9722
|
|
|
9723
|
9723
|
if ($globalDBdriver == 'mysql') { |
|
9724
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
9724
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
9725
|
9725
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
9726
|
9726
|
GROUP BY hour_name |
|
9727
|
9727
|
ORDER BY hour_name ASC"; |
|
9728
|
9728
|
} else { |
|
9729
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
9729
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
9730
|
9730
|
FROM spotter_output".$filter_query." ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
|
9731
|
9731
|
GROUP BY hour_name |
|
9732
|
9732
|
ORDER BY hour_name ASC"; |
|
9733
|
9733
|
} |
|
9734
|
9734
|
|
|
9735
|
9735
|
$sth = $this->db->prepare($query); |
|
9736
|
|
- $sth->execute(array(':country' => $country,':offset' => $offset)); |
|
|
9736
|
+ $sth->execute(array(':country' => $country, ':offset' => $offset)); |
|
9737
|
9737
|
|
|
9738
|
9738
|
$hour_array = array(); |
|
9739
|
9739
|
$temp_array = array(); |
|
9740
|
9740
|
|
|
9741
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
9741
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
9742
|
9742
|
{ |
|
9743
|
9743
|
$temp_array['hour_name'] = $row['hour_name']; |
|
9744
|
9744
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -9758,29 +9758,29 @@ discard block |
|
|
block discarded – undo |
|
9758
|
9758
|
* @return Integer the number of aircrafts |
|
9759
|
9759
|
* |
|
9760
|
9760
|
*/ |
|
9761
|
|
- public function countOverallAircrafts($filters = array(),$year = '',$month = '') |
|
|
9761
|
+ public function countOverallAircrafts($filters = array(), $year = '', $month = '') |
|
9762
|
9762
|
{ |
|
9763
|
9763
|
global $globalDBdriver; |
|
9764
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9765
|
|
- $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
|
9764
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9765
|
+ $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
9766
|
9766
|
FROM spotter_output".$filter_query." spotter_output.ident <> ''"; |
|
9767
|
9767
|
$query_values = array(); |
|
9768
|
9768
|
if ($year != '') { |
|
9769
|
9769
|
if ($globalDBdriver == 'mysql') { |
|
9770
|
9770
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9771
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9771
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9772
|
9772
|
} else { |
|
9773
|
9773
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9774
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9774
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9775
|
9775
|
} |
|
9776
|
9776
|
} |
|
9777
|
9777
|
if ($month != '') { |
|
9778
|
9778
|
if ($globalDBdriver == 'mysql') { |
|
9779
|
9779
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9780
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9780
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9781
|
9781
|
} else { |
|
9782
|
9782
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9783
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9783
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9784
|
9784
|
} |
|
9785
|
9785
|
} |
|
9786
|
9786
|
|
|
@@ -9795,29 +9795,29 @@ discard block |
|
|
block discarded – undo |
|
9795
|
9795
|
* @return Integer the number of aircrafts |
|
9796
|
9796
|
* |
|
9797
|
9797
|
*/ |
|
9798
|
|
- public function countOverallArrival($filters = array(),$year = '',$month = '') |
|
|
9798
|
+ public function countOverallArrival($filters = array(), $year = '', $month = '') |
|
9799
|
9799
|
{ |
|
9800
|
9800
|
global $globalDBdriver; |
|
9801
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9802
|
|
- $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
|
9801
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9802
|
+ $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
9803
|
9803
|
FROM spotter_output".$filter_query." spotter_output.arrival_airport_icao <> ''"; |
|
9804
|
9804
|
$query_values = array(); |
|
9805
|
9805
|
if ($year != '') { |
|
9806
|
9806
|
if ($globalDBdriver == 'mysql') { |
|
9807
|
9807
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9808
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9808
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9809
|
9809
|
} else { |
|
9810
|
9810
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9811
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9811
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9812
|
9812
|
} |
|
9813
|
9813
|
} |
|
9814
|
9814
|
if ($month != '') { |
|
9815
|
9815
|
if ($globalDBdriver == 'mysql') { |
|
9816
|
9816
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9817
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9817
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9818
|
9818
|
} else { |
|
9819
|
9819
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9820
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9820
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9821
|
9821
|
} |
|
9822
|
9822
|
} |
|
9823
|
9823
|
|
|
@@ -9832,29 +9832,29 @@ discard block |
|
|
block discarded – undo |
|
9832
|
9832
|
* @return Integer the number of pilots |
|
9833
|
9833
|
* |
|
9834
|
9834
|
*/ |
|
9835
|
|
- public function countOverallPilots($filters = array(),$year = '',$month = '') |
|
|
9835
|
+ public function countOverallPilots($filters = array(), $year = '', $month = '') |
|
9836
|
9836
|
{ |
|
9837
|
9837
|
global $globalDBdriver; |
|
9838
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9839
|
|
- $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
|
9838
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9839
|
+ $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
9840
|
9840
|
FROM spotter_output".$filter_query." spotter_output.pilot_id <> ''"; |
|
9841
|
9841
|
$query_values = array(); |
|
9842
|
9842
|
if ($year != '') { |
|
9843
|
9843
|
if ($globalDBdriver == 'mysql') { |
|
9844
|
9844
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9845
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9845
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9846
|
9846
|
} else { |
|
9847
|
9847
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9848
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9848
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9849
|
9849
|
} |
|
9850
|
9850
|
} |
|
9851
|
9851
|
if ($month != '') { |
|
9852
|
9852
|
if ($globalDBdriver == 'mysql') { |
|
9853
|
9853
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9854
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9854
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9855
|
9855
|
} else { |
|
9856
|
9856
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9857
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9857
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9858
|
9858
|
} |
|
9859
|
9859
|
} |
|
9860
|
9860
|
$sth = $this->db->prepare($query); |
|
@@ -9868,29 +9868,29 @@ discard block |
|
|
block discarded – undo |
|
9868
|
9868
|
* @return Integer the number of owners |
|
9869
|
9869
|
* |
|
9870
|
9870
|
*/ |
|
9871
|
|
- public function countOverallOwners($filters = array(),$year = '',$month = '') |
|
|
9871
|
+ public function countOverallOwners($filters = array(), $year = '', $month = '') |
|
9872
|
9872
|
{ |
|
9873
|
9873
|
global $globalDBdriver; |
|
9874
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9875
|
|
- $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
|
9874
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9875
|
+ $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
9876
|
9876
|
FROM spotter_output".$filter_query." spotter_output.owner_name <> ''"; |
|
9877
|
9877
|
$query_values = array(); |
|
9878
|
9878
|
if ($year != '') { |
|
9879
|
9879
|
if ($globalDBdriver == 'mysql') { |
|
9880
|
9880
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9881
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9881
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9882
|
9882
|
} else { |
|
9883
|
9883
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9884
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9884
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9885
|
9885
|
} |
|
9886
|
9886
|
} |
|
9887
|
9887
|
if ($month != '') { |
|
9888
|
9888
|
if ($globalDBdriver == 'mysql') { |
|
9889
|
9889
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9890
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9890
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9891
|
9891
|
} else { |
|
9892
|
9892
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9893
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9893
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9894
|
9894
|
} |
|
9895
|
9895
|
} |
|
9896
|
9896
|
$sth = $this->db->prepare($query); |
|
@@ -9905,32 +9905,32 @@ discard block |
|
|
block discarded – undo |
|
9905
|
9905
|
* @return Integer the number of flights |
|
9906
|
9906
|
* |
|
9907
|
9907
|
*/ |
|
9908
|
|
- public function countOverallFlights($filters = array(),$year = '',$month = '') |
|
|
9908
|
+ public function countOverallFlights($filters = array(), $year = '', $month = '') |
|
9909
|
9909
|
{ |
|
9910
|
9910
|
global $globalDBdriver; |
|
9911
|
|
- $queryi = "SELECT COUNT(spotter_output.spotter_id) AS flight_count FROM spotter_output"; |
|
|
9911
|
+ $queryi = "SELECT COUNT(spotter_output.spotter_id) AS flight_count FROM spotter_output"; |
|
9912
|
9912
|
$query_values = array(); |
|
9913
|
9913
|
$query = ''; |
|
9914
|
9914
|
if ($year != '') { |
|
9915
|
9915
|
if ($globalDBdriver == 'mysql') { |
|
9916
|
9916
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9917
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9917
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9918
|
9918
|
} else { |
|
9919
|
9919
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9920
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9920
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9921
|
9921
|
} |
|
9922
|
9922
|
} |
|
9923
|
9923
|
if ($month != '') { |
|
9924
|
9924
|
if ($globalDBdriver == 'mysql') { |
|
9925
|
9925
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9926
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9926
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9927
|
9927
|
} else { |
|
9928
|
9928
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9929
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9929
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9930
|
9930
|
} |
|
9931
|
9931
|
} |
|
9932
|
9932
|
if (empty($query_values)) $queryi .= $this->getFilter($filters); |
|
9933
|
|
- else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
|
9933
|
+ else $queryi .= $this->getFilter($filters, true, true).substr($query, 4); |
|
9934
|
9934
|
|
|
9935
|
9935
|
//echo $query; |
|
9936
|
9936
|
$sth = $this->db->prepare($queryi); |
|
@@ -9944,29 +9944,29 @@ discard block |
|
|
block discarded – undo |
|
9944
|
9944
|
* @return Integer the number of flights |
|
9945
|
9945
|
* |
|
9946
|
9946
|
*/ |
|
9947
|
|
- public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '') |
|
|
9947
|
+ public function countOverallMilitaryFlights($filters = array(), $year = '', $month = '') |
|
9948
|
9948
|
{ |
|
9949
|
9949
|
global $globalDBdriver; |
|
9950
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
9951
|
|
- $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
|
|
9950
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
|
9951
|
+ $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
|
9952
|
9952
|
FROM airlines,spotter_output".$filter_query." spotter_output.airline_icao = airlines.icao AND airlines.type = 'military'"; |
|
9953
|
9953
|
$query_values = array(); |
|
9954
|
9954
|
if ($year != '') { |
|
9955
|
9955
|
if ($globalDBdriver == 'mysql') { |
|
9956
|
9956
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9957
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9957
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9958
|
9958
|
} else { |
|
9959
|
9959
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
9960
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9960
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9961
|
9961
|
} |
|
9962
|
9962
|
} |
|
9963
|
9963
|
if ($month != '') { |
|
9964
|
9964
|
if ($globalDBdriver == 'mysql') { |
|
9965
|
9965
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
9966
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9966
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9967
|
9967
|
} else { |
|
9968
|
9968
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
9969
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
9969
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
9970
|
9970
|
} |
|
9971
|
9971
|
} |
|
9972
|
9972
|
|
|
@@ -9983,10 +9983,10 @@ discard block |
|
|
block discarded – undo |
|
9983
|
9983
|
* @return Integer the number of airlines |
|
9984
|
9984
|
* |
|
9985
|
9985
|
*/ |
|
9986
|
|
- public function countOverallAirlines($filters = array(),$year = '',$month = '') |
|
|
9986
|
+ public function countOverallAirlines($filters = array(), $year = '', $month = '') |
|
9987
|
9987
|
{ |
|
9988
|
9988
|
global $globalDBdriver; |
|
9989
|
|
- $queryi = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
|
|
9989
|
+ $queryi = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
|
9990
|
9990
|
FROM spotter_output"; |
|
9991
|
9991
|
|
|
9992
|
9992
|
$query_values = array(); |
|
@@ -9994,23 +9994,23 @@ discard block |
|
|
block discarded – undo |
|
9994
|
9994
|
if ($year != '') { |
|
9995
|
9995
|
if ($globalDBdriver == 'mysql') { |
|
9996
|
9996
|
$query .= " AND YEAR(spotter_output.date) = :year"; |
|
9997
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
9997
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
9998
|
9998
|
} else { |
|
9999
|
9999
|
$query .= " AND EXTRACT(YEAR FROM spotter_output.date) = :year"; |
|
10000
|
|
- $query_values = array_merge($query_values,array(':year' => $year)); |
|
|
10000
|
+ $query_values = array_merge($query_values, array(':year' => $year)); |
|
10001
|
10001
|
} |
|
10002
|
10002
|
} |
|
10003
|
10003
|
if ($month != '') { |
|
10004
|
10004
|
if ($globalDBdriver == 'mysql') { |
|
10005
|
10005
|
$query .= " AND MONTH(spotter_output.date) = :month"; |
|
10006
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
10006
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
10007
|
10007
|
} else { |
|
10008
|
10008
|
$query .= " AND EXTRACT(MONTH FROM spotter_output.date) = :month"; |
|
10009
|
|
- $query_values = array_merge($query_values,array(':month' => $month)); |
|
|
10009
|
+ $query_values = array_merge($query_values, array(':month' => $month)); |
|
10010
|
10010
|
} |
|
10011
|
10011
|
} |
|
10012
|
10012
|
if ($query == '') $queryi .= $this->getFilter($filters); |
|
10013
|
|
- else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
|
10013
|
+ else $queryi .= $this->getFilter($filters, true, true).substr($query, 4); |
|
10014
|
10014
|
|
|
10015
|
10015
|
|
|
10016
|
10016
|
$sth = $this->db->prepare($queryi); |
|
@@ -10028,7 +10028,7 @@ discard block |
|
|
block discarded – undo |
|
10028
|
10028
|
public function countAllHoursFromToday($filters = array()) |
|
10029
|
10029
|
{ |
|
10030
|
10030
|
global $globalTimezone, $globalDBdriver; |
|
10031
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
10031
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
10032
|
10032
|
if ($globalTimezone != '') { |
|
10033
|
10033
|
date_default_timezone_set($globalTimezone); |
|
10034
|
10034
|
$datetime = new DateTime(); |
|
@@ -10036,12 +10036,12 @@ discard block |
|
|
block discarded – undo |
|
10036
|
10036
|
} else $offset = '+00:00'; |
|
10037
|
10037
|
|
|
10038
|
10038
|
if ($globalDBdriver == 'mysql') { |
|
10039
|
|
- $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
|
10039
|
+ $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
10040
|
10040
|
FROM spotter_output".$filter_query." DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = CURDATE() |
|
10041
|
10041
|
GROUP BY hour_name |
|
10042
|
10042
|
ORDER BY hour_name ASC"; |
|
10043
|
10043
|
} else { |
|
10044
|
|
- $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
|
10044
|
+ $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
10045
|
10045
|
FROM spotter_output".$filter_query." to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = CAST(NOW() AS date) |
|
10046
|
10046
|
GROUP BY hour_name |
|
10047
|
10047
|
ORDER BY hour_name ASC"; |
|
@@ -10053,7 +10053,7 @@ discard block |
|
|
block discarded – undo |
|
10053
|
10053
|
$hour_array = array(); |
|
10054
|
10054
|
$temp_array = array(); |
|
10055
|
10055
|
|
|
10056
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10056
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10057
|
10057
|
{ |
|
10058
|
10058
|
$temp_array['hour_name'] = $row['hour_name']; |
|
10059
|
10059
|
$temp_array['hour_count'] = $row['hour_count']; |
|
@@ -10072,14 +10072,14 @@ discard block |
|
|
block discarded – undo |
|
10072
|
10072
|
public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
|
10073
|
10073
|
{ |
|
10074
|
10074
|
global $global_query, $globalDBdriver, $globalTimezone; |
|
10075
|
|
- $filter_query = $this->getFilter($filters,true,true); |
|
|
10075
|
+ $filter_query = $this->getFilter($filters, true, true); |
|
10076
|
10076
|
date_default_timezone_set('UTC'); |
|
10077
|
10077
|
$limit_query = ''; |
|
10078
|
10078
|
if ($limit != "") |
|
10079
|
10079
|
{ |
|
10080
|
10080
|
$limit_array = explode(",", $limit); |
|
10081
|
|
- $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
10082
|
|
- $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
|
10081
|
+ $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
|
10082
|
+ $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
10083
|
10083
|
if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
10084
|
10084
|
{ |
|
10085
|
10085
|
//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
|
@@ -10132,7 +10132,7 @@ discard block |
|
|
block discarded – undo |
|
10132
|
10132
|
GROUP BY spotter_output.ident,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time, to_char(spotter_output.date,'HH') |
|
10133
|
10133
|
HAVING count(spotter_output.ident) > 5$orderby_query"; |
|
10134
|
10134
|
//echo $query; |
|
10135
|
|
- $spotter_array = $this->getDataFromDB($query.$limit_query,array(':timezone' => $globalTimezone)); |
|
|
10135
|
+ $spotter_array = $this->getDataFromDB($query.$limit_query, array(':timezone' => $globalTimezone)); |
|
10136
|
10136
|
/* |
|
10137
|
10137
|
$sth = $this->db->prepare($query); |
|
10138
|
10138
|
$sth->execute(array(':timezone' => $globalTimezone)); |
|
@@ -10151,9 +10151,9 @@ discard block |
|
|
block discarded – undo |
|
10151
|
10151
|
*/ |
|
10152
|
10152
|
public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
|
10153
|
10153
|
{ |
|
10154
|
|
- $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
|
10154
|
+ $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
10155
|
10155
|
|
|
10156
|
|
- $query = "SELECT spotter_output.spotter_id |
|
|
10156
|
+ $query = "SELECT spotter_output.spotter_id |
|
10157
|
10157
|
FROM spotter_output |
|
10158
|
10158
|
WHERE spotter_output.flightaware_id = '".$flightaware_id."'"; |
|
10159
|
10159
|
|
|
@@ -10161,7 +10161,7 @@ discard block |
|
|
block discarded – undo |
|
10161
|
10161
|
$sth = $this->db->prepare($query); |
|
10162
|
10162
|
$sth->execute(); |
|
10163
|
10163
|
|
|
10164
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10164
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10165
|
10165
|
{ |
|
10166
|
10166
|
return $row['spotter_id']; |
|
10167
|
10167
|
} |
|
@@ -10186,23 +10186,23 @@ discard block |
|
|
block discarded – undo |
|
10186
|
10186
|
} |
|
10187
|
10187
|
|
|
10188
|
10188
|
$current_date = date("Y-m-d H:i:s"); |
|
10189
|
|
- $date = date("Y-m-d H:i:s",strtotime($dateString." UTC")); |
|
|
10189
|
+ $date = date("Y-m-d H:i:s", strtotime($dateString." UTC")); |
|
10190
|
10190
|
|
|
10191
|
10191
|
$diff = abs(strtotime($current_date) - strtotime($date)); |
|
10192
|
10192
|
|
|
10193
|
|
- $time_array['years'] = floor($diff / (365*60*60*24)); |
|
|
10193
|
+ $time_array['years'] = floor($diff/(365*60*60*24)); |
|
10194
|
10194
|
$years = $time_array['years']; |
|
10195
|
10195
|
|
|
10196
|
|
- $time_array['months'] = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); |
|
|
10196
|
+ $time_array['months'] = floor(($diff - $years*365*60*60*24)/(30*60*60*24)); |
|
10197
|
10197
|
$months = $time_array['months']; |
|
10198
|
10198
|
|
|
10199
|
|
- $time_array['days'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); |
|
|
10199
|
+ $time_array['days'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24)/(60*60*24)); |
|
10200
|
10200
|
$days = $time_array['days']; |
|
10201
|
|
- $time_array['hours'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); |
|
|
10201
|
+ $time_array['hours'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/(60*60)); |
|
10202
|
10202
|
$hours = $time_array['hours']; |
|
10203
|
|
- $time_array['minutes'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60); |
|
|
10203
|
+ $time_array['minutes'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/60); |
|
10204
|
10204
|
$minutes = $time_array['minutes']; |
|
10205
|
|
- $time_array['seconds'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
|
10205
|
+ $time_array['seconds'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
10206
|
10206
|
|
|
10207
|
10207
|
return $time_array; |
|
10208
|
10208
|
} |
|
@@ -10228,63 +10228,63 @@ discard block |
|
|
block discarded – undo |
|
10228
|
10228
|
$temp_array['direction_degree'] = $direction; |
|
10229
|
10229
|
$temp_array['direction_shortname'] = "N"; |
|
10230
|
10230
|
$temp_array['direction_fullname'] = "North"; |
|
10231
|
|
- } elseif ($direction >= 22.5 && $direction < 45){ |
|
|
10231
|
+ } elseif ($direction >= 22.5 && $direction < 45) { |
|
10232
|
10232
|
$temp_array['direction_degree'] = $direction; |
|
10233
|
10233
|
$temp_array['direction_shortname'] = "NNE"; |
|
10234
|
10234
|
$temp_array['direction_fullname'] = "North-Northeast"; |
|
10235
|
|
- } elseif ($direction >= 45 && $direction < 67.5){ |
|
|
10235
|
+ } elseif ($direction >= 45 && $direction < 67.5) { |
|
10236
|
10236
|
$temp_array['direction_degree'] = $direction; |
|
10237
|
10237
|
$temp_array['direction_shortname'] = "NE"; |
|
10238
|
10238
|
$temp_array['direction_fullname'] = "Northeast"; |
|
10239
|
|
- } elseif ($direction >= 67.5 && $direction < 90){ |
|
|
10239
|
+ } elseif ($direction >= 67.5 && $direction < 90) { |
|
10240
|
10240
|
$temp_array['direction_degree'] = $direction; |
|
10241
|
10241
|
$temp_array['direction_shortname'] = "ENE"; |
|
10242
|
10242
|
$temp_array['direction_fullname'] = "East-Northeast"; |
|
10243
|
|
- } elseif ($direction >= 90 && $direction < 112.5){ |
|
|
10243
|
+ } elseif ($direction >= 90 && $direction < 112.5) { |
|
10244
|
10244
|
$temp_array['direction_degree'] = $direction; |
|
10245
|
10245
|
$temp_array['direction_shortname'] = "E"; |
|
10246
|
10246
|
$temp_array['direction_fullname'] = "East"; |
|
10247
|
|
- } elseif ($direction >= 112.5 && $direction < 135){ |
|
|
10247
|
+ } elseif ($direction >= 112.5 && $direction < 135) { |
|
10248
|
10248
|
$temp_array['direction_degree'] = $direction; |
|
10249
|
10249
|
$temp_array['direction_shortname'] = "ESE"; |
|
10250
|
10250
|
$temp_array['direction_fullname'] = "East-Southeast"; |
|
10251
|
|
- } elseif ($direction >= 135 && $direction < 157.5){ |
|
|
10251
|
+ } elseif ($direction >= 135 && $direction < 157.5) { |
|
10252
|
10252
|
$temp_array['direction_degree'] = $direction; |
|
10253
|
10253
|
$temp_array['direction_shortname'] = "SE"; |
|
10254
|
10254
|
$temp_array['direction_fullname'] = "Southeast"; |
|
10255
|
|
- } elseif ($direction >= 157.5 && $direction < 180){ |
|
|
10255
|
+ } elseif ($direction >= 157.5 && $direction < 180) { |
|
10256
|
10256
|
$temp_array['direction_degree'] = $direction; |
|
10257
|
10257
|
$temp_array['direction_shortname'] = "SSE"; |
|
10258
|
10258
|
$temp_array['direction_fullname'] = "South-Southeast"; |
|
10259
|
|
- } elseif ($direction >= 180 && $direction < 202.5){ |
|
|
10259
|
+ } elseif ($direction >= 180 && $direction < 202.5) { |
|
10260
|
10260
|
$temp_array['direction_degree'] = $direction; |
|
10261
|
10261
|
$temp_array['direction_shortname'] = "S"; |
|
10262
|
10262
|
$temp_array['direction_fullname'] = "South"; |
|
10263
|
|
- } elseif ($direction >= 202.5 && $direction < 225){ |
|
|
10263
|
+ } elseif ($direction >= 202.5 && $direction < 225) { |
|
10264
|
10264
|
$temp_array['direction_degree'] = $direction; |
|
10265
|
10265
|
$temp_array['direction_shortname'] = "SSW"; |
|
10266
|
10266
|
$temp_array['direction_fullname'] = "South-Southwest"; |
|
10267
|
|
- } elseif ($direction >= 225 && $direction < 247.5){ |
|
|
10267
|
+ } elseif ($direction >= 225 && $direction < 247.5) { |
|
10268
|
10268
|
$temp_array['direction_degree'] = $direction; |
|
10269
|
10269
|
$temp_array['direction_shortname'] = "SW"; |
|
10270
|
10270
|
$temp_array['direction_fullname'] = "Southwest"; |
|
10271
|
|
- } elseif ($direction >= 247.5 && $direction < 270){ |
|
|
10271
|
+ } elseif ($direction >= 247.5 && $direction < 270) { |
|
10272
|
10272
|
$temp_array['direction_degree'] = $direction; |
|
10273
|
10273
|
$temp_array['direction_shortname'] = "WSW"; |
|
10274
|
10274
|
$temp_array['direction_fullname'] = "West-Southwest"; |
|
10275
|
|
- } elseif ($direction >= 270 && $direction < 292.5){ |
|
|
10275
|
+ } elseif ($direction >= 270 && $direction < 292.5) { |
|
10276
|
10276
|
$temp_array['direction_degree'] = $direction; |
|
10277
|
10277
|
$temp_array['direction_shortname'] = "W"; |
|
10278
|
10278
|
$temp_array['direction_fullname'] = "West"; |
|
10279
|
|
- } elseif ($direction >= 292.5 && $direction < 315){ |
|
|
10279
|
+ } elseif ($direction >= 292.5 && $direction < 315) { |
|
10280
|
10280
|
$temp_array['direction_degree'] = $direction; |
|
10281
|
10281
|
$temp_array['direction_shortname'] = "WNW"; |
|
10282
|
10282
|
$temp_array['direction_fullname'] = "West-Northwest"; |
|
10283
|
|
- } elseif ($direction >= 315 && $direction < 337.5){ |
|
|
10283
|
+ } elseif ($direction >= 315 && $direction < 337.5) { |
|
10284
|
10284
|
$temp_array['direction_degree'] = $direction; |
|
10285
|
10285
|
$temp_array['direction_shortname'] = "NW"; |
|
10286
|
10286
|
$temp_array['direction_fullname'] = "Northwest"; |
|
10287
|
|
- } elseif ($direction >= 337.5 && $direction < 360){ |
|
|
10287
|
+ } elseif ($direction >= 337.5 && $direction < 360) { |
|
10288
|
10288
|
$temp_array['direction_degree'] = $direction; |
|
10289
|
10289
|
$temp_array['direction_shortname'] = "NNW"; |
|
10290
|
10290
|
$temp_array['direction_fullname'] = "North-Northwest"; |
|
@@ -10337,9 +10337,9 @@ discard block |
|
|
block discarded – undo |
|
10337
|
10337
|
*/ |
|
10338
|
10338
|
public function getAircraftRegistrationBymodeS($aircraft_modes) |
|
10339
|
10339
|
{ |
|
10340
|
|
- $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
|
10340
|
+ $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
10341
|
10341
|
|
|
10342
|
|
- $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
|
10342
|
+ $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
10343
|
10343
|
|
|
10344
|
10344
|
$sth = $this->db->prepare($query); |
|
10345
|
10345
|
$sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
|
@@ -10362,9 +10362,9 @@ discard block |
|
|
block discarded – undo |
|
10362
|
10362
|
*/ |
|
10363
|
10363
|
public function getAircraftTypeBymodeS($aircraft_modes) |
|
10364
|
10364
|
{ |
|
10365
|
|
- $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
|
10365
|
+ $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
10366
|
10366
|
|
|
10367
|
|
- $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
|
10367
|
+ $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes ORDER BY FirstCreated DESC LIMIT 1"; |
|
10368
|
10368
|
|
|
10369
|
10369
|
$sth = $this->db->prepare($query); |
|
10370
|
10370
|
$sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
|
@@ -10385,11 +10385,11 @@ discard block |
|
|
block discarded – undo |
|
10385
|
10385
|
* @param Float $longitude longitute of the flight |
|
10386
|
10386
|
* @return String the countrie |
|
10387
|
10387
|
*/ |
|
10388
|
|
- public function getCountryFromLatitudeLongitude($latitude,$longitude) |
|
|
10388
|
+ public function getCountryFromLatitudeLongitude($latitude, $longitude) |
|
10389
|
10389
|
{ |
|
10390
|
10390
|
global $globalDBdriver, $globalDebug; |
|
10391
|
|
- $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
10392
|
|
- $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
|
10391
|
+ $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
|
10392
|
+ $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
10393
|
10393
|
|
|
10394
|
10394
|
$Connection = new Connection($this->db); |
|
10395
|
10395
|
if (!$Connection->tableExists('countries')) return ''; |
|
@@ -10429,7 +10429,7 @@ discard block |
|
|
block discarded – undo |
|
10429
|
10429
|
public function getCountryFromISO2($iso2) |
|
10430
|
10430
|
{ |
|
10431
|
10431
|
global $globalDBdriver, $globalDebug; |
|
10432
|
|
- $iso2 = filter_var($iso2,FILTER_SANITIZE_STRING); |
|
|
10432
|
+ $iso2 = filter_var($iso2, FILTER_SANITIZE_STRING); |
|
10433
|
10433
|
|
|
10434
|
10434
|
$Connection = new Connection($this->db); |
|
10435
|
10435
|
if (!$Connection->tableExists('countries')) return ''; |
|
@@ -10461,19 +10461,19 @@ discard block |
|
|
block discarded – undo |
|
10461
|
10461
|
*/ |
|
10462
|
10462
|
public function convertAircraftRegistration($registration) |
|
10463
|
10463
|
{ |
|
10464
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
10464
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
10465
|
10465
|
$registration_prefix = ''; |
|
10466
|
10466
|
$registration_1 = substr($registration, 0, 1); |
|
10467
|
10467
|
$registration_2 = substr($registration, 0, 2); |
|
10468
|
10468
|
|
|
10469
|
10469
|
//first get the prefix based on two characters |
|
10470
|
|
- $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
|
10470
|
+ $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
10471
|
10471
|
|
|
10472
|
10472
|
|
|
10473
|
10473
|
$sth = $this->db->prepare($query); |
|
10474
|
10474
|
$sth->execute(array(':registration_2' => $registration_2)); |
|
10475
|
10475
|
|
|
10476
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10476
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10477
|
10477
|
{ |
|
10478
|
10478
|
$registration_prefix = $row['registration_prefix']; |
|
10479
|
10479
|
} |
|
@@ -10481,11 +10481,11 @@ discard block |
|
|
block discarded – undo |
|
10481
|
10481
|
//if we didn't find a two chracter prefix lets just search the one with one character |
|
10482
|
10482
|
if ($registration_prefix == '') |
|
10483
|
10483
|
{ |
|
10484
|
|
- $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
|
10484
|
+ $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
10485
|
10485
|
$sth = $this->db->prepare($query); |
|
10486
|
10486
|
$sth->execute(array(':registration_1' => $registration_1)); |
|
10487
|
10487
|
|
|
10488
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10488
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10489
|
10489
|
{ |
|
10490
|
10490
|
$registration_prefix = $row['registration_prefix']; |
|
10491
|
10491
|
} |
|
@@ -10499,7 +10499,7 @@ discard block |
|
|
block discarded – undo |
|
10499
|
10499
|
} else { |
|
10500
|
10500
|
$registration = preg_replace("/^(.{1})/", "$1-", $registration); |
|
10501
|
10501
|
} |
|
10502
|
|
- } else if(strlen($registration_prefix) == 2){ |
|
|
10502
|
+ } else if (strlen($registration_prefix) == 2) { |
|
10503
|
10503
|
if (0 === strpos($registration, 'N')) { |
|
10504
|
10504
|
$registration = preg_replace("/^(.{2})/", "$1", $registration); |
|
10505
|
10505
|
} else { |
|
@@ -10518,17 +10518,17 @@ discard block |
|
|
block discarded – undo |
|
10518
|
10518
|
*/ |
|
10519
|
10519
|
public function countryFromAircraftRegistration($registration) |
|
10520
|
10520
|
{ |
|
10521
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
10521
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
10522
|
10522
|
|
|
10523
|
10523
|
$registration_prefix = ''; |
|
10524
|
|
- $registration_test = explode('-',$registration); |
|
|
10524
|
+ $registration_test = explode('-', $registration); |
|
10525
|
10525
|
$country = ''; |
|
10526
|
10526
|
if ($registration_test[0] != $registration) { |
|
10527
|
10527
|
$query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
10528
|
10528
|
|
|
10529
|
10529
|
$sth = $this->db->prepare($query); |
|
10530
|
10530
|
$sth->execute(array(':registration_1' => $registration_test[0])); |
|
10531
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10531
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10532
|
10532
|
{ |
|
10533
|
10533
|
//$registration_prefix = $row['registration_prefix']; |
|
10534
|
10534
|
$country = $row['country']; |
|
@@ -10539,13 +10539,13 @@ discard block |
|
|
block discarded – undo |
|
10539
|
10539
|
|
|
10540
|
10540
|
$country = ''; |
|
10541
|
10541
|
//first get the prefix based on two characters |
|
10542
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
|
10542
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
10543
|
10543
|
|
|
10544
|
10544
|
|
|
10545
|
10545
|
$sth = $this->db->prepare($query); |
|
10546
|
10546
|
$sth->execute(array(':registration_2' => $registration_2)); |
|
10547
|
10547
|
|
|
10548
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10548
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10549
|
10549
|
{ |
|
10550
|
10550
|
$registration_prefix = $row['registration_prefix']; |
|
10551
|
10551
|
$country = $row['country']; |
|
@@ -10554,12 +10554,12 @@ discard block |
|
|
block discarded – undo |
|
10554
|
10554
|
//if we didn't find a two chracter prefix lets just search the one with one character |
|
10555
|
10555
|
if ($registration_prefix == "") |
|
10556
|
10556
|
{ |
|
10557
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
|
10557
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
10558
|
10558
|
|
|
10559
|
10559
|
$sth = $this->db->prepare($query); |
|
10560
|
10560
|
$sth->execute(array(':registration_1' => $registration_1)); |
|
10561
|
10561
|
|
|
10562
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10562
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10563
|
10563
|
{ |
|
10564
|
10564
|
//$registration_prefix = $row['registration_prefix']; |
|
10565
|
10565
|
$country = $row['country']; |
|
@@ -10579,17 +10579,17 @@ discard block |
|
|
block discarded – undo |
|
10579
|
10579
|
*/ |
|
10580
|
10580
|
public function registrationPrefixFromAircraftRegistration($registration) |
|
10581
|
10581
|
{ |
|
10582
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
10582
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
10583
|
10583
|
|
|
10584
|
10584
|
$registration_prefix = ''; |
|
10585
|
|
- $registration_test = explode('-',$registration); |
|
|
10585
|
+ $registration_test = explode('-', $registration); |
|
10586
|
10586
|
//$country = ''; |
|
10587
|
10587
|
if ($registration_test[0] != $registration) { |
|
10588
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
|
10588
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
10589
|
10589
|
|
|
10590
|
10590
|
$sth = $this->db->prepare($query); |
|
10591
|
10591
|
$sth->execute(array(':registration_1' => $registration_test[0])); |
|
10592
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10592
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10593
|
10593
|
{ |
|
10594
|
10594
|
$registration_prefix = $row['registration_prefix']; |
|
10595
|
10595
|
//$country = $row['country']; |
|
@@ -10599,13 +10599,13 @@ discard block |
|
|
block discarded – undo |
|
10599
|
10599
|
$registration_2 = substr($registration, 0, 2); |
|
10600
|
10600
|
|
|
10601
|
10601
|
//first get the prefix based on two characters |
|
10602
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
|
10602
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
10603
|
10603
|
|
|
10604
|
10604
|
|
|
10605
|
10605
|
$sth = $this->db->prepare($query); |
|
10606
|
10606
|
$sth->execute(array(':registration_2' => $registration_2)); |
|
10607
|
10607
|
|
|
10608
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10608
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10609
|
10609
|
{ |
|
10610
|
10610
|
$registration_prefix = $row['registration_prefix']; |
|
10611
|
10611
|
//$country = $row['country']; |
|
@@ -10614,12 +10614,12 @@ discard block |
|
|
block discarded – undo |
|
10614
|
10614
|
//if we didn't find a two chracter prefix lets just search the one with one character |
|
10615
|
10615
|
if ($registration_prefix == "") |
|
10616
|
10616
|
{ |
|
10617
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
|
10617
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
10618
|
10618
|
|
|
10619
|
10619
|
$sth = $this->db->prepare($query); |
|
10620
|
10620
|
$sth->execute(array(':registration_1' => $registration_1)); |
|
10621
|
10621
|
|
|
10622
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10622
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10623
|
10623
|
{ |
|
10624
|
10624
|
$registration_prefix = $row['registration_prefix']; |
|
10625
|
10625
|
//$country = $row['country']; |
|
@@ -10640,13 +10640,13 @@ discard block |
|
|
block discarded – undo |
|
10640
|
10640
|
*/ |
|
10641
|
10641
|
public function countryFromAircraftRegistrationCode($registration) |
|
10642
|
10642
|
{ |
|
10643
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
10643
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
10644
|
10644
|
|
|
10645
|
10645
|
$country = ''; |
|
10646
|
|
- $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration LIMIT 1"; |
|
|
10646
|
+ $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration LIMIT 1"; |
|
10647
|
10647
|
$sth = $this->db->prepare($query); |
|
10648
|
10648
|
$sth->execute(array(':registration' => $registration)); |
|
10649
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10649
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10650
|
10650
|
{ |
|
10651
|
10651
|
$country = $row['country']; |
|
10652
|
10652
|
} |
|
@@ -10659,9 +10659,9 @@ discard block |
|
|
block discarded – undo |
|
10659
|
10659
|
* @param String $flightaware_id flightaware_id from spotter_output table |
|
10660
|
10660
|
* @param String $highlight New highlight value |
|
10661
|
10661
|
*/ |
|
10662
|
|
- public function setHighlightFlight($flightaware_id,$highlight) { |
|
|
10662
|
+ public function setHighlightFlight($flightaware_id, $highlight) { |
|
10663
|
10663
|
|
|
10664
|
|
- $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
|
10664
|
+ $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
10665
|
10665
|
$sth = $this->db->prepare($query); |
|
10666
|
10666
|
$sth->execute(array(':flightaware_id' => $flightaware_id, ':highlight' => $highlight)); |
|
10667
|
10667
|
} |
|
@@ -10673,13 +10673,13 @@ discard block |
|
|
block discarded – undo |
|
10673
|
10673
|
* @param String $date Date of spotted aircraft |
|
10674
|
10674
|
* @param String $highlight New highlight value |
|
10675
|
10675
|
*/ |
|
10676
|
|
- public function setHighlightFlightByRegistration($registration,$highlight, $date = '') { |
|
|
10676
|
+ public function setHighlightFlightByRegistration($registration, $highlight, $date = '') { |
|
10677
|
10677
|
if ($date == '') { |
|
10678
|
10678
|
$query = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)"; |
|
10679
|
10679
|
$query_values = array(':registration' => $registration, ':highlight' => $highlight); |
|
10680
|
10680
|
} else { |
|
10681
|
10681
|
$query = "UPDATE spotter_output SET highlight = :highlight WHERE registration = :registration AND date(date) = :date"; |
|
10682
|
|
- $query_values = array(':registration' => $registration, ':highlight' => $highlight,':date' => $date); |
|
|
10682
|
+ $query_values = array(':registration' => $registration, ':highlight' => $highlight, ':date' => $date); |
|
10683
|
10683
|
} |
|
10684
|
10684
|
$sth = $this->db->prepare($query); |
|
10685
|
10685
|
$sth->execute($query_values); |
|
@@ -10709,7 +10709,7 @@ discard block |
|
|
block discarded – undo |
|
10709
|
10709
|
|
|
10710
|
10710
|
$bitly_data = json_decode($bitly_data); |
|
10711
|
10711
|
$bitly_url = ''; |
|
10712
|
|
- if ($bitly_data->status_txt = "OK"){ |
|
|
10712
|
+ if ($bitly_data->status_txt = "OK") { |
|
10713
|
10713
|
$bitly_url = $bitly_data->data->url; |
|
10714
|
10714
|
} |
|
10715
|
10715
|
|
|
@@ -10719,7 +10719,7 @@ discard block |
|
|
block discarded – undo |
|
10719
|
10719
|
|
|
10720
|
10720
|
public function getOrderBy() |
|
10721
|
10721
|
{ |
|
10722
|
|
- $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_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")); |
|
|
10722
|
+ $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_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")); |
|
10723
|
10723
|
|
|
10724
|
10724
|
return $orderby; |
|
10725
|
10725
|
|
|
@@ -10853,14 +10853,14 @@ discard block |
|
|
block discarded – undo |
|
10853
|
10853
|
} |
|
10854
|
10854
|
$sth = $this->db->prepare($query); |
|
10855
|
10855
|
$sth->execute(); |
|
10856
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10856
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10857
|
10857
|
{ |
|
10858
|
10858
|
$departure_airport_array = $this->getAllAirportInfo($row['fromairport_icao']); |
|
10859
|
10859
|
$arrival_airport_array = $this->getAllAirportInfo($row['toairport_icao']); |
|
10860
|
10860
|
if (count($departure_airport_array) > 0 && count($arrival_airport_array) > 0) { |
|
10861
|
|
- $update_query="UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
|
10861
|
+ $update_query = "UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
10862
|
10862
|
$sthu = $this->db->prepare($update_query); |
|
10863
|
|
- $sthu->execute(array(':fromicao' => $row['fromairport_icao'],':toicao' => $row['toairport_icao'],':spotter_id' => $row['spotter_id'],':departure_airport_name' => $departure_airport_array[0]['name'],':departure_airport_city' => $departure_airport_array[0]['city'],':departure_airport_country' => $departure_airport_array[0]['country'],':arrival_airport_name' => $arrival_airport_array[0]['name'],':arrival_airport_city' => $arrival_airport_array[0]['city'],':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
|
10863
|
+ $sthu->execute(array(':fromicao' => $row['fromairport_icao'], ':toicao' => $row['toairport_icao'], ':spotter_id' => $row['spotter_id'], ':departure_airport_name' => $departure_airport_array[0]['name'], ':departure_airport_city' => $departure_airport_array[0]['city'], ':departure_airport_country' => $departure_airport_array[0]['country'], ':arrival_airport_name' => $arrival_airport_array[0]['name'], ':arrival_airport_city' => $arrival_airport_array[0]['city'], ':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
10864
|
10864
|
} |
|
10865
|
10865
|
} |
|
10866
|
10866
|
|
|
@@ -10873,7 +10873,7 @@ discard block |
|
|
block discarded – undo |
|
10873
|
10873
|
} |
|
10874
|
10874
|
$sth = $this->db->prepare($query); |
|
10875
|
10875
|
$sth->execute(); |
|
10876
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10876
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10877
|
10877
|
{ |
|
10878
|
10878
|
if (is_numeric(substr($row['ident'], -1, 1))) |
|
10879
|
10879
|
{ |
|
@@ -10882,11 +10882,11 @@ discard block |
|
|
block discarded – undo |
|
10882
|
10882
|
elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
|
10883
|
10883
|
elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
10884
|
10884
|
elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
10885
|
|
- $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
|
|
10885
|
+ $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3), $fromsource); |
|
10886
|
10886
|
if (isset($airline_array[0]['name'])) { |
|
10887
|
|
- $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
|
|
10887
|
+ $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
|
10888
|
10888
|
$sthu = $this->db->prepare($update_query); |
|
10889
|
|
- $sthu->execute(array(':airline_name' => $airline_array[0]['name'],':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
|
10889
|
+ $sthu->execute(array(':airline_name' => $airline_array[0]['name'], ':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
10890
|
10890
|
} |
|
10891
|
10891
|
} |
|
10892
|
10892
|
} |
|
@@ -10906,18 +10906,18 @@ discard block |
|
|
block discarded – undo |
|
10906
|
10906
|
} |
|
10907
|
10907
|
$sth = $this->db->prepare($query); |
|
10908
|
10908
|
$sth->execute(); |
|
10909
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10909
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10910
|
10910
|
{ |
|
10911
|
10911
|
if ($row['aircraft_icao'] != '') { |
|
10912
|
10912
|
$aircraft_name = $this->getAllAircraftInfo($row['aircraft_icao']); |
|
10913
|
|
- if ($row['registration'] != ""){ |
|
|
10913
|
+ if ($row['registration'] != "") { |
|
10914
|
10914
|
$image_array = $Image->getSpotterImage($row['registration']); |
|
10915
|
10915
|
if (!isset($image_array[0]['registration'])) { |
|
10916
|
10916
|
$Image->addSpotterImage($row['registration']); |
|
10917
|
10917
|
} |
|
10918
|
10918
|
} |
|
10919
|
10919
|
if (count($aircraft_name) > 0) { |
|
10920
|
|
- $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
|
10920
|
+ $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
10921
|
10921
|
$sthu = $this->db->prepare($update_query); |
|
10922
|
10922
|
$sthu->execute(array(':aircraft_name' => $aircraft_name[0]['type'], ':aircraft_manufacturer' => $aircraft_name[0]['manufacturer'], ':spotter_id' => $row['spotter_id'])); |
|
10923
|
10923
|
} |
|
@@ -10932,10 +10932,10 @@ discard block |
|
|
block discarded – undo |
|
10932
|
10932
|
$query = "SELECT spotter_output.spotter_id, spotter_output.last_latitude, spotter_output.last_longitude, spotter_output.last_altitude, spotter_output.arrival_airport_icao, spotter_output.real_arrival_airport_icao FROM spotter_output"; |
|
10933
|
10933
|
$sth = $this->db->prepare($query); |
|
10934
|
10934
|
$sth->execute(); |
|
10935
|
|
- while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
|
10935
|
+ while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
10936
|
10936
|
{ |
|
10937
|
10937
|
if ($row['last_latitude'] != '' && $row['last_longitude'] != '') { |
|
10938
|
|
- $closestAirports = $this->closestAirports($row['last_latitude'],$row['last_longitude'],$globalClosestMinDist); |
|
|
10938
|
+ $closestAirports = $this->closestAirports($row['last_latitude'], $row['last_longitude'], $globalClosestMinDist); |
|
10939
|
10939
|
$airport_icao = ''; |
|
10940
|
10940
|
if (isset($closestAirports[0])) { |
|
10941
|
10941
|
if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
|
@@ -10949,7 +10949,7 @@ discard block |
|
|
block discarded – undo |
|
10949
|
10949
|
break; |
|
10950
|
10950
|
} |
|
10951
|
10951
|
} |
|
10952
|
|
- } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
|
|
10952
|
+ } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100 + 1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude'] + 5000))) { |
|
10953
|
10953
|
$airport_icao = $closestAirports[0]['icao']; |
|
10954
|
10954
|
if ($globalDebug) echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
10955
|
10955
|
} else { |
|
@@ -10960,28 +10960,28 @@ discard block |
|
|
block discarded – undo |
|
10960
|
10960
|
} |
|
10961
|
10961
|
if ($row['real_arrival_airport_icao'] != $airport_icao) { |
|
10962
|
10962
|
if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
|
10963
|
|
- $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
|
10963
|
+ $update_query = "UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
10964
|
10964
|
$sthu = $this->db->prepare($update_query); |
|
10965
|
|
- $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |
|
|
10965
|
+ $sthu->execute(array(':airport_icao' => $airport_icao, ':spotter_id' => $row['spotter_id'])); |
|
10966
|
10966
|
} |
|
10967
|
10967
|
} |
|
10968
|
10968
|
} |
|
10969
|
10969
|
} |
|
10970
|
10970
|
|
|
10971
|
|
- public function closestAirports($origLat,$origLon,$dist = 10) { |
|
|
10971
|
+ public function closestAirports($origLat, $origLon, $dist = 10) { |
|
10972
|
10972
|
global $globalDBdriver; |
|
10973
|
|
- $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
|
10973
|
+ $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
10974
|
10974
|
/* |
|
10975
|
10975
|
$query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - abs(latitude))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(abs(latitude)*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance |
|
10976
|
10976
|
FROM airport WHERE longitude between ($origLon-$dist/abs(cos(radians($origLat))*69)) and ($origLon+$dist/abs(cos(radians($origLat))*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
|
10977
|
10977
|
having distance < $dist ORDER BY distance limit 100;"; |
|
10978
|
10978
|
*/ |
|
10979
|
10979
|
if ($globalDBdriver == 'mysql') { |
|
10980
|
|
- $query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance |
|
|
10980
|
+ $query = "SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance |
|
10981
|
10981
|
FROM airport WHERE longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
|
10982
|
10982
|
AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;"; |
|
10983
|
10983
|
} else { |
|
10984
|
|
- $query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2))) as distance |
|
|
10984
|
+ $query = "SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2))) as distance |
|
10985
|
10985
|
FROM airport WHERE CAST(longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
|
10986
|
10986
|
AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;"; |
|
10987
|
10987
|
} |