@@ -15,33 +15,33 @@ discard block |
||
| 15 | 15 | if (isset($globalFilterName)) $this->filter_name = $globalFilterName; |
| 16 | 16 | $Connection = new Connection($dbc); |
| 17 | 17 | $this->db = $Connection->db(); |
| 18 | - } |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function addLastStatsUpdate($type,$stats_date) { |
| 21 | - $query = "DELETE FROM config WHERE name = :type; |
|
| 21 | + $query = "DELETE FROM config WHERE name = :type; |
|
| 22 | 22 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
| 23 | - $query_values = array('type' => $type,':stats_date' => $stats_date); |
|
| 24 | - try { |
|
| 25 | - $sth = $this->db->prepare($query); |
|
| 26 | - $sth->execute($query_values); |
|
| 27 | - } catch(PDOException $e) { |
|
| 28 | - return "error : ".$e->getMessage(); |
|
| 29 | - } |
|
| 30 | - } |
|
| 23 | + $query_values = array('type' => $type,':stats_date' => $stats_date); |
|
| 24 | + try { |
|
| 25 | + $sth = $this->db->prepare($query); |
|
| 26 | + $sth->execute($query_values); |
|
| 27 | + } catch(PDOException $e) { |
|
| 28 | + return "error : ".$e->getMessage(); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | public function getLastStatsUpdate($type = 'last_update_stats') { |
| 33 | - $query = "SELECT value FROM config WHERE name = :type"; |
|
| 34 | - try { |
|
| 35 | - $sth = $this->db->prepare($query); |
|
| 36 | - $sth->execute(array(':type' => $type)); |
|
| 37 | - } catch(PDOException $e) { |
|
| 38 | - echo "error : ".$e->getMessage(); |
|
| 39 | - } |
|
| 40 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 41 | - return $all; |
|
| 42 | - } |
|
| 43 | - public function deleteStats($filter_name = '') { |
|
| 44 | - /* |
|
| 33 | + $query = "SELECT value FROM config WHERE name = :type"; |
|
| 34 | + try { |
|
| 35 | + $sth = $this->db->prepare($query); |
|
| 36 | + $sth->execute(array(':type' => $type)); |
|
| 37 | + } catch(PDOException $e) { |
|
| 38 | + echo "error : ".$e->getMessage(); |
|
| 39 | + } |
|
| 40 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 41 | + return $all; |
|
| 42 | + } |
|
| 43 | + public function deleteStats($filter_name = '') { |
|
| 44 | + /* |
|
| 45 | 45 | $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
| 46 | 46 | try { |
| 47 | 47 | $sth = $this->db->prepare($query); |
@@ -50,106 +50,106 @@ discard block |
||
| 50 | 50 | return "error : ".$e->getMessage(); |
| 51 | 51 | } |
| 52 | 52 | */ |
| 53 | - $query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
| 54 | - try { |
|
| 55 | - $sth = $this->db->prepare($query); |
|
| 56 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 57 | - } catch(PDOException $e) { |
|
| 58 | - return "error : ".$e->getMessage(); |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - public function deleteOldStats($filter_name = '') { |
|
| 53 | + $query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
| 54 | + try { |
|
| 55 | + $sth = $this->db->prepare($query); |
|
| 56 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 57 | + } catch(PDOException $e) { |
|
| 58 | + return "error : ".$e->getMessage(); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + public function deleteOldStats($filter_name = '') { |
|
| 62 | 62 | |
| 63 | - $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
|
| 64 | - try { |
|
| 65 | - $sth = $this->db->prepare($query); |
|
| 66 | - $sth->execute(); |
|
| 67 | - } catch(PDOException $e) { |
|
| 68 | - return "error : ".$e->getMessage(); |
|
| 69 | - } |
|
| 63 | + $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
|
| 64 | + try { |
|
| 65 | + $sth = $this->db->prepare($query); |
|
| 66 | + $sth->execute(); |
|
| 67 | + } catch(PDOException $e) { |
|
| 68 | + return "error : ".$e->getMessage(); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - $query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
| 72 | - try { |
|
| 73 | - $sth = $this->db->prepare($query); |
|
| 74 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 75 | - } catch(PDOException $e) { |
|
| 76 | - return "error : ".$e->getMessage(); |
|
| 77 | - } |
|
| 78 | - } |
|
| 71 | + $query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
| 72 | + try { |
|
| 73 | + $sth = $this->db->prepare($query); |
|
| 74 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 75 | + } catch(PDOException $e) { |
|
| 76 | + return "error : ".$e->getMessage(); |
|
| 77 | + } |
|
| 78 | + } |
|
| 79 | 79 | public function getAllAirlineNames($filter_name = '') { |
| 80 | 80 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 81 | - $query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC"; |
|
| 82 | - try { |
|
| 83 | - $sth = $this->db->prepare($query); |
|
| 84 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 85 | - } catch(PDOException $e) { |
|
| 86 | - echo "error : ".$e->getMessage(); |
|
| 87 | - } |
|
| 88 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 89 | - return $all; |
|
| 90 | - } |
|
| 81 | + $query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC"; |
|
| 82 | + try { |
|
| 83 | + $sth = $this->db->prepare($query); |
|
| 84 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 85 | + } catch(PDOException $e) { |
|
| 86 | + echo "error : ".$e->getMessage(); |
|
| 87 | + } |
|
| 88 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 89 | + return $all; |
|
| 90 | + } |
|
| 91 | 91 | public function getAllAircraftTypes($stats_airline = '',$filter_name = '') { |
| 92 | 92 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 93 | - $query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC"; |
|
| 94 | - try { |
|
| 95 | - $sth = $this->db->prepare($query); |
|
| 96 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 97 | - } catch(PDOException $e) { |
|
| 98 | - echo "error : ".$e->getMessage(); |
|
| 99 | - } |
|
| 100 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 101 | - return $all; |
|
| 102 | - } |
|
| 93 | + $query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC"; |
|
| 94 | + try { |
|
| 95 | + $sth = $this->db->prepare($query); |
|
| 96 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 97 | + } catch(PDOException $e) { |
|
| 98 | + echo "error : ".$e->getMessage(); |
|
| 99 | + } |
|
| 100 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 101 | + return $all; |
|
| 102 | + } |
|
| 103 | 103 | public function getAllManufacturers($stats_airline = '',$filter_name = '') { |
| 104 | 104 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 105 | - $query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC"; |
|
| 106 | - try { |
|
| 107 | - $sth = $this->db->prepare($query); |
|
| 108 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 109 | - } catch(PDOException $e) { |
|
| 110 | - echo "error : ".$e->getMessage(); |
|
| 111 | - } |
|
| 112 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 113 | - return $all; |
|
| 114 | - } |
|
| 105 | + $query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC"; |
|
| 106 | + try { |
|
| 107 | + $sth = $this->db->prepare($query); |
|
| 108 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 109 | + } catch(PDOException $e) { |
|
| 110 | + echo "error : ".$e->getMessage(); |
|
| 111 | + } |
|
| 112 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 113 | + return $all; |
|
| 114 | + } |
|
| 115 | 115 | public function getAllAirportNames($stats_airline = '',$filter_name = '') { |
| 116 | 116 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 117 | - $query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC"; |
|
| 118 | - try { |
|
| 119 | - $sth = $this->db->prepare($query); |
|
| 120 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 121 | - } catch(PDOException $e) { |
|
| 122 | - echo "error : ".$e->getMessage(); |
|
| 123 | - } |
|
| 124 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 125 | - return $all; |
|
| 126 | - } |
|
| 117 | + $query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC"; |
|
| 118 | + try { |
|
| 119 | + $sth = $this->db->prepare($query); |
|
| 120 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 121 | + } catch(PDOException $e) { |
|
| 122 | + echo "error : ".$e->getMessage(); |
|
| 123 | + } |
|
| 124 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 125 | + return $all; |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | public function getAllOwnerNames($stats_airline = '',$filter_name = '') { |
| 129 | 129 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 130 | - $query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC"; |
|
| 131 | - try { |
|
| 132 | - $sth = $this->db->prepare($query); |
|
| 133 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 134 | - } catch(PDOException $e) { |
|
| 135 | - echo "error : ".$e->getMessage(); |
|
| 136 | - } |
|
| 137 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 138 | - return $all; |
|
| 139 | - } |
|
| 130 | + $query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC"; |
|
| 131 | + try { |
|
| 132 | + $sth = $this->db->prepare($query); |
|
| 133 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 134 | + } catch(PDOException $e) { |
|
| 135 | + echo "error : ".$e->getMessage(); |
|
| 136 | + } |
|
| 137 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 138 | + return $all; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | public function getAllPilotNames($stats_airline = '',$filter_name = '') { |
| 142 | 142 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 143 | - $query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC"; |
|
| 144 | - try { |
|
| 145 | - $sth = $this->db->prepare($query); |
|
| 146 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 147 | - } catch(PDOException $e) { |
|
| 148 | - echo "error : ".$e->getMessage(); |
|
| 149 | - } |
|
| 150 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 151 | - return $all; |
|
| 152 | - } |
|
| 143 | + $query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC"; |
|
| 144 | + try { |
|
| 145 | + $sth = $this->db->prepare($query); |
|
| 146 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 147 | + } catch(PDOException $e) { |
|
| 148 | + echo "error : ".$e->getMessage(); |
|
| 149 | + } |
|
| 150 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 151 | + return $all; |
|
| 152 | + } |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | public function countAllAircraftTypes($limit = true, $stats_airline = '', $filter_name = '',$year = '', $month = '') { |
@@ -166,15 +166,15 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 168 | 168 | } else $all = array(); |
| 169 | - if (empty($all)) { |
|
| 170 | - $filters = array('airlines' => array($stats_airline)); |
|
| 171 | - if ($filter_name != '') { |
|
| 172 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 173 | - } |
|
| 174 | - $Spotter = new Spotter($this->db); |
|
| 175 | - $all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month); |
|
| 176 | - } |
|
| 177 | - return $all; |
|
| 169 | + if (empty($all)) { |
|
| 170 | + $filters = array('airlines' => array($stats_airline)); |
|
| 171 | + if ($filter_name != '') { |
|
| 172 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 173 | + } |
|
| 174 | + $Spotter = new Spotter($this->db); |
|
| 175 | + $all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month); |
|
| 176 | + } |
|
| 177 | + return $all; |
|
| 178 | 178 | } |
| 179 | 179 | public function countAllAirlineCountries($limit = true,$filter_name = '',$year = '',$month = '') { |
| 180 | 180 | global $globalStatsFilters; |
@@ -190,15 +190,15 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 192 | 192 | } else $all = array(); |
| 193 | - if (empty($all)) { |
|
| 194 | - $Spotter = new Spotter($this->db); |
|
| 195 | - $filters = array(); |
|
| 196 | - if ($filter_name != '') { |
|
| 197 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 193 | + if (empty($all)) { |
|
| 194 | + $Spotter = new Spotter($this->db); |
|
| 195 | + $filters = array(); |
|
| 196 | + if ($filter_name != '') { |
|
| 197 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 198 | 198 | } |
| 199 | - $all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month); |
|
| 200 | - } |
|
| 201 | - return $all; |
|
| 199 | + $all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month); |
|
| 200 | + } |
|
| 201 | + return $all; |
|
| 202 | 202 | } |
| 203 | 203 | public function countAllAircraftManufacturers($limit = true,$stats_airline = '', $filter_name = '',$year = '', $month = '') { |
| 204 | 204 | global $globalStatsFilters; |
@@ -239,37 +239,37 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 241 | 241 | } else $all = array(); |
| 242 | - if (empty($all)) { |
|
| 242 | + if (empty($all)) { |
|
| 243 | 243 | $filters = array('airlines' => array($stats_airline)); |
| 244 | 244 | if ($filter_name != '') { |
| 245 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 245 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 246 | 246 | } |
| 247 | 247 | $Spotter = new Spotter($this->db); |
| 248 | 248 | $all = $Spotter->countAllArrivalCountries($limit,$filters,$year,$month); |
| 249 | - } |
|
| 250 | - return $all; |
|
| 249 | + } |
|
| 250 | + return $all; |
|
| 251 | 251 | } |
| 252 | 252 | public function countAllDepartureCountries($limit = true, $stats_airline = '', $filter_name = '', $year = '', $month = '') { |
| 253 | 253 | global $globalStatsFilters; |
| 254 | 254 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 255 | 255 | if ($limit) $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count FROM stats_airport WHERE stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country ORDER BY airport_departure_country_count DESC LIMIT 10 OFFSET 0"; |
| 256 | 256 | else $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count FROM stats_airport WHERE stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country ORDER BY airport_departure_country_count DESC"; |
| 257 | - try { |
|
| 258 | - $sth = $this->db->prepare($query); |
|
| 259 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 260 | - } catch(PDOException $e) { |
|
| 261 | - echo "error : ".$e->getMessage(); |
|
| 262 | - } |
|
| 263 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 264 | - if (empty($all)) { |
|
| 257 | + try { |
|
| 258 | + $sth = $this->db->prepare($query); |
|
| 259 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
| 260 | + } catch(PDOException $e) { |
|
| 261 | + echo "error : ".$e->getMessage(); |
|
| 262 | + } |
|
| 263 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 264 | + if (empty($all)) { |
|
| 265 | 265 | $filters = array('airlines' => array($stats_airline)); |
| 266 | 266 | if ($filter_name != '') { |
| 267 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 267 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 268 | 268 | } |
| 269 | 269 | $Spotter = new Spotter($this->db); |
| 270 | 270 | $all = $Spotter->countAllDepartureCountries($filters,$year,$month); |
| 271 | - } |
|
| 272 | - return $all; |
|
| 271 | + } |
|
| 272 | + return $all; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | public function countAllAirlines($limit = true,$filter_name = '',$year = '',$month = '') { |
@@ -286,16 +286,16 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 288 | 288 | } else $all = array(); |
| 289 | - if (empty($all)) { |
|
| 290 | - $Spotter = new Spotter($this->db); |
|
| 291 | - $filters = array(); |
|
| 292 | - if ($filter_name != '') { |
|
| 293 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 289 | + if (empty($all)) { |
|
| 290 | + $Spotter = new Spotter($this->db); |
|
| 291 | + $filters = array(); |
|
| 292 | + if ($filter_name != '') { |
|
| 293 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - $all = $Spotter->countAllAirlines($limit,0,'',$filters,$year,$month); |
|
| 297 | - } |
|
| 298 | - return $all; |
|
| 296 | + $all = $Spotter->countAllAirlines($limit,0,'',$filters,$year,$month); |
|
| 297 | + } |
|
| 298 | + return $all; |
|
| 299 | 299 | } |
| 300 | 300 | public function countAllAircraftRegistrations($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
| 301 | 301 | global $globalStatsFilters; |
@@ -311,15 +311,15 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 313 | 313 | } else $all = array(); |
| 314 | - if (empty($all)) { |
|
| 314 | + if (empty($all)) { |
|
| 315 | 315 | $filters = array('airlines' => array($stats_airline)); |
| 316 | 316 | if ($filter_name != '') { |
| 317 | 317 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 318 | 318 | } |
| 319 | - $Spotter = new Spotter($this->db); |
|
| 320 | - $all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month); |
|
| 321 | - } |
|
| 322 | - return $all; |
|
| 319 | + $Spotter = new Spotter($this->db); |
|
| 320 | + $all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month); |
|
| 321 | + } |
|
| 322 | + return $all; |
|
| 323 | 323 | } |
| 324 | 324 | public function countAllCallsigns($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
| 325 | 325 | global $globalStatsFilters; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | echo "error : ".$e->getMessage(); |
| 360 | 360 | } |
| 361 | 361 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 362 | - /* |
|
| 362 | + /* |
|
| 363 | 363 | if (empty($all)) { |
| 364 | 364 | $Spotter = new Spotter($this->db); |
| 365 | 365 | $all = $Spotter->countAllFlightOverCountries($limit); |
@@ -410,15 +410,15 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 412 | 412 | } else $all = array(); |
| 413 | - if (empty($all)) { |
|
| 413 | + if (empty($all)) { |
|
| 414 | 414 | $filters = array('airlines' => array($stats_airline)); |
| 415 | 415 | if ($filter_name != '') { |
| 416 | 416 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 417 | 417 | } |
| 418 | - $Spotter = new Spotter($this->db); |
|
| 419 | - $all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month); |
|
| 420 | - } |
|
| 421 | - return $all; |
|
| 418 | + $Spotter = new Spotter($this->db); |
|
| 419 | + $all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month); |
|
| 420 | + } |
|
| 421 | + return $all; |
|
| 422 | 422 | } |
| 423 | 423 | public function countAllDepartureAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
| 424 | 424 | global $globalStatsFilters; |
@@ -434,33 +434,33 @@ discard block |
||
| 434 | 434 | } |
| 435 | 435 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 436 | 436 | } else $all = array(); |
| 437 | - if (empty($all)) { |
|
| 437 | + if (empty($all)) { |
|
| 438 | 438 | $filters = array('airlines' => array($stats_airline)); |
| 439 | - if ($filter_name != '') { |
|
| 440 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 441 | - } |
|
| 442 | - $Spotter = new Spotter($this->db); |
|
| 443 | - $pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters,$year,$month); |
|
| 444 | - $dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters,$year,$month); |
|
| 445 | - $all = array(); |
|
| 446 | - foreach ($pall as $value) { |
|
| 447 | - $icao = $value['airport_departure_icao']; |
|
| 448 | - $all[$icao] = $value; |
|
| 449 | - } |
|
| 439 | + if ($filter_name != '') { |
|
| 440 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 441 | + } |
|
| 442 | + $Spotter = new Spotter($this->db); |
|
| 443 | + $pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters,$year,$month); |
|
| 444 | + $dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters,$year,$month); |
|
| 445 | + $all = array(); |
|
| 446 | + foreach ($pall as $value) { |
|
| 447 | + $icao = $value['airport_departure_icao']; |
|
| 448 | + $all[$icao] = $value; |
|
| 449 | + } |
|
| 450 | 450 | |
| 451 | - foreach ($dall as $value) { |
|
| 452 | - $icao = $value['airport_departure_icao']; |
|
| 453 | - if (isset($all[$icao])) { |
|
| 454 | - $all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 455 | - } else $all[$icao] = $value; |
|
| 456 | - } |
|
| 457 | - $count = array(); |
|
| 458 | - foreach ($all as $key => $row) { |
|
| 459 | - $count[$key] = $row['airport_departure_icao_count']; |
|
| 460 | - } |
|
| 461 | - array_multisort($count,SORT_DESC,$all); |
|
| 462 | - } |
|
| 463 | - return $all; |
|
| 451 | + foreach ($dall as $value) { |
|
| 452 | + $icao = $value['airport_departure_icao']; |
|
| 453 | + if (isset($all[$icao])) { |
|
| 454 | + $all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 455 | + } else $all[$icao] = $value; |
|
| 456 | + } |
|
| 457 | + $count = array(); |
|
| 458 | + foreach ($all as $key => $row) { |
|
| 459 | + $count[$key] = $row['airport_departure_icao_count']; |
|
| 460 | + } |
|
| 461 | + array_multisort($count,SORT_DESC,$all); |
|
| 462 | + } |
|
| 463 | + return $all; |
|
| 464 | 464 | } |
| 465 | 465 | public function countAllArrivalAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
| 466 | 466 | global $globalStatsFilters; |
@@ -484,26 +484,26 @@ discard block |
||
| 484 | 484 | $Spotter = new Spotter($this->db); |
| 485 | 485 | $pall = $Spotter->countAllArrivalAirports($limit,0,'',false,$filters,$year,$month); |
| 486 | 486 | $dall = $Spotter->countAllDetectedArrivalAirports($limit,0,'',false,$filters,$year,$month); |
| 487 | - $all = array(); |
|
| 488 | - foreach ($pall as $value) { |
|
| 489 | - $icao = $value['airport_arrival_icao']; |
|
| 490 | - $all[$icao] = $value; |
|
| 491 | - } |
|
| 487 | + $all = array(); |
|
| 488 | + foreach ($pall as $value) { |
|
| 489 | + $icao = $value['airport_arrival_icao']; |
|
| 490 | + $all[$icao] = $value; |
|
| 491 | + } |
|
| 492 | 492 | |
| 493 | - foreach ($dall as $value) { |
|
| 494 | - $icao = $value['airport_arrival_icao']; |
|
| 495 | - if (isset($all[$icao])) { |
|
| 496 | - $all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 497 | - } else $all[$icao] = $value; |
|
| 498 | - } |
|
| 499 | - $count = array(); |
|
| 500 | - foreach ($all as $key => $row) { |
|
| 501 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
| 502 | - } |
|
| 503 | - array_multisort($count,SORT_DESC,$all); |
|
| 504 | - } |
|
| 493 | + foreach ($dall as $value) { |
|
| 494 | + $icao = $value['airport_arrival_icao']; |
|
| 495 | + if (isset($all[$icao])) { |
|
| 496 | + $all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 497 | + } else $all[$icao] = $value; |
|
| 498 | + } |
|
| 499 | + $count = array(); |
|
| 500 | + foreach ($all as $key => $row) { |
|
| 501 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
| 502 | + } |
|
| 503 | + array_multisort($count,SORT_DESC,$all); |
|
| 504 | + } |
|
| 505 | 505 | |
| 506 | - return $all; |
|
| 506 | + return $all; |
|
| 507 | 507 | } |
| 508 | 508 | public function countAllMonthsLastYear($limit = true,$stats_airline = '',$filter_name = '') { |
| 509 | 509 | global $globalDBdriver, $globalStatsFilters; |
@@ -516,23 +516,23 @@ discard block |
||
| 516 | 516 | else $query = "SELECT EXTRACT(MONTH FROM stats_date) as month_name, EXTRACT(YEAR FROM stats_date) as year_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 517 | 517 | } |
| 518 | 518 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
| 519 | - try { |
|
| 520 | - $sth = $this->db->prepare($query); |
|
| 521 | - $sth->execute($query_data); |
|
| 522 | - } catch(PDOException $e) { |
|
| 523 | - echo "error : ".$e->getMessage(); |
|
| 524 | - } |
|
| 525 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 526 | - if (empty($all)) { |
|
| 519 | + try { |
|
| 520 | + $sth = $this->db->prepare($query); |
|
| 521 | + $sth->execute($query_data); |
|
| 522 | + } catch(PDOException $e) { |
|
| 523 | + echo "error : ".$e->getMessage(); |
|
| 524 | + } |
|
| 525 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 526 | + if (empty($all)) { |
|
| 527 | 527 | $filters = array('airlines' => array($stats_airline)); |
| 528 | 528 | if ($filter_name != '') { |
| 529 | 529 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 530 | 530 | } |
| 531 | - $Spotter = new Spotter($this->db); |
|
| 532 | - $all = $Spotter->countAllMonthsLastYear($filters); |
|
| 533 | - } |
|
| 531 | + $Spotter = new Spotter($this->db); |
|
| 532 | + $all = $Spotter->countAllMonthsLastYear($filters); |
|
| 533 | + } |
|
| 534 | 534 | |
| 535 | - return $all; |
|
| 535 | + return $all; |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | public function countAllDatesLastMonth($stats_airline = '',$filter_name = '') { |
@@ -540,22 +540,22 @@ discard block |
||
| 540 | 540 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 541 | 541 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 542 | 542 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
| 543 | - try { |
|
| 544 | - $sth = $this->db->prepare($query); |
|
| 545 | - $sth->execute($query_data); |
|
| 546 | - } catch(PDOException $e) { |
|
| 547 | - echo "error : ".$e->getMessage(); |
|
| 548 | - } |
|
| 549 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 550 | - if (empty($all)) { |
|
| 543 | + try { |
|
| 544 | + $sth = $this->db->prepare($query); |
|
| 545 | + $sth->execute($query_data); |
|
| 546 | + } catch(PDOException $e) { |
|
| 547 | + echo "error : ".$e->getMessage(); |
|
| 548 | + } |
|
| 549 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 550 | + if (empty($all)) { |
|
| 551 | 551 | $filters = array('airlines' => array($stats_airline)); |
| 552 | 552 | if ($filter_name != '') { |
| 553 | 553 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 554 | 554 | } |
| 555 | - $Spotter = new Spotter($this->db); |
|
| 556 | - $all = $Spotter->countAllDatesLastMonth($filters); |
|
| 557 | - } |
|
| 558 | - return $all; |
|
| 555 | + $Spotter = new Spotter($this->db); |
|
| 556 | + $all = $Spotter->countAllDatesLastMonth($filters); |
|
| 557 | + } |
|
| 558 | + return $all; |
|
| 559 | 559 | } |
| 560 | 560 | public function countAllDatesLast7Days($stats_airline = '',$filter_name = '') { |
| 561 | 561 | global $globalDBdriver, $globalStatsFilters; |
@@ -566,110 +566,110 @@ discard block |
||
| 566 | 566 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND flight_date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '7 DAYS' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 567 | 567 | } |
| 568 | 568 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
| 569 | - try { |
|
| 570 | - $sth = $this->db->prepare($query); |
|
| 571 | - $sth->execute($query_data); |
|
| 572 | - } catch(PDOException $e) { |
|
| 573 | - echo "error : ".$e->getMessage(); |
|
| 574 | - } |
|
| 575 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 576 | - if (empty($all)) { |
|
| 569 | + try { |
|
| 570 | + $sth = $this->db->prepare($query); |
|
| 571 | + $sth->execute($query_data); |
|
| 572 | + } catch(PDOException $e) { |
|
| 573 | + echo "error : ".$e->getMessage(); |
|
| 574 | + } |
|
| 575 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 576 | + if (empty($all)) { |
|
| 577 | 577 | $filters = array('airlines' => array($stats_airline)); |
| 578 | 578 | if ($filter_name != '') { |
| 579 | 579 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 580 | 580 | } |
| 581 | - $Spotter = new Spotter($this->db); |
|
| 582 | - $all = $Spotter->countAllDatesLast7Days($filters); |
|
| 583 | - } |
|
| 584 | - return $all; |
|
| 581 | + $Spotter = new Spotter($this->db); |
|
| 582 | + $all = $Spotter->countAllDatesLast7Days($filters); |
|
| 583 | + } |
|
| 584 | + return $all; |
|
| 585 | 585 | } |
| 586 | 586 | public function countAllDates($stats_airline = '',$filter_name = '') { |
| 587 | 587 | global $globalStatsFilters; |
| 588 | 588 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 589 | 589 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 590 | 590 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
| 591 | - try { |
|
| 592 | - $sth = $this->db->prepare($query); |
|
| 593 | - $sth->execute($query_data); |
|
| 594 | - } catch(PDOException $e) { |
|
| 595 | - echo "error : ".$e->getMessage(); |
|
| 596 | - } |
|
| 597 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 598 | - if (empty($all)) { |
|
| 591 | + try { |
|
| 592 | + $sth = $this->db->prepare($query); |
|
| 593 | + $sth->execute($query_data); |
|
| 594 | + } catch(PDOException $e) { |
|
| 595 | + echo "error : ".$e->getMessage(); |
|
| 596 | + } |
|
| 597 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 598 | + if (empty($all)) { |
|
| 599 | 599 | $filters = array('airlines' => array($stats_airline)); |
| 600 | 600 | if ($filter_name != '') { |
| 601 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 601 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 602 | 602 | } |
| 603 | - $Spotter = new Spotter($this->db); |
|
| 604 | - $all = $Spotter->countAllDates($filters); |
|
| 605 | - } |
|
| 606 | - return $all; |
|
| 603 | + $Spotter = new Spotter($this->db); |
|
| 604 | + $all = $Spotter->countAllDates($filters); |
|
| 605 | + } |
|
| 606 | + return $all; |
|
| 607 | 607 | } |
| 608 | 608 | public function countAllDatesByAirlines($filter_name = '') { |
| 609 | 609 | global $globalStatsFilters; |
| 610 | 610 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 611 | 611 | $query = "SELECT stats_airline as airline_icao, flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND filter_name = :filter_name"; |
| 612 | 612 | $query_data = array('filter_name' => $filter_name); |
| 613 | - try { |
|
| 614 | - $sth = $this->db->prepare($query); |
|
| 615 | - $sth->execute($query_data); |
|
| 616 | - } catch(PDOException $e) { |
|
| 617 | - echo "error : ".$e->getMessage(); |
|
| 618 | - } |
|
| 619 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 620 | - if (empty($all)) { |
|
| 621 | - $filters = array(); |
|
| 622 | - if ($filter_name != '') { |
|
| 623 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 613 | + try { |
|
| 614 | + $sth = $this->db->prepare($query); |
|
| 615 | + $sth->execute($query_data); |
|
| 616 | + } catch(PDOException $e) { |
|
| 617 | + echo "error : ".$e->getMessage(); |
|
| 618 | + } |
|
| 619 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 620 | + if (empty($all)) { |
|
| 621 | + $filters = array(); |
|
| 622 | + if ($filter_name != '') { |
|
| 623 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 624 | 624 | } |
| 625 | - $Spotter = new Spotter($this->db); |
|
| 626 | - $all = $Spotter->countAllDatesByAirlines($filters); |
|
| 627 | - } |
|
| 628 | - return $all; |
|
| 625 | + $Spotter = new Spotter($this->db); |
|
| 626 | + $all = $Spotter->countAllDatesByAirlines($filters); |
|
| 627 | + } |
|
| 628 | + return $all; |
|
| 629 | 629 | } |
| 630 | 630 | public function countAllMonths($stats_airline = '',$filter_name = '') { |
| 631 | 631 | global $globalStatsFilters; |
| 632 | 632 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 633 | - $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
|
| 634 | - try { |
|
| 635 | - $sth = $this->db->prepare($query); |
|
| 636 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 637 | - } catch(PDOException $e) { |
|
| 638 | - echo "error : ".$e->getMessage(); |
|
| 639 | - } |
|
| 640 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 633 | + $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
|
| 634 | + try { |
|
| 635 | + $sth = $this->db->prepare($query); |
|
| 636 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 637 | + } catch(PDOException $e) { |
|
| 638 | + echo "error : ".$e->getMessage(); |
|
| 639 | + } |
|
| 640 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 641 | 641 | |
| 642 | - if (empty($all)) { |
|
| 642 | + if (empty($all)) { |
|
| 643 | 643 | $filters = array('airlines' => array($stats_airline)); |
| 644 | 644 | if ($filter_name != '') { |
| 645 | 645 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
| 646 | 646 | } |
| 647 | - $Spotter = new Spotter($this->db); |
|
| 648 | - $all = $Spotter->countAllMonths($filters); |
|
| 649 | - } |
|
| 647 | + $Spotter = new Spotter($this->db); |
|
| 648 | + $all = $Spotter->countAllMonths($filters); |
|
| 649 | + } |
|
| 650 | 650 | |
| 651 | - return $all; |
|
| 651 | + return $all; |
|
| 652 | 652 | } |
| 653 | 653 | public function countAllMilitaryMonths($filter_name = '') { |
| 654 | 654 | global $globalStatsFilters; |
| 655 | 655 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 656 | - $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name"; |
|
| 657 | - try { |
|
| 658 | - $sth = $this->db->prepare($query); |
|
| 659 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 660 | - } catch(PDOException $e) { |
|
| 661 | - echo "error : ".$e->getMessage(); |
|
| 662 | - } |
|
| 663 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 664 | - if (empty($all)) { |
|
| 665 | - $filters = array(); |
|
| 666 | - if ($filter_name != '') { |
|
| 667 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 656 | + $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name"; |
|
| 657 | + try { |
|
| 658 | + $sth = $this->db->prepare($query); |
|
| 659 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 660 | + } catch(PDOException $e) { |
|
| 661 | + echo "error : ".$e->getMessage(); |
|
| 662 | + } |
|
| 663 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 664 | + if (empty($all)) { |
|
| 665 | + $filters = array(); |
|
| 666 | + if ($filter_name != '') { |
|
| 667 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 668 | 668 | } |
| 669 | - $Spotter = new Spotter($this->db); |
|
| 670 | - $all = $Spotter->countAllMilitaryMonths($filters); |
|
| 671 | - } |
|
| 672 | - return $all; |
|
| 669 | + $Spotter = new Spotter($this->db); |
|
| 670 | + $all = $Spotter->countAllMilitaryMonths($filters); |
|
| 671 | + } |
|
| 672 | + return $all; |
|
| 673 | 673 | } |
| 674 | 674 | public function countAllHours($orderby = 'hour',$limit = true,$stats_airline = '',$filter_name = '') { |
| 675 | 675 | global $globalTimezone, $globalDBdriver, $globalStatsFilters; |
@@ -685,22 +685,22 @@ discard block |
||
| 685 | 685 | $query .= " ORDER BY CAST(flight_date AS integer) ASC"; |
| 686 | 686 | } |
| 687 | 687 | if ($orderby == 'count') $query .= " ORDER BY hour_count DESC"; |
| 688 | - try { |
|
| 689 | - $sth = $this->db->prepare($query); |
|
| 690 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 691 | - } catch(PDOException $e) { |
|
| 692 | - echo "error : ".$e->getMessage(); |
|
| 693 | - } |
|
| 694 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 695 | - if (empty($all)) { |
|
| 688 | + try { |
|
| 689 | + $sth = $this->db->prepare($query); |
|
| 690 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 691 | + } catch(PDOException $e) { |
|
| 692 | + echo "error : ".$e->getMessage(); |
|
| 693 | + } |
|
| 694 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 695 | + if (empty($all)) { |
|
| 696 | 696 | $filters = array('airlines' => array($stats_airline)); |
| 697 | 697 | if ($filter_name != '') { |
| 698 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 698 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 699 | 699 | } |
| 700 | - $Spotter = new Spotter($this->db); |
|
| 701 | - $all = $Spotter->countAllHours($orderby,$filters); |
|
| 702 | - } |
|
| 703 | - return $all; |
|
| 700 | + $Spotter = new Spotter($this->db); |
|
| 701 | + $all = $Spotter->countAllHours($orderby,$filters); |
|
| 702 | + } |
|
| 703 | + return $all; |
|
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | public function countOverallFlights($stats_airline = '', $filter_name = '',$year = '',$month = '') { |
@@ -724,9 +724,9 @@ discard block |
||
| 724 | 724 | if ($year == '') $year = date('Y'); |
| 725 | 725 | $all = $this->getSumStats('military_flights_bymonth',$year,'',$filter_name,$month); |
| 726 | 726 | if (empty($all)) { |
| 727 | - $filters = array(); |
|
| 728 | - if ($filter_name != '') { |
|
| 729 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 727 | + $filters = array(); |
|
| 728 | + if ($filter_name != '') { |
|
| 729 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 730 | 730 | } |
| 731 | 731 | $Spotter = new Spotter($this->db); |
| 732 | 732 | $all = $Spotter->countOverallMilitaryFlights($filters,$year,$month); |
@@ -787,9 +787,9 @@ discard block |
||
| 787 | 787 | $all = $result[0]['nb_airline']; |
| 788 | 788 | } else $all = $this->getSumStats('airlines_bymonth',$year,'',$filter_name,$month); |
| 789 | 789 | if (empty($all)) { |
| 790 | - $filters = array(); |
|
| 791 | - if ($filter_name != '') { |
|
| 792 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 790 | + $filters = array(); |
|
| 791 | + if ($filter_name != '') { |
|
| 792 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
| 793 | 793 | } |
| 794 | 794 | $Spotter = new Spotter($this->db); |
| 795 | 795 | $all = $Spotter->countOverallAirlines($filters,$year,$month); |
@@ -856,33 +856,33 @@ discard block |
||
| 856 | 856 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 857 | 857 | $query = "SELECT * FROM stats_airport WHERE stats_type = 'daily' AND airport_icao = :airport_icao AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY date"; |
| 858 | 858 | $query_values = array(':airport_icao' => $airport_icao,':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
| 859 | - try { |
|
| 860 | - $sth = $this->db->prepare($query); |
|
| 861 | - $sth->execute($query_values); |
|
| 862 | - } catch(PDOException $e) { |
|
| 863 | - echo "error : ".$e->getMessage(); |
|
| 864 | - } |
|
| 865 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 866 | - return $all; |
|
| 859 | + try { |
|
| 860 | + $sth = $this->db->prepare($query); |
|
| 861 | + $sth->execute($query_values); |
|
| 862 | + } catch(PDOException $e) { |
|
| 863 | + echo "error : ".$e->getMessage(); |
|
| 864 | + } |
|
| 865 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 866 | + return $all; |
|
| 867 | 867 | } |
| 868 | 868 | public function getStats($type,$stats_airline = '', $filter_name = '') { |
| 869 | 869 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 870 | - $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
| 871 | - $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 872 | - try { |
|
| 873 | - $sth = $this->db->prepare($query); |
|
| 874 | - $sth->execute($query_values); |
|
| 875 | - } catch(PDOException $e) { |
|
| 876 | - echo "error : ".$e->getMessage(); |
|
| 877 | - } |
|
| 878 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 879 | - return $all; |
|
| 880 | - } |
|
| 870 | + $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
| 871 | + $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 872 | + try { |
|
| 873 | + $sth = $this->db->prepare($query); |
|
| 874 | + $sth->execute($query_values); |
|
| 875 | + } catch(PDOException $e) { |
|
| 876 | + echo "error : ".$e->getMessage(); |
|
| 877 | + } |
|
| 878 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 879 | + return $all; |
|
| 880 | + } |
|
| 881 | 881 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
| 882 | 882 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 883 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 884 | - if ($globalDBdriver == 'mysql') { |
|
| 885 | - if ($month == '') { |
|
| 883 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 884 | + if ($globalDBdriver == 'mysql') { |
|
| 885 | + if ($month == '') { |
|
| 886 | 886 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND YEAR(stats_date) = :year AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 887 | 887 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
| 888 | 888 | } else { |
@@ -897,165 +897,165 @@ discard block |
||
| 897 | 897 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND EXTRACT(YEAR FROM stats_date) = :year AND EXTRACT(MONTH FROM stats_date) = :month AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 898 | 898 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name,':month' => $month); |
| 899 | 899 | } |
| 900 | - } |
|
| 901 | - try { |
|
| 902 | - $sth = $this->db->prepare($query); |
|
| 903 | - $sth->execute($query_values); |
|
| 904 | - } catch(PDOException $e) { |
|
| 905 | - echo "error : ".$e->getMessage(); |
|
| 906 | - } |
|
| 907 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 908 | - return $all[0]['total']; |
|
| 909 | - } |
|
| 900 | + } |
|
| 901 | + try { |
|
| 902 | + $sth = $this->db->prepare($query); |
|
| 903 | + $sth->execute($query_values); |
|
| 904 | + } catch(PDOException $e) { |
|
| 905 | + echo "error : ".$e->getMessage(); |
|
| 906 | + } |
|
| 907 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 908 | + return $all[0]['total']; |
|
| 909 | + } |
|
| 910 | 910 | public function getStatsTotal($type, $stats_airline = '', $filter_name = '') { |
| 911 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 911 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 912 | 912 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 913 | - if ($globalDBdriver == 'mysql') { |
|
| 913 | + if ($globalDBdriver == 'mysql') { |
|
| 914 | 914 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL ".$globalArchiveMonths." MONTH) AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 915 | 915 | } else { |
| 916 | 916 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalArchiveMonths." MONTHS' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 917 | - } |
|
| 918 | - $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
| 919 | - try { |
|
| 920 | - $sth = $this->db->prepare($query); |
|
| 921 | - $sth->execute($query_values); |
|
| 922 | - } catch(PDOException $e) { |
|
| 923 | - echo "error : ".$e->getMessage(); |
|
| 924 | - } |
|
| 925 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 926 | - return $all[0]['total']; |
|
| 927 | - } |
|
| 917 | + } |
|
| 918 | + $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
| 919 | + try { |
|
| 920 | + $sth = $this->db->prepare($query); |
|
| 921 | + $sth->execute($query_values); |
|
| 922 | + } catch(PDOException $e) { |
|
| 923 | + echo "error : ".$e->getMessage(); |
|
| 924 | + } |
|
| 925 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 926 | + return $all[0]['total']; |
|
| 927 | + } |
|
| 928 | 928 | public function getStatsAircraftTotal($stats_airline = '', $filter_name = '') { |
| 929 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 929 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 930 | 930 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 931 | - if ($globalDBdriver == 'mysql') { |
|
| 931 | + if ($globalDBdriver == 'mysql') { |
|
| 932 | 932 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 933 | - } else { |
|
| 933 | + } else { |
|
| 934 | 934 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
| 935 | - } |
|
| 936 | - try { |
|
| 937 | - $sth = $this->db->prepare($query); |
|
| 938 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 939 | - } catch(PDOException $e) { |
|
| 940 | - echo "error : ".$e->getMessage(); |
|
| 941 | - } |
|
| 942 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 943 | - return $all[0]['total']; |
|
| 944 | - } |
|
| 935 | + } |
|
| 936 | + try { |
|
| 937 | + $sth = $this->db->prepare($query); |
|
| 938 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
| 939 | + } catch(PDOException $e) { |
|
| 940 | + echo "error : ".$e->getMessage(); |
|
| 941 | + } |
|
| 942 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 943 | + return $all[0]['total']; |
|
| 944 | + } |
|
| 945 | 945 | public function getStatsAirlineTotal($filter_name = '') { |
| 946 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 946 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 947 | 947 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 948 | - if ($globalDBdriver == 'mysql') { |
|
| 948 | + if ($globalDBdriver == 'mysql') { |
|
| 949 | 949 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
| 950 | - } else { |
|
| 950 | + } else { |
|
| 951 | 951 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
| 952 | - } |
|
| 953 | - try { |
|
| 954 | - $sth = $this->db->prepare($query); |
|
| 955 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 956 | - } catch(PDOException $e) { |
|
| 957 | - echo "error : ".$e->getMessage(); |
|
| 958 | - } |
|
| 959 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 960 | - return $all[0]['total']; |
|
| 961 | - } |
|
| 952 | + } |
|
| 953 | + try { |
|
| 954 | + $sth = $this->db->prepare($query); |
|
| 955 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 956 | + } catch(PDOException $e) { |
|
| 957 | + echo "error : ".$e->getMessage(); |
|
| 958 | + } |
|
| 959 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 960 | + return $all[0]['total']; |
|
| 961 | + } |
|
| 962 | 962 | public function getStatsOwnerTotal($filter_name = '') { |
| 963 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 963 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 964 | 964 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 965 | - if ($globalDBdriver == 'mysql') { |
|
| 965 | + if ($globalDBdriver == 'mysql') { |
|
| 966 | 966 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
| 967 | 967 | } else { |
| 968 | 968 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
| 969 | - } |
|
| 970 | - try { |
|
| 971 | - $sth = $this->db->prepare($query); |
|
| 972 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 973 | - } catch(PDOException $e) { |
|
| 974 | - echo "error : ".$e->getMessage(); |
|
| 975 | - } |
|
| 976 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 977 | - return $all[0]['total']; |
|
| 978 | - } |
|
| 969 | + } |
|
| 970 | + try { |
|
| 971 | + $sth = $this->db->prepare($query); |
|
| 972 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 973 | + } catch(PDOException $e) { |
|
| 974 | + echo "error : ".$e->getMessage(); |
|
| 975 | + } |
|
| 976 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 977 | + return $all[0]['total']; |
|
| 978 | + } |
|
| 979 | 979 | public function getStatsOwner($owner_name,$filter_name = '') { |
| 980 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 980 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 981 | 981 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 982 | 982 | $query = "SELECT cnt FROM stats_owner WHERE filter_name = :filter_name AND owner_name = :owner_name"; |
| 983 | - try { |
|
| 984 | - $sth = $this->db->prepare($query); |
|
| 985 | - $sth->execute(array(':filter_name' => $filter_name,':owner_name' => $owner_name)); |
|
| 986 | - } catch(PDOException $e) { |
|
| 987 | - echo "error : ".$e->getMessage(); |
|
| 988 | - } |
|
| 989 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 990 | - if (isset($all[0]['cnt'])) return $all[0]['cnt']; |
|
| 991 | - else return 0; |
|
| 992 | - } |
|
| 983 | + try { |
|
| 984 | + $sth = $this->db->prepare($query); |
|
| 985 | + $sth->execute(array(':filter_name' => $filter_name,':owner_name' => $owner_name)); |
|
| 986 | + } catch(PDOException $e) { |
|
| 987 | + echo "error : ".$e->getMessage(); |
|
| 988 | + } |
|
| 989 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 990 | + if (isset($all[0]['cnt'])) return $all[0]['cnt']; |
|
| 991 | + else return 0; |
|
| 992 | + } |
|
| 993 | 993 | public function getStatsPilotTotal($filter_name = '') { |
| 994 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 994 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 995 | 995 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 996 | - if ($globalDBdriver == 'mysql') { |
|
| 997 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
| 998 | - } else { |
|
| 999 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
| 1000 | - } |
|
| 1001 | - try { |
|
| 1002 | - $sth = $this->db->prepare($query); |
|
| 1003 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
| 1004 | - } catch(PDOException $e) { |
|
| 1005 | - echo "error : ".$e->getMessage(); |
|
| 1006 | - } |
|
| 1007 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 1008 | - return $all[0]['total']; |
|
| 1009 | - } |
|
| 996 | + if ($globalDBdriver == 'mysql') { |
|
| 997 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
| 998 | + } else { |
|
| 999 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
| 1000 | + } |
|
| 1001 | + try { |
|
| 1002 | + $sth = $this->db->prepare($query); |
|
| 1003 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
| 1004 | + } catch(PDOException $e) { |
|
| 1005 | + echo "error : ".$e->getMessage(); |
|
| 1006 | + } |
|
| 1007 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 1008 | + return $all[0]['total']; |
|
| 1009 | + } |
|
| 1010 | 1010 | public function getStatsPilot($pilot,$filter_name = '') { |
| 1011 | - global $globalArchiveMonths, $globalDBdriver; |
|
| 1011 | + global $globalArchiveMonths, $globalDBdriver; |
|
| 1012 | 1012 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1013 | 1013 | $query = "SELECT cnt FROM stats_pilot WHERE filter_name = :filter_name AND (pilot_name = :pilot OR pilot_id = :pilot)"; |
| 1014 | - try { |
|
| 1015 | - $sth = $this->db->prepare($query); |
|
| 1016 | - $sth->execute(array(':filter_name' => $filter_name,':pilot' => $pilot)); |
|
| 1017 | - } catch(PDOException $e) { |
|
| 1018 | - echo "error : ".$e->getMessage(); |
|
| 1019 | - } |
|
| 1020 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 1021 | - if (isset($all[0]['cnt'])) return $all[0]['cnt']; |
|
| 1022 | - else return 0; |
|
| 1023 | - } |
|
| 1014 | + try { |
|
| 1015 | + $sth = $this->db->prepare($query); |
|
| 1016 | + $sth->execute(array(':filter_name' => $filter_name,':pilot' => $pilot)); |
|
| 1017 | + } catch(PDOException $e) { |
|
| 1018 | + echo "error : ".$e->getMessage(); |
|
| 1019 | + } |
|
| 1020 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 1021 | + if (isset($all[0]['cnt'])) return $all[0]['cnt']; |
|
| 1022 | + else return 0; |
|
| 1023 | + } |
|
| 1024 | 1024 | |
| 1025 | 1025 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
| 1026 | 1026 | global $globalDBdriver; |
| 1027 | 1027 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1028 | 1028 | if ($globalDBdriver == 'mysql') { |
| 1029 | 1029 | $query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = :cnt"; |
| 1030 | - } else { |
|
| 1030 | + } else { |
|
| 1031 | 1031 | $query = "UPDATE stats SET cnt = :cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
| 1032 | 1032 | } |
| 1033 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1034 | - try { |
|
| 1035 | - $sth = $this->db->prepare($query); |
|
| 1036 | - $sth->execute($query_values); |
|
| 1037 | - } catch(PDOException $e) { |
|
| 1038 | - return "error : ".$e->getMessage(); |
|
| 1039 | - } |
|
| 1040 | - } |
|
| 1033 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1034 | + try { |
|
| 1035 | + $sth = $this->db->prepare($query); |
|
| 1036 | + $sth->execute($query_values); |
|
| 1037 | + } catch(PDOException $e) { |
|
| 1038 | + return "error : ".$e->getMessage(); |
|
| 1039 | + } |
|
| 1040 | + } |
|
| 1041 | 1041 | public function updateStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
| 1042 | 1042 | global $globalDBdriver; |
| 1043 | 1043 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1044 | 1044 | if ($globalDBdriver == 'mysql') { |
| 1045 | 1045 | $query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
| 1046 | 1046 | } else { |
| 1047 | - //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
| 1047 | + //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
| 1048 | 1048 | $query = "UPDATE stats SET cnt = cnt+:cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
| 1049 | - } |
|
| 1050 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1051 | - try { |
|
| 1052 | - $sth = $this->db->prepare($query); |
|
| 1053 | - $sth->execute($query_values); |
|
| 1054 | - } catch(PDOException $e) { |
|
| 1055 | - return "error : ".$e->getMessage(); |
|
| 1056 | - } |
|
| 1057 | - } |
|
| 1058 | - /* |
|
| 1049 | + } |
|
| 1050 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1051 | + try { |
|
| 1052 | + $sth = $this->db->prepare($query); |
|
| 1053 | + $sth->execute($query_values); |
|
| 1054 | + } catch(PDOException $e) { |
|
| 1055 | + return "error : ".$e->getMessage(); |
|
| 1056 | + } |
|
| 1057 | + } |
|
| 1058 | + /* |
|
| 1059 | 1059 | public function getStatsSource($date,$stats_type = '') { |
| 1060 | 1060 | if ($stats_type == '') { |
| 1061 | 1061 | $query = "SELECT * FROM stats_source WHERE stats_date = :date ORDER BY source_name"; |
@@ -1124,25 +1124,25 @@ discard block |
||
| 1124 | 1124 | $query = "INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) VALUES (:data,:source_name,:stats_type,:stats_date) ON DUPLICATE KEY UPDATE source_data = :data"; |
| 1125 | 1125 | } else { |
| 1126 | 1126 | $query = "UPDATE stats_source SET source_data = :data WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type; INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) SELECT :data,:source_name,:stats_type,:stats_date WHERE NOT EXISTS (SELECT 1 FROM stats_source WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type);"; |
| 1127 | - } |
|
| 1128 | - $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
| 1129 | - try { |
|
| 1130 | - $sth = $this->db->prepare($query); |
|
| 1131 | - $sth->execute($query_values); |
|
| 1132 | - } catch(PDOException $e) { |
|
| 1133 | - return "error : ".$e->getMessage(); |
|
| 1134 | - } |
|
| 1135 | - } |
|
| 1136 | - public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
| 1137 | - $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
| 1138 | - $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1139 | - try { |
|
| 1140 | - $sth = $this->db->prepare($query); |
|
| 1141 | - $sth->execute($query_values); |
|
| 1142 | - } catch(PDOException $e) { |
|
| 1143 | - return "error : ".$e->getMessage(); |
|
| 1144 | - } |
|
| 1145 | - } |
|
| 1127 | + } |
|
| 1128 | + $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
| 1129 | + try { |
|
| 1130 | + $sth = $this->db->prepare($query); |
|
| 1131 | + $sth->execute($query_values); |
|
| 1132 | + } catch(PDOException $e) { |
|
| 1133 | + return "error : ".$e->getMessage(); |
|
| 1134 | + } |
|
| 1135 | + } |
|
| 1136 | + public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
| 1137 | + $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
| 1138 | + $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1139 | + try { |
|
| 1140 | + $sth = $this->db->prepare($query); |
|
| 1141 | + $sth->execute($query_values); |
|
| 1142 | + } catch(PDOException $e) { |
|
| 1143 | + return "error : ".$e->getMessage(); |
|
| 1144 | + } |
|
| 1145 | + } |
|
| 1146 | 1146 | public function addStatAircraftRegistration($registration,$cnt,$aircraft_icao = '',$airline_icao = '',$filter_name = '',$reset = false) { |
| 1147 | 1147 | global $globalDBdriver; |
| 1148 | 1148 | if ($globalDBdriver == 'mysql') { |
@@ -1158,14 +1158,14 @@ discard block |
||
| 1158 | 1158 | $query = "UPDATE stats_registration SET cnt = cnt+:cnt WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_registration (aircraft_icao,registration,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:registration,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_registration WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
| 1159 | 1159 | } |
| 1160 | 1160 | } |
| 1161 | - $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
| 1162 | - try { |
|
| 1163 | - $sth = $this->db->prepare($query); |
|
| 1164 | - $sth->execute($query_values); |
|
| 1165 | - } catch(PDOException $e) { |
|
| 1166 | - return "error : ".$e->getMessage(); |
|
| 1167 | - } |
|
| 1168 | - } |
|
| 1161 | + $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
| 1162 | + try { |
|
| 1163 | + $sth = $this->db->prepare($query); |
|
| 1164 | + $sth->execute($query_values); |
|
| 1165 | + } catch(PDOException $e) { |
|
| 1166 | + return "error : ".$e->getMessage(); |
|
| 1167 | + } |
|
| 1168 | + } |
|
| 1169 | 1169 | public function addStatCallsign($callsign_icao,$cnt,$airline_icao = '', $filter_name = '', $reset = false) { |
| 1170 | 1170 | global $globalDBdriver; |
| 1171 | 1171 | if ($globalDBdriver == 'mysql') { |
@@ -1181,14 +1181,14 @@ discard block |
||
| 1181 | 1181 | $query = "UPDATE stats_callsign SET cnt = cnt+:cnt WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name; INSERT INTO stats_callsign (callsign_icao,airline_icao,cnt,filter_name) SELECT :callsign_icao,:airline_icao,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_callsign WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name);"; |
| 1182 | 1182 | } |
| 1183 | 1183 | } |
| 1184 | - $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
| 1185 | - try { |
|
| 1186 | - $sth = $this->db->prepare($query); |
|
| 1187 | - $sth->execute($query_values); |
|
| 1188 | - } catch(PDOException $e) { |
|
| 1189 | - return "error : ".$e->getMessage(); |
|
| 1190 | - } |
|
| 1191 | - } |
|
| 1184 | + $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
| 1185 | + try { |
|
| 1186 | + $sth = $this->db->prepare($query); |
|
| 1187 | + $sth->execute($query_values); |
|
| 1188 | + } catch(PDOException $e) { |
|
| 1189 | + return "error : ".$e->getMessage(); |
|
| 1190 | + } |
|
| 1191 | + } |
|
| 1192 | 1192 | public function addStatCountry($iso2,$iso3,$name,$cnt,$airline_icao = '',$filter_name = '',$reset = false) { |
| 1193 | 1193 | global $globalDBdriver; |
| 1194 | 1194 | if ($globalDBdriver == 'mysql') { |
@@ -1204,14 +1204,14 @@ discard block |
||
| 1204 | 1204 | $query = "UPDATE stats_country SET cnt = cnt+:cnt WHERE iso2 = :iso2 AND filter_name = :filter_name AND stats_airline = :airline; INSERT INTO stats_country (iso2,iso3,name,cnt,stats_airline,filter_name) SELECT :iso2,:iso3,:name,:cnt,:airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_country WHERE iso2 = :iso2 AND filter_name = :filter_name AND stats_airline = :airline);"; |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| 1207 | - $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name,':airline' => $airline_icao); |
|
| 1208 | - try { |
|
| 1209 | - $sth = $this->db->prepare($query); |
|
| 1210 | - $sth->execute($query_values); |
|
| 1211 | - } catch(PDOException $e) { |
|
| 1212 | - return "error : ".$e->getMessage(); |
|
| 1213 | - } |
|
| 1214 | - } |
|
| 1207 | + $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name,':airline' => $airline_icao); |
|
| 1208 | + try { |
|
| 1209 | + $sth = $this->db->prepare($query); |
|
| 1210 | + $sth->execute($query_values); |
|
| 1211 | + } catch(PDOException $e) { |
|
| 1212 | + return "error : ".$e->getMessage(); |
|
| 1213 | + } |
|
| 1214 | + } |
|
| 1215 | 1215 | public function addStatAircraft($aircraft_icao,$cnt,$aircraft_name = '',$aircraft_manufacturer = '', $airline_icao = '', $filter_name = '', $reset = false) { |
| 1216 | 1216 | global $globalDBdriver; |
| 1217 | 1217 | if ($globalDBdriver == 'mysql') { |
@@ -1227,14 +1227,14 @@ discard block |
||
| 1227 | 1227 | $query = "UPDATE stats_aircraft SET cnt = cnt+:cnt, aircraft_name = :aircraft_name, aircraft_manufacturer = :aircraft_manufacturer, filter_name = :filter_name WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_aircraft (aircraft_icao,aircraft_name,aircraft_manufacturer,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:aircraft_name,:aircraft_manufacturer,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_aircraft WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
| 1228 | 1228 | } |
| 1229 | 1229 | } |
| 1230 | - $query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
| 1231 | - try { |
|
| 1232 | - $sth = $this->db->prepare($query); |
|
| 1233 | - $sth->execute($query_values); |
|
| 1234 | - } catch(PDOException $e) { |
|
| 1235 | - return "error : ".$e->getMessage(); |
|
| 1236 | - } |
|
| 1237 | - } |
|
| 1230 | + $query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
| 1231 | + try { |
|
| 1232 | + $sth = $this->db->prepare($query); |
|
| 1233 | + $sth->execute($query_values); |
|
| 1234 | + } catch(PDOException $e) { |
|
| 1235 | + return "error : ".$e->getMessage(); |
|
| 1236 | + } |
|
| 1237 | + } |
|
| 1238 | 1238 | public function addStatAirline($airline_icao,$cnt,$airline_name = '',$filter_name = '', $reset = false) { |
| 1239 | 1239 | global $globalDBdriver; |
| 1240 | 1240 | if ($globalDBdriver == 'mysql') { |
@@ -1250,14 +1250,14 @@ discard block |
||
| 1250 | 1250 | $query = "UPDATE stats_airline SET cnt = cnt+:cnt WHERE airline_icao = :airline_icao AND filter_name = :filter_name; INSERT INTO stats_airline (airline_icao,airline_name,cnt,filter_name) SELECT :airline_icao,:airline_name,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airline WHERE airline_icao = :airline_icao AND filter_name = :filter_name);"; |
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | - $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
| 1254 | - try { |
|
| 1255 | - $sth = $this->db->prepare($query); |
|
| 1256 | - $sth->execute($query_values); |
|
| 1257 | - } catch(PDOException $e) { |
|
| 1258 | - return "error : ".$e->getMessage(); |
|
| 1259 | - } |
|
| 1260 | - } |
|
| 1253 | + $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
| 1254 | + try { |
|
| 1255 | + $sth = $this->db->prepare($query); |
|
| 1256 | + $sth->execute($query_values); |
|
| 1257 | + } catch(PDOException $e) { |
|
| 1258 | + return "error : ".$e->getMessage(); |
|
| 1259 | + } |
|
| 1260 | + } |
|
| 1261 | 1261 | public function addStatOwner($owner_name,$cnt,$stats_airline = '', $filter_name = '', $reset = false) { |
| 1262 | 1262 | global $globalDBdriver; |
| 1263 | 1263 | if ($globalDBdriver == 'mysql') { |
@@ -1273,14 +1273,14 @@ discard block |
||
| 1273 | 1273 | $query = "UPDATE stats_owner SET cnt = cnt+:cnt WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_owner (owner_name,cnt,stats_airline,filter_name) SELECT :owner_name,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_owner WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
| 1274 | 1274 | } |
| 1275 | 1275 | } |
| 1276 | - $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1277 | - try { |
|
| 1278 | - $sth = $this->db->prepare($query); |
|
| 1279 | - $sth->execute($query_values); |
|
| 1280 | - } catch(PDOException $e) { |
|
| 1281 | - return "error : ".$e->getMessage(); |
|
| 1282 | - } |
|
| 1283 | - } |
|
| 1276 | + $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
| 1277 | + try { |
|
| 1278 | + $sth = $this->db->prepare($query); |
|
| 1279 | + $sth->execute($query_values); |
|
| 1280 | + } catch(PDOException $e) { |
|
| 1281 | + return "error : ".$e->getMessage(); |
|
| 1282 | + } |
|
| 1283 | + } |
|
| 1284 | 1284 | public function addStatPilot($pilot_id,$cnt,$pilot_name,$stats_airline = '',$filter_name = '',$format_source = '',$reset = false) { |
| 1285 | 1285 | global $globalDBdriver; |
| 1286 | 1286 | if ($globalDBdriver == 'mysql') { |
@@ -1296,14 +1296,14 @@ discard block |
||
| 1296 | 1296 | $query = "UPDATE stats_pilot SET cnt = cnt+:cnt, pilot_name = :pilot_name WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source; INSERT INTO stats_pilot (pilot_id,cnt,pilot_name,stats_airline,filter_name,format_source) SELECT :pilot_id,:cnt,:pilot_name,:stats_airline,:filter_name,:format_source WHERE NOT EXISTS (SELECT 1 FROM stats_pilot WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source);"; |
| 1297 | 1297 | } |
| 1298 | 1298 | } |
| 1299 | - $query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source); |
|
| 1300 | - try { |
|
| 1301 | - $sth = $this->db->prepare($query); |
|
| 1302 | - $sth->execute($query_values); |
|
| 1303 | - } catch(PDOException $e) { |
|
| 1304 | - return "error : ".$e->getMessage(); |
|
| 1305 | - } |
|
| 1306 | - } |
|
| 1299 | + $query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source); |
|
| 1300 | + try { |
|
| 1301 | + $sth = $this->db->prepare($query); |
|
| 1302 | + $sth->execute($query_values); |
|
| 1303 | + } catch(PDOException $e) { |
|
| 1304 | + return "error : ".$e->getMessage(); |
|
| 1305 | + } |
|
| 1306 | + } |
|
| 1307 | 1307 | public function addStatDepartureAirports($airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '',$reset = false) { |
| 1308 | 1308 | global $globalDBdriver; |
| 1309 | 1309 | if ($airport_icao != '') { |
@@ -1327,8 +1327,8 @@ discard block |
||
| 1327 | 1327 | } catch(PDOException $e) { |
| 1328 | 1328 | return "error : ".$e->getMessage(); |
| 1329 | 1329 | } |
| 1330 | - } |
|
| 1331 | - } |
|
| 1330 | + } |
|
| 1331 | + } |
|
| 1332 | 1332 | public function addStatDepartureAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '') { |
| 1333 | 1333 | global $globalDBdriver; |
| 1334 | 1334 | if ($airport_icao != '') { |
@@ -1344,8 +1344,8 @@ discard block |
||
| 1344 | 1344 | } catch(PDOException $e) { |
| 1345 | 1345 | return "error : ".$e->getMessage(); |
| 1346 | 1346 | } |
| 1347 | - } |
|
| 1348 | - } |
|
| 1347 | + } |
|
| 1348 | + } |
|
| 1349 | 1349 | public function addStatArrivalAirports($airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '',$reset = false) { |
| 1350 | 1350 | global $globalDBdriver; |
| 1351 | 1351 | if ($airport_icao != '') { |
@@ -1362,15 +1362,15 @@ discard block |
||
| 1362 | 1362 | $query = "UPDATE stats_airport SET arrival = arrival+:arrival WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name; INSERT INTO stats_airport (airport_icao,airport_name,airport_city,airport_country,arrival,stats_type,date,stats_airline,filter_name) SELECT :airport_icao,:airport_name,:airport_city,:airport_country,:arrival,'yearly',:date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airport WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name);"; |
| 1363 | 1363 | } |
| 1364 | 1364 | } |
| 1365 | - $query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name); |
|
| 1365 | + $query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name); |
|
| 1366 | 1366 | try { |
| 1367 | - $sth = $this->db->prepare($query); |
|
| 1368 | - $sth->execute($query_values); |
|
| 1369 | - } catch(PDOException $e) { |
|
| 1370 | - return "error : ".$e->getMessage(); |
|
| 1371 | - } |
|
| 1372 | - } |
|
| 1373 | - } |
|
| 1367 | + $sth = $this->db->prepare($query); |
|
| 1368 | + $sth->execute($query_values); |
|
| 1369 | + } catch(PDOException $e) { |
|
| 1370 | + return "error : ".$e->getMessage(); |
|
| 1371 | + } |
|
| 1372 | + } |
|
| 1373 | + } |
|
| 1374 | 1374 | public function addStatArrivalAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '') { |
| 1375 | 1375 | global $globalDBdriver; |
| 1376 | 1376 | if ($airport_icao != '') { |
@@ -1386,46 +1386,46 @@ discard block |
||
| 1386 | 1386 | } catch(PDOException $e) { |
| 1387 | 1387 | return "error : ".$e->getMessage(); |
| 1388 | 1388 | } |
| 1389 | - } |
|
| 1390 | - } |
|
| 1389 | + } |
|
| 1390 | + } |
|
| 1391 | 1391 | |
| 1392 | 1392 | public function deleteStat($id) { |
| 1393 | - $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
| 1394 | - $query_values = array(':id' => $id); |
|
| 1395 | - try { |
|
| 1396 | - $sth = $this->db->prepare($query); |
|
| 1397 | - $sth->execute($query_values); |
|
| 1398 | - } catch(PDOException $e) { |
|
| 1399 | - return "error : ".$e->getMessage(); |
|
| 1400 | - } |
|
| 1401 | - } |
|
| 1393 | + $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
| 1394 | + $query_values = array(':id' => $id); |
|
| 1395 | + try { |
|
| 1396 | + $sth = $this->db->prepare($query); |
|
| 1397 | + $sth->execute($query_values); |
|
| 1398 | + } catch(PDOException $e) { |
|
| 1399 | + return "error : ".$e->getMessage(); |
|
| 1400 | + } |
|
| 1401 | + } |
|
| 1402 | 1402 | public function deleteStatFlight($type) { |
| 1403 | - $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
| 1404 | - $query_values = array(':type' => $type); |
|
| 1405 | - try { |
|
| 1406 | - $sth = $this->db->prepare($query); |
|
| 1407 | - $sth->execute($query_values); |
|
| 1408 | - } catch(PDOException $e) { |
|
| 1409 | - return "error : ".$e->getMessage(); |
|
| 1410 | - } |
|
| 1411 | - } |
|
| 1403 | + $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
| 1404 | + $query_values = array(':type' => $type); |
|
| 1405 | + try { |
|
| 1406 | + $sth = $this->db->prepare($query); |
|
| 1407 | + $sth->execute($query_values); |
|
| 1408 | + } catch(PDOException $e) { |
|
| 1409 | + return "error : ".$e->getMessage(); |
|
| 1410 | + } |
|
| 1411 | + } |
|
| 1412 | 1412 | public function deleteStatAirport($type) { |
| 1413 | - $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
| 1414 | - $query_values = array(':type' => $type); |
|
| 1415 | - try { |
|
| 1416 | - $sth = $this->db->prepare($query); |
|
| 1417 | - $sth->execute($query_values); |
|
| 1418 | - } catch(PDOException $e) { |
|
| 1419 | - return "error : ".$e->getMessage(); |
|
| 1420 | - } |
|
| 1421 | - } |
|
| 1413 | + $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
| 1414 | + $query_values = array(':type' => $type); |
|
| 1415 | + try { |
|
| 1416 | + $sth = $this->db->prepare($query); |
|
| 1417 | + $sth->execute($query_values); |
|
| 1418 | + } catch(PDOException $e) { |
|
| 1419 | + return "error : ".$e->getMessage(); |
|
| 1420 | + } |
|
| 1421 | + } |
|
| 1422 | 1422 | |
| 1423 | - public function addOldStats() { |
|
| 1424 | - global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
| 1425 | - $Common = new Common(); |
|
| 1426 | - $Connection = new Connection(); |
|
| 1427 | - date_default_timezone_set('UTC'); |
|
| 1428 | - $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
| 1423 | + public function addOldStats() { |
|
| 1424 | + global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
| 1425 | + $Common = new Common(); |
|
| 1426 | + $Connection = new Connection(); |
|
| 1427 | + date_default_timezone_set('UTC'); |
|
| 1428 | + $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
| 1429 | 1429 | if ($globalDebug) echo 'Update stats !'."\n"; |
| 1430 | 1430 | if (isset($last_update[0]['value'])) { |
| 1431 | 1431 | $last_update_day = $last_update[0]['value']; |
@@ -1471,24 +1471,24 @@ discard block |
||
| 1471 | 1471 | if ($globalDebug) echo 'Count all departure airports...'."\n"; |
| 1472 | 1472 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day); |
| 1473 | 1473 | if ($globalDebug) echo 'Count all detected departure airports...'."\n"; |
| 1474 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
| 1474 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
| 1475 | 1475 | if ($globalDebug) echo 'Order departure airports...'."\n"; |
| 1476 | - $alldata = array(); |
|
| 1476 | + $alldata = array(); |
|
| 1477 | 1477 | |
| 1478 | - foreach ($pall as $value) { |
|
| 1479 | - $icao = $value['airport_departure_icao']; |
|
| 1480 | - $alldata[$icao] = $value; |
|
| 1481 | - } |
|
| 1482 | - foreach ($dall as $value) { |
|
| 1483 | - $icao = $value['airport_departure_icao']; |
|
| 1484 | - if (isset($alldata[$icao])) { |
|
| 1485 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1486 | - } else $alldata[$icao] = $value; |
|
| 1487 | - } |
|
| 1488 | - $count = array(); |
|
| 1489 | - foreach ($alldata as $key => $row) { |
|
| 1490 | - $count[$key] = $row['airport_departure_icao_count']; |
|
| 1491 | - } |
|
| 1478 | + foreach ($pall as $value) { |
|
| 1479 | + $icao = $value['airport_departure_icao']; |
|
| 1480 | + $alldata[$icao] = $value; |
|
| 1481 | + } |
|
| 1482 | + foreach ($dall as $value) { |
|
| 1483 | + $icao = $value['airport_departure_icao']; |
|
| 1484 | + if (isset($alldata[$icao])) { |
|
| 1485 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1486 | + } else $alldata[$icao] = $value; |
|
| 1487 | + } |
|
| 1488 | + $count = array(); |
|
| 1489 | + foreach ($alldata as $key => $row) { |
|
| 1490 | + $count[$key] = $row['airport_departure_icao_count']; |
|
| 1491 | + } |
|
| 1492 | 1492 | array_multisort($count,SORT_DESC,$alldata); |
| 1493 | 1493 | foreach ($alldata as $number) { |
| 1494 | 1494 | echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'','',$reset); |
@@ -1496,25 +1496,25 @@ discard block |
||
| 1496 | 1496 | if ($globalDebug) echo 'Count all arrival airports...'."\n"; |
| 1497 | 1497 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day); |
| 1498 | 1498 | if ($globalDebug) echo 'Count all detected arrival airports...'."\n"; |
| 1499 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
| 1499 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
| 1500 | 1500 | if ($globalDebug) echo 'Order arrival airports...'."\n"; |
| 1501 | - $alldata = array(); |
|
| 1502 | - foreach ($pall as $value) { |
|
| 1503 | - $icao = $value['airport_arrival_icao']; |
|
| 1504 | - $alldata[$icao] = $value; |
|
| 1505 | - } |
|
| 1506 | - foreach ($dall as $value) { |
|
| 1507 | - $icao = $value['airport_arrival_icao']; |
|
| 1508 | - if (isset($alldata[$icao])) { |
|
| 1509 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1510 | - } else $alldata[$icao] = $value; |
|
| 1511 | - } |
|
| 1512 | - $count = array(); |
|
| 1513 | - foreach ($alldata as $key => $row) { |
|
| 1514 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
| 1515 | - } |
|
| 1516 | - array_multisort($count,SORT_DESC,$alldata); |
|
| 1517 | - foreach ($alldata as $number) { |
|
| 1501 | + $alldata = array(); |
|
| 1502 | + foreach ($pall as $value) { |
|
| 1503 | + $icao = $value['airport_arrival_icao']; |
|
| 1504 | + $alldata[$icao] = $value; |
|
| 1505 | + } |
|
| 1506 | + foreach ($dall as $value) { |
|
| 1507 | + $icao = $value['airport_arrival_icao']; |
|
| 1508 | + if (isset($alldata[$icao])) { |
|
| 1509 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1510 | + } else $alldata[$icao] = $value; |
|
| 1511 | + } |
|
| 1512 | + $count = array(); |
|
| 1513 | + foreach ($alldata as $key => $row) { |
|
| 1514 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
| 1515 | + } |
|
| 1516 | + array_multisort($count,SORT_DESC,$alldata); |
|
| 1517 | + foreach ($alldata as $number) { |
|
| 1518 | 1518 | echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'','',$reset); |
| 1519 | 1519 | } |
| 1520 | 1520 | if ($Connection->tableExists('countries')) { |
@@ -1574,8 +1574,8 @@ discard block |
||
| 1574 | 1574 | // $pall = $Spotter->getLast7DaysAirportsDeparture(); |
| 1575 | 1575 | // $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
| 1576 | 1576 | $pall = $Spotter->getLast7DaysAirportsDeparture(); |
| 1577 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
| 1578 | - /* |
|
| 1577 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
| 1578 | + /* |
|
| 1579 | 1579 | $alldata = array(); |
| 1580 | 1580 | foreach ($pall as $value) { |
| 1581 | 1581 | $icao = $value['departure_airport_icao']; |
@@ -1594,29 +1594,29 @@ discard block |
||
| 1594 | 1594 | } |
| 1595 | 1595 | array_multisort($count,SORT_DESC,$alldata); |
| 1596 | 1596 | */ |
| 1597 | - foreach ($dall as $value) { |
|
| 1598 | - $icao = $value['departure_airport_icao']; |
|
| 1599 | - $ddate = $value['date']; |
|
| 1600 | - $find = false; |
|
| 1601 | - foreach ($pall as $pvalue) { |
|
| 1602 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1603 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1604 | - $find = true; |
|
| 1605 | - break; |
|
| 1606 | - } |
|
| 1607 | - } |
|
| 1608 | - if ($find === false) { |
|
| 1609 | - $pall[] = $value; |
|
| 1610 | - } |
|
| 1611 | - } |
|
| 1612 | - $alldata = $pall; |
|
| 1597 | + foreach ($dall as $value) { |
|
| 1598 | + $icao = $value['departure_airport_icao']; |
|
| 1599 | + $ddate = $value['date']; |
|
| 1600 | + $find = false; |
|
| 1601 | + foreach ($pall as $pvalue) { |
|
| 1602 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1603 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1604 | + $find = true; |
|
| 1605 | + break; |
|
| 1606 | + } |
|
| 1607 | + } |
|
| 1608 | + if ($find === false) { |
|
| 1609 | + $pall[] = $value; |
|
| 1610 | + } |
|
| 1611 | + } |
|
| 1612 | + $alldata = $pall; |
|
| 1613 | 1613 | foreach ($alldata as $number) { |
| 1614 | 1614 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count']); |
| 1615 | 1615 | } |
| 1616 | 1616 | echo '...Arrival'."\n"; |
| 1617 | 1617 | $pall = $Spotter->getLast7DaysAirportsArrival(); |
| 1618 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
| 1619 | - /* |
|
| 1618 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
| 1619 | + /* |
|
| 1620 | 1620 | $alldata = array(); |
| 1621 | 1621 | foreach ($pall as $value) { |
| 1622 | 1622 | $icao = $value['arrival_airport_icao']; |
@@ -1636,22 +1636,22 @@ discard block |
||
| 1636 | 1636 | */ |
| 1637 | 1637 | |
| 1638 | 1638 | |
| 1639 | - foreach ($dall as $value) { |
|
| 1640 | - $icao = $value['arrival_airport_icao']; |
|
| 1641 | - $ddate = $value['date']; |
|
| 1642 | - $find = false; |
|
| 1643 | - foreach ($pall as $pvalue) { |
|
| 1644 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1645 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 1646 | - $find = true; |
|
| 1647 | - break; |
|
| 1648 | - } |
|
| 1649 | - } |
|
| 1650 | - if ($find === false) { |
|
| 1651 | - $pall[] = $value; |
|
| 1652 | - } |
|
| 1653 | - } |
|
| 1654 | - $alldata = $pall; |
|
| 1639 | + foreach ($dall as $value) { |
|
| 1640 | + $icao = $value['arrival_airport_icao']; |
|
| 1641 | + $ddate = $value['date']; |
|
| 1642 | + $find = false; |
|
| 1643 | + foreach ($pall as $pvalue) { |
|
| 1644 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1645 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 1646 | + $find = true; |
|
| 1647 | + break; |
|
| 1648 | + } |
|
| 1649 | + } |
|
| 1650 | + if ($find === false) { |
|
| 1651 | + $pall[] = $value; |
|
| 1652 | + } |
|
| 1653 | + } |
|
| 1654 | + $alldata = $pall; |
|
| 1655 | 1655 | foreach ($alldata as $number) { |
| 1656 | 1656 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count']); |
| 1657 | 1657 | } |
@@ -1726,51 +1726,51 @@ discard block |
||
| 1726 | 1726 | if ($globalDebug) echo 'Count all departure airports by airlines...'."\n"; |
| 1727 | 1727 | $pall = $Spotter->countAllDepartureAirportsByAirlines(false,0,$last_update_day); |
| 1728 | 1728 | if ($globalDebug) echo 'Count all detected departure airports by airlines...'."\n"; |
| 1729 | - $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
| 1729 | + $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
| 1730 | 1730 | if ($globalDebug) echo 'Order detected departure airports by airlines...'."\n"; |
| 1731 | - //$alldata = array(); |
|
| 1732 | - foreach ($dall as $value) { |
|
| 1733 | - $icao = $value['airport_departure_icao']; |
|
| 1734 | - $dicao = $value['airline_icao']; |
|
| 1735 | - $find = false; |
|
| 1736 | - foreach ($pall as $pvalue) { |
|
| 1737 | - if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
| 1738 | - $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1739 | - $find = true; |
|
| 1740 | - break; |
|
| 1741 | - } |
|
| 1742 | - } |
|
| 1743 | - if ($find === false) { |
|
| 1744 | - $pall[] = $value; |
|
| 1745 | - } |
|
| 1746 | - } |
|
| 1747 | - $alldata = $pall; |
|
| 1731 | + //$alldata = array(); |
|
| 1732 | + foreach ($dall as $value) { |
|
| 1733 | + $icao = $value['airport_departure_icao']; |
|
| 1734 | + $dicao = $value['airline_icao']; |
|
| 1735 | + $find = false; |
|
| 1736 | + foreach ($pall as $pvalue) { |
|
| 1737 | + if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
| 1738 | + $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1739 | + $find = true; |
|
| 1740 | + break; |
|
| 1741 | + } |
|
| 1742 | + } |
|
| 1743 | + if ($find === false) { |
|
| 1744 | + $pall[] = $value; |
|
| 1745 | + } |
|
| 1746 | + } |
|
| 1747 | + $alldata = $pall; |
|
| 1748 | 1748 | foreach ($alldata as $number) { |
| 1749 | 1749 | echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],$number['airline_icao'],'',$reset); |
| 1750 | 1750 | } |
| 1751 | 1751 | if ($globalDebug) echo 'Count all arrival airports by airlines...'."\n"; |
| 1752 | 1752 | $pall = $Spotter->countAllArrivalAirportsByAirlines(false,0,$last_update_day); |
| 1753 | 1753 | if ($globalDebug) echo 'Count all detected arrival airports by airlines...'."\n"; |
| 1754 | - $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
| 1754 | + $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
| 1755 | 1755 | if ($globalDebug) echo 'Order arrival airports by airlines...'."\n"; |
| 1756 | - //$alldata = array(); |
|
| 1757 | - foreach ($dall as $value) { |
|
| 1758 | - $icao = $value['airport_arrival_icao']; |
|
| 1759 | - $dicao = $value['airline_icao']; |
|
| 1760 | - $find = false; |
|
| 1761 | - foreach ($pall as $pvalue) { |
|
| 1762 | - if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
| 1763 | - $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1764 | - $find = true; |
|
| 1765 | - break; |
|
| 1766 | - } |
|
| 1767 | - } |
|
| 1768 | - if ($find === false) { |
|
| 1769 | - $pall[] = $value; |
|
| 1770 | - } |
|
| 1771 | - } |
|
| 1772 | - $alldata = $pall; |
|
| 1773 | - foreach ($alldata as $number) { |
|
| 1756 | + //$alldata = array(); |
|
| 1757 | + foreach ($dall as $value) { |
|
| 1758 | + $icao = $value['airport_arrival_icao']; |
|
| 1759 | + $dicao = $value['airline_icao']; |
|
| 1760 | + $find = false; |
|
| 1761 | + foreach ($pall as $pvalue) { |
|
| 1762 | + if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
| 1763 | + $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1764 | + $find = true; |
|
| 1765 | + break; |
|
| 1766 | + } |
|
| 1767 | + } |
|
| 1768 | + if ($find === false) { |
|
| 1769 | + $pall[] = $value; |
|
| 1770 | + } |
|
| 1771 | + } |
|
| 1772 | + $alldata = $pall; |
|
| 1773 | + foreach ($alldata as $number) { |
|
| 1774 | 1774 | if ($number['airline_icao'] != '') echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],$number['airline_icao'],'',$reset); |
| 1775 | 1775 | } |
| 1776 | 1776 | if ($globalDebug) echo 'Count all flights by months by airlines...'."\n"; |
@@ -1803,47 +1803,47 @@ discard block |
||
| 1803 | 1803 | } |
| 1804 | 1804 | if ($globalDebug) echo '...Departure'."\n"; |
| 1805 | 1805 | $pall = $Spotter->getLast7DaysAirportsDepartureByAirlines(); |
| 1806 | - $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
| 1807 | - foreach ($dall as $value) { |
|
| 1808 | - $icao = $value['departure_airport_icao']; |
|
| 1809 | - $airline = $value['airline_icao']; |
|
| 1810 | - $ddate = $value['date']; |
|
| 1811 | - $find = false; |
|
| 1812 | - foreach ($pall as $pvalue) { |
|
| 1813 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
| 1814 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1815 | - $find = true; |
|
| 1816 | - break; |
|
| 1817 | - } |
|
| 1818 | - } |
|
| 1819 | - if ($find === false) { |
|
| 1820 | - $pall[] = $value; |
|
| 1821 | - } |
|
| 1822 | - } |
|
| 1823 | - $alldata = $pall; |
|
| 1806 | + $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
| 1807 | + foreach ($dall as $value) { |
|
| 1808 | + $icao = $value['departure_airport_icao']; |
|
| 1809 | + $airline = $value['airline_icao']; |
|
| 1810 | + $ddate = $value['date']; |
|
| 1811 | + $find = false; |
|
| 1812 | + foreach ($pall as $pvalue) { |
|
| 1813 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
| 1814 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1815 | + $find = true; |
|
| 1816 | + break; |
|
| 1817 | + } |
|
| 1818 | + } |
|
| 1819 | + if ($find === false) { |
|
| 1820 | + $pall[] = $value; |
|
| 1821 | + } |
|
| 1822 | + } |
|
| 1823 | + $alldata = $pall; |
|
| 1824 | 1824 | foreach ($alldata as $number) { |
| 1825 | 1825 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],$number['airline_icao']); |
| 1826 | 1826 | } |
| 1827 | 1827 | if ($globalDebug) echo '...Arrival'."\n"; |
| 1828 | 1828 | $pall = $Spotter->getLast7DaysAirportsArrivalByAirlines(); |
| 1829 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
| 1830 | - foreach ($dall as $value) { |
|
| 1831 | - $icao = $value['arrival_airport_icao']; |
|
| 1832 | - $airline = $value['airline_icao']; |
|
| 1833 | - $ddate = $value['date']; |
|
| 1834 | - $find = false; |
|
| 1835 | - foreach ($pall as $pvalue) { |
|
| 1836 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
| 1837 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 1838 | - $find = true; |
|
| 1839 | - break; |
|
| 1840 | - } |
|
| 1841 | - } |
|
| 1842 | - if ($find === false) { |
|
| 1843 | - $pall[] = $value; |
|
| 1844 | - } |
|
| 1845 | - } |
|
| 1846 | - $alldata = $pall; |
|
| 1829 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
| 1830 | + foreach ($dall as $value) { |
|
| 1831 | + $icao = $value['arrival_airport_icao']; |
|
| 1832 | + $airline = $value['airline_icao']; |
|
| 1833 | + $ddate = $value['date']; |
|
| 1834 | + $find = false; |
|
| 1835 | + foreach ($pall as $pvalue) { |
|
| 1836 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
| 1837 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 1838 | + $find = true; |
|
| 1839 | + break; |
|
| 1840 | + } |
|
| 1841 | + } |
|
| 1842 | + if ($find === false) { |
|
| 1843 | + $pall[] = $value; |
|
| 1844 | + } |
|
| 1845 | + } |
|
| 1846 | + $alldata = $pall; |
|
| 1847 | 1847 | foreach ($alldata as $number) { |
| 1848 | 1848 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],$number['airline_icao']); |
| 1849 | 1849 | } |
@@ -1914,44 +1914,44 @@ discard block |
||
| 1914 | 1914 | $this->addStatPilot($number['pilot_id'],$number['pilot_count'],$number['pilot_name'],'',$filter_name,$number['format_source'],$reset); |
| 1915 | 1915 | } |
| 1916 | 1916 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day,$filter); |
| 1917 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
| 1918 | - $alldata = array(); |
|
| 1919 | - foreach ($pall as $value) { |
|
| 1920 | - $icao = $value['airport_departure_icao']; |
|
| 1921 | - $alldata[$icao] = $value; |
|
| 1922 | - } |
|
| 1923 | - foreach ($dall as $value) { |
|
| 1924 | - $icao = $value['airport_departure_icao']; |
|
| 1925 | - if (isset($alldata[$icao])) { |
|
| 1926 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1927 | - } else $alldata[$icao] = $value; |
|
| 1928 | - } |
|
| 1929 | - $count = array(); |
|
| 1930 | - foreach ($alldata as $key => $row) { |
|
| 1931 | - $count[$key] = $row['airport_departure_icao_count']; |
|
| 1932 | - } |
|
| 1917 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
| 1918 | + $alldata = array(); |
|
| 1919 | + foreach ($pall as $value) { |
|
| 1920 | + $icao = $value['airport_departure_icao']; |
|
| 1921 | + $alldata[$icao] = $value; |
|
| 1922 | + } |
|
| 1923 | + foreach ($dall as $value) { |
|
| 1924 | + $icao = $value['airport_departure_icao']; |
|
| 1925 | + if (isset($alldata[$icao])) { |
|
| 1926 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
| 1927 | + } else $alldata[$icao] = $value; |
|
| 1928 | + } |
|
| 1929 | + $count = array(); |
|
| 1930 | + foreach ($alldata as $key => $row) { |
|
| 1931 | + $count[$key] = $row['airport_departure_icao_count']; |
|
| 1932 | + } |
|
| 1933 | 1933 | array_multisort($count,SORT_DESC,$alldata); |
| 1934 | 1934 | foreach ($alldata as $number) { |
| 1935 | - echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset); |
|
| 1935 | + echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset); |
|
| 1936 | 1936 | } |
| 1937 | 1937 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day,false,$filter); |
| 1938 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
| 1938 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
| 1939 | 1939 | $alldata = array(); |
| 1940 | - foreach ($pall as $value) { |
|
| 1941 | - $icao = $value['airport_arrival_icao']; |
|
| 1942 | - $alldata[$icao] = $value; |
|
| 1943 | - } |
|
| 1944 | - foreach ($dall as $value) { |
|
| 1945 | - $icao = $value['airport_arrival_icao']; |
|
| 1946 | - if (isset($alldata[$icao])) { |
|
| 1947 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1948 | - } else $alldata[$icao] = $value; |
|
| 1949 | - } |
|
| 1950 | - $count = array(); |
|
| 1951 | - foreach ($alldata as $key => $row) { |
|
| 1952 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
| 1953 | - } |
|
| 1954 | - array_multisort($count,SORT_DESC,$alldata); |
|
| 1940 | + foreach ($pall as $value) { |
|
| 1941 | + $icao = $value['airport_arrival_icao']; |
|
| 1942 | + $alldata[$icao] = $value; |
|
| 1943 | + } |
|
| 1944 | + foreach ($dall as $value) { |
|
| 1945 | + $icao = $value['airport_arrival_icao']; |
|
| 1946 | + if (isset($alldata[$icao])) { |
|
| 1947 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
| 1948 | + } else $alldata[$icao] = $value; |
|
| 1949 | + } |
|
| 1950 | + $count = array(); |
|
| 1951 | + foreach ($alldata as $key => $row) { |
|
| 1952 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
| 1953 | + } |
|
| 1954 | + array_multisort($count,SORT_DESC,$alldata); |
|
| 1955 | 1955 | foreach ($alldata as $number) { |
| 1956 | 1956 | echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'',$filter_name,$reset); |
| 1957 | 1957 | } |
@@ -1984,45 +1984,45 @@ discard block |
||
| 1984 | 1984 | } |
| 1985 | 1985 | echo '...Departure'."\n"; |
| 1986 | 1986 | $pall = $Spotter->getLast7DaysAirportsDeparture('',$filter); |
| 1987 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
| 1987 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
| 1988 | 1988 | foreach ($dall as $value) { |
| 1989 | - $icao = $value['departure_airport_icao']; |
|
| 1990 | - $ddate = $value['date']; |
|
| 1991 | - $find = false; |
|
| 1992 | - foreach ($pall as $pvalue) { |
|
| 1993 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1994 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1995 | - $find = true; |
|
| 1996 | - break; |
|
| 1997 | - } |
|
| 1998 | - } |
|
| 1999 | - if ($find === false) { |
|
| 2000 | - $pall[] = $value; |
|
| 2001 | - } |
|
| 2002 | - } |
|
| 2003 | - $alldata = $pall; |
|
| 1989 | + $icao = $value['departure_airport_icao']; |
|
| 1990 | + $ddate = $value['date']; |
|
| 1991 | + $find = false; |
|
| 1992 | + foreach ($pall as $pvalue) { |
|
| 1993 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 1994 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
| 1995 | + $find = true; |
|
| 1996 | + break; |
|
| 1997 | + } |
|
| 1998 | + } |
|
| 1999 | + if ($find === false) { |
|
| 2000 | + $pall[] = $value; |
|
| 2001 | + } |
|
| 2002 | + } |
|
| 2003 | + $alldata = $pall; |
|
| 2004 | 2004 | foreach ($alldata as $number) { |
| 2005 | 2005 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],'',$filter_name); |
| 2006 | 2006 | } |
| 2007 | 2007 | echo '...Arrival'."\n"; |
| 2008 | 2008 | $pall = $Spotter->getLast7DaysAirportsArrival('',$filter); |
| 2009 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
| 2009 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
| 2010 | 2010 | foreach ($dall as $value) { |
| 2011 | 2011 | $icao = $value['arrival_airport_icao']; |
| 2012 | 2012 | $ddate = $value['date']; |
| 2013 | - $find = false; |
|
| 2013 | + $find = false; |
|
| 2014 | 2014 | foreach ($pall as $pvalue) { |
| 2015 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 2016 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 2017 | - $find = true; |
|
| 2018 | - break; |
|
| 2019 | - } |
|
| 2020 | - } |
|
| 2021 | - if ($find === false) { |
|
| 2022 | - $pall[] = $value; |
|
| 2023 | - } |
|
| 2024 | - } |
|
| 2025 | - $alldata = $pall; |
|
| 2015 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
| 2016 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
| 2017 | + $find = true; |
|
| 2018 | + break; |
|
| 2019 | + } |
|
| 2020 | + } |
|
| 2021 | + if ($find === false) { |
|
| 2022 | + $pall[] = $value; |
|
| 2023 | + } |
|
| 2024 | + } |
|
| 2025 | + $alldata = $pall; |
|
| 2026 | 2026 | foreach ($alldata as $number) { |
| 2027 | 2027 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],'',$filter_name); |
| 2028 | 2028 | } |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Get SQL query part for filter used |
|
| 59 | - * @param Array $filter the filter |
|
| 60 | - * @return Array the SQL part |
|
| 61 | - */ |
|
| 58 | + * Get SQL query part for filter used |
|
| 59 | + * @param Array $filter the filter |
|
| 60 | + * @return Array the SQL part |
|
| 61 | + */ |
|
| 62 | 62 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 63 | 63 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
| 64 | 64 | $filters = array(); |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * Executes the SQL statements to get the spotter information |
|
| 133 | - * |
|
| 134 | - * @param String $query the SQL query |
|
| 135 | - * @param Array $params parameter of the query |
|
| 136 | - * @param String $limitQuery the limit query |
|
| 137 | - * @return Array the spotter information |
|
| 138 | - * |
|
| 139 | - */ |
|
| 132 | + * Executes the SQL statements to get the spotter information |
|
| 133 | + * |
|
| 134 | + * @param String $query the SQL query |
|
| 135 | + * @param Array $params parameter of the query |
|
| 136 | + * @param String $limitQuery the limit query |
|
| 137 | + * @return Array the spotter information |
|
| 138 | + * |
|
| 139 | + */ |
|
| 140 | 140 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
| 141 | 141 | { |
| 142 | 142 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM; |
@@ -303,11 +303,11 @@ discard block |
||
| 303 | 303 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 304 | 304 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 305 | 305 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
| 306 | - } else { |
|
| 307 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 306 | + } else { |
|
| 307 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 308 | 308 | $temp_array['aircraft_name'] = 'N/A'; |
| 309 | 309 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
| 310 | - } |
|
| 310 | + } |
|
| 311 | 311 | } |
| 312 | 312 | $fromsource = NULL; |
| 313 | 313 | if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
@@ -503,11 +503,11 @@ discard block |
||
| 503 | 503 | |
| 504 | 504 | |
| 505 | 505 | /** |
| 506 | - * Gets all the spotter information |
|
| 507 | - * |
|
| 508 | - * @return Array the spotter information |
|
| 509 | - * |
|
| 510 | - */ |
|
| 506 | + * Gets all the spotter information |
|
| 507 | + * |
|
| 508 | + * @return Array the spotter information |
|
| 509 | + * |
|
| 510 | + */ |
|
| 511 | 511 | 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()) |
| 512 | 512 | { |
| 513 | 513 | global $globalTimezone, $globalDBdriver; |
@@ -854,11 +854,11 @@ discard block |
||
| 854 | 854 | |
| 855 | 855 | |
| 856 | 856 | /** |
| 857 | - * Gets all the spotter information based on the latest data entry |
|
| 858 | - * |
|
| 859 | - * @return Array the spotter information |
|
| 860 | - * |
|
| 861 | - */ |
|
| 857 | + * Gets all the spotter information based on the latest data entry |
|
| 858 | + * |
|
| 859 | + * @return Array the spotter information |
|
| 860 | + * |
|
| 861 | + */ |
|
| 862 | 862 | public function getLatestSpotterData($limit = '', $sort = '', $filter = array()) |
| 863 | 863 | { |
| 864 | 864 | global $global_query; |
@@ -897,12 +897,12 @@ discard block |
||
| 897 | 897 | } |
| 898 | 898 | |
| 899 | 899 | |
| 900 | - /** |
|
| 901 | - * Gets all the spotter information based on a user's latitude and longitude |
|
| 902 | - * |
|
| 903 | - * @return Array the spotter information |
|
| 904 | - * |
|
| 905 | - */ |
|
| 900 | + /** |
|
| 901 | + * Gets all the spotter information based on a user's latitude and longitude |
|
| 902 | + * |
|
| 903 | + * @return Array the spotter information |
|
| 904 | + * |
|
| 905 | + */ |
|
| 906 | 906 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
| 907 | 907 | { |
| 908 | 908 | date_default_timezone_set('UTC'); |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | return false; |
| 931 | 931 | } |
| 932 | 932 | } |
| 933 | - $additional_query = ''; |
|
| 933 | + $additional_query = ''; |
|
| 934 | 934 | if ($interval != "") |
| 935 | 935 | { |
| 936 | 936 | if (!is_string($interval)) |
@@ -970,12 +970,12 @@ discard block |
||
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | |
| 973 | - /** |
|
| 974 | - * Gets all the spotter information sorted by the newest aircraft type |
|
| 975 | - * |
|
| 976 | - * @return Array the spotter information |
|
| 977 | - * |
|
| 978 | - */ |
|
| 973 | + /** |
|
| 974 | + * Gets all the spotter information sorted by the newest aircraft type |
|
| 975 | + * |
|
| 976 | + * @return Array the spotter information |
|
| 977 | + * |
|
| 978 | + */ |
|
| 979 | 979 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
| 980 | 980 | { |
| 981 | 981 | global $global_query; |
@@ -1016,11 +1016,11 @@ discard block |
||
| 1016 | 1016 | |
| 1017 | 1017 | |
| 1018 | 1018 | /** |
| 1019 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
| 1020 | - * |
|
| 1021 | - * @return Array the spotter information |
|
| 1022 | - * |
|
| 1023 | - */ |
|
| 1019 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
| 1020 | + * |
|
| 1021 | + * @return Array the spotter information |
|
| 1022 | + * |
|
| 1023 | + */ |
|
| 1024 | 1024 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array()) |
| 1025 | 1025 | { |
| 1026 | 1026 | global $global_query; |
@@ -1060,11 +1060,11 @@ discard block |
||
| 1060 | 1060 | |
| 1061 | 1061 | |
| 1062 | 1062 | /** |
| 1063 | - * Gets all the spotter information sorted by the newest airline |
|
| 1064 | - * |
|
| 1065 | - * @return Array the spotter information |
|
| 1066 | - * |
|
| 1067 | - */ |
|
| 1063 | + * Gets all the spotter information sorted by the newest airline |
|
| 1064 | + * |
|
| 1065 | + * @return Array the spotter information |
|
| 1066 | + * |
|
| 1067 | + */ |
|
| 1068 | 1068 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
| 1069 | 1069 | { |
| 1070 | 1070 | global $global_query; |
@@ -1103,12 +1103,12 @@ discard block |
||
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | |
| 1106 | - /** |
|
| 1107 | - * Gets all the spotter information sorted by the newest departure airport |
|
| 1108 | - * |
|
| 1109 | - * @return Array the spotter information |
|
| 1110 | - * |
|
| 1111 | - */ |
|
| 1106 | + /** |
|
| 1107 | + * Gets all the spotter information sorted by the newest departure airport |
|
| 1108 | + * |
|
| 1109 | + * @return Array the spotter information |
|
| 1110 | + * |
|
| 1111 | + */ |
|
| 1112 | 1112 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array()) |
| 1113 | 1113 | { |
| 1114 | 1114 | global $global_query; |
@@ -1150,11 +1150,11 @@ discard block |
||
| 1150 | 1150 | |
| 1151 | 1151 | |
| 1152 | 1152 | /** |
| 1153 | - * Gets all the spotter information sorted by the newest arrival airport |
|
| 1154 | - * |
|
| 1155 | - * @return Array the spotter information |
|
| 1156 | - * |
|
| 1157 | - */ |
|
| 1153 | + * Gets all the spotter information sorted by the newest arrival airport |
|
| 1154 | + * |
|
| 1155 | + * @return Array the spotter information |
|
| 1156 | + * |
|
| 1157 | + */ |
|
| 1158 | 1158 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array()) |
| 1159 | 1159 | { |
| 1160 | 1160 | global $global_query; |
@@ -1193,11 +1193,11 @@ discard block |
||
| 1193 | 1193 | |
| 1194 | 1194 | |
| 1195 | 1195 | /** |
| 1196 | - * Gets all the spotter information based on the spotter id |
|
| 1197 | - * |
|
| 1198 | - * @return Array the spotter information |
|
| 1199 | - * |
|
| 1200 | - */ |
|
| 1196 | + * Gets all the spotter information based on the spotter id |
|
| 1197 | + * |
|
| 1198 | + * @return Array the spotter information |
|
| 1199 | + * |
|
| 1200 | + */ |
|
| 1201 | 1201 | public function getSpotterDataByID($id = '') |
| 1202 | 1202 | { |
| 1203 | 1203 | global $global_query; |
@@ -1219,11 +1219,11 @@ discard block |
||
| 1219 | 1219 | |
| 1220 | 1220 | |
| 1221 | 1221 | /** |
| 1222 | - * Gets all the spotter information based on the callsign |
|
| 1223 | - * |
|
| 1224 | - * @return Array the spotter information |
|
| 1225 | - * |
|
| 1226 | - */ |
|
| 1222 | + * Gets all the spotter information based on the callsign |
|
| 1223 | + * |
|
| 1224 | + * @return Array the spotter information |
|
| 1225 | + * |
|
| 1226 | + */ |
|
| 1227 | 1227 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') |
| 1228 | 1228 | { |
| 1229 | 1229 | global $global_query; |
@@ -1274,11 +1274,11 @@ discard block |
||
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | /** |
| 1277 | - * Gets all the spotter information based on the owner |
|
| 1278 | - * |
|
| 1279 | - * @return Array the spotter information |
|
| 1280 | - * |
|
| 1281 | - */ |
|
| 1277 | + * Gets all the spotter information based on the owner |
|
| 1278 | + * |
|
| 1279 | + * @return Array the spotter information |
|
| 1280 | + * |
|
| 1281 | + */ |
|
| 1282 | 1282 | public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '') |
| 1283 | 1283 | { |
| 1284 | 1284 | global $global_query; |
@@ -1329,11 +1329,11 @@ discard block |
||
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | 1331 | /** |
| 1332 | - * Gets all the spotter information based on the pilot |
|
| 1333 | - * |
|
| 1334 | - * @return Array the spotter information |
|
| 1335 | - * |
|
| 1336 | - */ |
|
| 1332 | + * Gets all the spotter information based on the pilot |
|
| 1333 | + * |
|
| 1334 | + * @return Array the spotter information |
|
| 1335 | + * |
|
| 1336 | + */ |
|
| 1337 | 1337 | public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '') |
| 1338 | 1338 | { |
| 1339 | 1339 | global $global_query; |
@@ -1381,11 +1381,11 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | |
| 1383 | 1383 | /** |
| 1384 | - * Gets all the spotter information based on the aircraft type |
|
| 1385 | - * |
|
| 1386 | - * @return Array the spotter information |
|
| 1387 | - * |
|
| 1388 | - */ |
|
| 1384 | + * Gets all the spotter information based on the aircraft type |
|
| 1385 | + * |
|
| 1386 | + * @return Array the spotter information |
|
| 1387 | + * |
|
| 1388 | + */ |
|
| 1389 | 1389 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array()) |
| 1390 | 1390 | { |
| 1391 | 1391 | global $global_query; |
@@ -1439,11 +1439,11 @@ discard block |
||
| 1439 | 1439 | |
| 1440 | 1440 | |
| 1441 | 1441 | /** |
| 1442 | - * Gets all the spotter information based on the aircraft registration |
|
| 1443 | - * |
|
| 1444 | - * @return Array the spotter information |
|
| 1445 | - * |
|
| 1446 | - */ |
|
| 1442 | + * Gets all the spotter information based on the aircraft registration |
|
| 1443 | + * |
|
| 1444 | + * @return Array the spotter information |
|
| 1445 | + * |
|
| 1446 | + */ |
|
| 1447 | 1447 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array()) |
| 1448 | 1448 | { |
| 1449 | 1449 | global $global_query; |
@@ -1500,11 +1500,11 @@ discard block |
||
| 1500 | 1500 | |
| 1501 | 1501 | |
| 1502 | 1502 | /** |
| 1503 | - * Gets all the spotter information based on the airline |
|
| 1504 | - * |
|
| 1505 | - * @return Array the spotter information |
|
| 1506 | - * |
|
| 1507 | - */ |
|
| 1503 | + * Gets all the spotter information based on the airline |
|
| 1504 | + * |
|
| 1505 | + * @return Array the spotter information |
|
| 1506 | + * |
|
| 1507 | + */ |
|
| 1508 | 1508 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array()) |
| 1509 | 1509 | { |
| 1510 | 1510 | global $global_query; |
@@ -1557,11 +1557,11 @@ discard block |
||
| 1557 | 1557 | |
| 1558 | 1558 | |
| 1559 | 1559 | /** |
| 1560 | - * Gets all the spotter information based on the airport |
|
| 1561 | - * |
|
| 1562 | - * @return Array the spotter information |
|
| 1563 | - * |
|
| 1564 | - */ |
|
| 1560 | + * Gets all the spotter information based on the airport |
|
| 1561 | + * |
|
| 1562 | + * @return Array the spotter information |
|
| 1563 | + * |
|
| 1564 | + */ |
|
| 1565 | 1565 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
| 1566 | 1566 | { |
| 1567 | 1567 | global $global_query; |
@@ -1615,11 +1615,11 @@ discard block |
||
| 1615 | 1615 | |
| 1616 | 1616 | |
| 1617 | 1617 | /** |
| 1618 | - * Gets all the spotter information based on the date |
|
| 1619 | - * |
|
| 1620 | - * @return Array the spotter information |
|
| 1621 | - * |
|
| 1622 | - */ |
|
| 1618 | + * Gets all the spotter information based on the date |
|
| 1619 | + * |
|
| 1620 | + * @return Array the spotter information |
|
| 1621 | + * |
|
| 1622 | + */ |
|
| 1623 | 1623 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
| 1624 | 1624 | { |
| 1625 | 1625 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1683,11 +1683,11 @@ discard block |
||
| 1683 | 1683 | |
| 1684 | 1684 | |
| 1685 | 1685 | /** |
| 1686 | - * Gets all the spotter information based on the country name |
|
| 1687 | - * |
|
| 1688 | - * @return Array the spotter information |
|
| 1689 | - * |
|
| 1690 | - */ |
|
| 1686 | + * Gets all the spotter information based on the country name |
|
| 1687 | + * |
|
| 1688 | + * @return Array the spotter information |
|
| 1689 | + * |
|
| 1690 | + */ |
|
| 1691 | 1691 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array()) |
| 1692 | 1692 | { |
| 1693 | 1693 | global $global_query; |
@@ -1741,11 +1741,11 @@ discard block |
||
| 1741 | 1741 | |
| 1742 | 1742 | |
| 1743 | 1743 | /** |
| 1744 | - * Gets all the spotter information based on the manufacturer name |
|
| 1745 | - * |
|
| 1746 | - * @return Array the spotter information |
|
| 1747 | - * |
|
| 1748 | - */ |
|
| 1744 | + * Gets all the spotter information based on the manufacturer name |
|
| 1745 | + * |
|
| 1746 | + * @return Array the spotter information |
|
| 1747 | + * |
|
| 1748 | + */ |
|
| 1749 | 1749 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array()) |
| 1750 | 1750 | { |
| 1751 | 1751 | global $global_query; |
@@ -1801,13 +1801,13 @@ discard block |
||
| 1801 | 1801 | |
| 1802 | 1802 | |
| 1803 | 1803 | /** |
| 1804 | - * Gets a list of all aircraft that take a route |
|
| 1805 | - * |
|
| 1806 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1807 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1808 | - * @return Array the spotter information |
|
| 1809 | - * |
|
| 1810 | - */ |
|
| 1804 | + * Gets a list of all aircraft that take a route |
|
| 1805 | + * |
|
| 1806 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1807 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1808 | + * @return Array the spotter information |
|
| 1809 | + * |
|
| 1810 | + */ |
|
| 1811 | 1811 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array()) |
| 1812 | 1812 | { |
| 1813 | 1813 | global $global_query; |
@@ -1876,11 +1876,11 @@ discard block |
||
| 1876 | 1876 | |
| 1877 | 1877 | |
| 1878 | 1878 | /** |
| 1879 | - * Gets all the spotter information based on the special column in the table |
|
| 1880 | - * |
|
| 1881 | - * @return Array the spotter information |
|
| 1882 | - * |
|
| 1883 | - */ |
|
| 1879 | + * Gets all the spotter information based on the special column in the table |
|
| 1880 | + * |
|
| 1881 | + * @return Array the spotter information |
|
| 1882 | + * |
|
| 1883 | + */ |
|
| 1884 | 1884 | public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array()) |
| 1885 | 1885 | { |
| 1886 | 1886 | global $global_query; |
@@ -1919,11 +1919,11 @@ discard block |
||
| 1919 | 1919 | } |
| 1920 | 1920 | |
| 1921 | 1921 | /** |
| 1922 | - * Gets all the highlight based on a aircraft registration |
|
| 1923 | - * |
|
| 1924 | - * @return String the highlight text |
|
| 1925 | - * |
|
| 1926 | - */ |
|
| 1922 | + * Gets all the highlight based on a aircraft registration |
|
| 1923 | + * |
|
| 1924 | + * @return String the highlight text |
|
| 1925 | + * |
|
| 1926 | + */ |
|
| 1927 | 1927 | public function getHighlightByRegistration($registration,$filter = array()) |
| 1928 | 1928 | { |
| 1929 | 1929 | global $global_query; |
@@ -1945,13 +1945,13 @@ discard block |
||
| 1945 | 1945 | |
| 1946 | 1946 | |
| 1947 | 1947 | /** |
| 1948 | - * Gets the squawk usage from squawk code |
|
| 1949 | - * |
|
| 1950 | - * @param String $squawk squawk code |
|
| 1951 | - * @param String $country country |
|
| 1952 | - * @return String usage |
|
| 1953 | - * |
|
| 1954 | - */ |
|
| 1948 | + * Gets the squawk usage from squawk code |
|
| 1949 | + * |
|
| 1950 | + * @param String $squawk squawk code |
|
| 1951 | + * @param String $country country |
|
| 1952 | + * @return String usage |
|
| 1953 | + * |
|
| 1954 | + */ |
|
| 1955 | 1955 | public function getSquawkUsage($squawk = '',$country = 'FR') |
| 1956 | 1956 | { |
| 1957 | 1957 | |
@@ -1972,12 +1972,12 @@ discard block |
||
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | 1974 | /** |
| 1975 | - * Gets the airport icao from the iata |
|
| 1976 | - * |
|
| 1977 | - * @param String $airport_iata the iata code of the airport |
|
| 1978 | - * @return String airport iata |
|
| 1979 | - * |
|
| 1980 | - */ |
|
| 1975 | + * Gets the airport icao from the iata |
|
| 1976 | + * |
|
| 1977 | + * @param String $airport_iata the iata code of the airport |
|
| 1978 | + * @return String airport iata |
|
| 1979 | + * |
|
| 1980 | + */ |
|
| 1981 | 1981 | public function getAirportIcao($airport_iata = '') |
| 1982 | 1982 | { |
| 1983 | 1983 | |
@@ -1997,14 +1997,14 @@ discard block |
||
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | 1999 | /** |
| 2000 | - * Gets the airport distance |
|
| 2001 | - * |
|
| 2002 | - * @param String $airport_icao the icao code of the airport |
|
| 2003 | - * @param Float $latitude the latitude |
|
| 2004 | - * @param Float $longitude the longitude |
|
| 2005 | - * @return Float distance to the airport |
|
| 2006 | - * |
|
| 2007 | - */ |
|
| 2000 | + * Gets the airport distance |
|
| 2001 | + * |
|
| 2002 | + * @param String $airport_icao the icao code of the airport |
|
| 2003 | + * @param Float $latitude the latitude |
|
| 2004 | + * @param Float $longitude the longitude |
|
| 2005 | + * @return Float distance to the airport |
|
| 2006 | + * |
|
| 2007 | + */ |
|
| 2008 | 2008 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
| 2009 | 2009 | { |
| 2010 | 2010 | |
@@ -2025,12 +2025,12 @@ discard block |
||
| 2025 | 2025 | } |
| 2026 | 2026 | |
| 2027 | 2027 | /** |
| 2028 | - * Gets the airport info based on the icao |
|
| 2029 | - * |
|
| 2030 | - * @param String $airport the icao code of the airport |
|
| 2031 | - * @return Array airport information |
|
| 2032 | - * |
|
| 2033 | - */ |
|
| 2028 | + * Gets the airport info based on the icao |
|
| 2029 | + * |
|
| 2030 | + * @param String $airport the icao code of the airport |
|
| 2031 | + * @return Array airport information |
|
| 2032 | + * |
|
| 2033 | + */ |
|
| 2034 | 2034 | public function getAllAirportInfo($airport = '') |
| 2035 | 2035 | { |
| 2036 | 2036 | |
@@ -2076,12 +2076,12 @@ discard block |
||
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | 2078 | /** |
| 2079 | - * Gets the airport info based on the country |
|
| 2080 | - * |
|
| 2081 | - * @param Array $countries Airports countries |
|
| 2082 | - * @return Array airport information |
|
| 2083 | - * |
|
| 2084 | - */ |
|
| 2079 | + * Gets the airport info based on the country |
|
| 2080 | + * |
|
| 2081 | + * @param Array $countries Airports countries |
|
| 2082 | + * @return Array airport information |
|
| 2083 | + * |
|
| 2084 | + */ |
|
| 2085 | 2085 | public function getAllAirportInfobyCountry($countries) |
| 2086 | 2086 | { |
| 2087 | 2087 | $lst_countries = ''; |
@@ -2119,12 +2119,12 @@ discard block |
||
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | /** |
| 2122 | - * Gets airports info based on the coord |
|
| 2123 | - * |
|
| 2124 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 2125 | - * @return Array airport information |
|
| 2126 | - * |
|
| 2127 | - */ |
|
| 2122 | + * Gets airports info based on the coord |
|
| 2123 | + * |
|
| 2124 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 2125 | + * @return Array airport information |
|
| 2126 | + * |
|
| 2127 | + */ |
|
| 2128 | 2128 | public function getAllAirportInfobyCoord($coord) |
| 2129 | 2129 | { |
| 2130 | 2130 | global $globalDBdriver; |
@@ -2155,12 +2155,12 @@ discard block |
||
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | /** |
| 2158 | - * Gets waypoints info based on the coord |
|
| 2159 | - * |
|
| 2160 | - * @param Array $coord waypoints coord |
|
| 2161 | - * @return Array airport information |
|
| 2162 | - * |
|
| 2163 | - */ |
|
| 2158 | + * Gets waypoints info based on the coord |
|
| 2159 | + * |
|
| 2160 | + * @param Array $coord waypoints coord |
|
| 2161 | + * @return Array airport information |
|
| 2162 | + * |
|
| 2163 | + */ |
|
| 2164 | 2164 | public function getAllWaypointsInfobyCoord($coord) |
| 2165 | 2165 | { |
| 2166 | 2166 | if (is_array($coord)) { |
@@ -2194,12 +2194,12 @@ discard block |
||
| 2194 | 2194 | |
| 2195 | 2195 | |
| 2196 | 2196 | /** |
| 2197 | - * Gets the airline info based on the icao code or iata code |
|
| 2198 | - * |
|
| 2199 | - * @param String $airline_icao the iata code of the airport |
|
| 2200 | - * @return Array airport information |
|
| 2201 | - * |
|
| 2202 | - */ |
|
| 2197 | + * Gets the airline info based on the icao code or iata code |
|
| 2198 | + * |
|
| 2199 | + * @param String $airline_icao the iata code of the airport |
|
| 2200 | + * @return Array airport information |
|
| 2201 | + * |
|
| 2202 | + */ |
|
| 2203 | 2203 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
| 2204 | 2204 | { |
| 2205 | 2205 | global $globalUseRealAirlines; |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | } else { |
| 2231 | 2231 | $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
| 2232 | 2232 | } |
| 2233 | - /* |
|
| 2233 | + /* |
|
| 2234 | 2234 | $airline_array = array(); |
| 2235 | 2235 | $temp_array = array(); |
| 2236 | 2236 | |
@@ -2263,12 +2263,12 @@ discard block |
||
| 2263 | 2263 | } |
| 2264 | 2264 | |
| 2265 | 2265 | /** |
| 2266 | - * Gets the airline info based on the airline name |
|
| 2267 | - * |
|
| 2268 | - * @param String $airline_name the name of the airline |
|
| 2269 | - * @return Array airline information |
|
| 2270 | - * |
|
| 2271 | - */ |
|
| 2266 | + * Gets the airline info based on the airline name |
|
| 2267 | + * |
|
| 2268 | + * @param String $airline_name the name of the airline |
|
| 2269 | + * @return Array airline information |
|
| 2270 | + * |
|
| 2271 | + */ |
|
| 2272 | 2272 | public function getAllAirlineInfoByName($airline_name, $fromsource = NULL) |
| 2273 | 2273 | { |
| 2274 | 2274 | global $globalUseRealAirlines; |
@@ -2296,12 +2296,12 @@ discard block |
||
| 2296 | 2296 | |
| 2297 | 2297 | |
| 2298 | 2298 | /** |
| 2299 | - * Gets the aircraft info based on the aircraft type |
|
| 2300 | - * |
|
| 2301 | - * @param String $aircraft_type the aircraft type |
|
| 2302 | - * @return Array aircraft information |
|
| 2303 | - * |
|
| 2304 | - */ |
|
| 2299 | + * Gets the aircraft info based on the aircraft type |
|
| 2300 | + * |
|
| 2301 | + * @param String $aircraft_type the aircraft type |
|
| 2302 | + * @return Array aircraft information |
|
| 2303 | + * |
|
| 2304 | + */ |
|
| 2305 | 2305 | public function getAllAircraftInfo($aircraft_type) |
| 2306 | 2306 | { |
| 2307 | 2307 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2333,12 +2333,12 @@ discard block |
||
| 2333 | 2333 | } |
| 2334 | 2334 | |
| 2335 | 2335 | /** |
| 2336 | - * Gets the aircraft icao based on the aircraft name/type |
|
| 2337 | - * |
|
| 2338 | - * @param String $aircraft_type the aircraft type |
|
| 2339 | - * @return String aircraft information |
|
| 2340 | - * |
|
| 2341 | - */ |
|
| 2336 | + * Gets the aircraft icao based on the aircraft name/type |
|
| 2337 | + * |
|
| 2338 | + * @param String $aircraft_type the aircraft type |
|
| 2339 | + * @return String aircraft information |
|
| 2340 | + * |
|
| 2341 | + */ |
|
| 2342 | 2342 | public function getAircraftIcao($aircraft_type) |
| 2343 | 2343 | { |
| 2344 | 2344 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2363,12 +2363,12 @@ discard block |
||
| 2363 | 2363 | } |
| 2364 | 2364 | |
| 2365 | 2365 | /** |
| 2366 | - * Gets the aircraft info based on the aircraft modes |
|
| 2367 | - * |
|
| 2368 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2369 | - * @return String aircraft type |
|
| 2370 | - * |
|
| 2371 | - */ |
|
| 2366 | + * Gets the aircraft info based on the aircraft modes |
|
| 2367 | + * |
|
| 2368 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2369 | + * @return String aircraft type |
|
| 2370 | + * |
|
| 2371 | + */ |
|
| 2372 | 2372 | public function getAllAircraftType($aircraft_modes) |
| 2373 | 2373 | { |
| 2374 | 2374 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2388,12 +2388,12 @@ discard block |
||
| 2388 | 2388 | } |
| 2389 | 2389 | |
| 2390 | 2390 | /** |
| 2391 | - * Gets the aircraft info based on the aircraft registration |
|
| 2392 | - * |
|
| 2393 | - * @param String $registration the aircraft registration |
|
| 2394 | - * @return String aircraft type |
|
| 2395 | - * |
|
| 2396 | - */ |
|
| 2391 | + * Gets the aircraft info based on the aircraft registration |
|
| 2392 | + * |
|
| 2393 | + * @param String $registration the aircraft registration |
|
| 2394 | + * @return String aircraft type |
|
| 2395 | + * |
|
| 2396 | + */ |
|
| 2397 | 2397 | public function getAllAircraftTypeByRegistration($registration) |
| 2398 | 2398 | { |
| 2399 | 2399 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2411,12 +2411,12 @@ discard block |
||
| 2411 | 2411 | } |
| 2412 | 2412 | |
| 2413 | 2413 | /** |
| 2414 | - * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
| 2415 | - * |
|
| 2416 | - * @param String $registration the aircraft registration |
|
| 2417 | - * @return Array spotter_id and flightaware_id |
|
| 2418 | - * |
|
| 2419 | - */ |
|
| 2414 | + * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
| 2415 | + * |
|
| 2416 | + * @param String $registration the aircraft registration |
|
| 2417 | + * @return Array spotter_id and flightaware_id |
|
| 2418 | + * |
|
| 2419 | + */ |
|
| 2420 | 2420 | public function getAllIDByRegistration($registration) |
| 2421 | 2421 | { |
| 2422 | 2422 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2435,12 +2435,12 @@ discard block |
||
| 2435 | 2435 | } |
| 2436 | 2436 | |
| 2437 | 2437 | /** |
| 2438 | - * Gets correct aircraft operator code |
|
| 2439 | - * |
|
| 2440 | - * @param String $operator the aircraft operator code (callsign) |
|
| 2441 | - * @return String aircraft operator code |
|
| 2442 | - * |
|
| 2443 | - */ |
|
| 2438 | + * Gets correct aircraft operator code |
|
| 2439 | + * |
|
| 2440 | + * @param String $operator the aircraft operator code (callsign) |
|
| 2441 | + * @return String aircraft operator code |
|
| 2442 | + * |
|
| 2443 | + */ |
|
| 2444 | 2444 | public function getOperator($operator) |
| 2445 | 2445 | { |
| 2446 | 2446 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2457,16 +2457,16 @@ discard block |
||
| 2457 | 2457 | } |
| 2458 | 2458 | |
| 2459 | 2459 | /** |
| 2460 | - * Gets the aircraft route based on the aircraft callsign |
|
| 2461 | - * |
|
| 2462 | - * @param String $callsign the aircraft callsign |
|
| 2463 | - * @return Array aircraft type |
|
| 2464 | - * |
|
| 2465 | - */ |
|
| 2460 | + * Gets the aircraft route based on the aircraft callsign |
|
| 2461 | + * |
|
| 2462 | + * @param String $callsign the aircraft callsign |
|
| 2463 | + * @return Array aircraft type |
|
| 2464 | + * |
|
| 2465 | + */ |
|
| 2466 | 2466 | public function getRouteInfo($callsign) |
| 2467 | 2467 | { |
| 2468 | 2468 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2469 | - if ($callsign == '') return array(); |
|
| 2469 | + if ($callsign == '') return array(); |
|
| 2470 | 2470 | $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"; |
| 2471 | 2471 | |
| 2472 | 2472 | $sth = $this->db->prepare($query); |
@@ -2480,12 +2480,12 @@ discard block |
||
| 2480 | 2480 | } |
| 2481 | 2481 | |
| 2482 | 2482 | /** |
| 2483 | - * Gets the aircraft info based on the aircraft registration |
|
| 2484 | - * |
|
| 2485 | - * @param String $registration the aircraft registration |
|
| 2486 | - * @return Array aircraft information |
|
| 2487 | - * |
|
| 2488 | - */ |
|
| 2483 | + * Gets the aircraft info based on the aircraft registration |
|
| 2484 | + * |
|
| 2485 | + * @param String $registration the aircraft registration |
|
| 2486 | + * @return Array aircraft information |
|
| 2487 | + * |
|
| 2488 | + */ |
|
| 2489 | 2489 | public function getAircraftInfoByRegistration($registration) |
| 2490 | 2490 | { |
| 2491 | 2491 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2512,12 +2512,12 @@ discard block |
||
| 2512 | 2512 | } |
| 2513 | 2513 | |
| 2514 | 2514 | /** |
| 2515 | - * Gets the aircraft owner & base based on the aircraft registration |
|
| 2516 | - * |
|
| 2517 | - * @param String $registration the aircraft registration |
|
| 2518 | - * @return Array aircraft information |
|
| 2519 | - * |
|
| 2520 | - */ |
|
| 2515 | + * Gets the aircraft owner & base based on the aircraft registration |
|
| 2516 | + * |
|
| 2517 | + * @param String $registration the aircraft registration |
|
| 2518 | + * @return Array aircraft information |
|
| 2519 | + * |
|
| 2520 | + */ |
|
| 2521 | 2521 | public function getAircraftOwnerByRegistration($registration) |
| 2522 | 2522 | { |
| 2523 | 2523 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2534,11 +2534,11 @@ discard block |
||
| 2534 | 2534 | |
| 2535 | 2535 | |
| 2536 | 2536 | /** |
| 2537 | - * Gets all flights (but with only little info) |
|
| 2538 | - * |
|
| 2539 | - * @return Array basic flight information |
|
| 2540 | - * |
|
| 2541 | - */ |
|
| 2537 | + * Gets all flights (but with only little info) |
|
| 2538 | + * |
|
| 2539 | + * @return Array basic flight information |
|
| 2540 | + * |
|
| 2541 | + */ |
|
| 2542 | 2542 | public function getAllFlightsforSitemap() |
| 2543 | 2543 | { |
| 2544 | 2544 | //$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 "; |
@@ -2546,7 +2546,7 @@ discard block |
||
| 2546 | 2546 | |
| 2547 | 2547 | $sth = $this->db->prepare($query); |
| 2548 | 2548 | $sth->execute(); |
| 2549 | - /* |
|
| 2549 | + /* |
|
| 2550 | 2550 | $flight_array = array(); |
| 2551 | 2551 | $temp_array = array(); |
| 2552 | 2552 | |
@@ -2568,11 +2568,11 @@ discard block |
||
| 2568 | 2568 | } |
| 2569 | 2569 | |
| 2570 | 2570 | /** |
| 2571 | - * Gets a list of all aircraft manufacturers |
|
| 2572 | - * |
|
| 2573 | - * @return Array list of aircraft types |
|
| 2574 | - * |
|
| 2575 | - */ |
|
| 2571 | + * Gets a list of all aircraft manufacturers |
|
| 2572 | + * |
|
| 2573 | + * @return Array list of aircraft types |
|
| 2574 | + * |
|
| 2575 | + */ |
|
| 2576 | 2576 | public function getAllManufacturers() |
| 2577 | 2577 | { |
| 2578 | 2578 | /* |
@@ -2601,11 +2601,11 @@ discard block |
||
| 2601 | 2601 | |
| 2602 | 2602 | |
| 2603 | 2603 | /** |
| 2604 | - * Gets a list of all aircraft types |
|
| 2605 | - * |
|
| 2606 | - * @return Array list of aircraft types |
|
| 2607 | - * |
|
| 2608 | - */ |
|
| 2604 | + * Gets a list of all aircraft types |
|
| 2605 | + * |
|
| 2606 | + * @return Array list of aircraft types |
|
| 2607 | + * |
|
| 2608 | + */ |
|
| 2609 | 2609 | public function getAllAircraftTypes($filters = array()) |
| 2610 | 2610 | { |
| 2611 | 2611 | /* |
@@ -2640,11 +2640,11 @@ discard block |
||
| 2640 | 2640 | |
| 2641 | 2641 | |
| 2642 | 2642 | /** |
| 2643 | - * Gets a list of all aircraft registrations |
|
| 2644 | - * |
|
| 2645 | - * @return Array list of aircraft registrations |
|
| 2646 | - * |
|
| 2647 | - */ |
|
| 2643 | + * Gets a list of all aircraft registrations |
|
| 2644 | + * |
|
| 2645 | + * @return Array list of aircraft registrations |
|
| 2646 | + * |
|
| 2647 | + */ |
|
| 2648 | 2648 | public function getAllAircraftRegistrations($filters = array()) |
| 2649 | 2649 | { |
| 2650 | 2650 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2669,12 +2669,12 @@ discard block |
||
| 2669 | 2669 | } |
| 2670 | 2670 | |
| 2671 | 2671 | /** |
| 2672 | - * Gets all source name |
|
| 2673 | - * |
|
| 2674 | - * @param String type format of source |
|
| 2675 | - * @return Array list of source name |
|
| 2676 | - * |
|
| 2677 | - */ |
|
| 2672 | + * Gets all source name |
|
| 2673 | + * |
|
| 2674 | + * @param String type format of source |
|
| 2675 | + * @return Array list of source name |
|
| 2676 | + * |
|
| 2677 | + */ |
|
| 2678 | 2678 | public function getAllSourceName($type = '',$filters = array()) |
| 2679 | 2679 | { |
| 2680 | 2680 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2705,11 +2705,11 @@ discard block |
||
| 2705 | 2705 | |
| 2706 | 2706 | |
| 2707 | 2707 | /** |
| 2708 | - * Gets a list of all airline names |
|
| 2709 | - * |
|
| 2710 | - * @return Array list of airline names |
|
| 2711 | - * |
|
| 2712 | - */ |
|
| 2708 | + * Gets a list of all airline names |
|
| 2709 | + * |
|
| 2710 | + * @return Array list of airline names |
|
| 2711 | + * |
|
| 2712 | + */ |
|
| 2713 | 2713 | public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array()) |
| 2714 | 2714 | { |
| 2715 | 2715 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2758,11 +2758,11 @@ discard block |
||
| 2758 | 2758 | } |
| 2759 | 2759 | |
| 2760 | 2760 | /** |
| 2761 | - * Gets a list of all alliance names |
|
| 2762 | - * |
|
| 2763 | - * @return Array list of alliance names |
|
| 2764 | - * |
|
| 2765 | - */ |
|
| 2761 | + * Gets a list of all alliance names |
|
| 2762 | + * |
|
| 2763 | + * @return Array list of alliance names |
|
| 2764 | + * |
|
| 2765 | + */ |
|
| 2766 | 2766 | public function getAllAllianceNames($forsource = NULL,$filters = array()) |
| 2767 | 2767 | { |
| 2768 | 2768 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2787,11 +2787,11 @@ discard block |
||
| 2787 | 2787 | } |
| 2788 | 2788 | |
| 2789 | 2789 | /** |
| 2790 | - * Gets a list of all airline countries |
|
| 2791 | - * |
|
| 2792 | - * @return Array list of airline countries |
|
| 2793 | - * |
|
| 2794 | - */ |
|
| 2790 | + * Gets a list of all airline countries |
|
| 2791 | + * |
|
| 2792 | + * @return Array list of airline countries |
|
| 2793 | + * |
|
| 2794 | + */ |
|
| 2795 | 2795 | public function getAllAirlineCountries($filters = array()) |
| 2796 | 2796 | { |
| 2797 | 2797 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2819,11 +2819,11 @@ discard block |
||
| 2819 | 2819 | |
| 2820 | 2820 | |
| 2821 | 2821 | /** |
| 2822 | - * Gets a list of all departure & arrival names |
|
| 2823 | - * |
|
| 2824 | - * @return Array list of airport names |
|
| 2825 | - * |
|
| 2826 | - */ |
|
| 2822 | + * Gets a list of all departure & arrival names |
|
| 2823 | + * |
|
| 2824 | + * @return Array list of airport names |
|
| 2825 | + * |
|
| 2826 | + */ |
|
| 2827 | 2827 | public function getAllAirportNames($filters = array()) |
| 2828 | 2828 | { |
| 2829 | 2829 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2871,11 +2871,11 @@ discard block |
||
| 2871 | 2871 | } |
| 2872 | 2872 | |
| 2873 | 2873 | /** |
| 2874 | - * Gets a list of all owner names |
|
| 2875 | - * |
|
| 2876 | - * @return Array list of owner names |
|
| 2877 | - * |
|
| 2878 | - */ |
|
| 2874 | + * Gets a list of all owner names |
|
| 2875 | + * |
|
| 2876 | + * @return Array list of owner names |
|
| 2877 | + * |
|
| 2878 | + */ |
|
| 2879 | 2879 | public function getAllOwnerNames($filters = array()) |
| 2880 | 2880 | { |
| 2881 | 2881 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2889,11 +2889,11 @@ discard block |
||
| 2889 | 2889 | } |
| 2890 | 2890 | |
| 2891 | 2891 | /** |
| 2892 | - * Gets a list of all pilot names and pilot ids |
|
| 2893 | - * |
|
| 2894 | - * @return Array list of pilot names and pilot ids |
|
| 2895 | - * |
|
| 2896 | - */ |
|
| 2892 | + * Gets a list of all pilot names and pilot ids |
|
| 2893 | + * |
|
| 2894 | + * @return Array list of pilot names and pilot ids |
|
| 2895 | + * |
|
| 2896 | + */ |
|
| 2897 | 2897 | public function getAllPilotNames($filters = array()) |
| 2898 | 2898 | { |
| 2899 | 2899 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2908,11 +2908,11 @@ discard block |
||
| 2908 | 2908 | |
| 2909 | 2909 | |
| 2910 | 2910 | /** |
| 2911 | - * Gets a list of all departure & arrival airport countries |
|
| 2912 | - * |
|
| 2913 | - * @return Array list of airport countries |
|
| 2914 | - * |
|
| 2915 | - */ |
|
| 2911 | + * Gets a list of all departure & arrival airport countries |
|
| 2912 | + * |
|
| 2913 | + * @return Array list of airport countries |
|
| 2914 | + * |
|
| 2915 | + */ |
|
| 2916 | 2916 | public function getAllAirportCountries($filters = array()) |
| 2917 | 2917 | { |
| 2918 | 2918 | $airport_array = array(); |
@@ -2960,11 +2960,11 @@ discard block |
||
| 2960 | 2960 | |
| 2961 | 2961 | |
| 2962 | 2962 | /** |
| 2963 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2964 | - * |
|
| 2965 | - * @return Array list of countries |
|
| 2966 | - * |
|
| 2967 | - */ |
|
| 2963 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2964 | + * |
|
| 2965 | + * @return Array list of countries |
|
| 2966 | + * |
|
| 2967 | + */ |
|
| 2968 | 2968 | public function getAllCountries($filters = array()) |
| 2969 | 2969 | { |
| 2970 | 2970 | $Connection= new Connection($this->db); |
@@ -3041,11 +3041,11 @@ discard block |
||
| 3041 | 3041 | |
| 3042 | 3042 | |
| 3043 | 3043 | /** |
| 3044 | - * Gets a list of all idents/callsigns |
|
| 3045 | - * |
|
| 3046 | - * @return Array list of ident/callsign names |
|
| 3047 | - * |
|
| 3048 | - */ |
|
| 3044 | + * Gets a list of all idents/callsigns |
|
| 3045 | + * |
|
| 3046 | + * @return Array list of ident/callsign names |
|
| 3047 | + * |
|
| 3048 | + */ |
|
| 3049 | 3049 | public function getAllIdents($filters = array()) |
| 3050 | 3050 | { |
| 3051 | 3051 | $filter_query = $this->getFilter($filters,true,true); |
@@ -3069,9 +3069,9 @@ discard block |
||
| 3069 | 3069 | } |
| 3070 | 3070 | |
| 3071 | 3071 | /** |
| 3072 | - * Get a list of flights from airport since 7 days |
|
| 3073 | - * @return Array number, icao, name and city of airports |
|
| 3074 | - */ |
|
| 3072 | + * Get a list of flights from airport since 7 days |
|
| 3073 | + * @return Array number, icao, name and city of airports |
|
| 3074 | + */ |
|
| 3075 | 3075 | |
| 3076 | 3076 | public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
| 3077 | 3077 | global $globalTimezone, $globalDBdriver; |
@@ -3102,9 +3102,9 @@ discard block |
||
| 3102 | 3102 | } |
| 3103 | 3103 | |
| 3104 | 3104 | /** |
| 3105 | - * Get a list of flights from airport since 7 days |
|
| 3106 | - * @return Array number, icao, name and city of airports |
|
| 3107 | - */ |
|
| 3105 | + * Get a list of flights from airport since 7 days |
|
| 3106 | + * @return Array number, icao, name and city of airports |
|
| 3107 | + */ |
|
| 3108 | 3108 | |
| 3109 | 3109 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
| 3110 | 3110 | global $globalTimezone, $globalDBdriver; |
@@ -3134,9 +3134,9 @@ discard block |
||
| 3134 | 3134 | } |
| 3135 | 3135 | |
| 3136 | 3136 | /** |
| 3137 | - * Get a list of flights from detected airport since 7 days |
|
| 3138 | - * @return Array number, icao, name and city of airports |
|
| 3139 | - */ |
|
| 3137 | + * Get a list of flights from detected airport since 7 days |
|
| 3138 | + * @return Array number, icao, name and city of airports |
|
| 3139 | + */ |
|
| 3140 | 3140 | |
| 3141 | 3141 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
| 3142 | 3142 | global $globalTimezone, $globalDBdriver; |
@@ -3174,9 +3174,9 @@ discard block |
||
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | 3176 | /** |
| 3177 | - * Get a list of flights from detected airport since 7 days |
|
| 3178 | - * @return Array number, icao, name and city of airports |
|
| 3179 | - */ |
|
| 3177 | + * Get a list of flights from detected airport since 7 days |
|
| 3178 | + * @return Array number, icao, name and city of airports |
|
| 3179 | + */ |
|
| 3180 | 3180 | |
| 3181 | 3181 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
| 3182 | 3182 | global $globalTimezone, $globalDBdriver; |
@@ -3218,9 +3218,9 @@ discard block |
||
| 3218 | 3218 | |
| 3219 | 3219 | |
| 3220 | 3220 | /** |
| 3221 | - * Get a list of flights to airport since 7 days |
|
| 3222 | - * @return Array number, icao, name and city of airports |
|
| 3223 | - */ |
|
| 3221 | + * Get a list of flights to airport since 7 days |
|
| 3222 | + * @return Array number, icao, name and city of airports |
|
| 3223 | + */ |
|
| 3224 | 3224 | |
| 3225 | 3225 | public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
| 3226 | 3226 | global $globalTimezone, $globalDBdriver; |
@@ -3253,9 +3253,9 @@ discard block |
||
| 3253 | 3253 | |
| 3254 | 3254 | |
| 3255 | 3255 | /** |
| 3256 | - * Get a list of flights detected to airport since 7 days |
|
| 3257 | - * @return Array number, icao, name and city of airports |
|
| 3258 | - */ |
|
| 3256 | + * Get a list of flights detected to airport since 7 days |
|
| 3257 | + * @return Array number, icao, name and city of airports |
|
| 3258 | + */ |
|
| 3259 | 3259 | |
| 3260 | 3260 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
| 3261 | 3261 | global $globalTimezone, $globalDBdriver; |
@@ -3296,9 +3296,9 @@ discard block |
||
| 3296 | 3296 | |
| 3297 | 3297 | |
| 3298 | 3298 | /** |
| 3299 | - * Get a list of flights to airport since 7 days |
|
| 3300 | - * @return Array number, icao, name and city of airports |
|
| 3301 | - */ |
|
| 3299 | + * Get a list of flights to airport since 7 days |
|
| 3300 | + * @return Array number, icao, name and city of airports |
|
| 3301 | + */ |
|
| 3302 | 3302 | |
| 3303 | 3303 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
| 3304 | 3304 | global $globalTimezone, $globalDBdriver; |
@@ -3330,9 +3330,9 @@ discard block |
||
| 3330 | 3330 | |
| 3331 | 3331 | |
| 3332 | 3332 | /** |
| 3333 | - * Get a list of flights detected to airport since 7 days |
|
| 3334 | - * @return Array number, icao, name and city of airports |
|
| 3335 | - */ |
|
| 3333 | + * Get a list of flights detected to airport since 7 days |
|
| 3334 | + * @return Array number, icao, name and city of airports |
|
| 3335 | + */ |
|
| 3336 | 3336 | |
| 3337 | 3337 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
| 3338 | 3338 | global $globalTimezone, $globalDBdriver; |
@@ -3376,11 +3376,11 @@ discard block |
||
| 3376 | 3376 | |
| 3377 | 3377 | |
| 3378 | 3378 | /** |
| 3379 | - * Gets a list of all dates |
|
| 3380 | - * |
|
| 3381 | - * @return Array list of date names |
|
| 3382 | - * |
|
| 3383 | - */ |
|
| 3379 | + * Gets a list of all dates |
|
| 3380 | + * |
|
| 3381 | + * @return Array list of date names |
|
| 3382 | + * |
|
| 3383 | + */ |
|
| 3384 | 3384 | public function getAllDates() |
| 3385 | 3385 | { |
| 3386 | 3386 | global $globalTimezone, $globalDBdriver; |
@@ -3421,11 +3421,11 @@ discard block |
||
| 3421 | 3421 | |
| 3422 | 3422 | |
| 3423 | 3423 | /** |
| 3424 | - * Gets all route combinations |
|
| 3425 | - * |
|
| 3426 | - * @return Array the route list |
|
| 3427 | - * |
|
| 3428 | - */ |
|
| 3424 | + * Gets all route combinations |
|
| 3425 | + * |
|
| 3426 | + * @return Array the route list |
|
| 3427 | + * |
|
| 3428 | + */ |
|
| 3429 | 3429 | public function getAllRoutes() |
| 3430 | 3430 | { |
| 3431 | 3431 | $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 |
@@ -3451,13 +3451,13 @@ discard block |
||
| 3451 | 3451 | } |
| 3452 | 3452 | |
| 3453 | 3453 | /** |
| 3454 | - * Update ident spotter data |
|
| 3455 | - * |
|
| 3456 | - * @param String $flightaware_id the ID from flightaware |
|
| 3457 | - * @param String $ident the flight ident |
|
| 3458 | - * @return String success or false |
|
| 3459 | - * |
|
| 3460 | - */ |
|
| 3454 | + * Update ident spotter data |
|
| 3455 | + * |
|
| 3456 | + * @param String $flightaware_id the ID from flightaware |
|
| 3457 | + * @param String $ident the flight ident |
|
| 3458 | + * @return String success or false |
|
| 3459 | + * |
|
| 3460 | + */ |
|
| 3461 | 3461 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
| 3462 | 3462 | { |
| 3463 | 3463 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3478,14 +3478,14 @@ discard block |
||
| 3478 | 3478 | } else { |
| 3479 | 3479 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3480 | 3480 | } |
| 3481 | - $airline_name = $airline_array[0]['name']; |
|
| 3482 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3483 | - $airline_country = $airline_array[0]['country']; |
|
| 3484 | - $airline_type = $airline_array[0]['type']; |
|
| 3481 | + $airline_name = $airline_array[0]['name']; |
|
| 3482 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3483 | + $airline_country = $airline_array[0]['country']; |
|
| 3484 | + $airline_type = $airline_array[0]['type']; |
|
| 3485 | 3485 | |
| 3486 | 3486 | |
| 3487 | 3487 | $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'; |
| 3488 | - $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); |
|
| 3488 | + $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); |
|
| 3489 | 3489 | |
| 3490 | 3490 | try { |
| 3491 | 3491 | $sth = $this->db->prepare($query); |
@@ -3498,19 +3498,19 @@ discard block |
||
| 3498 | 3498 | |
| 3499 | 3499 | } |
| 3500 | 3500 | /** |
| 3501 | - * Update latest spotter data |
|
| 3502 | - * |
|
| 3503 | - * @param String $flightaware_id the ID from flightaware |
|
| 3504 | - * @param String $ident the flight ident |
|
| 3505 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3506 | - * @return String success or false |
|
| 3507 | - * |
|
| 3508 | - */ |
|
| 3501 | + * Update latest spotter data |
|
| 3502 | + * |
|
| 3503 | + * @param String $flightaware_id the ID from flightaware |
|
| 3504 | + * @param String $ident the flight ident |
|
| 3505 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3506 | + * @return String success or false |
|
| 3507 | + * |
|
| 3508 | + */ |
|
| 3509 | 3509 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 3510 | 3510 | { |
| 3511 | 3511 | if ($groundspeed == '') $groundspeed = NULL; |
| 3512 | 3512 | $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'; |
| 3513 | - $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); |
|
| 3513 | + $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); |
|
| 3514 | 3514 | |
| 3515 | 3515 | try { |
| 3516 | 3516 | $sth = $this->db->prepare($query); |
@@ -3524,32 +3524,32 @@ discard block |
||
| 3524 | 3524 | } |
| 3525 | 3525 | |
| 3526 | 3526 | /** |
| 3527 | - * Adds a new spotter data |
|
| 3528 | - * |
|
| 3529 | - * @param String $flightaware_id the ID from flightaware |
|
| 3530 | - * @param String $ident the flight ident |
|
| 3531 | - * @param String $aircraft_icao the aircraft type |
|
| 3532 | - * @param String $departure_airport_icao the departure airport |
|
| 3533 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3534 | - * @param String $latitude latitude of flight |
|
| 3535 | - * @param String $longitude latitude of flight |
|
| 3536 | - * @param String $waypoints waypoints of flight |
|
| 3537 | - * @param String $altitude altitude of flight |
|
| 3538 | - * @param String $heading heading of flight |
|
| 3539 | - * @param String $groundspeed speed of flight |
|
| 3540 | - * @param String $date date of flight |
|
| 3541 | - * @param String $departure_airport_time departure time of flight |
|
| 3542 | - * @param String $arrival_airport_time arrival time of flight |
|
| 3543 | - * @param String $squawk squawk code of flight |
|
| 3544 | - * @param String $route_stop route stop of flight |
|
| 3545 | - * @param String $highlight highlight or not |
|
| 3546 | - * @param String $ModeS ModesS code of flight |
|
| 3547 | - * @param String $registration registration code of flight |
|
| 3548 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3549 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3550 | - * @param String $verticalrate vertival rate of flight |
|
| 3551 | - * @return String success or false |
|
| 3552 | - */ |
|
| 3527 | + * Adds a new spotter data |
|
| 3528 | + * |
|
| 3529 | + * @param String $flightaware_id the ID from flightaware |
|
| 3530 | + * @param String $ident the flight ident |
|
| 3531 | + * @param String $aircraft_icao the aircraft type |
|
| 3532 | + * @param String $departure_airport_icao the departure airport |
|
| 3533 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3534 | + * @param String $latitude latitude of flight |
|
| 3535 | + * @param String $longitude latitude of flight |
|
| 3536 | + * @param String $waypoints waypoints of flight |
|
| 3537 | + * @param String $altitude altitude of flight |
|
| 3538 | + * @param String $heading heading of flight |
|
| 3539 | + * @param String $groundspeed speed of flight |
|
| 3540 | + * @param String $date date of flight |
|
| 3541 | + * @param String $departure_airport_time departure time of flight |
|
| 3542 | + * @param String $arrival_airport_time arrival time of flight |
|
| 3543 | + * @param String $squawk squawk code of flight |
|
| 3544 | + * @param String $route_stop route stop of flight |
|
| 3545 | + * @param String $highlight highlight or not |
|
| 3546 | + * @param String $ModeS ModesS code of flight |
|
| 3547 | + * @param String $registration registration code of flight |
|
| 3548 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3549 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3550 | + * @param String $verticalrate vertival rate of flight |
|
| 3551 | + * @return String success or false |
|
| 3552 | + */ |
|
| 3553 | 3553 | 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 = '') |
| 3554 | 3554 | { |
| 3555 | 3555 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
@@ -3764,8 +3764,8 @@ discard block |
||
| 3764 | 3764 | |
| 3765 | 3765 | if ($globalIVAO && $aircraft_icao != '') |
| 3766 | 3766 | { |
| 3767 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3768 | - else $airline_icao = ''; |
|
| 3767 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3768 | + else $airline_icao = ''; |
|
| 3769 | 3769 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3770 | 3770 | if (!isset($image_array[0]['registration'])) |
| 3771 | 3771 | { |
@@ -3796,53 +3796,53 @@ discard block |
||
| 3796 | 3796 | |
| 3797 | 3797 | if (count($airline_array) == 0) |
| 3798 | 3798 | { |
| 3799 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3800 | - } |
|
| 3801 | - if (count($aircraft_array) == 0) |
|
| 3802 | - { |
|
| 3803 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3804 | - } |
|
| 3805 | - if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
| 3806 | - { |
|
| 3807 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3808 | - } |
|
| 3809 | - if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
| 3810 | - { |
|
| 3811 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3812 | - } |
|
| 3813 | - if ($registration == '') $registration = 'NA'; |
|
| 3814 | - if ($latitude == '' && $longitude == '') { |
|
| 3815 | - $latitude = 0; |
|
| 3816 | - $longitude = 0; |
|
| 3817 | - } |
|
| 3818 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3819 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3820 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3821 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3822 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3823 | - $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) |
|
| 3799 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3800 | + } |
|
| 3801 | + if (count($aircraft_array) == 0) |
|
| 3802 | + { |
|
| 3803 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3804 | + } |
|
| 3805 | + if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
| 3806 | + { |
|
| 3807 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3808 | + } |
|
| 3809 | + if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
| 3810 | + { |
|
| 3811 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3812 | + } |
|
| 3813 | + if ($registration == '') $registration = 'NA'; |
|
| 3814 | + if ($latitude == '' && $longitude == '') { |
|
| 3815 | + $latitude = 0; |
|
| 3816 | + $longitude = 0; |
|
| 3817 | + } |
|
| 3818 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3819 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3820 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3821 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3822 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3823 | + $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) |
|
| 3824 | 3824 | 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)"; |
| 3825 | 3825 | |
| 3826 | - $airline_name = $airline_array[0]['name']; |
|
| 3827 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3828 | - $airline_country = $airline_array[0]['country']; |
|
| 3829 | - $airline_type = $airline_array[0]['type']; |
|
| 3826 | + $airline_name = $airline_array[0]['name']; |
|
| 3827 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3828 | + $airline_country = $airline_array[0]['country']; |
|
| 3829 | + $airline_type = $airline_array[0]['type']; |
|
| 3830 | 3830 | if ($airline_type == '') { |
| 3831 | 3831 | $timeelapsed = microtime(true); |
| 3832 | 3832 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3833 | 3833 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
| 3834 | 3834 | } |
| 3835 | 3835 | if ($airline_type == null) $airline_type = ''; |
| 3836 | - $aircraft_type = $aircraft_array[0]['type']; |
|
| 3837 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3838 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3839 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3840 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3836 | + $aircraft_type = $aircraft_array[0]['type']; |
|
| 3837 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3838 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3839 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3840 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3841 | 3841 | |
| 3842 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3843 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3844 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3845 | - $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); |
|
| 3842 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3843 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3844 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3845 | + $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); |
|
| 3846 | 3846 | |
| 3847 | 3847 | try { |
| 3848 | 3848 | |
@@ -3850,7 +3850,7 @@ discard block |
||
| 3850 | 3850 | $sth->execute($query_values); |
| 3851 | 3851 | $this->db = null; |
| 3852 | 3852 | } catch (PDOException $e) { |
| 3853 | - return "error : ".$e->getMessage(); |
|
| 3853 | + return "error : ".$e->getMessage(); |
|
| 3854 | 3854 | } |
| 3855 | 3855 | |
| 3856 | 3856 | return "success"; |
@@ -3859,11 +3859,11 @@ discard block |
||
| 3859 | 3859 | |
| 3860 | 3860 | |
| 3861 | 3861 | /** |
| 3862 | - * Gets the aircraft ident within the last hour |
|
| 3863 | - * |
|
| 3864 | - * @return String the ident |
|
| 3865 | - * |
|
| 3866 | - */ |
|
| 3862 | + * Gets the aircraft ident within the last hour |
|
| 3863 | + * |
|
| 3864 | + * @return String the ident |
|
| 3865 | + * |
|
| 3866 | + */ |
|
| 3867 | 3867 | public function getIdentFromLastHour($ident) |
| 3868 | 3868 | { |
| 3869 | 3869 | global $globalDBdriver, $globalTimezone; |
@@ -3879,11 +3879,11 @@ discard block |
||
| 3879 | 3879 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3880 | 3880 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
| 3881 | 3881 | $query_data = array(':ident' => $ident); |
| 3882 | - } |
|
| 3882 | + } |
|
| 3883 | 3883 | |
| 3884 | 3884 | $sth = $this->db->prepare($query); |
| 3885 | 3885 | $sth->execute($query_data); |
| 3886 | - $ident_result=''; |
|
| 3886 | + $ident_result=''; |
|
| 3887 | 3887 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3888 | 3888 | { |
| 3889 | 3889 | $ident_result = $row['ident']; |
@@ -3894,11 +3894,11 @@ discard block |
||
| 3894 | 3894 | |
| 3895 | 3895 | |
| 3896 | 3896 | /** |
| 3897 | - * Gets the aircraft data from the last 20 seconds |
|
| 3898 | - * |
|
| 3899 | - * @return Array the spotter data |
|
| 3900 | - * |
|
| 3901 | - */ |
|
| 3897 | + * Gets the aircraft data from the last 20 seconds |
|
| 3898 | + * |
|
| 3899 | + * @return Array the spotter data |
|
| 3900 | + * |
|
| 3901 | + */ |
|
| 3902 | 3902 | public function getRealTimeData($q = '') |
| 3903 | 3903 | { |
| 3904 | 3904 | global $globalDBdriver; |
@@ -3942,11 +3942,11 @@ discard block |
||
| 3942 | 3942 | |
| 3943 | 3943 | |
| 3944 | 3944 | /** |
| 3945 | - * Gets all airlines that have flown over |
|
| 3946 | - * |
|
| 3947 | - * @return Array the airline list |
|
| 3948 | - * |
|
| 3949 | - */ |
|
| 3945 | + * Gets all airlines that have flown over |
|
| 3946 | + * |
|
| 3947 | + * @return Array the airline list |
|
| 3948 | + * |
|
| 3949 | + */ |
|
| 3950 | 3950 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '') |
| 3951 | 3951 | { |
| 3952 | 3952 | global $globalDBdriver; |
@@ -3960,7 +3960,7 @@ discard block |
||
| 3960 | 3960 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 3961 | 3961 | } |
| 3962 | 3962 | } |
| 3963 | - if ($sincedate != '') { |
|
| 3963 | + if ($sincedate != '') { |
|
| 3964 | 3964 | if ($globalDBdriver == 'mysql') { |
| 3965 | 3965 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 3966 | 3966 | } else { |
@@ -4014,26 +4014,26 @@ discard block |
||
| 4014 | 4014 | } |
| 4015 | 4015 | |
| 4016 | 4016 | /** |
| 4017 | - * Gets all pilots that have flown over |
|
| 4018 | - * |
|
| 4019 | - * @return Array the pilots list |
|
| 4020 | - * |
|
| 4021 | - */ |
|
| 4017 | + * Gets all pilots that have flown over |
|
| 4018 | + * |
|
| 4019 | + * @return Array the pilots list |
|
| 4020 | + * |
|
| 4021 | + */ |
|
| 4022 | 4022 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '') |
| 4023 | 4023 | { |
| 4024 | 4024 | global $globalDBdriver; |
| 4025 | 4025 | $filter_query = $this->getFilter($filters,true,true); |
| 4026 | 4026 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
| 4027 | 4027 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> ''"; |
| 4028 | - if ($olderthanmonths > 0) { |
|
| 4029 | - if ($globalDBdriver == 'mysql') { |
|
| 4028 | + if ($olderthanmonths > 0) { |
|
| 4029 | + if ($globalDBdriver == 'mysql') { |
|
| 4030 | 4030 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 4031 | 4031 | } else { |
| 4032 | 4032 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4033 | 4033 | } |
| 4034 | 4034 | } |
| 4035 | - if ($sincedate != '') { |
|
| 4036 | - if ($globalDBdriver == 'mysql') { |
|
| 4035 | + if ($sincedate != '') { |
|
| 4036 | + if ($globalDBdriver == 'mysql') { |
|
| 4037 | 4037 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 4038 | 4038 | } else { |
| 4039 | 4039 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4088,25 +4088,25 @@ discard block |
||
| 4088 | 4088 | } |
| 4089 | 4089 | |
| 4090 | 4090 | /** |
| 4091 | - * Gets all pilots that have flown over |
|
| 4092 | - * |
|
| 4093 | - * @return Array the pilots list |
|
| 4094 | - * |
|
| 4095 | - */ |
|
| 4091 | + * Gets all pilots that have flown over |
|
| 4092 | + * |
|
| 4093 | + * @return Array the pilots list |
|
| 4094 | + * |
|
| 4095 | + */ |
|
| 4096 | 4096 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 4097 | 4097 | { |
| 4098 | 4098 | global $globalDBdriver; |
| 4099 | 4099 | $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 |
| 4100 | 4100 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
| 4101 | - if ($olderthanmonths > 0) { |
|
| 4102 | - if ($globalDBdriver == 'mysql') { |
|
| 4101 | + if ($olderthanmonths > 0) { |
|
| 4102 | + if ($globalDBdriver == 'mysql') { |
|
| 4103 | 4103 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4104 | 4104 | } else { |
| 4105 | 4105 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4106 | 4106 | } |
| 4107 | 4107 | } |
| 4108 | - if ($sincedate != '') { |
|
| 4109 | - if ($globalDBdriver == 'mysql') { |
|
| 4108 | + if ($sincedate != '') { |
|
| 4109 | + if ($globalDBdriver == 'mysql') { |
|
| 4110 | 4110 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 4111 | 4111 | } else { |
| 4112 | 4112 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4135,26 +4135,26 @@ discard block |
||
| 4135 | 4135 | } |
| 4136 | 4136 | |
| 4137 | 4137 | /** |
| 4138 | - * Gets all owner that have flown over |
|
| 4139 | - * |
|
| 4140 | - * @return Array the pilots list |
|
| 4141 | - * |
|
| 4142 | - */ |
|
| 4138 | + * Gets all owner that have flown over |
|
| 4139 | + * |
|
| 4140 | + * @return Array the pilots list |
|
| 4141 | + * |
|
| 4142 | + */ |
|
| 4143 | 4143 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 4144 | 4144 | { |
| 4145 | 4145 | global $globalDBdriver; |
| 4146 | 4146 | $filter_query = $this->getFilter($filters,true,true); |
| 4147 | 4147 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 4148 | 4148 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL"; |
| 4149 | - if ($olderthanmonths > 0) { |
|
| 4150 | - if ($globalDBdriver == 'mysql') { |
|
| 4149 | + if ($olderthanmonths > 0) { |
|
| 4150 | + if ($globalDBdriver == 'mysql') { |
|
| 4151 | 4151 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 4152 | 4152 | } else { |
| 4153 | 4153 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4154 | 4154 | } |
| 4155 | 4155 | } |
| 4156 | - if ($sincedate != '') { |
|
| 4157 | - if ($globalDBdriver == 'mysql') { |
|
| 4156 | + if ($sincedate != '') { |
|
| 4157 | + if ($globalDBdriver == 'mysql') { |
|
| 4158 | 4158 | $query .= " AND spotter_output.date > '".$sincedate."' "; |
| 4159 | 4159 | } else { |
| 4160 | 4160 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4205,26 +4205,26 @@ discard block |
||
| 4205 | 4205 | } |
| 4206 | 4206 | |
| 4207 | 4207 | /** |
| 4208 | - * Gets all owner that have flown over |
|
| 4209 | - * |
|
| 4210 | - * @return Array the pilots list |
|
| 4211 | - * |
|
| 4212 | - */ |
|
| 4208 | + * Gets all owner that have flown over |
|
| 4209 | + * |
|
| 4210 | + * @return Array the pilots list |
|
| 4211 | + * |
|
| 4212 | + */ |
|
| 4213 | 4213 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 4214 | 4214 | { |
| 4215 | 4215 | global $globalDBdriver; |
| 4216 | 4216 | $filter_query = $this->getFilter($filters,true,true); |
| 4217 | 4217 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 4218 | 4218 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 4219 | - if ($olderthanmonths > 0) { |
|
| 4220 | - if ($globalDBdriver == 'mysql') { |
|
| 4219 | + if ($olderthanmonths > 0) { |
|
| 4220 | + if ($globalDBdriver == 'mysql') { |
|
| 4221 | 4221 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4222 | 4222 | } else { |
| 4223 | 4223 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4224 | 4224 | } |
| 4225 | 4225 | } |
| 4226 | - if ($sincedate != '') { |
|
| 4227 | - if ($globalDBdriver == 'mysql') { |
|
| 4226 | + if ($sincedate != '') { |
|
| 4227 | + if ($globalDBdriver == 'mysql') { |
|
| 4228 | 4228 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 4229 | 4229 | } else { |
| 4230 | 4230 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4251,11 +4251,11 @@ discard block |
||
| 4251 | 4251 | } |
| 4252 | 4252 | |
| 4253 | 4253 | /** |
| 4254 | - * Gets all airlines that have flown over by aircraft |
|
| 4255 | - * |
|
| 4256 | - * @return Array the airline list |
|
| 4257 | - * |
|
| 4258 | - */ |
|
| 4254 | + * Gets all airlines that have flown over by aircraft |
|
| 4255 | + * |
|
| 4256 | + * @return Array the airline list |
|
| 4257 | + * |
|
| 4258 | + */ |
|
| 4259 | 4259 | public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
| 4260 | 4260 | { |
| 4261 | 4261 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4287,11 +4287,11 @@ discard block |
||
| 4287 | 4287 | |
| 4288 | 4288 | |
| 4289 | 4289 | /** |
| 4290 | - * Gets all airline countries that have flown over by aircraft |
|
| 4291 | - * |
|
| 4292 | - * @return Array the airline country list |
|
| 4293 | - * |
|
| 4294 | - */ |
|
| 4290 | + * Gets all airline countries that have flown over by aircraft |
|
| 4291 | + * |
|
| 4292 | + * @return Array the airline country list |
|
| 4293 | + * |
|
| 4294 | + */ |
|
| 4295 | 4295 | public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
| 4296 | 4296 | { |
| 4297 | 4297 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4323,11 +4323,11 @@ discard block |
||
| 4323 | 4323 | |
| 4324 | 4324 | |
| 4325 | 4325 | /** |
| 4326 | - * Gets all airlines that have flown over by airport |
|
| 4327 | - * |
|
| 4328 | - * @return Array the airline list |
|
| 4329 | - * |
|
| 4330 | - */ |
|
| 4326 | + * Gets all airlines that have flown over by airport |
|
| 4327 | + * |
|
| 4328 | + * @return Array the airline list |
|
| 4329 | + * |
|
| 4330 | + */ |
|
| 4331 | 4331 | public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
| 4332 | 4332 | { |
| 4333 | 4333 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4358,11 +4358,11 @@ discard block |
||
| 4358 | 4358 | |
| 4359 | 4359 | |
| 4360 | 4360 | /** |
| 4361 | - * Gets all airline countries that have flown over by airport icao |
|
| 4362 | - * |
|
| 4363 | - * @return Array the airline country list |
|
| 4364 | - * |
|
| 4365 | - */ |
|
| 4361 | + * Gets all airline countries that have flown over by airport icao |
|
| 4362 | + * |
|
| 4363 | + * @return Array the airline country list |
|
| 4364 | + * |
|
| 4365 | + */ |
|
| 4366 | 4366 | public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
| 4367 | 4367 | { |
| 4368 | 4368 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4392,11 +4392,11 @@ discard block |
||
| 4392 | 4392 | |
| 4393 | 4393 | |
| 4394 | 4394 | /** |
| 4395 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
| 4396 | - * |
|
| 4397 | - * @return Array the airline list |
|
| 4398 | - * |
|
| 4399 | - */ |
|
| 4395 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
| 4396 | + * |
|
| 4397 | + * @return Array the airline list |
|
| 4398 | + * |
|
| 4399 | + */ |
|
| 4400 | 4400 | public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 4401 | 4401 | { |
| 4402 | 4402 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4427,11 +4427,11 @@ discard block |
||
| 4427 | 4427 | |
| 4428 | 4428 | |
| 4429 | 4429 | /** |
| 4430 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 4431 | - * |
|
| 4432 | - * @return Array the airline country list |
|
| 4433 | - * |
|
| 4434 | - */ |
|
| 4430 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 4431 | + * |
|
| 4432 | + * @return Array the airline country list |
|
| 4433 | + * |
|
| 4434 | + */ |
|
| 4435 | 4435 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 4436 | 4436 | { |
| 4437 | 4437 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4460,11 +4460,11 @@ discard block |
||
| 4460 | 4460 | |
| 4461 | 4461 | |
| 4462 | 4462 | /** |
| 4463 | - * Gets all airlines that have flown over by date |
|
| 4464 | - * |
|
| 4465 | - * @return Array the airline list |
|
| 4466 | - * |
|
| 4467 | - */ |
|
| 4463 | + * Gets all airlines that have flown over by date |
|
| 4464 | + * |
|
| 4465 | + * @return Array the airline list |
|
| 4466 | + * |
|
| 4467 | + */ |
|
| 4468 | 4468 | public function countAllAirlinesByDate($date,$filters = array()) |
| 4469 | 4469 | { |
| 4470 | 4470 | global $globalTimezone, $globalDBdriver; |
@@ -4508,11 +4508,11 @@ discard block |
||
| 4508 | 4508 | |
| 4509 | 4509 | |
| 4510 | 4510 | /** |
| 4511 | - * Gets all airline countries that have flown over by date |
|
| 4512 | - * |
|
| 4513 | - * @return Array the airline country list |
|
| 4514 | - * |
|
| 4515 | - */ |
|
| 4511 | + * Gets all airline countries that have flown over by date |
|
| 4512 | + * |
|
| 4513 | + * @return Array the airline country list |
|
| 4514 | + * |
|
| 4515 | + */ |
|
| 4516 | 4516 | public function countAllAirlineCountriesByDate($date,$filters = array()) |
| 4517 | 4517 | { |
| 4518 | 4518 | global $globalTimezone, $globalDBdriver; |
@@ -4555,11 +4555,11 @@ discard block |
||
| 4555 | 4555 | |
| 4556 | 4556 | |
| 4557 | 4557 | /** |
| 4558 | - * Gets all airlines that have flown over by ident/callsign |
|
| 4559 | - * |
|
| 4560 | - * @return Array the airline list |
|
| 4561 | - * |
|
| 4562 | - */ |
|
| 4558 | + * Gets all airlines that have flown over by ident/callsign |
|
| 4559 | + * |
|
| 4560 | + * @return Array the airline list |
|
| 4561 | + * |
|
| 4562 | + */ |
|
| 4563 | 4563 | public function countAllAirlinesByIdent($ident,$filters = array()) |
| 4564 | 4564 | { |
| 4565 | 4565 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4576,11 +4576,11 @@ discard block |
||
| 4576 | 4576 | } |
| 4577 | 4577 | |
| 4578 | 4578 | /** |
| 4579 | - * Gets all airlines by owner |
|
| 4580 | - * |
|
| 4581 | - * @return Array the airline list |
|
| 4582 | - * |
|
| 4583 | - */ |
|
| 4579 | + * Gets all airlines by owner |
|
| 4580 | + * |
|
| 4581 | + * @return Array the airline list |
|
| 4582 | + * |
|
| 4583 | + */ |
|
| 4584 | 4584 | public function countAllAirlinesByOwner($owner,$filters = array()) |
| 4585 | 4585 | { |
| 4586 | 4586 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4597,11 +4597,11 @@ discard block |
||
| 4597 | 4597 | } |
| 4598 | 4598 | |
| 4599 | 4599 | /** |
| 4600 | - * Gets flight duration by owner |
|
| 4601 | - * |
|
| 4602 | - * @return String Duration of all flights |
|
| 4603 | - * |
|
| 4604 | - */ |
|
| 4600 | + * Gets flight duration by owner |
|
| 4601 | + * |
|
| 4602 | + * @return String Duration of all flights |
|
| 4603 | + * |
|
| 4604 | + */ |
|
| 4605 | 4605 | public function getFlightDurationByOwner($owner,$filters = array()) |
| 4606 | 4606 | { |
| 4607 | 4607 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4616,11 +4616,11 @@ discard block |
||
| 4616 | 4616 | } |
| 4617 | 4617 | |
| 4618 | 4618 | /** |
| 4619 | - * Gets flight duration by pilot |
|
| 4620 | - * |
|
| 4621 | - * @return String Duration of all flights |
|
| 4622 | - * |
|
| 4623 | - */ |
|
| 4619 | + * Gets flight duration by pilot |
|
| 4620 | + * |
|
| 4621 | + * @return String Duration of all flights |
|
| 4622 | + * |
|
| 4623 | + */ |
|
| 4624 | 4624 | public function getFlightDurationByPilot($pilot,$filters = array()) |
| 4625 | 4625 | { |
| 4626 | 4626 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4635,11 +4635,11 @@ discard block |
||
| 4635 | 4635 | } |
| 4636 | 4636 | |
| 4637 | 4637 | /** |
| 4638 | - * Gets all airlines used by pilot |
|
| 4639 | - * |
|
| 4640 | - * @return Array the airline list |
|
| 4641 | - * |
|
| 4642 | - */ |
|
| 4638 | + * Gets all airlines used by pilot |
|
| 4639 | + * |
|
| 4640 | + * @return Array the airline list |
|
| 4641 | + * |
|
| 4642 | + */ |
|
| 4643 | 4643 | public function countAllAirlinesByPilot($pilot,$filters = array()) |
| 4644 | 4644 | { |
| 4645 | 4645 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4656,11 +4656,11 @@ discard block |
||
| 4656 | 4656 | } |
| 4657 | 4657 | |
| 4658 | 4658 | /** |
| 4659 | - * Gets all airlines that have flown over by route |
|
| 4660 | - * |
|
| 4661 | - * @return Array the airline list |
|
| 4662 | - * |
|
| 4663 | - */ |
|
| 4659 | + * Gets all airlines that have flown over by route |
|
| 4660 | + * |
|
| 4661 | + * @return Array the airline list |
|
| 4662 | + * |
|
| 4663 | + */ |
|
| 4664 | 4664 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 4665 | 4665 | { |
| 4666 | 4666 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4692,11 +4692,11 @@ discard block |
||
| 4692 | 4692 | } |
| 4693 | 4693 | |
| 4694 | 4694 | /** |
| 4695 | - * Gets all airline countries that have flown over by route |
|
| 4696 | - * |
|
| 4697 | - * @return Array the airline country list |
|
| 4698 | - * |
|
| 4699 | - */ |
|
| 4695 | + * Gets all airline countries that have flown over by route |
|
| 4696 | + * |
|
| 4697 | + * @return Array the airline country list |
|
| 4698 | + * |
|
| 4699 | + */ |
|
| 4700 | 4700 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
| 4701 | 4701 | { |
| 4702 | 4702 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4728,11 +4728,11 @@ discard block |
||
| 4728 | 4728 | |
| 4729 | 4729 | |
| 4730 | 4730 | /** |
| 4731 | - * Gets all airlines that have flown over by country |
|
| 4732 | - * |
|
| 4733 | - * @return Array the airline list |
|
| 4734 | - * |
|
| 4735 | - */ |
|
| 4731 | + * Gets all airlines that have flown over by country |
|
| 4732 | + * |
|
| 4733 | + * @return Array the airline list |
|
| 4734 | + * |
|
| 4735 | + */ |
|
| 4736 | 4736 | public function countAllAirlinesByCountry($country,$filters = array()) |
| 4737 | 4737 | { |
| 4738 | 4738 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4762,11 +4762,11 @@ discard block |
||
| 4762 | 4762 | |
| 4763 | 4763 | |
| 4764 | 4764 | /** |
| 4765 | - * Gets all airline countries that have flown over by country |
|
| 4766 | - * |
|
| 4767 | - * @return Array the airline country list |
|
| 4768 | - * |
|
| 4769 | - */ |
|
| 4765 | + * Gets all airline countries that have flown over by country |
|
| 4766 | + * |
|
| 4767 | + * @return Array the airline country list |
|
| 4768 | + * |
|
| 4769 | + */ |
|
| 4770 | 4770 | public function countAllAirlineCountriesByCountry($country,$filters = array()) |
| 4771 | 4771 | { |
| 4772 | 4772 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4795,11 +4795,11 @@ discard block |
||
| 4795 | 4795 | |
| 4796 | 4796 | |
| 4797 | 4797 | /** |
| 4798 | - * Gets all airlines countries |
|
| 4799 | - * |
|
| 4800 | - * @return Array the airline country list |
|
| 4801 | - * |
|
| 4802 | - */ |
|
| 4798 | + * Gets all airlines countries |
|
| 4799 | + * |
|
| 4800 | + * @return Array the airline country list |
|
| 4801 | + * |
|
| 4802 | + */ |
|
| 4803 | 4803 | public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
| 4804 | 4804 | { |
| 4805 | 4805 | global $globalDBdriver; |
@@ -4854,11 +4854,11 @@ discard block |
||
| 4854 | 4854 | } |
| 4855 | 4855 | |
| 4856 | 4856 | /** |
| 4857 | - * Gets all number of flight over countries |
|
| 4858 | - * |
|
| 4859 | - * @return Array the airline country list |
|
| 4860 | - * |
|
| 4861 | - */ |
|
| 4857 | + * Gets all number of flight over countries |
|
| 4858 | + * |
|
| 4859 | + * @return Array the airline country list |
|
| 4860 | + * |
|
| 4861 | + */ |
|
| 4862 | 4862 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 4863 | 4863 | { |
| 4864 | 4864 | global $globalDBdriver; |
@@ -4880,15 +4880,15 @@ discard block |
||
| 4880 | 4880 | $SpotterLive = new SpotterLive(); |
| 4881 | 4881 | $filter_query = $SpotterLive->getFilter($filters,true,true); |
| 4882 | 4882 | $filter_query .= ' over_country IS NOT NULL'; |
| 4883 | - if ($olderthanmonths > 0) { |
|
| 4883 | + if ($olderthanmonths > 0) { |
|
| 4884 | 4884 | if ($globalDBdriver == 'mysql') { |
| 4885 | 4885 | $filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4886 | 4886 | } else { |
| 4887 | 4887 | $filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4888 | 4888 | } |
| 4889 | 4889 | } |
| 4890 | - if ($sincedate != '') { |
|
| 4891 | - if ($globalDBdriver == 'mysql') { |
|
| 4890 | + if ($sincedate != '') { |
|
| 4891 | + if ($globalDBdriver == 'mysql') { |
|
| 4892 | 4892 | $filter_query .= " AND spotter_live.date > '".$sincedate."' "; |
| 4893 | 4893 | } else { |
| 4894 | 4894 | $filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4918,11 +4918,11 @@ discard block |
||
| 4918 | 4918 | |
| 4919 | 4919 | |
| 4920 | 4920 | /** |
| 4921 | - * Gets all aircraft types that have flown over |
|
| 4922 | - * |
|
| 4923 | - * @return Array the aircraft list |
|
| 4924 | - * |
|
| 4925 | - */ |
|
| 4921 | + * Gets all aircraft types that have flown over |
|
| 4922 | + * |
|
| 4923 | + * @return Array the aircraft list |
|
| 4924 | + * |
|
| 4925 | + */ |
|
| 4926 | 4926 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 4927 | 4927 | { |
| 4928 | 4928 | global $globalDBdriver; |
@@ -4992,11 +4992,11 @@ discard block |
||
| 4992 | 4992 | } |
| 4993 | 4993 | |
| 4994 | 4994 | /** |
| 4995 | - * Gets all aircraft types that have flown over by airline |
|
| 4996 | - * |
|
| 4997 | - * @return Array the aircraft list |
|
| 4998 | - * |
|
| 4999 | - */ |
|
| 4995 | + * Gets all aircraft types that have flown over by airline |
|
| 4996 | + * |
|
| 4997 | + * @return Array the aircraft list |
|
| 4998 | + * |
|
| 4999 | + */ |
|
| 5000 | 5000 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '') |
| 5001 | 5001 | { |
| 5002 | 5002 | global $globalDBdriver; |
@@ -5067,11 +5067,11 @@ discard block |
||
| 5067 | 5067 | } |
| 5068 | 5068 | |
| 5069 | 5069 | /** |
| 5070 | - * Gets all aircraft types that have flown over by months |
|
| 5071 | - * |
|
| 5072 | - * @return Array the aircraft list |
|
| 5073 | - * |
|
| 5074 | - */ |
|
| 5070 | + * Gets all aircraft types that have flown over by months |
|
| 5071 | + * |
|
| 5072 | + * @return Array the aircraft list |
|
| 5073 | + * |
|
| 5074 | + */ |
|
| 5075 | 5075 | public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 5076 | 5076 | { |
| 5077 | 5077 | global $globalDBdriver; |
@@ -5115,11 +5115,11 @@ discard block |
||
| 5115 | 5115 | |
| 5116 | 5116 | |
| 5117 | 5117 | /** |
| 5118 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
| 5119 | - * |
|
| 5120 | - * @return Array the aircraft list |
|
| 5121 | - * |
|
| 5122 | - */ |
|
| 5118 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
| 5119 | + * |
|
| 5120 | + * @return Array the aircraft list |
|
| 5121 | + * |
|
| 5122 | + */ |
|
| 5123 | 5123 | public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
| 5124 | 5124 | { |
| 5125 | 5125 | $Image = new Image($this->db); |
@@ -5158,11 +5158,11 @@ discard block |
||
| 5158 | 5158 | |
| 5159 | 5159 | |
| 5160 | 5160 | /** |
| 5161 | - * Gets all aircraft types that have flown over by airline icao |
|
| 5162 | - * |
|
| 5163 | - * @return Array the aircraft list |
|
| 5164 | - * |
|
| 5165 | - */ |
|
| 5161 | + * Gets all aircraft types that have flown over by airline icao |
|
| 5162 | + * |
|
| 5163 | + * @return Array the aircraft list |
|
| 5164 | + * |
|
| 5165 | + */ |
|
| 5166 | 5166 | public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
| 5167 | 5167 | { |
| 5168 | 5168 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5191,11 +5191,11 @@ discard block |
||
| 5191 | 5191 | |
| 5192 | 5192 | |
| 5193 | 5193 | /** |
| 5194 | - * Gets all aircraft registration that have flown over by airline icao |
|
| 5195 | - * |
|
| 5196 | - * @return Array the aircraft list |
|
| 5197 | - * |
|
| 5198 | - */ |
|
| 5194 | + * Gets all aircraft registration that have flown over by airline icao |
|
| 5195 | + * |
|
| 5196 | + * @return Array the aircraft list |
|
| 5197 | + * |
|
| 5198 | + */ |
|
| 5199 | 5199 | public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
| 5200 | 5200 | { |
| 5201 | 5201 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5233,11 +5233,11 @@ discard block |
||
| 5233 | 5233 | |
| 5234 | 5234 | |
| 5235 | 5235 | /** |
| 5236 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 5237 | - * |
|
| 5238 | - * @return Array the aircraft list |
|
| 5239 | - * |
|
| 5240 | - */ |
|
| 5236 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 5237 | + * |
|
| 5238 | + * @return Array the aircraft list |
|
| 5239 | + * |
|
| 5240 | + */ |
|
| 5241 | 5241 | public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
| 5242 | 5242 | { |
| 5243 | 5243 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5265,11 +5265,11 @@ discard block |
||
| 5265 | 5265 | |
| 5266 | 5266 | |
| 5267 | 5267 | /** |
| 5268 | - * Gets all aircraft types that have flown over by airline icao |
|
| 5269 | - * |
|
| 5270 | - * @return Array the aircraft list |
|
| 5271 | - * |
|
| 5272 | - */ |
|
| 5268 | + * Gets all aircraft types that have flown over by airline icao |
|
| 5269 | + * |
|
| 5270 | + * @return Array the aircraft list |
|
| 5271 | + * |
|
| 5272 | + */ |
|
| 5273 | 5273 | public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
| 5274 | 5274 | { |
| 5275 | 5275 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5298,11 +5298,11 @@ discard block |
||
| 5298 | 5298 | |
| 5299 | 5299 | |
| 5300 | 5300 | /** |
| 5301 | - * Gets all aircraft registration that have flown over by airport icao |
|
| 5302 | - * |
|
| 5303 | - * @return Array the aircraft list |
|
| 5304 | - * |
|
| 5305 | - */ |
|
| 5301 | + * Gets all aircraft registration that have flown over by airport icao |
|
| 5302 | + * |
|
| 5303 | + * @return Array the aircraft list |
|
| 5304 | + * |
|
| 5305 | + */ |
|
| 5306 | 5306 | public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
| 5307 | 5307 | { |
| 5308 | 5308 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5339,11 +5339,11 @@ discard block |
||
| 5339 | 5339 | |
| 5340 | 5340 | |
| 5341 | 5341 | /** |
| 5342 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 5343 | - * |
|
| 5344 | - * @return Array the aircraft list |
|
| 5345 | - * |
|
| 5346 | - */ |
|
| 5342 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 5343 | + * |
|
| 5344 | + * @return Array the aircraft list |
|
| 5345 | + * |
|
| 5346 | + */ |
|
| 5347 | 5347 | public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
| 5348 | 5348 | { |
| 5349 | 5349 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5369,11 +5369,11 @@ discard block |
||
| 5369 | 5369 | } |
| 5370 | 5370 | |
| 5371 | 5371 | /** |
| 5372 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 5373 | - * |
|
| 5374 | - * @return Array the aircraft list |
|
| 5375 | - * |
|
| 5376 | - */ |
|
| 5372 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 5373 | + * |
|
| 5374 | + * @return Array the aircraft list |
|
| 5375 | + * |
|
| 5376 | + */ |
|
| 5377 | 5377 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 5378 | 5378 | { |
| 5379 | 5379 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5400,11 +5400,11 @@ discard block |
||
| 5400 | 5400 | |
| 5401 | 5401 | |
| 5402 | 5402 | /** |
| 5403 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 5404 | - * |
|
| 5405 | - * @return Array the aircraft list |
|
| 5406 | - * |
|
| 5407 | - */ |
|
| 5403 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 5404 | + * |
|
| 5405 | + * @return Array the aircraft list |
|
| 5406 | + * |
|
| 5407 | + */ |
|
| 5408 | 5408 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
| 5409 | 5409 | { |
| 5410 | 5410 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5440,11 +5440,11 @@ discard block |
||
| 5440 | 5440 | } |
| 5441 | 5441 | |
| 5442 | 5442 | /** |
| 5443 | - * Gets all aircraft types that have flown over by date |
|
| 5444 | - * |
|
| 5445 | - * @return Array the aircraft list |
|
| 5446 | - * |
|
| 5447 | - */ |
|
| 5443 | + * Gets all aircraft types that have flown over by date |
|
| 5444 | + * |
|
| 5445 | + * @return Array the aircraft list |
|
| 5446 | + * |
|
| 5447 | + */ |
|
| 5448 | 5448 | public function countAllAircraftTypesByDate($date,$filters = array()) |
| 5449 | 5449 | { |
| 5450 | 5450 | global $globalTimezone, $globalDBdriver; |
@@ -5486,11 +5486,11 @@ discard block |
||
| 5486 | 5486 | |
| 5487 | 5487 | |
| 5488 | 5488 | /** |
| 5489 | - * Gets all aircraft registration that have flown over by date |
|
| 5490 | - * |
|
| 5491 | - * @return Array the aircraft list |
|
| 5492 | - * |
|
| 5493 | - */ |
|
| 5489 | + * Gets all aircraft registration that have flown over by date |
|
| 5490 | + * |
|
| 5491 | + * @return Array the aircraft list |
|
| 5492 | + * |
|
| 5493 | + */ |
|
| 5494 | 5494 | public function countAllAircraftRegistrationByDate($date,$filters = array()) |
| 5495 | 5495 | { |
| 5496 | 5496 | global $globalTimezone, $globalDBdriver; |
@@ -5541,11 +5541,11 @@ discard block |
||
| 5541 | 5541 | |
| 5542 | 5542 | |
| 5543 | 5543 | /** |
| 5544 | - * Gets all aircraft manufacturer that have flown over by date |
|
| 5545 | - * |
|
| 5546 | - * @return Array the aircraft manufacturer list |
|
| 5547 | - * |
|
| 5548 | - */ |
|
| 5544 | + * Gets all aircraft manufacturer that have flown over by date |
|
| 5545 | + * |
|
| 5546 | + * @return Array the aircraft manufacturer list |
|
| 5547 | + * |
|
| 5548 | + */ |
|
| 5549 | 5549 | public function countAllAircraftManufacturerByDate($date,$filters = array()) |
| 5550 | 5550 | { |
| 5551 | 5551 | global $globalTimezone, $globalDBdriver; |
@@ -5587,11 +5587,11 @@ discard block |
||
| 5587 | 5587 | |
| 5588 | 5588 | |
| 5589 | 5589 | /** |
| 5590 | - * Gets all aircraft types that have flown over by ident/callsign |
|
| 5591 | - * |
|
| 5592 | - * @return Array the aircraft list |
|
| 5593 | - * |
|
| 5594 | - */ |
|
| 5590 | + * Gets all aircraft types that have flown over by ident/callsign |
|
| 5591 | + * |
|
| 5592 | + * @return Array the aircraft list |
|
| 5593 | + * |
|
| 5594 | + */ |
|
| 5595 | 5595 | public function countAllAircraftTypesByIdent($ident,$filters = array()) |
| 5596 | 5596 | { |
| 5597 | 5597 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5619,11 +5619,11 @@ discard block |
||
| 5619 | 5619 | } |
| 5620 | 5620 | |
| 5621 | 5621 | /** |
| 5622 | - * Gets all aircraft types that have flown over by pilot |
|
| 5623 | - * |
|
| 5624 | - * @return Array the aircraft list |
|
| 5625 | - * |
|
| 5626 | - */ |
|
| 5622 | + * Gets all aircraft types that have flown over by pilot |
|
| 5623 | + * |
|
| 5624 | + * @return Array the aircraft list |
|
| 5625 | + * |
|
| 5626 | + */ |
|
| 5627 | 5627 | public function countAllAircraftTypesByPilot($pilot,$filters = array()) |
| 5628 | 5628 | { |
| 5629 | 5629 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5639,11 +5639,11 @@ discard block |
||
| 5639 | 5639 | } |
| 5640 | 5640 | |
| 5641 | 5641 | /** |
| 5642 | - * Gets all aircraft types that have flown over by owner |
|
| 5643 | - * |
|
| 5644 | - * @return Array the aircraft list |
|
| 5645 | - * |
|
| 5646 | - */ |
|
| 5642 | + * Gets all aircraft types that have flown over by owner |
|
| 5643 | + * |
|
| 5644 | + * @return Array the aircraft list |
|
| 5645 | + * |
|
| 5646 | + */ |
|
| 5647 | 5647 | public function countAllAircraftTypesByOwner($owner,$filters = array()) |
| 5648 | 5648 | { |
| 5649 | 5649 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5659,11 +5659,11 @@ discard block |
||
| 5659 | 5659 | } |
| 5660 | 5660 | |
| 5661 | 5661 | /** |
| 5662 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
| 5663 | - * |
|
| 5664 | - * @return Array the aircraft list |
|
| 5665 | - * |
|
| 5666 | - */ |
|
| 5662 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
| 5663 | + * |
|
| 5664 | + * @return Array the aircraft list |
|
| 5665 | + * |
|
| 5666 | + */ |
|
| 5667 | 5667 | public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
| 5668 | 5668 | { |
| 5669 | 5669 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5702,11 +5702,11 @@ discard block |
||
| 5702 | 5702 | } |
| 5703 | 5703 | |
| 5704 | 5704 | /** |
| 5705 | - * Gets all aircraft registration that have flown over by owner |
|
| 5706 | - * |
|
| 5707 | - * @return Array the aircraft list |
|
| 5708 | - * |
|
| 5709 | - */ |
|
| 5705 | + * Gets all aircraft registration that have flown over by owner |
|
| 5706 | + * |
|
| 5707 | + * @return Array the aircraft list |
|
| 5708 | + * |
|
| 5709 | + */ |
|
| 5710 | 5710 | public function countAllAircraftRegistrationByOwner($owner,$filters = array()) |
| 5711 | 5711 | { |
| 5712 | 5712 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5746,11 +5746,11 @@ discard block |
||
| 5746 | 5746 | } |
| 5747 | 5747 | |
| 5748 | 5748 | /** |
| 5749 | - * Gets all aircraft registration that have flown over by pilot |
|
| 5750 | - * |
|
| 5751 | - * @return Array the aircraft list |
|
| 5752 | - * |
|
| 5753 | - */ |
|
| 5749 | + * Gets all aircraft registration that have flown over by pilot |
|
| 5750 | + * |
|
| 5751 | + * @return Array the aircraft list |
|
| 5752 | + * |
|
| 5753 | + */ |
|
| 5754 | 5754 | public function countAllAircraftRegistrationByPilot($pilot,$filters = array()) |
| 5755 | 5755 | { |
| 5756 | 5756 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5791,11 +5791,11 @@ discard block |
||
| 5791 | 5791 | |
| 5792 | 5792 | |
| 5793 | 5793 | /** |
| 5794 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 5795 | - * |
|
| 5796 | - * @return Array the aircraft manufacturer list |
|
| 5797 | - * |
|
| 5798 | - */ |
|
| 5794 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 5795 | + * |
|
| 5796 | + * @return Array the aircraft manufacturer list |
|
| 5797 | + * |
|
| 5798 | + */ |
|
| 5799 | 5799 | public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
| 5800 | 5800 | { |
| 5801 | 5801 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5820,11 +5820,11 @@ discard block |
||
| 5820 | 5820 | } |
| 5821 | 5821 | |
| 5822 | 5822 | /** |
| 5823 | - * Gets all aircraft manufacturer that have flown over by owner |
|
| 5824 | - * |
|
| 5825 | - * @return Array the aircraft manufacturer list |
|
| 5826 | - * |
|
| 5827 | - */ |
|
| 5823 | + * Gets all aircraft manufacturer that have flown over by owner |
|
| 5824 | + * |
|
| 5825 | + * @return Array the aircraft manufacturer list |
|
| 5826 | + * |
|
| 5827 | + */ |
|
| 5828 | 5828 | public function countAllAircraftManufacturerByOwner($owner,$filters = array()) |
| 5829 | 5829 | { |
| 5830 | 5830 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5841,11 +5841,11 @@ discard block |
||
| 5841 | 5841 | } |
| 5842 | 5842 | |
| 5843 | 5843 | /** |
| 5844 | - * Gets all aircraft manufacturer that have flown over by pilot |
|
| 5845 | - * |
|
| 5846 | - * @return Array the aircraft manufacturer list |
|
| 5847 | - * |
|
| 5848 | - */ |
|
| 5844 | + * Gets all aircraft manufacturer that have flown over by pilot |
|
| 5845 | + * |
|
| 5846 | + * @return Array the aircraft manufacturer list |
|
| 5847 | + * |
|
| 5848 | + */ |
|
| 5849 | 5849 | public function countAllAircraftManufacturerByPilot($pilot,$filters = array()) |
| 5850 | 5850 | { |
| 5851 | 5851 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5863,11 +5863,11 @@ discard block |
||
| 5863 | 5863 | |
| 5864 | 5864 | |
| 5865 | 5865 | /** |
| 5866 | - * Gets all aircraft types that have flown over by route |
|
| 5867 | - * |
|
| 5868 | - * @return Array the aircraft list |
|
| 5869 | - * |
|
| 5870 | - */ |
|
| 5866 | + * Gets all aircraft types that have flown over by route |
|
| 5867 | + * |
|
| 5868 | + * @return Array the aircraft list |
|
| 5869 | + * |
|
| 5870 | + */ |
|
| 5871 | 5871 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 5872 | 5872 | { |
| 5873 | 5873 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5896,11 +5896,11 @@ discard block |
||
| 5896 | 5896 | } |
| 5897 | 5897 | |
| 5898 | 5898 | /** |
| 5899 | - * Gets all aircraft registration that have flown over by route |
|
| 5900 | - * |
|
| 5901 | - * @return Array the aircraft list |
|
| 5902 | - * |
|
| 5903 | - */ |
|
| 5899 | + * Gets all aircraft registration that have flown over by route |
|
| 5900 | + * |
|
| 5901 | + * @return Array the aircraft list |
|
| 5902 | + * |
|
| 5903 | + */ |
|
| 5904 | 5904 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 5905 | 5905 | { |
| 5906 | 5906 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5942,11 +5942,11 @@ discard block |
||
| 5942 | 5942 | |
| 5943 | 5943 | |
| 5944 | 5944 | /** |
| 5945 | - * Gets all aircraft manufacturer that have flown over by route |
|
| 5946 | - * |
|
| 5947 | - * @return Array the aircraft manufacturer list |
|
| 5948 | - * |
|
| 5949 | - */ |
|
| 5945 | + * Gets all aircraft manufacturer that have flown over by route |
|
| 5946 | + * |
|
| 5947 | + * @return Array the aircraft manufacturer list |
|
| 5948 | + * |
|
| 5949 | + */ |
|
| 5950 | 5950 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 5951 | 5951 | { |
| 5952 | 5952 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5980,11 +5980,11 @@ discard block |
||
| 5980 | 5980 | |
| 5981 | 5981 | |
| 5982 | 5982 | /** |
| 5983 | - * Gets all aircraft types that have flown over by country |
|
| 5984 | - * |
|
| 5985 | - * @return Array the aircraft list |
|
| 5986 | - * |
|
| 5987 | - */ |
|
| 5983 | + * Gets all aircraft types that have flown over by country |
|
| 5984 | + * |
|
| 5985 | + * @return Array the aircraft list |
|
| 5986 | + * |
|
| 5987 | + */ |
|
| 5988 | 5988 | public function countAllAircraftTypesByCountry($country,$filters = array()) |
| 5989 | 5989 | { |
| 5990 | 5990 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6015,11 +6015,11 @@ discard block |
||
| 6015 | 6015 | |
| 6016 | 6016 | |
| 6017 | 6017 | /** |
| 6018 | - * Gets all aircraft registration that have flown over by country |
|
| 6019 | - * |
|
| 6020 | - * @return Array the aircraft list |
|
| 6021 | - * |
|
| 6022 | - */ |
|
| 6018 | + * Gets all aircraft registration that have flown over by country |
|
| 6019 | + * |
|
| 6020 | + * @return Array the aircraft list |
|
| 6021 | + * |
|
| 6022 | + */ |
|
| 6023 | 6023 | public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
| 6024 | 6024 | { |
| 6025 | 6025 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6059,11 +6059,11 @@ discard block |
||
| 6059 | 6059 | |
| 6060 | 6060 | |
| 6061 | 6061 | /** |
| 6062 | - * Gets all aircraft manufacturer that have flown over by country |
|
| 6063 | - * |
|
| 6064 | - * @return Array the aircraft manufacturer list |
|
| 6065 | - * |
|
| 6066 | - */ |
|
| 6062 | + * Gets all aircraft manufacturer that have flown over by country |
|
| 6063 | + * |
|
| 6064 | + * @return Array the aircraft manufacturer list |
|
| 6065 | + * |
|
| 6066 | + */ |
|
| 6067 | 6067 | public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
| 6068 | 6068 | { |
| 6069 | 6069 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6094,18 +6094,18 @@ discard block |
||
| 6094 | 6094 | |
| 6095 | 6095 | |
| 6096 | 6096 | /** |
| 6097 | - * Gets all aircraft manufacturers that have flown over |
|
| 6098 | - * |
|
| 6099 | - * @return Array the aircraft list |
|
| 6100 | - * |
|
| 6101 | - */ |
|
| 6097 | + * Gets all aircraft manufacturers that have flown over |
|
| 6098 | + * |
|
| 6099 | + * @return Array the aircraft list |
|
| 6100 | + * |
|
| 6101 | + */ |
|
| 6102 | 6102 | public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '') |
| 6103 | 6103 | { |
| 6104 | 6104 | global $globalDBdriver; |
| 6105 | 6105 | $filter_query = $this->getFilter($filters,true,true); |
| 6106 | 6106 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
| 6107 | 6107 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
| 6108 | - $query_values = array(); |
|
| 6108 | + $query_values = array(); |
|
| 6109 | 6109 | if ($year != '') { |
| 6110 | 6110 | if ($globalDBdriver == 'mysql') { |
| 6111 | 6111 | $query .= " AND YEAR(spotter_output.date) = :year"; |
@@ -6158,11 +6158,11 @@ discard block |
||
| 6158 | 6158 | |
| 6159 | 6159 | |
| 6160 | 6160 | /** |
| 6161 | - * Gets all aircraft registrations that have flown over |
|
| 6162 | - * |
|
| 6163 | - * @return Array the aircraft list |
|
| 6164 | - * |
|
| 6165 | - */ |
|
| 6161 | + * Gets all aircraft registrations that have flown over |
|
| 6162 | + * |
|
| 6163 | + * @return Array the aircraft list |
|
| 6164 | + * |
|
| 6165 | + */ |
|
| 6166 | 6166 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
| 6167 | 6167 | { |
| 6168 | 6168 | global $globalDBdriver; |
@@ -6170,15 +6170,15 @@ discard block |
||
| 6170 | 6170 | $filter_query = $this->getFilter($filters,true,true); |
| 6171 | 6171 | $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 |
| 6172 | 6172 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
| 6173 | - if ($olderthanmonths > 0) { |
|
| 6174 | - if ($globalDBdriver == 'mysql') { |
|
| 6173 | + if ($olderthanmonths > 0) { |
|
| 6174 | + if ($globalDBdriver == 'mysql') { |
|
| 6175 | 6175 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6176 | 6176 | } else { |
| 6177 | 6177 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6178 | 6178 | } |
| 6179 | 6179 | } |
| 6180 | - if ($sincedate != '') { |
|
| 6181 | - if ($globalDBdriver == 'mysql') { |
|
| 6180 | + if ($sincedate != '') { |
|
| 6181 | + if ($globalDBdriver == 'mysql') { |
|
| 6182 | 6182 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6183 | 6183 | } else { |
| 6184 | 6184 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6243,11 +6243,11 @@ discard block |
||
| 6243 | 6243 | |
| 6244 | 6244 | |
| 6245 | 6245 | /** |
| 6246 | - * Gets all aircraft registrations that have flown over |
|
| 6247 | - * |
|
| 6248 | - * @return Array the aircraft list |
|
| 6249 | - * |
|
| 6250 | - */ |
|
| 6246 | + * Gets all aircraft registrations that have flown over |
|
| 6247 | + * |
|
| 6248 | + * @return Array the aircraft list |
|
| 6249 | + * |
|
| 6250 | + */ |
|
| 6251 | 6251 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 6252 | 6252 | { |
| 6253 | 6253 | global $globalDBdriver; |
@@ -6255,15 +6255,15 @@ discard block |
||
| 6255 | 6255 | $Image = new Image($this->db); |
| 6256 | 6256 | $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 |
| 6257 | 6257 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 6258 | - if ($olderthanmonths > 0) { |
|
| 6259 | - if ($globalDBdriver == 'mysql') { |
|
| 6258 | + if ($olderthanmonths > 0) { |
|
| 6259 | + if ($globalDBdriver == 'mysql') { |
|
| 6260 | 6260 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6261 | 6261 | } else { |
| 6262 | 6262 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6263 | 6263 | } |
| 6264 | 6264 | } |
| 6265 | - if ($sincedate != '') { |
|
| 6266 | - if ($globalDBdriver == 'mysql') { |
|
| 6265 | + if ($sincedate != '') { |
|
| 6266 | + if ($globalDBdriver == 'mysql') { |
|
| 6267 | 6267 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6268 | 6268 | } else { |
| 6269 | 6269 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6272,7 +6272,7 @@ discard block |
||
| 6272 | 6272 | |
| 6273 | 6273 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6274 | 6274 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6275 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 6275 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 6276 | 6276 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6277 | 6277 | |
| 6278 | 6278 | $sth = $this->db->prepare($query); |
@@ -6304,26 +6304,26 @@ discard block |
||
| 6304 | 6304 | |
| 6305 | 6305 | |
| 6306 | 6306 | /** |
| 6307 | - * Gets all departure airports of the airplanes that have flown over |
|
| 6308 | - * |
|
| 6309 | - * @return Array the airport list |
|
| 6310 | - * |
|
| 6311 | - */ |
|
| 6307 | + * Gets all departure airports of the airplanes that have flown over |
|
| 6308 | + * |
|
| 6309 | + * @return Array the airport list |
|
| 6310 | + * |
|
| 6311 | + */ |
|
| 6312 | 6312 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 6313 | 6313 | { |
| 6314 | 6314 | global $globalDBdriver; |
| 6315 | 6315 | $filter_query = $this->getFilter($filters,true,true); |
| 6316 | 6316 | $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 |
| 6317 | 6317 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
| 6318 | - if ($olderthanmonths > 0) { |
|
| 6319 | - if ($globalDBdriver == 'mysql') { |
|
| 6318 | + if ($olderthanmonths > 0) { |
|
| 6319 | + if ($globalDBdriver == 'mysql') { |
|
| 6320 | 6320 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6321 | 6321 | } else { |
| 6322 | 6322 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6323 | 6323 | } |
| 6324 | - } |
|
| 6325 | - if ($sincedate != '') { |
|
| 6326 | - if ($globalDBdriver == 'mysql') { |
|
| 6324 | + } |
|
| 6325 | + if ($sincedate != '') { |
|
| 6326 | + if ($globalDBdriver == 'mysql') { |
|
| 6327 | 6327 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6328 | 6328 | } else { |
| 6329 | 6329 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6357,7 +6357,7 @@ discard block |
||
| 6357 | 6357 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 6358 | 6358 | } |
| 6359 | 6359 | } |
| 6360 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 6360 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 6361 | 6361 | ORDER BY airport_departure_icao_count DESC"; |
| 6362 | 6362 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6363 | 6363 | |
@@ -6380,35 +6380,35 @@ discard block |
||
| 6380 | 6380 | } |
| 6381 | 6381 | |
| 6382 | 6382 | /** |
| 6383 | - * Gets all departure airports of the airplanes that have flown over |
|
| 6384 | - * |
|
| 6385 | - * @return Array the airport list |
|
| 6386 | - * |
|
| 6387 | - */ |
|
| 6383 | + * Gets all departure airports of the airplanes that have flown over |
|
| 6384 | + * |
|
| 6385 | + * @return Array the airport list |
|
| 6386 | + * |
|
| 6387 | + */ |
|
| 6388 | 6388 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 6389 | 6389 | { |
| 6390 | 6390 | global $globalDBdriver; |
| 6391 | 6391 | $filter_query = $this->getFilter($filters,true,true); |
| 6392 | 6392 | $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 |
| 6393 | 6393 | 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 <> '' "; |
| 6394 | - if ($olderthanmonths > 0) { |
|
| 6395 | - if ($globalDBdriver == 'mysql') { |
|
| 6394 | + if ($olderthanmonths > 0) { |
|
| 6395 | + if ($globalDBdriver == 'mysql') { |
|
| 6396 | 6396 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6397 | 6397 | } else { |
| 6398 | 6398 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6399 | 6399 | } |
| 6400 | - } |
|
| 6401 | - if ($sincedate != '') { |
|
| 6402 | - if ($globalDBdriver == 'mysql') { |
|
| 6400 | + } |
|
| 6401 | + if ($sincedate != '') { |
|
| 6402 | + if ($globalDBdriver == 'mysql') { |
|
| 6403 | 6403 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6404 | 6404 | } else { |
| 6405 | 6405 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6406 | 6406 | } |
| 6407 | 6407 | } |
| 6408 | 6408 | |
| 6409 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6410 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6411 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 6409 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6410 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6411 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 6412 | 6412 | ORDER BY airport_departure_icao_count DESC"; |
| 6413 | 6413 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6414 | 6414 | |
@@ -6433,26 +6433,26 @@ discard block |
||
| 6433 | 6433 | } |
| 6434 | 6434 | |
| 6435 | 6435 | /** |
| 6436 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 6437 | - * |
|
| 6438 | - * @return Array the airport list |
|
| 6439 | - * |
|
| 6440 | - */ |
|
| 6436 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 6437 | + * |
|
| 6438 | + * @return Array the airport list |
|
| 6439 | + * |
|
| 6440 | + */ |
|
| 6441 | 6441 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 6442 | 6442 | { |
| 6443 | 6443 | global $globalDBdriver; |
| 6444 | 6444 | $filter_query = $this->getFilter($filters,true,true); |
| 6445 | 6445 | $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 |
| 6446 | 6446 | 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"; |
| 6447 | - if ($olderthanmonths > 0) { |
|
| 6448 | - if ($globalDBdriver == 'mysql') { |
|
| 6447 | + if ($olderthanmonths > 0) { |
|
| 6448 | + if ($globalDBdriver == 'mysql') { |
|
| 6449 | 6449 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6450 | 6450 | } else { |
| 6451 | 6451 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6452 | 6452 | } |
| 6453 | - } |
|
| 6454 | - if ($sincedate != '') { |
|
| 6455 | - if ($globalDBdriver == 'mysql') { |
|
| 6453 | + } |
|
| 6454 | + if ($sincedate != '') { |
|
| 6455 | + if ($globalDBdriver == 'mysql') { |
|
| 6456 | 6456 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6457 | 6457 | } else { |
| 6458 | 6458 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6486,10 +6486,10 @@ discard block |
||
| 6486 | 6486 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 6487 | 6487 | } |
| 6488 | 6488 | } |
| 6489 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6489 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6490 | 6490 | ORDER BY airport_departure_icao_count DESC"; |
| 6491 | 6491 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6492 | - //echo $query; |
|
| 6492 | + //echo $query; |
|
| 6493 | 6493 | $sth = $this->db->prepare($query); |
| 6494 | 6494 | $sth->execute($query_values); |
| 6495 | 6495 | |
@@ -6510,35 +6510,35 @@ discard block |
||
| 6510 | 6510 | } |
| 6511 | 6511 | |
| 6512 | 6512 | /** |
| 6513 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 6514 | - * |
|
| 6515 | - * @return Array the airport list |
|
| 6516 | - * |
|
| 6517 | - */ |
|
| 6513 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 6514 | + * |
|
| 6515 | + * @return Array the airport list |
|
| 6516 | + * |
|
| 6517 | + */ |
|
| 6518 | 6518 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 6519 | 6519 | { |
| 6520 | 6520 | global $globalDBdriver; |
| 6521 | 6521 | $filter_query = $this->getFilter($filters,true,true); |
| 6522 | 6522 | $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 |
| 6523 | 6523 | 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 "; |
| 6524 | - if ($olderthanmonths > 0) { |
|
| 6525 | - if ($globalDBdriver == 'mysql') { |
|
| 6524 | + if ($olderthanmonths > 0) { |
|
| 6525 | + if ($globalDBdriver == 'mysql') { |
|
| 6526 | 6526 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6527 | 6527 | } else { |
| 6528 | 6528 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6529 | 6529 | } |
| 6530 | - } |
|
| 6531 | - if ($sincedate != '') { |
|
| 6532 | - if ($globalDBdriver == 'mysql') { |
|
| 6530 | + } |
|
| 6531 | + if ($sincedate != '') { |
|
| 6532 | + if ($globalDBdriver == 'mysql') { |
|
| 6533 | 6533 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6534 | 6534 | } else { |
| 6535 | 6535 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
| 6536 | 6536 | } |
| 6537 | 6537 | } |
| 6538 | 6538 | |
| 6539 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6540 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6541 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6539 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6540 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6541 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6542 | 6542 | ORDER BY airport_departure_icao_count DESC"; |
| 6543 | 6543 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6544 | 6544 | |
@@ -6563,11 +6563,11 @@ discard block |
||
| 6563 | 6563 | } |
| 6564 | 6564 | |
| 6565 | 6565 | /** |
| 6566 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 6567 | - * |
|
| 6568 | - * @return Array the airport list |
|
| 6569 | - * |
|
| 6570 | - */ |
|
| 6566 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 6567 | + * |
|
| 6568 | + * @return Array the airport list |
|
| 6569 | + * |
|
| 6570 | + */ |
|
| 6571 | 6571 | public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
| 6572 | 6572 | { |
| 6573 | 6573 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6601,11 +6601,11 @@ discard block |
||
| 6601 | 6601 | |
| 6602 | 6602 | |
| 6603 | 6603 | /** |
| 6604 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 6605 | - * |
|
| 6606 | - * @return Array the airport list |
|
| 6607 | - * |
|
| 6608 | - */ |
|
| 6604 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 6605 | + * |
|
| 6606 | + * @return Array the airport list |
|
| 6607 | + * |
|
| 6608 | + */ |
|
| 6609 | 6609 | public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
| 6610 | 6610 | { |
| 6611 | 6611 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6636,11 +6636,11 @@ discard block |
||
| 6636 | 6636 | |
| 6637 | 6637 | |
| 6638 | 6638 | /** |
| 6639 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 6640 | - * |
|
| 6641 | - * @return Array the airport list |
|
| 6642 | - * |
|
| 6643 | - */ |
|
| 6639 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 6640 | + * |
|
| 6641 | + * @return Array the airport list |
|
| 6642 | + * |
|
| 6643 | + */ |
|
| 6644 | 6644 | public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
| 6645 | 6645 | { |
| 6646 | 6646 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6673,11 +6673,11 @@ discard block |
||
| 6673 | 6673 | |
| 6674 | 6674 | |
| 6675 | 6675 | /** |
| 6676 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 6677 | - * |
|
| 6678 | - * @return Array the airport list |
|
| 6679 | - * |
|
| 6680 | - */ |
|
| 6676 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 6677 | + * |
|
| 6678 | + * @return Array the airport list |
|
| 6679 | + * |
|
| 6680 | + */ |
|
| 6681 | 6681 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
| 6682 | 6682 | { |
| 6683 | 6683 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6707,11 +6707,11 @@ discard block |
||
| 6707 | 6707 | |
| 6708 | 6708 | |
| 6709 | 6709 | /** |
| 6710 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 6711 | - * |
|
| 6712 | - * @return Array the airport list |
|
| 6713 | - * |
|
| 6714 | - */ |
|
| 6710 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 6711 | + * |
|
| 6712 | + * @return Array the airport list |
|
| 6713 | + * |
|
| 6714 | + */ |
|
| 6715 | 6715 | public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
| 6716 | 6716 | { |
| 6717 | 6717 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6744,11 +6744,11 @@ discard block |
||
| 6744 | 6744 | |
| 6745 | 6745 | |
| 6746 | 6746 | /** |
| 6747 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6748 | - * |
|
| 6749 | - * @return Array the airport list |
|
| 6750 | - * |
|
| 6751 | - */ |
|
| 6747 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6748 | + * |
|
| 6749 | + * @return Array the airport list |
|
| 6750 | + * |
|
| 6751 | + */ |
|
| 6752 | 6752 | public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
| 6753 | 6753 | { |
| 6754 | 6754 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6778,11 +6778,11 @@ discard block |
||
| 6778 | 6778 | |
| 6779 | 6779 | |
| 6780 | 6780 | /** |
| 6781 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 6782 | - * |
|
| 6783 | - * @return Array the airport list |
|
| 6784 | - * |
|
| 6785 | - */ |
|
| 6781 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 6782 | + * |
|
| 6783 | + * @return Array the airport list |
|
| 6784 | + * |
|
| 6785 | + */ |
|
| 6786 | 6786 | public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
| 6787 | 6787 | { |
| 6788 | 6788 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6815,11 +6815,11 @@ discard block |
||
| 6815 | 6815 | |
| 6816 | 6816 | |
| 6817 | 6817 | /** |
| 6818 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 6819 | - * |
|
| 6820 | - * @return Array the airport list |
|
| 6821 | - * |
|
| 6822 | - */ |
|
| 6818 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 6819 | + * |
|
| 6820 | + * @return Array the airport list |
|
| 6821 | + * |
|
| 6822 | + */ |
|
| 6823 | 6823 | public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
| 6824 | 6824 | { |
| 6825 | 6825 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6850,11 +6850,11 @@ discard block |
||
| 6850 | 6850 | |
| 6851 | 6851 | |
| 6852 | 6852 | /** |
| 6853 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 6854 | - * |
|
| 6855 | - * @return Array the airport list |
|
| 6856 | - * |
|
| 6857 | - */ |
|
| 6853 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 6854 | + * |
|
| 6855 | + * @return Array the airport list |
|
| 6856 | + * |
|
| 6857 | + */ |
|
| 6858 | 6858 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
| 6859 | 6859 | { |
| 6860 | 6860 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6887,11 +6887,11 @@ discard block |
||
| 6887 | 6887 | |
| 6888 | 6888 | |
| 6889 | 6889 | /** |
| 6890 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 6891 | - * |
|
| 6892 | - * @return Array the airport list |
|
| 6893 | - * |
|
| 6894 | - */ |
|
| 6890 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 6891 | + * |
|
| 6892 | + * @return Array the airport list |
|
| 6893 | + * |
|
| 6894 | + */ |
|
| 6895 | 6895 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 6896 | 6896 | { |
| 6897 | 6897 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6921,11 +6921,11 @@ discard block |
||
| 6921 | 6921 | |
| 6922 | 6922 | |
| 6923 | 6923 | /** |
| 6924 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 6925 | - * |
|
| 6926 | - * @return Array the airport list |
|
| 6927 | - * |
|
| 6928 | - */ |
|
| 6924 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 6925 | + * |
|
| 6926 | + * @return Array the airport list |
|
| 6927 | + * |
|
| 6928 | + */ |
|
| 6929 | 6929 | public function countAllDepartureAirportsByDate($date,$filters = array()) |
| 6930 | 6930 | { |
| 6931 | 6931 | global $globalTimezone, $globalDBdriver; |
@@ -6971,11 +6971,11 @@ discard block |
||
| 6971 | 6971 | |
| 6972 | 6972 | |
| 6973 | 6973 | /** |
| 6974 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 6975 | - * |
|
| 6976 | - * @return Array the airport list |
|
| 6977 | - * |
|
| 6978 | - */ |
|
| 6974 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 6975 | + * |
|
| 6976 | + * @return Array the airport list |
|
| 6977 | + * |
|
| 6978 | + */ |
|
| 6979 | 6979 | public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
| 6980 | 6980 | { |
| 6981 | 6981 | global $globalTimezone, $globalDBdriver; |
@@ -7018,11 +7018,11 @@ discard block |
||
| 7018 | 7018 | |
| 7019 | 7019 | |
| 7020 | 7020 | /** |
| 7021 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 7022 | - * |
|
| 7023 | - * @return Array the airport list |
|
| 7024 | - * |
|
| 7025 | - */ |
|
| 7021 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 7022 | + * |
|
| 7023 | + * @return Array the airport list |
|
| 7024 | + * |
|
| 7025 | + */ |
|
| 7026 | 7026 | public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
| 7027 | 7027 | { |
| 7028 | 7028 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7054,11 +7054,11 @@ discard block |
||
| 7054 | 7054 | } |
| 7055 | 7055 | |
| 7056 | 7056 | /** |
| 7057 | - * Gets all departure airports of the airplanes that have flown over based on a owner |
|
| 7058 | - * |
|
| 7059 | - * @return Array the airport list |
|
| 7060 | - * |
|
| 7061 | - */ |
|
| 7057 | + * Gets all departure airports of the airplanes that have flown over based on a owner |
|
| 7058 | + * |
|
| 7059 | + * @return Array the airport list |
|
| 7060 | + * |
|
| 7061 | + */ |
|
| 7062 | 7062 | public function countAllDepartureAirportsByOwner($owner,$filters = array()) |
| 7063 | 7063 | { |
| 7064 | 7064 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7090,11 +7090,11 @@ discard block |
||
| 7090 | 7090 | } |
| 7091 | 7091 | |
| 7092 | 7092 | /** |
| 7093 | - * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
| 7094 | - * |
|
| 7095 | - * @return Array the airport list |
|
| 7096 | - * |
|
| 7097 | - */ |
|
| 7093 | + * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
| 7094 | + * |
|
| 7095 | + * @return Array the airport list |
|
| 7096 | + * |
|
| 7097 | + */ |
|
| 7098 | 7098 | public function countAllDepartureAirportsByPilot($pilot,$filters = array()) |
| 7099 | 7099 | { |
| 7100 | 7100 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7127,11 +7127,11 @@ discard block |
||
| 7127 | 7127 | |
| 7128 | 7128 | |
| 7129 | 7129 | /** |
| 7130 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7131 | - * |
|
| 7132 | - * @return Array the airport list |
|
| 7133 | - * |
|
| 7134 | - */ |
|
| 7130 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7131 | + * |
|
| 7132 | + * @return Array the airport list |
|
| 7133 | + * |
|
| 7134 | + */ |
|
| 7135 | 7135 | public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
| 7136 | 7136 | { |
| 7137 | 7137 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7160,11 +7160,11 @@ discard block |
||
| 7160 | 7160 | } |
| 7161 | 7161 | |
| 7162 | 7162 | /** |
| 7163 | - * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
| 7164 | - * |
|
| 7165 | - * @return Array the airport list |
|
| 7166 | - * |
|
| 7167 | - */ |
|
| 7163 | + * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
| 7164 | + * |
|
| 7165 | + * @return Array the airport list |
|
| 7166 | + * |
|
| 7167 | + */ |
|
| 7168 | 7168 | public function countAllDepartureAirportCountriesByOwner($owner,$filters = array()) |
| 7169 | 7169 | { |
| 7170 | 7170 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7180,11 +7180,11 @@ discard block |
||
| 7180 | 7180 | } |
| 7181 | 7181 | |
| 7182 | 7182 | /** |
| 7183 | - * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
| 7184 | - * |
|
| 7185 | - * @return Array the airport list |
|
| 7186 | - * |
|
| 7187 | - */ |
|
| 7183 | + * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
| 7184 | + * |
|
| 7185 | + * @return Array the airport list |
|
| 7186 | + * |
|
| 7187 | + */ |
|
| 7188 | 7188 | public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array()) |
| 7189 | 7189 | { |
| 7190 | 7190 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7202,11 +7202,11 @@ discard block |
||
| 7202 | 7202 | |
| 7203 | 7203 | |
| 7204 | 7204 | /** |
| 7205 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 7206 | - * |
|
| 7207 | - * @return Array the airport list |
|
| 7208 | - * |
|
| 7209 | - */ |
|
| 7205 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 7206 | + * |
|
| 7207 | + * @return Array the airport list |
|
| 7208 | + * |
|
| 7209 | + */ |
|
| 7210 | 7210 | public function countAllDepartureAirportsByCountry($country,$filters = array()) |
| 7211 | 7211 | { |
| 7212 | 7212 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7240,11 +7240,11 @@ discard block |
||
| 7240 | 7240 | |
| 7241 | 7241 | |
| 7242 | 7242 | /** |
| 7243 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7244 | - * |
|
| 7245 | - * @return Array the airport list |
|
| 7246 | - * |
|
| 7247 | - */ |
|
| 7243 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7244 | + * |
|
| 7245 | + * @return Array the airport list |
|
| 7246 | + * |
|
| 7247 | + */ |
|
| 7248 | 7248 | public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
| 7249 | 7249 | { |
| 7250 | 7250 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7274,31 +7274,31 @@ discard block |
||
| 7274 | 7274 | |
| 7275 | 7275 | |
| 7276 | 7276 | /** |
| 7277 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 7278 | - * |
|
| 7279 | - * @param Boolean $limit Limit result to 10 or not |
|
| 7280 | - * @param Integer $olderthanmonths Only show result older than x months |
|
| 7281 | - * @param String $sincedate Only show result since x date |
|
| 7282 | - * @param Boolean $icaoaskey Show result by ICAO |
|
| 7283 | - * @param Array $filters Filter used here |
|
| 7284 | - * @return Array the airport list |
|
| 7285 | - * |
|
| 7286 | - */ |
|
| 7277 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 7278 | + * |
|
| 7279 | + * @param Boolean $limit Limit result to 10 or not |
|
| 7280 | + * @param Integer $olderthanmonths Only show result older than x months |
|
| 7281 | + * @param String $sincedate Only show result since x date |
|
| 7282 | + * @param Boolean $icaoaskey Show result by ICAO |
|
| 7283 | + * @param Array $filters Filter used here |
|
| 7284 | + * @return Array the airport list |
|
| 7285 | + * |
|
| 7286 | + */ |
|
| 7287 | 7287 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
| 7288 | 7288 | { |
| 7289 | 7289 | global $globalDBdriver; |
| 7290 | 7290 | $filter_query = $this->getFilter($filters,true,true); |
| 7291 | 7291 | $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 |
| 7292 | 7292 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
| 7293 | - if ($olderthanmonths > 0) { |
|
| 7294 | - if ($globalDBdriver == 'mysql') { |
|
| 7293 | + if ($olderthanmonths > 0) { |
|
| 7294 | + if ($globalDBdriver == 'mysql') { |
|
| 7295 | 7295 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 7296 | 7296 | } else { |
| 7297 | 7297 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 7298 | 7298 | } |
| 7299 | 7299 | } |
| 7300 | - if ($sincedate != '') { |
|
| 7301 | - if ($globalDBdriver == 'mysql') { |
|
| 7300 | + if ($sincedate != '') { |
|
| 7301 | + if ($globalDBdriver == 'mysql') { |
|
| 7302 | 7302 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 7303 | 7303 | } else { |
| 7304 | 7304 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7332,7 +7332,7 @@ discard block |
||
| 7332 | 7332 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 7333 | 7333 | } |
| 7334 | 7334 | } |
| 7335 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 7335 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 7336 | 7336 | ORDER BY airport_arrival_icao_count DESC"; |
| 7337 | 7337 | if ($limit) $query .= " LIMIT 10"; |
| 7338 | 7338 | |
@@ -7361,35 +7361,35 @@ discard block |
||
| 7361 | 7361 | } |
| 7362 | 7362 | |
| 7363 | 7363 | /** |
| 7364 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 7365 | - * |
|
| 7366 | - * @return Array the airport list |
|
| 7367 | - * |
|
| 7368 | - */ |
|
| 7364 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 7365 | + * |
|
| 7366 | + * @return Array the airport list |
|
| 7367 | + * |
|
| 7368 | + */ |
|
| 7369 | 7369 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
| 7370 | 7370 | { |
| 7371 | 7371 | global $globalDBdriver; |
| 7372 | 7372 | $filter_query = $this->getFilter($filters,true,true); |
| 7373 | 7373 | $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 |
| 7374 | 7374 | 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 <> '' "; |
| 7375 | - if ($olderthanmonths > 0) { |
|
| 7376 | - if ($globalDBdriver == 'mysql') { |
|
| 7375 | + if ($olderthanmonths > 0) { |
|
| 7376 | + if ($globalDBdriver == 'mysql') { |
|
| 7377 | 7377 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 7378 | 7378 | } else { |
| 7379 | 7379 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 7380 | 7380 | } |
| 7381 | 7381 | } |
| 7382 | - if ($sincedate != '') { |
|
| 7383 | - if ($globalDBdriver == 'mysql') { |
|
| 7382 | + if ($sincedate != '') { |
|
| 7383 | + if ($globalDBdriver == 'mysql') { |
|
| 7384 | 7384 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 7385 | 7385 | } else { |
| 7386 | 7386 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 7387 | 7387 | } |
| 7388 | 7388 | } |
| 7389 | 7389 | |
| 7390 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7391 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7392 | - $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 7390 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7391 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7392 | + $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 7393 | 7393 | ORDER BY airport_arrival_icao_count DESC"; |
| 7394 | 7394 | if ($limit) $query .= " LIMIT 10"; |
| 7395 | 7395 | |
@@ -7420,26 +7420,26 @@ discard block |
||
| 7420 | 7420 | |
| 7421 | 7421 | |
| 7422 | 7422 | /** |
| 7423 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7424 | - * |
|
| 7425 | - * @return Array the airport list |
|
| 7426 | - * |
|
| 7427 | - */ |
|
| 7423 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7424 | + * |
|
| 7425 | + * @return Array the airport list |
|
| 7426 | + * |
|
| 7427 | + */ |
|
| 7428 | 7428 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
| 7429 | 7429 | { |
| 7430 | 7430 | global $globalDBdriver; |
| 7431 | 7431 | $filter_query = $this->getFilter($filters,true,true); |
| 7432 | 7432 | $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 |
| 7433 | 7433 | 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"; |
| 7434 | - if ($olderthanmonths > 0) { |
|
| 7435 | - if ($globalDBdriver == 'mysql') { |
|
| 7434 | + if ($olderthanmonths > 0) { |
|
| 7435 | + if ($globalDBdriver == 'mysql') { |
|
| 7436 | 7436 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 7437 | 7437 | } else { |
| 7438 | 7438 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 7439 | 7439 | } |
| 7440 | 7440 | } |
| 7441 | - if ($sincedate != '') { |
|
| 7442 | - if ($globalDBdriver == 'mysql') { |
|
| 7441 | + if ($sincedate != '') { |
|
| 7442 | + if ($globalDBdriver == 'mysql') { |
|
| 7443 | 7443 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 7444 | 7444 | } else { |
| 7445 | 7445 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7473,7 +7473,7 @@ discard block |
||
| 7473 | 7473 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 7474 | 7474 | } |
| 7475 | 7475 | } |
| 7476 | - $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7476 | + $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7477 | 7477 | ORDER BY airport_arrival_icao_count DESC"; |
| 7478 | 7478 | if ($limit) $query .= " LIMIT 10"; |
| 7479 | 7479 | |
@@ -7501,35 +7501,35 @@ discard block |
||
| 7501 | 7501 | } |
| 7502 | 7502 | |
| 7503 | 7503 | /** |
| 7504 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7505 | - * |
|
| 7506 | - * @return Array the airport list |
|
| 7507 | - * |
|
| 7508 | - */ |
|
| 7504 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7505 | + * |
|
| 7506 | + * @return Array the airport list |
|
| 7507 | + * |
|
| 7508 | + */ |
|
| 7509 | 7509 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
| 7510 | 7510 | { |
| 7511 | 7511 | global $globalDBdriver; |
| 7512 | 7512 | $filter_query = $this->getFilter($filters,true,true); |
| 7513 | 7513 | $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 |
| 7514 | 7514 | 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 "; |
| 7515 | - if ($olderthanmonths > 0) { |
|
| 7516 | - if ($globalDBdriver == 'mysql') { |
|
| 7515 | + if ($olderthanmonths > 0) { |
|
| 7516 | + if ($globalDBdriver == 'mysql') { |
|
| 7517 | 7517 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 7518 | 7518 | } else { |
| 7519 | 7519 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 7520 | 7520 | } |
| 7521 | 7521 | } |
| 7522 | - if ($sincedate != '') { |
|
| 7523 | - if ($globalDBdriver == 'mysql') { |
|
| 7522 | + if ($sincedate != '') { |
|
| 7523 | + if ($globalDBdriver == 'mysql') { |
|
| 7524 | 7524 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 7525 | 7525 | } else { |
| 7526 | 7526 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 7527 | 7527 | } |
| 7528 | 7528 | } |
| 7529 | 7529 | |
| 7530 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7531 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7532 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7530 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7531 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7532 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7533 | 7533 | ORDER BY airport_arrival_icao_count DESC"; |
| 7534 | 7534 | if ($limit) $query .= " LIMIT 10"; |
| 7535 | 7535 | |
@@ -7559,11 +7559,11 @@ discard block |
||
| 7559 | 7559 | } |
| 7560 | 7560 | |
| 7561 | 7561 | /** |
| 7562 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 7563 | - * |
|
| 7564 | - * @return Array the airport list |
|
| 7565 | - * |
|
| 7566 | - */ |
|
| 7562 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 7563 | + * |
|
| 7564 | + * @return Array the airport list |
|
| 7565 | + * |
|
| 7566 | + */ |
|
| 7567 | 7567 | public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
| 7568 | 7568 | { |
| 7569 | 7569 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7595,11 +7595,11 @@ discard block |
||
| 7595 | 7595 | |
| 7596 | 7596 | |
| 7597 | 7597 | /** |
| 7598 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 7599 | - * |
|
| 7600 | - * @return Array the airport list |
|
| 7601 | - * |
|
| 7602 | - */ |
|
| 7598 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 7599 | + * |
|
| 7600 | + * @return Array the airport list |
|
| 7601 | + * |
|
| 7602 | + */ |
|
| 7603 | 7603 | public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
| 7604 | 7604 | { |
| 7605 | 7605 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7630,11 +7630,11 @@ discard block |
||
| 7630 | 7630 | |
| 7631 | 7631 | |
| 7632 | 7632 | /** |
| 7633 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 7634 | - * |
|
| 7635 | - * @return Array the airport list |
|
| 7636 | - * |
|
| 7637 | - */ |
|
| 7633 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 7634 | + * |
|
| 7635 | + * @return Array the airport list |
|
| 7636 | + * |
|
| 7637 | + */ |
|
| 7638 | 7638 | public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
| 7639 | 7639 | { |
| 7640 | 7640 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7668,11 +7668,11 @@ discard block |
||
| 7668 | 7668 | |
| 7669 | 7669 | |
| 7670 | 7670 | /** |
| 7671 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7672 | - * |
|
| 7673 | - * @return Array the airport list |
|
| 7674 | - * |
|
| 7675 | - */ |
|
| 7671 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7672 | + * |
|
| 7673 | + * @return Array the airport list |
|
| 7674 | + * |
|
| 7675 | + */ |
|
| 7676 | 7676 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
| 7677 | 7677 | { |
| 7678 | 7678 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7702,11 +7702,11 @@ discard block |
||
| 7702 | 7702 | |
| 7703 | 7703 | |
| 7704 | 7704 | /** |
| 7705 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 7706 | - * |
|
| 7707 | - * @return Array the airport list |
|
| 7708 | - * |
|
| 7709 | - */ |
|
| 7705 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 7706 | + * |
|
| 7707 | + * @return Array the airport list |
|
| 7708 | + * |
|
| 7709 | + */ |
|
| 7710 | 7710 | public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
| 7711 | 7711 | { |
| 7712 | 7712 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7740,11 +7740,11 @@ discard block |
||
| 7740 | 7740 | |
| 7741 | 7741 | |
| 7742 | 7742 | /** |
| 7743 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 7744 | - * |
|
| 7745 | - * @return Array the airport list |
|
| 7746 | - * |
|
| 7747 | - */ |
|
| 7743 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 7744 | + * |
|
| 7745 | + * @return Array the airport list |
|
| 7746 | + * |
|
| 7747 | + */ |
|
| 7748 | 7748 | public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
| 7749 | 7749 | { |
| 7750 | 7750 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7775,11 +7775,11 @@ discard block |
||
| 7775 | 7775 | |
| 7776 | 7776 | |
| 7777 | 7777 | /** |
| 7778 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 7779 | - * |
|
| 7780 | - * @return Array the airport list |
|
| 7781 | - * |
|
| 7782 | - */ |
|
| 7778 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 7779 | + * |
|
| 7780 | + * @return Array the airport list |
|
| 7781 | + * |
|
| 7782 | + */ |
|
| 7783 | 7783 | public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
| 7784 | 7784 | { |
| 7785 | 7785 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7812,11 +7812,11 @@ discard block |
||
| 7812 | 7812 | |
| 7813 | 7813 | |
| 7814 | 7814 | /** |
| 7815 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 7816 | - * |
|
| 7817 | - * @return Array the airport list |
|
| 7818 | - * |
|
| 7819 | - */ |
|
| 7815 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 7816 | + * |
|
| 7817 | + * @return Array the airport list |
|
| 7818 | + * |
|
| 7819 | + */ |
|
| 7820 | 7820 | public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
| 7821 | 7821 | { |
| 7822 | 7822 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7846,11 +7846,11 @@ discard block |
||
| 7846 | 7846 | |
| 7847 | 7847 | |
| 7848 | 7848 | /** |
| 7849 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 7850 | - * |
|
| 7851 | - * @return Array the airport list |
|
| 7852 | - * |
|
| 7853 | - */ |
|
| 7849 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 7850 | + * |
|
| 7851 | + * @return Array the airport list |
|
| 7852 | + * |
|
| 7853 | + */ |
|
| 7854 | 7854 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
| 7855 | 7855 | { |
| 7856 | 7856 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7884,11 +7884,11 @@ discard block |
||
| 7884 | 7884 | |
| 7885 | 7885 | |
| 7886 | 7886 | /** |
| 7887 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 7888 | - * |
|
| 7889 | - * @return Array the airport list |
|
| 7890 | - * |
|
| 7891 | - */ |
|
| 7887 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 7888 | + * |
|
| 7889 | + * @return Array the airport list |
|
| 7890 | + * |
|
| 7891 | + */ |
|
| 7892 | 7892 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 7893 | 7893 | { |
| 7894 | 7894 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7919,11 +7919,11 @@ discard block |
||
| 7919 | 7919 | |
| 7920 | 7920 | |
| 7921 | 7921 | /** |
| 7922 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 7923 | - * |
|
| 7924 | - * @return Array the airport list |
|
| 7925 | - * |
|
| 7926 | - */ |
|
| 7922 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 7923 | + * |
|
| 7924 | + * @return Array the airport list |
|
| 7925 | + * |
|
| 7926 | + */ |
|
| 7927 | 7927 | public function countAllArrivalAirportsByDate($date,$filters = array()) |
| 7928 | 7928 | { |
| 7929 | 7929 | global $globalTimezone, $globalDBdriver; |
@@ -7969,11 +7969,11 @@ discard block |
||
| 7969 | 7969 | |
| 7970 | 7970 | |
| 7971 | 7971 | /** |
| 7972 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 7973 | - * |
|
| 7974 | - * @return Array the airport list |
|
| 7975 | - * |
|
| 7976 | - */ |
|
| 7972 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 7973 | + * |
|
| 7974 | + * @return Array the airport list |
|
| 7975 | + * |
|
| 7976 | + */ |
|
| 7977 | 7977 | public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
| 7978 | 7978 | { |
| 7979 | 7979 | global $globalTimezone, $globalDBdriver; |
@@ -8016,11 +8016,11 @@ discard block |
||
| 8016 | 8016 | |
| 8017 | 8017 | |
| 8018 | 8018 | /** |
| 8019 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 8020 | - * |
|
| 8021 | - * @return Array the airport list |
|
| 8022 | - * |
|
| 8023 | - */ |
|
| 8019 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 8020 | + * |
|
| 8021 | + * @return Array the airport list |
|
| 8022 | + * |
|
| 8023 | + */ |
|
| 8024 | 8024 | public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
| 8025 | 8025 | { |
| 8026 | 8026 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8052,11 +8052,11 @@ discard block |
||
| 8052 | 8052 | } |
| 8053 | 8053 | |
| 8054 | 8054 | /** |
| 8055 | - * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
| 8056 | - * |
|
| 8057 | - * @return Array the airport list |
|
| 8058 | - * |
|
| 8059 | - */ |
|
| 8055 | + * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
| 8056 | + * |
|
| 8057 | + * @return Array the airport list |
|
| 8058 | + * |
|
| 8059 | + */ |
|
| 8060 | 8060 | public function countAllArrivalAirportsByOwner($owner,$filters = array()) |
| 8061 | 8061 | { |
| 8062 | 8062 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8087,11 +8087,11 @@ discard block |
||
| 8087 | 8087 | } |
| 8088 | 8088 | |
| 8089 | 8089 | /** |
| 8090 | - * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
| 8091 | - * |
|
| 8092 | - * @return Array the airport list |
|
| 8093 | - * |
|
| 8094 | - */ |
|
| 8090 | + * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
| 8091 | + * |
|
| 8092 | + * @return Array the airport list |
|
| 8093 | + * |
|
| 8094 | + */ |
|
| 8095 | 8095 | public function countAllArrivalAirportsByPilot($pilot,$filters = array()) |
| 8096 | 8096 | { |
| 8097 | 8097 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8122,11 +8122,11 @@ discard block |
||
| 8122 | 8122 | } |
| 8123 | 8123 | |
| 8124 | 8124 | /** |
| 8125 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 8126 | - * |
|
| 8127 | - * @return Array the airport list |
|
| 8128 | - * |
|
| 8129 | - */ |
|
| 8125 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 8126 | + * |
|
| 8127 | + * @return Array the airport list |
|
| 8128 | + * |
|
| 8129 | + */ |
|
| 8130 | 8130 | public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
| 8131 | 8131 | { |
| 8132 | 8132 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8155,11 +8155,11 @@ discard block |
||
| 8155 | 8155 | } |
| 8156 | 8156 | |
| 8157 | 8157 | /** |
| 8158 | - * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
| 8159 | - * |
|
| 8160 | - * @return Array the airport list |
|
| 8161 | - * |
|
| 8162 | - */ |
|
| 8158 | + * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
| 8159 | + * |
|
| 8160 | + * @return Array the airport list |
|
| 8161 | + * |
|
| 8162 | + */ |
|
| 8163 | 8163 | public function countAllArrivalAirportCountriesByOwner($owner, $filters = array()) |
| 8164 | 8164 | { |
| 8165 | 8165 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8175,11 +8175,11 @@ discard block |
||
| 8175 | 8175 | } |
| 8176 | 8176 | |
| 8177 | 8177 | /** |
| 8178 | - * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
| 8179 | - * |
|
| 8180 | - * @return Array the airport list |
|
| 8181 | - * |
|
| 8182 | - */ |
|
| 8178 | + * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
| 8179 | + * |
|
| 8180 | + * @return Array the airport list |
|
| 8181 | + * |
|
| 8182 | + */ |
|
| 8183 | 8183 | public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array()) |
| 8184 | 8184 | { |
| 8185 | 8185 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8197,11 +8197,11 @@ discard block |
||
| 8197 | 8197 | |
| 8198 | 8198 | |
| 8199 | 8199 | /** |
| 8200 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 8201 | - * |
|
| 8202 | - * @return Array the airport list |
|
| 8203 | - * |
|
| 8204 | - */ |
|
| 8200 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 8201 | + * |
|
| 8202 | + * @return Array the airport list |
|
| 8203 | + * |
|
| 8204 | + */ |
|
| 8205 | 8205 | public function countAllArrivalAirportsByCountry($country,$filters = array()) |
| 8206 | 8206 | { |
| 8207 | 8207 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8234,11 +8234,11 @@ discard block |
||
| 8234 | 8234 | |
| 8235 | 8235 | |
| 8236 | 8236 | /** |
| 8237 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 8238 | - * |
|
| 8239 | - * @return Array the airport list |
|
| 8240 | - * |
|
| 8241 | - */ |
|
| 8237 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 8238 | + * |
|
| 8239 | + * @return Array the airport list |
|
| 8240 | + * |
|
| 8241 | + */ |
|
| 8242 | 8242 | public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
| 8243 | 8243 | { |
| 8244 | 8244 | global $globalDBdriver; |
@@ -8270,11 +8270,11 @@ discard block |
||
| 8270 | 8270 | |
| 8271 | 8271 | |
| 8272 | 8272 | /** |
| 8273 | - * Counts all airport departure countries |
|
| 8274 | - * |
|
| 8275 | - * @return Array the airport departure list |
|
| 8276 | - * |
|
| 8277 | - */ |
|
| 8273 | + * Counts all airport departure countries |
|
| 8274 | + * |
|
| 8275 | + * @return Array the airport departure list |
|
| 8276 | + * |
|
| 8277 | + */ |
|
| 8278 | 8278 | public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '') |
| 8279 | 8279 | { |
| 8280 | 8280 | global $globalDBdriver; |
@@ -8333,11 +8333,11 @@ discard block |
||
| 8333 | 8333 | |
| 8334 | 8334 | |
| 8335 | 8335 | /** |
| 8336 | - * Counts all airport arrival countries |
|
| 8337 | - * |
|
| 8338 | - * @return Array the airport arrival list |
|
| 8339 | - * |
|
| 8340 | - */ |
|
| 8336 | + * Counts all airport arrival countries |
|
| 8337 | + * |
|
| 8338 | + * @return Array the airport arrival list |
|
| 8339 | + * |
|
| 8340 | + */ |
|
| 8341 | 8341 | public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '') |
| 8342 | 8342 | { |
| 8343 | 8343 | global $globalDBdriver; |
@@ -8399,11 +8399,11 @@ discard block |
||
| 8399 | 8399 | |
| 8400 | 8400 | |
| 8401 | 8401 | /** |
| 8402 | - * Gets all route combinations |
|
| 8403 | - * |
|
| 8404 | - * @return Array the route list |
|
| 8405 | - * |
|
| 8406 | - */ |
|
| 8402 | + * Gets all route combinations |
|
| 8403 | + * |
|
| 8404 | + * @return Array the route list |
|
| 8405 | + * |
|
| 8406 | + */ |
|
| 8407 | 8407 | public function countAllRoutes($filters = array()) |
| 8408 | 8408 | { |
| 8409 | 8409 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8442,11 +8442,11 @@ discard block |
||
| 8442 | 8442 | |
| 8443 | 8443 | |
| 8444 | 8444 | /** |
| 8445 | - * Gets all route combinations based on an aircraft |
|
| 8446 | - * |
|
| 8447 | - * @return Array the route list |
|
| 8448 | - * |
|
| 8449 | - */ |
|
| 8445 | + * Gets all route combinations based on an aircraft |
|
| 8446 | + * |
|
| 8447 | + * @return Array the route list |
|
| 8448 | + * |
|
| 8449 | + */ |
|
| 8450 | 8450 | public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
| 8451 | 8451 | { |
| 8452 | 8452 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8482,11 +8482,11 @@ discard block |
||
| 8482 | 8482 | |
| 8483 | 8483 | |
| 8484 | 8484 | /** |
| 8485 | - * Gets all route combinations based on an aircraft registration |
|
| 8486 | - * |
|
| 8487 | - * @return Array the route list |
|
| 8488 | - * |
|
| 8489 | - */ |
|
| 8485 | + * Gets all route combinations based on an aircraft registration |
|
| 8486 | + * |
|
| 8487 | + * @return Array the route list |
|
| 8488 | + * |
|
| 8489 | + */ |
|
| 8490 | 8490 | public function countAllRoutesByRegistration($registration, $filters = array()) |
| 8491 | 8491 | { |
| 8492 | 8492 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8524,11 +8524,11 @@ discard block |
||
| 8524 | 8524 | |
| 8525 | 8525 | |
| 8526 | 8526 | /** |
| 8527 | - * Gets all route combinations based on an airline |
|
| 8528 | - * |
|
| 8529 | - * @return Array the route list |
|
| 8530 | - * |
|
| 8531 | - */ |
|
| 8527 | + * Gets all route combinations based on an airline |
|
| 8528 | + * |
|
| 8529 | + * @return Array the route list |
|
| 8530 | + * |
|
| 8531 | + */ |
|
| 8532 | 8532 | public function countAllRoutesByAirline($airline_icao, $filters = array()) |
| 8533 | 8533 | { |
| 8534 | 8534 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8566,11 +8566,11 @@ discard block |
||
| 8566 | 8566 | |
| 8567 | 8567 | |
| 8568 | 8568 | /** |
| 8569 | - * Gets all route combinations based on an airport |
|
| 8570 | - * |
|
| 8571 | - * @return Array the route list |
|
| 8572 | - * |
|
| 8573 | - */ |
|
| 8569 | + * Gets all route combinations based on an airport |
|
| 8570 | + * |
|
| 8571 | + * @return Array the route list |
|
| 8572 | + * |
|
| 8573 | + */ |
|
| 8574 | 8574 | public function countAllRoutesByAirport($airport_icao, $filters = array()) |
| 8575 | 8575 | { |
| 8576 | 8576 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8607,11 +8607,11 @@ discard block |
||
| 8607 | 8607 | |
| 8608 | 8608 | |
| 8609 | 8609 | /** |
| 8610 | - * Gets all route combinations based on an country |
|
| 8611 | - * |
|
| 8612 | - * @return Array the route list |
|
| 8613 | - * |
|
| 8614 | - */ |
|
| 8610 | + * Gets all route combinations based on an country |
|
| 8611 | + * |
|
| 8612 | + * @return Array the route list |
|
| 8613 | + * |
|
| 8614 | + */ |
|
| 8615 | 8615 | public function countAllRoutesByCountry($country, $filters = array()) |
| 8616 | 8616 | { |
| 8617 | 8617 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8647,11 +8647,11 @@ discard block |
||
| 8647 | 8647 | |
| 8648 | 8648 | |
| 8649 | 8649 | /** |
| 8650 | - * Gets all route combinations based on an date |
|
| 8651 | - * |
|
| 8652 | - * @return Array the route list |
|
| 8653 | - * |
|
| 8654 | - */ |
|
| 8650 | + * Gets all route combinations based on an date |
|
| 8651 | + * |
|
| 8652 | + * @return Array the route list |
|
| 8653 | + * |
|
| 8654 | + */ |
|
| 8655 | 8655 | public function countAllRoutesByDate($date, $filters = array()) |
| 8656 | 8656 | { |
| 8657 | 8657 | global $globalTimezone, $globalDBdriver; |
@@ -8701,11 +8701,11 @@ discard block |
||
| 8701 | 8701 | |
| 8702 | 8702 | |
| 8703 | 8703 | /** |
| 8704 | - * Gets all route combinations based on an ident/callsign |
|
| 8705 | - * |
|
| 8706 | - * @return Array the route list |
|
| 8707 | - * |
|
| 8708 | - */ |
|
| 8704 | + * Gets all route combinations based on an ident/callsign |
|
| 8705 | + * |
|
| 8706 | + * @return Array the route list |
|
| 8707 | + * |
|
| 8708 | + */ |
|
| 8709 | 8709 | public function countAllRoutesByIdent($ident, $filters = array()) |
| 8710 | 8710 | { |
| 8711 | 8711 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8741,11 +8741,11 @@ discard block |
||
| 8741 | 8741 | } |
| 8742 | 8742 | |
| 8743 | 8743 | /** |
| 8744 | - * Gets all route combinations based on an owner |
|
| 8745 | - * |
|
| 8746 | - * @return Array the route list |
|
| 8747 | - * |
|
| 8748 | - */ |
|
| 8744 | + * Gets all route combinations based on an owner |
|
| 8745 | + * |
|
| 8746 | + * @return Array the route list |
|
| 8747 | + * |
|
| 8748 | + */ |
|
| 8749 | 8749 | public function countAllRoutesByOwner($owner,$filters = array()) |
| 8750 | 8750 | { |
| 8751 | 8751 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8781,11 +8781,11 @@ discard block |
||
| 8781 | 8781 | } |
| 8782 | 8782 | |
| 8783 | 8783 | /** |
| 8784 | - * Gets all route combinations based on a pilot |
|
| 8785 | - * |
|
| 8786 | - * @return Array the route list |
|
| 8787 | - * |
|
| 8788 | - */ |
|
| 8784 | + * Gets all route combinations based on a pilot |
|
| 8785 | + * |
|
| 8786 | + * @return Array the route list |
|
| 8787 | + * |
|
| 8788 | + */ |
|
| 8789 | 8789 | public function countAllRoutesByPilot($pilot,$filters = array()) |
| 8790 | 8790 | { |
| 8791 | 8791 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8822,11 +8822,11 @@ discard block |
||
| 8822 | 8822 | |
| 8823 | 8823 | |
| 8824 | 8824 | /** |
| 8825 | - * Gets all route combinations based on an manufacturer |
|
| 8826 | - * |
|
| 8827 | - * @return Array the route list |
|
| 8828 | - * |
|
| 8829 | - */ |
|
| 8825 | + * Gets all route combinations based on an manufacturer |
|
| 8826 | + * |
|
| 8827 | + * @return Array the route list |
|
| 8828 | + * |
|
| 8829 | + */ |
|
| 8830 | 8830 | public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
| 8831 | 8831 | { |
| 8832 | 8832 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8864,11 +8864,11 @@ discard block |
||
| 8864 | 8864 | |
| 8865 | 8865 | |
| 8866 | 8866 | /** |
| 8867 | - * Gets all route combinations with waypoints |
|
| 8868 | - * |
|
| 8869 | - * @return Array the route list |
|
| 8870 | - * |
|
| 8871 | - */ |
|
| 8867 | + * Gets all route combinations with waypoints |
|
| 8868 | + * |
|
| 8869 | + * @return Array the route list |
|
| 8870 | + * |
|
| 8871 | + */ |
|
| 8872 | 8872 | public function countAllRoutesWithWaypoints($filters = array()) |
| 8873 | 8873 | { |
| 8874 | 8874 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8905,11 +8905,11 @@ discard block |
||
| 8905 | 8905 | } |
| 8906 | 8906 | |
| 8907 | 8907 | /** |
| 8908 | - * Gets all callsigns that have flown over |
|
| 8909 | - * |
|
| 8910 | - * @return Array the callsign list |
|
| 8911 | - * |
|
| 8912 | - */ |
|
| 8908 | + * Gets all callsigns that have flown over |
|
| 8909 | + * |
|
| 8910 | + * @return Array the callsign list |
|
| 8911 | + * |
|
| 8912 | + */ |
|
| 8913 | 8913 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
| 8914 | 8914 | { |
| 8915 | 8915 | global $globalDBdriver; |
@@ -8975,11 +8975,11 @@ discard block |
||
| 8975 | 8975 | } |
| 8976 | 8976 | |
| 8977 | 8977 | /** |
| 8978 | - * Gets all callsigns that have flown over |
|
| 8979 | - * |
|
| 8980 | - * @return Array the callsign list |
|
| 8981 | - * |
|
| 8982 | - */ |
|
| 8978 | + * Gets all callsigns that have flown over |
|
| 8979 | + * |
|
| 8980 | + * @return Array the callsign list |
|
| 8981 | + * |
|
| 8982 | + */ |
|
| 8983 | 8983 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
| 8984 | 8984 | { |
| 8985 | 8985 | global $globalDBdriver; |
@@ -9020,11 +9020,11 @@ discard block |
||
| 9020 | 9020 | |
| 9021 | 9021 | |
| 9022 | 9022 | /** |
| 9023 | - * Counts all dates |
|
| 9024 | - * |
|
| 9025 | - * @return Array the date list |
|
| 9026 | - * |
|
| 9027 | - */ |
|
| 9023 | + * Counts all dates |
|
| 9024 | + * |
|
| 9025 | + * @return Array the date list |
|
| 9026 | + * |
|
| 9027 | + */ |
|
| 9028 | 9028 | public function countAllDates($filters = array()) |
| 9029 | 9029 | { |
| 9030 | 9030 | global $globalTimezone, $globalDBdriver; |
@@ -9069,11 +9069,11 @@ discard block |
||
| 9069 | 9069 | } |
| 9070 | 9070 | |
| 9071 | 9071 | /** |
| 9072 | - * Counts all dates |
|
| 9073 | - * |
|
| 9074 | - * @return Array the date list |
|
| 9075 | - * |
|
| 9076 | - */ |
|
| 9072 | + * Counts all dates |
|
| 9073 | + * |
|
| 9074 | + * @return Array the date list |
|
| 9075 | + * |
|
| 9076 | + */ |
|
| 9077 | 9077 | public function countAllDatesByAirlines($filters = array()) |
| 9078 | 9078 | { |
| 9079 | 9079 | global $globalTimezone, $globalDBdriver; |
@@ -9118,11 +9118,11 @@ discard block |
||
| 9118 | 9118 | } |
| 9119 | 9119 | |
| 9120 | 9120 | /** |
| 9121 | - * Counts all dates during the last 7 days |
|
| 9122 | - * |
|
| 9123 | - * @return Array the date list |
|
| 9124 | - * |
|
| 9125 | - */ |
|
| 9121 | + * Counts all dates during the last 7 days |
|
| 9122 | + * |
|
| 9123 | + * @return Array the date list |
|
| 9124 | + * |
|
| 9125 | + */ |
|
| 9126 | 9126 | public function countAllDatesLast7Days($filters = array()) |
| 9127 | 9127 | { |
| 9128 | 9128 | global $globalTimezone, $globalDBdriver; |
@@ -9144,7 +9144,7 @@ discard block |
||
| 9144 | 9144 | $query .= " GROUP BY date_name |
| 9145 | 9145 | ORDER BY date_name ASC"; |
| 9146 | 9146 | $query_data = array(':offset' => $offset); |
| 9147 | - } |
|
| 9147 | + } |
|
| 9148 | 9148 | |
| 9149 | 9149 | $sth = $this->db->prepare($query); |
| 9150 | 9150 | $sth->execute($query_data); |
@@ -9164,11 +9164,11 @@ discard block |
||
| 9164 | 9164 | } |
| 9165 | 9165 | |
| 9166 | 9166 | /** |
| 9167 | - * Counts all dates during the last month |
|
| 9168 | - * |
|
| 9169 | - * @return Array the date list |
|
| 9170 | - * |
|
| 9171 | - */ |
|
| 9167 | + * Counts all dates during the last month |
|
| 9168 | + * |
|
| 9169 | + * @return Array the date list |
|
| 9170 | + * |
|
| 9171 | + */ |
|
| 9172 | 9172 | public function countAllDatesLastMonth($filters = array()) |
| 9173 | 9173 | { |
| 9174 | 9174 | global $globalTimezone, $globalDBdriver; |
@@ -9190,7 +9190,7 @@ discard block |
||
| 9190 | 9190 | $query .= " GROUP BY date_name |
| 9191 | 9191 | ORDER BY date_name ASC"; |
| 9192 | 9192 | $query_data = array(':offset' => $offset); |
| 9193 | - } |
|
| 9193 | + } |
|
| 9194 | 9194 | |
| 9195 | 9195 | $sth = $this->db->prepare($query); |
| 9196 | 9196 | $sth->execute($query_data); |
@@ -9211,11 +9211,11 @@ discard block |
||
| 9211 | 9211 | |
| 9212 | 9212 | |
| 9213 | 9213 | /** |
| 9214 | - * Counts all dates during the last month |
|
| 9215 | - * |
|
| 9216 | - * @return Array the date list |
|
| 9217 | - * |
|
| 9218 | - */ |
|
| 9214 | + * Counts all dates during the last month |
|
| 9215 | + * |
|
| 9216 | + * @return Array the date list |
|
| 9217 | + * |
|
| 9218 | + */ |
|
| 9219 | 9219 | public function countAllDatesLastMonthByAirlines($filters = array()) |
| 9220 | 9220 | { |
| 9221 | 9221 | global $globalTimezone, $globalDBdriver; |
@@ -9238,7 +9238,7 @@ discard block |
||
| 9238 | 9238 | GROUP BY spotter_output.airline_icao, date_name |
| 9239 | 9239 | ORDER BY date_name ASC"; |
| 9240 | 9240 | $query_data = array(':offset' => $offset); |
| 9241 | - } |
|
| 9241 | + } |
|
| 9242 | 9242 | |
| 9243 | 9243 | $sth = $this->db->prepare($query); |
| 9244 | 9244 | $sth->execute($query_data); |
@@ -9260,11 +9260,11 @@ discard block |
||
| 9260 | 9260 | |
| 9261 | 9261 | |
| 9262 | 9262 | /** |
| 9263 | - * Counts all month |
|
| 9264 | - * |
|
| 9265 | - * @return Array the month list |
|
| 9266 | - * |
|
| 9267 | - */ |
|
| 9263 | + * Counts all month |
|
| 9264 | + * |
|
| 9265 | + * @return Array the month list |
|
| 9266 | + * |
|
| 9267 | + */ |
|
| 9268 | 9268 | public function countAllMonths($filters = array()) |
| 9269 | 9269 | { |
| 9270 | 9270 | global $globalTimezone, $globalDBdriver; |
@@ -9306,11 +9306,11 @@ discard block |
||
| 9306 | 9306 | } |
| 9307 | 9307 | |
| 9308 | 9308 | /** |
| 9309 | - * Counts all month |
|
| 9310 | - * |
|
| 9311 | - * @return Array the month list |
|
| 9312 | - * |
|
| 9313 | - */ |
|
| 9309 | + * Counts all month |
|
| 9310 | + * |
|
| 9311 | + * @return Array the month list |
|
| 9312 | + * |
|
| 9313 | + */ |
|
| 9314 | 9314 | public function countAllMonthsByAirlines($filters = array()) |
| 9315 | 9315 | { |
| 9316 | 9316 | global $globalTimezone, $globalDBdriver; |
@@ -9355,11 +9355,11 @@ discard block |
||
| 9355 | 9355 | } |
| 9356 | 9356 | |
| 9357 | 9357 | /** |
| 9358 | - * Counts all military month |
|
| 9359 | - * |
|
| 9360 | - * @return Array the month list |
|
| 9361 | - * |
|
| 9362 | - */ |
|
| 9358 | + * Counts all military month |
|
| 9359 | + * |
|
| 9360 | + * @return Array the month list |
|
| 9361 | + * |
|
| 9362 | + */ |
|
| 9363 | 9363 | public function countAllMilitaryMonths($filters = array()) |
| 9364 | 9364 | { |
| 9365 | 9365 | global $globalTimezone, $globalDBdriver; |
@@ -9400,11 +9400,11 @@ discard block |
||
| 9400 | 9400 | } |
| 9401 | 9401 | |
| 9402 | 9402 | /** |
| 9403 | - * Counts all month owners |
|
| 9404 | - * |
|
| 9405 | - * @return Array the month list |
|
| 9406 | - * |
|
| 9407 | - */ |
|
| 9403 | + * Counts all month owners |
|
| 9404 | + * |
|
| 9405 | + * @return Array the month list |
|
| 9406 | + * |
|
| 9407 | + */ |
|
| 9408 | 9408 | public function countAllMonthsOwners($filters = array()) |
| 9409 | 9409 | { |
| 9410 | 9410 | global $globalTimezone, $globalDBdriver; |
@@ -9446,11 +9446,11 @@ discard block |
||
| 9446 | 9446 | } |
| 9447 | 9447 | |
| 9448 | 9448 | /** |
| 9449 | - * Counts all month owners |
|
| 9450 | - * |
|
| 9451 | - * @return Array the month list |
|
| 9452 | - * |
|
| 9453 | - */ |
|
| 9449 | + * Counts all month owners |
|
| 9450 | + * |
|
| 9451 | + * @return Array the month list |
|
| 9452 | + * |
|
| 9453 | + */ |
|
| 9454 | 9454 | public function countAllMonthsOwnersByAirlines($filters = array()) |
| 9455 | 9455 | { |
| 9456 | 9456 | global $globalTimezone, $globalDBdriver; |
@@ -9493,11 +9493,11 @@ discard block |
||
| 9493 | 9493 | } |
| 9494 | 9494 | |
| 9495 | 9495 | /** |
| 9496 | - * Counts all month pilot |
|
| 9497 | - * |
|
| 9498 | - * @return Array the month list |
|
| 9499 | - * |
|
| 9500 | - */ |
|
| 9496 | + * Counts all month pilot |
|
| 9497 | + * |
|
| 9498 | + * @return Array the month list |
|
| 9499 | + * |
|
| 9500 | + */ |
|
| 9501 | 9501 | public function countAllMonthsPilots($filters = array()) |
| 9502 | 9502 | { |
| 9503 | 9503 | global $globalTimezone, $globalDBdriver; |
@@ -9539,11 +9539,11 @@ discard block |
||
| 9539 | 9539 | } |
| 9540 | 9540 | |
| 9541 | 9541 | /** |
| 9542 | - * Counts all month pilot |
|
| 9543 | - * |
|
| 9544 | - * @return Array the month list |
|
| 9545 | - * |
|
| 9546 | - */ |
|
| 9542 | + * Counts all month pilot |
|
| 9543 | + * |
|
| 9544 | + * @return Array the month list |
|
| 9545 | + * |
|
| 9546 | + */ |
|
| 9547 | 9547 | public function countAllMonthsPilotsByAirlines($filters = array()) |
| 9548 | 9548 | { |
| 9549 | 9549 | global $globalTimezone, $globalDBdriver; |
@@ -9586,11 +9586,11 @@ discard block |
||
| 9586 | 9586 | } |
| 9587 | 9587 | |
| 9588 | 9588 | /** |
| 9589 | - * Counts all month airline |
|
| 9590 | - * |
|
| 9591 | - * @return Array the month list |
|
| 9592 | - * |
|
| 9593 | - */ |
|
| 9589 | + * Counts all month airline |
|
| 9590 | + * |
|
| 9591 | + * @return Array the month list |
|
| 9592 | + * |
|
| 9593 | + */ |
|
| 9594 | 9594 | public function countAllMonthsAirlines($filters = array()) |
| 9595 | 9595 | { |
| 9596 | 9596 | global $globalTimezone, $globalDBdriver; |
@@ -9632,11 +9632,11 @@ discard block |
||
| 9632 | 9632 | } |
| 9633 | 9633 | |
| 9634 | 9634 | /** |
| 9635 | - * Counts all month aircraft |
|
| 9636 | - * |
|
| 9637 | - * @return Array the month list |
|
| 9638 | - * |
|
| 9639 | - */ |
|
| 9635 | + * Counts all month aircraft |
|
| 9636 | + * |
|
| 9637 | + * @return Array the month list |
|
| 9638 | + * |
|
| 9639 | + */ |
|
| 9640 | 9640 | public function countAllMonthsAircrafts($filters = array()) |
| 9641 | 9641 | { |
| 9642 | 9642 | global $globalTimezone, $globalDBdriver; |
@@ -9679,11 +9679,11 @@ discard block |
||
| 9679 | 9679 | |
| 9680 | 9680 | |
| 9681 | 9681 | /** |
| 9682 | - * Counts all month aircraft |
|
| 9683 | - * |
|
| 9684 | - * @return Array the month list |
|
| 9685 | - * |
|
| 9686 | - */ |
|
| 9682 | + * Counts all month aircraft |
|
| 9683 | + * |
|
| 9684 | + * @return Array the month list |
|
| 9685 | + * |
|
| 9686 | + */ |
|
| 9687 | 9687 | public function countAllMonthsAircraftsByAirlines($filters = array()) |
| 9688 | 9688 | { |
| 9689 | 9689 | global $globalTimezone, $globalDBdriver; |
@@ -9726,11 +9726,11 @@ discard block |
||
| 9726 | 9726 | } |
| 9727 | 9727 | |
| 9728 | 9728 | /** |
| 9729 | - * Counts all month real arrival |
|
| 9730 | - * |
|
| 9731 | - * @return Array the month list |
|
| 9732 | - * |
|
| 9733 | - */ |
|
| 9729 | + * Counts all month real arrival |
|
| 9730 | + * |
|
| 9731 | + * @return Array the month list |
|
| 9732 | + * |
|
| 9733 | + */ |
|
| 9734 | 9734 | public function countAllMonthsRealArrivals($filters = array()) |
| 9735 | 9735 | { |
| 9736 | 9736 | global $globalTimezone, $globalDBdriver; |
@@ -9773,11 +9773,11 @@ discard block |
||
| 9773 | 9773 | |
| 9774 | 9774 | |
| 9775 | 9775 | /** |
| 9776 | - * Counts all month real arrival |
|
| 9777 | - * |
|
| 9778 | - * @return Array the month list |
|
| 9779 | - * |
|
| 9780 | - */ |
|
| 9776 | + * Counts all month real arrival |
|
| 9777 | + * |
|
| 9778 | + * @return Array the month list |
|
| 9779 | + * |
|
| 9780 | + */ |
|
| 9781 | 9781 | public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
| 9782 | 9782 | { |
| 9783 | 9783 | global $globalTimezone, $globalDBdriver; |
@@ -9821,11 +9821,11 @@ discard block |
||
| 9821 | 9821 | |
| 9822 | 9822 | |
| 9823 | 9823 | /** |
| 9824 | - * Counts all dates during the last year |
|
| 9825 | - * |
|
| 9826 | - * @return Array the date list |
|
| 9827 | - * |
|
| 9828 | - */ |
|
| 9824 | + * Counts all dates during the last year |
|
| 9825 | + * |
|
| 9826 | + * @return Array the date list |
|
| 9827 | + * |
|
| 9828 | + */ |
|
| 9829 | 9829 | public function countAllMonthsLastYear($filters) |
| 9830 | 9830 | { |
| 9831 | 9831 | global $globalTimezone, $globalDBdriver; |
@@ -9847,7 +9847,7 @@ discard block |
||
| 9847 | 9847 | $query .= " GROUP BY year_name, month_name |
| 9848 | 9848 | ORDER BY year_name, month_name ASC"; |
| 9849 | 9849 | $query_data = array(':offset' => $offset); |
| 9850 | - } |
|
| 9850 | + } |
|
| 9851 | 9851 | |
| 9852 | 9852 | $sth = $this->db->prepare($query); |
| 9853 | 9853 | $sth->execute($query_data); |
@@ -9870,11 +9870,11 @@ discard block |
||
| 9870 | 9870 | |
| 9871 | 9871 | |
| 9872 | 9872 | /** |
| 9873 | - * Counts all hours |
|
| 9874 | - * |
|
| 9875 | - * @return Array the hour list |
|
| 9876 | - * |
|
| 9877 | - */ |
|
| 9873 | + * Counts all hours |
|
| 9874 | + * |
|
| 9875 | + * @return Array the hour list |
|
| 9876 | + * |
|
| 9877 | + */ |
|
| 9878 | 9878 | public function countAllHours($orderby,$filters = array()) |
| 9879 | 9879 | { |
| 9880 | 9880 | global $globalTimezone, $globalDBdriver; |
@@ -9935,11 +9935,11 @@ discard block |
||
| 9935 | 9935 | } |
| 9936 | 9936 | |
| 9937 | 9937 | /** |
| 9938 | - * Counts all hours |
|
| 9939 | - * |
|
| 9940 | - * @return Array the hour list |
|
| 9941 | - * |
|
| 9942 | - */ |
|
| 9938 | + * Counts all hours |
|
| 9939 | + * |
|
| 9940 | + * @return Array the hour list |
|
| 9941 | + * |
|
| 9942 | + */ |
|
| 9943 | 9943 | public function countAllHoursByAirlines($orderby, $filters = array()) |
| 9944 | 9944 | { |
| 9945 | 9945 | global $globalTimezone, $globalDBdriver; |
@@ -10002,11 +10002,11 @@ discard block |
||
| 10002 | 10002 | |
| 10003 | 10003 | |
| 10004 | 10004 | /** |
| 10005 | - * Counts all hours by airline |
|
| 10006 | - * |
|
| 10007 | - * @return Array the hour list |
|
| 10008 | - * |
|
| 10009 | - */ |
|
| 10005 | + * Counts all hours by airline |
|
| 10006 | + * |
|
| 10007 | + * @return Array the hour list |
|
| 10008 | + * |
|
| 10009 | + */ |
|
| 10010 | 10010 | public function countAllHoursByAirline($airline_icao, $filters = array()) |
| 10011 | 10011 | { |
| 10012 | 10012 | global $globalTimezone, $globalDBdriver; |
@@ -10052,11 +10052,11 @@ discard block |
||
| 10052 | 10052 | |
| 10053 | 10053 | |
| 10054 | 10054 | /** |
| 10055 | - * Counts all hours by aircraft |
|
| 10056 | - * |
|
| 10057 | - * @return Array the hour list |
|
| 10058 | - * |
|
| 10059 | - */ |
|
| 10055 | + * Counts all hours by aircraft |
|
| 10056 | + * |
|
| 10057 | + * @return Array the hour list |
|
| 10058 | + * |
|
| 10059 | + */ |
|
| 10060 | 10060 | public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
| 10061 | 10061 | { |
| 10062 | 10062 | global $globalTimezone, $globalDBdriver; |
@@ -10099,11 +10099,11 @@ discard block |
||
| 10099 | 10099 | |
| 10100 | 10100 | |
| 10101 | 10101 | /** |
| 10102 | - * Counts all hours by aircraft registration |
|
| 10103 | - * |
|
| 10104 | - * @return Array the hour list |
|
| 10105 | - * |
|
| 10106 | - */ |
|
| 10102 | + * Counts all hours by aircraft registration |
|
| 10103 | + * |
|
| 10104 | + * @return Array the hour list |
|
| 10105 | + * |
|
| 10106 | + */ |
|
| 10107 | 10107 | public function countAllHoursByRegistration($registration, $filters = array()) |
| 10108 | 10108 | { |
| 10109 | 10109 | global $globalTimezone, $globalDBdriver; |
@@ -10146,11 +10146,11 @@ discard block |
||
| 10146 | 10146 | |
| 10147 | 10147 | |
| 10148 | 10148 | /** |
| 10149 | - * Counts all hours by airport |
|
| 10150 | - * |
|
| 10151 | - * @return Array the hour list |
|
| 10152 | - * |
|
| 10153 | - */ |
|
| 10149 | + * Counts all hours by airport |
|
| 10150 | + * |
|
| 10151 | + * @return Array the hour list |
|
| 10152 | + * |
|
| 10153 | + */ |
|
| 10154 | 10154 | public function countAllHoursByAirport($airport_icao, $filters = array()) |
| 10155 | 10155 | { |
| 10156 | 10156 | global $globalTimezone, $globalDBdriver; |
@@ -10194,11 +10194,11 @@ discard block |
||
| 10194 | 10194 | |
| 10195 | 10195 | |
| 10196 | 10196 | /** |
| 10197 | - * Counts all hours by manufacturer |
|
| 10198 | - * |
|
| 10199 | - * @return Array the hour list |
|
| 10200 | - * |
|
| 10201 | - */ |
|
| 10197 | + * Counts all hours by manufacturer |
|
| 10198 | + * |
|
| 10199 | + * @return Array the hour list |
|
| 10200 | + * |
|
| 10201 | + */ |
|
| 10202 | 10202 | public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
| 10203 | 10203 | { |
| 10204 | 10204 | global $globalTimezone, $globalDBdriver; |
@@ -10242,11 +10242,11 @@ discard block |
||
| 10242 | 10242 | |
| 10243 | 10243 | |
| 10244 | 10244 | /** |
| 10245 | - * Counts all hours by date |
|
| 10246 | - * |
|
| 10247 | - * @return Array the hour list |
|
| 10248 | - * |
|
| 10249 | - */ |
|
| 10245 | + * Counts all hours by date |
|
| 10246 | + * |
|
| 10247 | + * @return Array the hour list |
|
| 10248 | + * |
|
| 10249 | + */ |
|
| 10250 | 10250 | public function countAllHoursByDate($date, $filters = array()) |
| 10251 | 10251 | { |
| 10252 | 10252 | global $globalTimezone, $globalDBdriver; |
@@ -10290,11 +10290,11 @@ discard block |
||
| 10290 | 10290 | |
| 10291 | 10291 | |
| 10292 | 10292 | /** |
| 10293 | - * Counts all hours by a ident/callsign |
|
| 10294 | - * |
|
| 10295 | - * @return Array the hour list |
|
| 10296 | - * |
|
| 10297 | - */ |
|
| 10293 | + * Counts all hours by a ident/callsign |
|
| 10294 | + * |
|
| 10295 | + * @return Array the hour list |
|
| 10296 | + * |
|
| 10297 | + */ |
|
| 10298 | 10298 | public function countAllHoursByIdent($ident, $filters = array()) |
| 10299 | 10299 | { |
| 10300 | 10300 | global $globalTimezone, $globalDBdriver; |
@@ -10337,11 +10337,11 @@ discard block |
||
| 10337 | 10337 | } |
| 10338 | 10338 | |
| 10339 | 10339 | /** |
| 10340 | - * Counts all hours by a owner |
|
| 10341 | - * |
|
| 10342 | - * @return Array the hour list |
|
| 10343 | - * |
|
| 10344 | - */ |
|
| 10340 | + * Counts all hours by a owner |
|
| 10341 | + * |
|
| 10342 | + * @return Array the hour list |
|
| 10343 | + * |
|
| 10344 | + */ |
|
| 10345 | 10345 | public function countAllHoursByOwner($owner, $filters = array()) |
| 10346 | 10346 | { |
| 10347 | 10347 | global $globalTimezone, $globalDBdriver; |
@@ -10384,11 +10384,11 @@ discard block |
||
| 10384 | 10384 | } |
| 10385 | 10385 | |
| 10386 | 10386 | /** |
| 10387 | - * Counts all hours by a pilot |
|
| 10388 | - * |
|
| 10389 | - * @return Array the hour list |
|
| 10390 | - * |
|
| 10391 | - */ |
|
| 10387 | + * Counts all hours by a pilot |
|
| 10388 | + * |
|
| 10389 | + * @return Array the hour list |
|
| 10390 | + * |
|
| 10391 | + */ |
|
| 10392 | 10392 | public function countAllHoursByPilot($pilot, $filters = array()) |
| 10393 | 10393 | { |
| 10394 | 10394 | global $globalTimezone, $globalDBdriver; |
@@ -10433,11 +10433,11 @@ discard block |
||
| 10433 | 10433 | |
| 10434 | 10434 | |
| 10435 | 10435 | /** |
| 10436 | - * Counts all hours by route |
|
| 10437 | - * |
|
| 10438 | - * @return Array the hour list |
|
| 10439 | - * |
|
| 10440 | - */ |
|
| 10436 | + * Counts all hours by route |
|
| 10437 | + * |
|
| 10438 | + * @return Array the hour list |
|
| 10439 | + * |
|
| 10440 | + */ |
|
| 10441 | 10441 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
| 10442 | 10442 | { |
| 10443 | 10443 | global $globalTimezone, $globalDBdriver; |
@@ -10481,11 +10481,11 @@ discard block |
||
| 10481 | 10481 | |
| 10482 | 10482 | |
| 10483 | 10483 | /** |
| 10484 | - * Counts all hours by country |
|
| 10485 | - * |
|
| 10486 | - * @return Array the hour list |
|
| 10487 | - * |
|
| 10488 | - */ |
|
| 10484 | + * Counts all hours by country |
|
| 10485 | + * |
|
| 10486 | + * @return Array the hour list |
|
| 10487 | + * |
|
| 10488 | + */ |
|
| 10489 | 10489 | public function countAllHoursByCountry($country, $filters = array()) |
| 10490 | 10490 | { |
| 10491 | 10491 | global $globalTimezone, $globalDBdriver; |
@@ -10530,11 +10530,11 @@ discard block |
||
| 10530 | 10530 | |
| 10531 | 10531 | |
| 10532 | 10532 | /** |
| 10533 | - * Counts all aircraft that have flown over |
|
| 10534 | - * |
|
| 10535 | - * @return Integer the number of aircrafts |
|
| 10536 | - * |
|
| 10537 | - */ |
|
| 10533 | + * Counts all aircraft that have flown over |
|
| 10534 | + * |
|
| 10535 | + * @return Integer the number of aircrafts |
|
| 10536 | + * |
|
| 10537 | + */ |
|
| 10538 | 10538 | public function countOverallAircrafts($filters = array(),$year = '',$month = '') |
| 10539 | 10539 | { |
| 10540 | 10540 | global $globalDBdriver; |
@@ -10567,11 +10567,11 @@ discard block |
||
| 10567 | 10567 | } |
| 10568 | 10568 | |
| 10569 | 10569 | /** |
| 10570 | - * Counts all flight that really arrival |
|
| 10571 | - * |
|
| 10572 | - * @return Integer the number of aircrafts |
|
| 10573 | - * |
|
| 10574 | - */ |
|
| 10570 | + * Counts all flight that really arrival |
|
| 10571 | + * |
|
| 10572 | + * @return Integer the number of aircrafts |
|
| 10573 | + * |
|
| 10574 | + */ |
|
| 10575 | 10575 | public function countOverallArrival($filters = array(),$year = '',$month = '') |
| 10576 | 10576 | { |
| 10577 | 10577 | global $globalDBdriver; |
@@ -10604,11 +10604,11 @@ discard block |
||
| 10604 | 10604 | } |
| 10605 | 10605 | |
| 10606 | 10606 | /** |
| 10607 | - * Counts all pilots that have flown over |
|
| 10608 | - * |
|
| 10609 | - * @return Integer the number of pilots |
|
| 10610 | - * |
|
| 10611 | - */ |
|
| 10607 | + * Counts all pilots that have flown over |
|
| 10608 | + * |
|
| 10609 | + * @return Integer the number of pilots |
|
| 10610 | + * |
|
| 10611 | + */ |
|
| 10612 | 10612 | public function countOverallPilots($filters = array(),$year = '',$month = '') |
| 10613 | 10613 | { |
| 10614 | 10614 | global $globalDBdriver; |
@@ -10640,11 +10640,11 @@ discard block |
||
| 10640 | 10640 | } |
| 10641 | 10641 | |
| 10642 | 10642 | /** |
| 10643 | - * Counts all owners that have flown over |
|
| 10644 | - * |
|
| 10645 | - * @return Integer the number of owners |
|
| 10646 | - * |
|
| 10647 | - */ |
|
| 10643 | + * Counts all owners that have flown over |
|
| 10644 | + * |
|
| 10645 | + * @return Integer the number of owners |
|
| 10646 | + * |
|
| 10647 | + */ |
|
| 10648 | 10648 | public function countOverallOwners($filters = array(),$year = '',$month = '') |
| 10649 | 10649 | { |
| 10650 | 10650 | global $globalDBdriver; |
@@ -10677,11 +10677,11 @@ discard block |
||
| 10677 | 10677 | |
| 10678 | 10678 | |
| 10679 | 10679 | /** |
| 10680 | - * Counts all flights that have flown over |
|
| 10681 | - * |
|
| 10682 | - * @return Integer the number of flights |
|
| 10683 | - * |
|
| 10684 | - */ |
|
| 10680 | + * Counts all flights that have flown over |
|
| 10681 | + * |
|
| 10682 | + * @return Integer the number of flights |
|
| 10683 | + * |
|
| 10684 | + */ |
|
| 10685 | 10685 | public function countOverallFlights($filters = array(),$year = '',$month = '') |
| 10686 | 10686 | { |
| 10687 | 10687 | global $globalDBdriver; |
@@ -10716,11 +10716,11 @@ discard block |
||
| 10716 | 10716 | } |
| 10717 | 10717 | |
| 10718 | 10718 | /** |
| 10719 | - * Counts all military flights that have flown over |
|
| 10720 | - * |
|
| 10721 | - * @return Integer the number of flights |
|
| 10722 | - * |
|
| 10723 | - */ |
|
| 10719 | + * Counts all military flights that have flown over |
|
| 10720 | + * |
|
| 10721 | + * @return Integer the number of flights |
|
| 10722 | + * |
|
| 10723 | + */ |
|
| 10724 | 10724 | public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '') |
| 10725 | 10725 | { |
| 10726 | 10726 | global $globalDBdriver; |
@@ -10755,11 +10755,11 @@ discard block |
||
| 10755 | 10755 | |
| 10756 | 10756 | |
| 10757 | 10757 | /** |
| 10758 | - * Counts all airlines that have flown over |
|
| 10759 | - * |
|
| 10760 | - * @return Integer the number of airlines |
|
| 10761 | - * |
|
| 10762 | - */ |
|
| 10758 | + * Counts all airlines that have flown over |
|
| 10759 | + * |
|
| 10760 | + * @return Integer the number of airlines |
|
| 10761 | + * |
|
| 10762 | + */ |
|
| 10763 | 10763 | public function countOverallAirlines($filters = array(),$year = '',$month = '') |
| 10764 | 10764 | { |
| 10765 | 10765 | global $globalDBdriver; |
@@ -10786,8 +10786,8 @@ discard block |
||
| 10786 | 10786 | $query_values = array_merge($query_values,array(':month' => $month)); |
| 10787 | 10787 | } |
| 10788 | 10788 | } |
| 10789 | - if ($query == '') $queryi .= $this->getFilter($filters); |
|
| 10790 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 10789 | + if ($query == '') $queryi .= $this->getFilter($filters); |
|
| 10790 | + else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 10791 | 10791 | |
| 10792 | 10792 | |
| 10793 | 10793 | $sth = $this->db->prepare($queryi); |
@@ -10797,11 +10797,11 @@ discard block |
||
| 10797 | 10797 | |
| 10798 | 10798 | |
| 10799 | 10799 | /** |
| 10800 | - * Counts all hours of today |
|
| 10801 | - * |
|
| 10802 | - * @return Array the hour list |
|
| 10803 | - * |
|
| 10804 | - */ |
|
| 10800 | + * Counts all hours of today |
|
| 10801 | + * |
|
| 10802 | + * @return Array the hour list |
|
| 10803 | + * |
|
| 10804 | + */ |
|
| 10805 | 10805 | public function countAllHoursFromToday($filters = array()) |
| 10806 | 10806 | { |
| 10807 | 10807 | global $globalTimezone, $globalDBdriver; |
@@ -10841,11 +10841,11 @@ discard block |
||
| 10841 | 10841 | } |
| 10842 | 10842 | |
| 10843 | 10843 | /** |
| 10844 | - * Gets all the spotter information based on calculated upcoming flights |
|
| 10845 | - * |
|
| 10846 | - * @return Array the spotter information |
|
| 10847 | - * |
|
| 10848 | - */ |
|
| 10844 | + * Gets all the spotter information based on calculated upcoming flights |
|
| 10845 | + * |
|
| 10846 | + * @return Array the spotter information |
|
| 10847 | + * |
|
| 10848 | + */ |
|
| 10849 | 10849 | public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
| 10850 | 10850 | { |
| 10851 | 10851 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -10920,12 +10920,12 @@ discard block |
||
| 10920 | 10920 | } |
| 10921 | 10921 | |
| 10922 | 10922 | |
| 10923 | - /** |
|
| 10924 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 10925 | - * |
|
| 10926 | - * @return Integer the Barrie Spotter ID |
|
| 10923 | + /** |
|
| 10924 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 10925 | + * |
|
| 10926 | + * @return Integer the Barrie Spotter ID |
|
| 10927 | 10927 | q * |
| 10928 | - */ |
|
| 10928 | + */ |
|
| 10929 | 10929 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 10930 | 10930 | { |
| 10931 | 10931 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -10946,13 +10946,13 @@ discard block |
||
| 10946 | 10946 | |
| 10947 | 10947 | |
| 10948 | 10948 | /** |
| 10949 | - * Parses a date string |
|
| 10950 | - * |
|
| 10951 | - * @param String $dateString the date string |
|
| 10952 | - * @param String $timezone the timezone of a user |
|
| 10953 | - * @return Array the time information |
|
| 10954 | - * |
|
| 10955 | - */ |
|
| 10949 | + * Parses a date string |
|
| 10950 | + * |
|
| 10951 | + * @param String $dateString the date string |
|
| 10952 | + * @param String $timezone the timezone of a user |
|
| 10953 | + * @return Array the time information |
|
| 10954 | + * |
|
| 10955 | + */ |
|
| 10956 | 10956 | public function parseDateString($dateString, $timezone = '') |
| 10957 | 10957 | { |
| 10958 | 10958 | $time_array = array(); |
@@ -10988,12 +10988,12 @@ discard block |
||
| 10988 | 10988 | |
| 10989 | 10989 | |
| 10990 | 10990 | /** |
| 10991 | - * Parses the direction degrees to working |
|
| 10992 | - * |
|
| 10993 | - * @param Float $direction the direction in degrees |
|
| 10994 | - * @return Array the direction information |
|
| 10995 | - * |
|
| 10996 | - */ |
|
| 10991 | + * Parses the direction degrees to working |
|
| 10992 | + * |
|
| 10993 | + * @param Float $direction the direction in degrees |
|
| 10994 | + * @return Array the direction information |
|
| 10995 | + * |
|
| 10996 | + */ |
|
| 10997 | 10997 | public function parseDirection($direction = 0) |
| 10998 | 10998 | { |
| 10999 | 10999 | if ($direction == '') $direction = 0; |
@@ -11072,12 +11072,12 @@ discard block |
||
| 11072 | 11072 | |
| 11073 | 11073 | |
| 11074 | 11074 | /** |
| 11075 | - * Gets the aircraft registration |
|
| 11076 | - * |
|
| 11077 | - * @param String $flightaware_id the flight aware id |
|
| 11078 | - * @return String the aircraft registration |
|
| 11079 | - * |
|
| 11080 | - */ |
|
| 11075 | + * Gets the aircraft registration |
|
| 11076 | + * |
|
| 11077 | + * @param String $flightaware_id the flight aware id |
|
| 11078 | + * @return String the aircraft registration |
|
| 11079 | + * |
|
| 11080 | + */ |
|
| 11081 | 11081 | |
| 11082 | 11082 | public function getAircraftRegistration($flightaware_id) |
| 11083 | 11083 | { |
@@ -11106,12 +11106,12 @@ discard block |
||
| 11106 | 11106 | |
| 11107 | 11107 | |
| 11108 | 11108 | /** |
| 11109 | - * Gets the aircraft registration from ModeS |
|
| 11110 | - * |
|
| 11111 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 11112 | - * @return String the aircraft registration |
|
| 11113 | - * |
|
| 11114 | - */ |
|
| 11109 | + * Gets the aircraft registration from ModeS |
|
| 11110 | + * |
|
| 11111 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 11112 | + * @return String the aircraft registration |
|
| 11113 | + * |
|
| 11114 | + */ |
|
| 11115 | 11115 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
| 11116 | 11116 | { |
| 11117 | 11117 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11124,19 +11124,19 @@ discard block |
||
| 11124 | 11124 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 11125 | 11125 | $sth->closeCursor(); |
| 11126 | 11126 | if (count($row) > 0) { |
| 11127 | - //return $row['Registration']; |
|
| 11128 | - return $row['registration']; |
|
| 11127 | + //return $row['Registration']; |
|
| 11128 | + return $row['registration']; |
|
| 11129 | 11129 | } else return ''; |
| 11130 | 11130 | |
| 11131 | 11131 | } |
| 11132 | 11132 | |
| 11133 | 11133 | /** |
| 11134 | - * Gets the aircraft type from ModeS |
|
| 11135 | - * |
|
| 11136 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 11137 | - * @return String the aircraft type |
|
| 11138 | - * |
|
| 11139 | - */ |
|
| 11134 | + * Gets the aircraft type from ModeS |
|
| 11135 | + * |
|
| 11136 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 11137 | + * @return String the aircraft type |
|
| 11138 | + * |
|
| 11139 | + */ |
|
| 11140 | 11140 | public function getAircraftTypeBymodeS($aircraft_modes) |
| 11141 | 11141 | { |
| 11142 | 11142 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11149,19 +11149,19 @@ discard block |
||
| 11149 | 11149 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 11150 | 11150 | $sth->closeCursor(); |
| 11151 | 11151 | if (count($row) > 0) { |
| 11152 | - if ($row['type_flight'] == null) return ''; |
|
| 11153 | - else return $row['type_flight']; |
|
| 11152 | + if ($row['type_flight'] == null) return ''; |
|
| 11153 | + else return $row['type_flight']; |
|
| 11154 | 11154 | } else return ''; |
| 11155 | 11155 | |
| 11156 | 11156 | } |
| 11157 | 11157 | |
| 11158 | 11158 | /** |
| 11159 | - * Gets Country from latitude/longitude |
|
| 11160 | - * |
|
| 11161 | - * @param Float $latitude latitute of the flight |
|
| 11162 | - * @param Float $longitude longitute of the flight |
|
| 11163 | - * @return String the countrie |
|
| 11164 | - */ |
|
| 11159 | + * Gets Country from latitude/longitude |
|
| 11160 | + * |
|
| 11161 | + * @param Float $latitude latitute of the flight |
|
| 11162 | + * @param Float $longitude longitute of the flight |
|
| 11163 | + * @return String the countrie |
|
| 11164 | + */ |
|
| 11165 | 11165 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
| 11166 | 11166 | { |
| 11167 | 11167 | global $globalDBdriver, $globalDebug; |
@@ -11198,11 +11198,11 @@ discard block |
||
| 11198 | 11198 | } |
| 11199 | 11199 | |
| 11200 | 11200 | /** |
| 11201 | - * Gets Country from iso2 |
|
| 11202 | - * |
|
| 11203 | - * @param String $iso2 ISO2 country code |
|
| 11204 | - * @return String the countrie |
|
| 11205 | - */ |
|
| 11201 | + * Gets Country from iso2 |
|
| 11202 | + * |
|
| 11203 | + * @param String $iso2 ISO2 country code |
|
| 11204 | + * @return String the countrie |
|
| 11205 | + */ |
|
| 11206 | 11206 | public function getCountryFromISO2($iso2) |
| 11207 | 11207 | { |
| 11208 | 11208 | global $globalDBdriver, $globalDebug; |
@@ -11230,12 +11230,12 @@ discard block |
||
| 11230 | 11230 | } |
| 11231 | 11231 | |
| 11232 | 11232 | /** |
| 11233 | - * converts the registration code using the country prefix |
|
| 11234 | - * |
|
| 11235 | - * @param String $registration the aircraft registration |
|
| 11236 | - * @return String the aircraft registration |
|
| 11237 | - * |
|
| 11238 | - */ |
|
| 11233 | + * converts the registration code using the country prefix |
|
| 11234 | + * |
|
| 11235 | + * @param String $registration the aircraft registration |
|
| 11236 | + * @return String the aircraft registration |
|
| 11237 | + * |
|
| 11238 | + */ |
|
| 11239 | 11239 | public function convertAircraftRegistration($registration) |
| 11240 | 11240 | { |
| 11241 | 11241 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11287,12 +11287,12 @@ discard block |
||
| 11287 | 11287 | } |
| 11288 | 11288 | |
| 11289 | 11289 | /** |
| 11290 | - * Country from the registration code |
|
| 11291 | - * |
|
| 11292 | - * @param String $registration the aircraft registration |
|
| 11293 | - * @return String the country |
|
| 11294 | - * |
|
| 11295 | - */ |
|
| 11290 | + * Country from the registration code |
|
| 11291 | + * |
|
| 11292 | + * @param String $registration the aircraft registration |
|
| 11293 | + * @return String the country |
|
| 11294 | + * |
|
| 11295 | + */ |
|
| 11296 | 11296 | public function countryFromAircraftRegistration($registration) |
| 11297 | 11297 | { |
| 11298 | 11298 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11311,8 +11311,8 @@ discard block |
||
| 11311 | 11311 | $country = $row['country']; |
| 11312 | 11312 | } |
| 11313 | 11313 | } else { |
| 11314 | - $registration_1 = substr($registration, 0, 1); |
|
| 11315 | - $registration_2 = substr($registration, 0, 2); |
|
| 11314 | + $registration_1 = substr($registration, 0, 1); |
|
| 11315 | + $registration_2 = substr($registration, 0, 2); |
|
| 11316 | 11316 | |
| 11317 | 11317 | $country = ''; |
| 11318 | 11318 | //first get the prefix based on two characters |
@@ -11348,12 +11348,12 @@ discard block |
||
| 11348 | 11348 | } |
| 11349 | 11349 | |
| 11350 | 11350 | /** |
| 11351 | - * Registration prefix from the registration code |
|
| 11352 | - * |
|
| 11353 | - * @param String $registration the aircraft registration |
|
| 11354 | - * @return String the registration prefix |
|
| 11355 | - * |
|
| 11356 | - */ |
|
| 11351 | + * Registration prefix from the registration code |
|
| 11352 | + * |
|
| 11353 | + * @param String $registration the aircraft registration |
|
| 11354 | + * @return String the registration prefix |
|
| 11355 | + * |
|
| 11356 | + */ |
|
| 11357 | 11357 | public function registrationPrefixFromAircraftRegistration($registration) |
| 11358 | 11358 | { |
| 11359 | 11359 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11372,8 +11372,8 @@ discard block |
||
| 11372 | 11372 | //$country = $row['country']; |
| 11373 | 11373 | } |
| 11374 | 11374 | } else { |
| 11375 | - $registration_1 = substr($registration, 0, 1); |
|
| 11376 | - $registration_2 = substr($registration, 0, 2); |
|
| 11375 | + $registration_1 = substr($registration, 0, 1); |
|
| 11376 | + $registration_2 = substr($registration, 0, 2); |
|
| 11377 | 11377 | |
| 11378 | 11378 | //first get the prefix based on two characters |
| 11379 | 11379 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
@@ -11409,12 +11409,12 @@ discard block |
||
| 11409 | 11409 | |
| 11410 | 11410 | |
| 11411 | 11411 | /** |
| 11412 | - * Country from the registration code |
|
| 11413 | - * |
|
| 11414 | - * @param String $registration the aircraft registration |
|
| 11415 | - * @return String the country |
|
| 11416 | - * |
|
| 11417 | - */ |
|
| 11412 | + * Country from the registration code |
|
| 11413 | + * |
|
| 11414 | + * @param String $registration the aircraft registration |
|
| 11415 | + * @return String the country |
|
| 11416 | + * |
|
| 11417 | + */ |
|
| 11418 | 11418 | public function countryFromAircraftRegistrationCode($registration) |
| 11419 | 11419 | { |
| 11420 | 11420 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11431,11 +11431,11 @@ discard block |
||
| 11431 | 11431 | } |
| 11432 | 11432 | |
| 11433 | 11433 | /** |
| 11434 | - * Set a new highlight value for a flight |
|
| 11435 | - * |
|
| 11436 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 11437 | - * @param String $highlight New highlight value |
|
| 11438 | - */ |
|
| 11434 | + * Set a new highlight value for a flight |
|
| 11435 | + * |
|
| 11436 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 11437 | + * @param String $highlight New highlight value |
|
| 11438 | + */ |
|
| 11439 | 11439 | public function setHighlightFlight($flightaware_id,$highlight) { |
| 11440 | 11440 | |
| 11441 | 11441 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -11444,12 +11444,12 @@ discard block |
||
| 11444 | 11444 | } |
| 11445 | 11445 | |
| 11446 | 11446 | /** |
| 11447 | - * Set a new highlight value for a flight by Registration |
|
| 11448 | - * |
|
| 11449 | - * @param String $registration Registration of the aircraft |
|
| 11450 | - * @param String $date Date of spotted aircraft |
|
| 11451 | - * @param String $highlight New highlight value |
|
| 11452 | - */ |
|
| 11447 | + * Set a new highlight value for a flight by Registration |
|
| 11448 | + * |
|
| 11449 | + * @param String $registration Registration of the aircraft |
|
| 11450 | + * @param String $date Date of spotted aircraft |
|
| 11451 | + * @param String $highlight New highlight value |
|
| 11452 | + */ |
|
| 11453 | 11453 | public function setHighlightFlightByRegistration($registration,$highlight, $date = '') { |
| 11454 | 11454 | if ($date == '') { |
| 11455 | 11455 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)"; |
@@ -11463,12 +11463,12 @@ discard block |
||
| 11463 | 11463 | } |
| 11464 | 11464 | |
| 11465 | 11465 | /** |
| 11466 | - * Gets the short url from bit.ly |
|
| 11467 | - * |
|
| 11468 | - * @param String $url the full url |
|
| 11469 | - * @return String the bit.ly url |
|
| 11470 | - * |
|
| 11471 | - */ |
|
| 11466 | + * Gets the short url from bit.ly |
|
| 11467 | + * |
|
| 11468 | + * @param String $url the full url |
|
| 11469 | + * @return String the bit.ly url |
|
| 11470 | + * |
|
| 11471 | + */ |
|
| 11472 | 11472 | public function getBitlyURL($url) |
| 11473 | 11473 | { |
| 11474 | 11474 | global $globalBitlyAccessToken; |
@@ -11757,11 +11757,11 @@ discard block |
||
| 11757 | 11757 | $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 |
| 11758 | 11758 | 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)) |
| 11759 | 11759 | 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;"; |
| 11760 | - } else { |
|
| 11760 | + } else { |
|
| 11761 | 11761 | $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 |
| 11762 | 11762 | 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)) |
| 11763 | 11763 | 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;"; |
| 11764 | - } |
|
| 11764 | + } |
|
| 11765 | 11765 | $sth = $this->db->prepare($query); |
| 11766 | 11766 | $sth->execute(); |
| 11767 | 11767 | return $sth->fetchAll(PDO::FETCH_ASSOC); |