@@ -8,29 +8,29 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class Schedule { |
| 10 | 10 | protected $cookies = array(); |
| 11 | - public $db; |
|
| 11 | + public $db; |
|
| 12 | 12 | public function __construct($dbc = null) { |
| 13 | 13 | $Connection = new Connection($dbc); |
| 14 | 14 | $this->db = $Connection->db(); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Add schedule data to database |
|
| 19 | - * @param String $ident aircraft ident |
|
| 20 | - * @param String $departure_airport_icao departure airport icao |
|
| 21 | - * @param String $departure_airport_time departure airport time |
|
| 22 | - * @param String $arrival_airport_icao arrival airport icao |
|
| 23 | - * @param String $arrival_airport_time arrival airport time |
|
| 18 | + * Add schedule data to database |
|
| 19 | + * @param String $ident aircraft ident |
|
| 20 | + * @param String $departure_airport_icao departure airport icao |
|
| 21 | + * @param String $departure_airport_time departure airport time |
|
| 22 | + * @param String $arrival_airport_icao arrival airport icao |
|
| 23 | + * @param String $arrival_airport_time arrival airport time |
|
| 24 | 24 | / @param String $source source of data |
| 25 | - */ |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | 27 | public function addSchedule($ident,$departure_airport_icao,$departure_airport_time,$arrival_airport_icao,$arrival_airport_time,$source = 'website') { |
| 28 | 28 | date_default_timezone_set('UTC'); |
| 29 | 29 | $date = date("Y-m-d H:i:s",time()); |
| 30 | - //if ($departure_airport_time == '' && $arrival_airport_time == '') exit; |
|
| 31 | - //$query = "SELECT COUNT(*) FROM schedule WHERE ident = :ident"; |
|
| 32 | - $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident"; |
|
| 33 | - $query_values = array(':ident' => $ident); |
|
| 30 | + //if ($departure_airport_time == '' && $arrival_airport_time == '') exit; |
|
| 31 | + //$query = "SELECT COUNT(*) FROM schedule WHERE ident = :ident"; |
|
| 32 | + $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident"; |
|
| 33 | + $query_values = array(':ident' => $ident); |
|
| 34 | 34 | try { |
| 35 | 35 | $sth = $this->db->prepare($query); |
| 36 | 36 | $sth->execute($query_values); |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | if ($sth->fetchColumn() > 0) { |
| 41 | 41 | if ($departure_airport_time == '' && $arrival_airport_time == '') { |
| 42 | - $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND ToAirport_ICAO = :arrival_airport_icao"; |
|
| 43 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao); |
|
| 42 | + $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND ToAirport_ICAO = :arrival_airport_icao"; |
|
| 43 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao); |
|
| 44 | 44 | } elseif ($arrival_airport_time == '') { |
| 45 | - $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND FromAirport_Time = :departure_airport_time AND ToAirport_ICAO = :arrival_airport_icao"; |
|
| 46 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao); |
|
| 45 | + $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND FromAirport_Time = :departure_airport_time AND ToAirport_ICAO = :arrival_airport_icao"; |
|
| 46 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao); |
|
| 47 | 47 | } elseif ($departure_airport_time == '') { |
| 48 | - $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND ToAirport_ICAO = :arrival_airport_icao AND ToAirport_Time = :arrival_airport_time"; |
|
| 49 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time); |
|
| 48 | + $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND ToAirport_ICAO = :arrival_airport_icao AND ToAirport_Time = :arrival_airport_time"; |
|
| 49 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time); |
|
| 50 | 50 | } else { |
| 51 | - //$query = "SELECT COUNT(*) FROM schedule WHERE ident = :ident AND departure_airport_icao = :departure_airport_icao AND departure_airport_time = :departure_airport_time AND arrival_airport_icao = :arrival_airport_icao AND arrival_airport_time = :arrival_airport_time"; |
|
| 52 | - $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND FromAirport_Time = :departure_airport_time AND ToAirport_ICAO = :arrival_airport_icao AND ToAirport_Time = :arrival_airport_time"; |
|
| 53 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time); |
|
| 51 | + //$query = "SELECT COUNT(*) FROM schedule WHERE ident = :ident AND departure_airport_icao = :departure_airport_icao AND departure_airport_time = :departure_airport_time AND arrival_airport_icao = :arrival_airport_icao AND arrival_airport_time = :arrival_airport_time"; |
|
| 52 | + $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident AND FromAirport_ICAO = :departure_airport_icao AND FromAirport_Time = :departure_airport_time AND ToAirport_ICAO = :arrival_airport_icao AND ToAirport_Time = :arrival_airport_time"; |
|
| 53 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time); |
|
| 54 | 54 | } |
| 55 | 55 | try { |
| 56 | 56 | $sth = $this->db->prepare($query); |
@@ -61,17 +61,17 @@ discard block |
||
| 61 | 61 | if ($sth->fetchColumn() == 0) { |
| 62 | 62 | //$query = 'UPDATE schedule SET departure_airport_icao = :departure_airport_icao, departure_airport_time = :departure_airport_time, arrival_airport_icao = :arrival_airport_icao, arrival_airport_time = :arrival_airport_time, date_modified = :date, source = :source WHERE ident = :ident'; |
| 63 | 63 | if ($departure_airport_time == '' && $arrival_airport_time == '') { |
| 64 | - $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, ToAirport_ICAO = :arrival_airport_icao, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 65 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao, ':date' => $date, ':source' => $source); |
|
| 64 | + $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, ToAirport_ICAO = :arrival_airport_icao, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 65 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao, ':date' => $date, ':source' => $source); |
|
| 66 | 66 | } elseif ($arrival_airport_time == '') { |
| 67 | - $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, FromAiport_Time = :departure_airport_time, ToAirport_ICAO = :arrival_airport_icao, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 68 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao, ':date' => $date, ':source' => $source); |
|
| 67 | + $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, FromAiport_Time = :departure_airport_time, ToAirport_ICAO = :arrival_airport_icao, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 68 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao, ':date' => $date, ':source' => $source); |
|
| 69 | 69 | } elseif ($departure_airport_time == '') { |
| 70 | - $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, ToAirport_ICAO = :arrival_airport_icao, ToAirport_Time = :arrival_airport_time, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 71 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time, ':date' => $date, ':source' => $source); |
|
| 70 | + $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, ToAirport_ICAO = :arrival_airport_icao, ToAirport_Time = :arrival_airport_time, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 71 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time, ':date' => $date, ':source' => $source); |
|
| 72 | 72 | } else { |
| 73 | - $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, FromAiport_Time = :departure_airport_time, ToAirport_ICAO = :arrival_airport_icao, ToAirport_Time = :arrival_airport_time, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 74 | - $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time, ':date' => $date, ':source' => $source); |
|
| 73 | + $query = 'UPDATE routes SET FromAirport_ICAO = :departure_airport_icao, FromAiport_Time = :departure_airport_time, ToAirport_ICAO = :arrival_airport_icao, ToAirport_Time = :arrival_airport_time, date_modified = :date, Source = :source WHERE CallSign = :ident'; |
|
| 74 | + $query_values = array(':ident' => $ident,':departure_airport_icao' => $departure_airport_icao,':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_time' => $arrival_airport_time, ':date' => $date, ':source' => $source); |
|
| 75 | 75 | } |
| 76 | 76 | try { |
| 77 | 77 | $sth = $this->db->prepare($query); |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | public function getSchedule($ident) { |
| 107 | - $Translation = new Translation($this->db); |
|
| 108 | - $operator = $Translation->checkTranslation($ident,false); |
|
| 109 | - if ($ident != $operator) { |
|
| 110 | - $query = "SELECT FromAirport_ICAO as departure_airport_icao, ToAirport_ICAO as arrival_airport_icao, FromAirport_Time as departure_airport_time, ToAirport_Time as arrival_airport_time FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :operator OR CallSign = :ident LIMIT 1"; |
|
| 111 | - $query_values = array(':ident' => $ident,'operator' => $operator); |
|
| 112 | - } else { |
|
| 113 | - $query = "SELECT FromAirport_ICAO as departure_airport_icao, ToAirport_ICAO as arrival_airport_icao, FromAirport_Time as departure_airport_time, ToAirport_Time as arrival_airport_time FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :ident LIMIT 1"; |
|
| 114 | - $query_values = array(':ident' => $ident); |
|
| 115 | - } |
|
| 107 | + $Translation = new Translation($this->db); |
|
| 108 | + $operator = $Translation->checkTranslation($ident,false); |
|
| 109 | + if ($ident != $operator) { |
|
| 110 | + $query = "SELECT FromAirport_ICAO as departure_airport_icao, ToAirport_ICAO as arrival_airport_icao, FromAirport_Time as departure_airport_time, ToAirport_Time as arrival_airport_time FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :operator OR CallSign = :ident LIMIT 1"; |
|
| 111 | + $query_values = array(':ident' => $ident,'operator' => $operator); |
|
| 112 | + } else { |
|
| 113 | + $query = "SELECT FromAirport_ICAO as departure_airport_icao, ToAirport_ICAO as arrival_airport_icao, FromAirport_Time as departure_airport_time, ToAirport_Time as arrival_airport_time FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :ident LIMIT 1"; |
|
| 114 | + $query_values = array(':ident' => $ident); |
|
| 115 | + } |
|
| 116 | 116 | try { |
| 117 | 117 | $sth = $this->db->prepare($query); |
| 118 | 118 | $sth->execute($query_values); |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function checkSchedule($ident) { |
| 130 | 130 | global $globalDBdriver; |
| 131 | - //$query = "SELECT COUNT(*) as nb FROM schedule WHERE ident = :ident AND date_added > DATE_SUB(CURDATE(), INTERVAL 8 DAY) - 8 LIMIT 1"; |
|
| 132 | - if ($globalDBdriver == 'mysql') { |
|
| 131 | + //$query = "SELECT COUNT(*) as nb FROM schedule WHERE ident = :ident AND date_added > DATE_SUB(CURDATE(), INTERVAL 8 DAY) - 8 LIMIT 1"; |
|
| 132 | + if ($globalDBdriver == 'mysql') { |
|
| 133 | 133 | $query = "SELECT COUNT(*) as nb FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :ident AND ((date_added BETWEEN DATE(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND DATE(NOW()) and date_modified IS NULL) OR (date_modified BETWEEN DATE(DATE_SUB(CURDATE(), INTERVAL 15 DAY)) AND DATE(NOW()))) LIMIT 1"; |
| 134 | 134 | } else { |
| 135 | 135 | $query = "SELECT COUNT(*) as nb FROM routes WHERE FromAirport_ICAO <> '' AND ToAirport_ICAO <> '' AND CallSign = :ident |
| 136 | 136 | AND ((date_added::timestamp BETWEEN CURRENT_TIMESTAMP - INTERVAL '1 MONTH' AND CURRENT_TIMESTAMP) and date_modified::timestamp IS NULL) |
| 137 | 137 | OR (date_modified::timestamp BETWEEN CURRENT_TIMESTAMP - INTERVAL '1 MONTH' AND CURRENT_TIMESTAMP) LIMIT 1"; |
| 138 | 138 | } |
| 139 | - $query_values = array(':ident' => $ident); |
|
| 139 | + $query_values = array(':ident' => $ident); |
|
| 140 | 140 | try { |
| 141 | 141 | $sth = $this->db->prepare($query); |
| 142 | 142 | $sth->execute($query_values); |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * Get flight info from Air France |
|
| 153 | - * @param String $callsign The callsign |
|
| 154 | - * @param String $date date we want flight number info |
|
| 155 | - * @param String $carrier IATA code |
|
| 156 | - * @return Flight departure and arrival airports and time |
|
| 157 | - */ |
|
| 152 | + * Get flight info from Air France |
|
| 153 | + * @param String $callsign The callsign |
|
| 154 | + * @param String $date date we want flight number info |
|
| 155 | + * @param String $carrier IATA code |
|
| 156 | + * @return Flight departure and arrival airports and time |
|
| 157 | + */ |
|
| 158 | 158 | private function getAirFrance($callsign, $date = 'NOW',$carrier = 'AF') { |
| 159 | 159 | $Common = new Common(); |
| 160 | 160 | $check_date = new Datetime($date); |
@@ -190,11 +190,11 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Get flight info from EasyJet |
|
| 194 | - * @param String $callsign The callsign |
|
| 195 | - * @param String $date date we want flight number info |
|
| 196 | - * @return Flight departure and arrival airports and time |
|
| 197 | - */ |
|
| 193 | + * Get flight info from EasyJet |
|
| 194 | + * @param String $callsign The callsign |
|
| 195 | + * @param String $date date we want flight number info |
|
| 196 | + * @return Flight departure and arrival airports and time |
|
| 197 | + */ |
|
| 198 | 198 | private function getEasyJet($callsign, $date = 'NOW') { |
| 199 | 199 | global $globalTimezone; |
| 200 | 200 | $Common = new Common(); |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | - * Get flight info from Ryanair |
|
| 222 | - * @param String $callsign The callsign |
|
| 223 | - * @return Flight departure and arrival airports and time |
|
| 224 | - */ |
|
| 221 | + * Get flight info from Ryanair |
|
| 222 | + * @param String $callsign The callsign |
|
| 223 | + * @return Flight departure and arrival airports and time |
|
| 224 | + */ |
|
| 225 | 225 | private function getRyanair($callsign) { |
| 226 | 226 | $Common = new Common(); |
| 227 | 227 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -244,10 +244,10 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * Get flight info from Swiss |
|
| 248 | - * @param String $callsign The callsign |
|
| 249 | - * @return Flight departure and arrival airports and time |
|
| 250 | - */ |
|
| 247 | + * Get flight info from Swiss |
|
| 248 | + * @param String $callsign The callsign |
|
| 249 | + * @return Flight departure and arrival airports and time |
|
| 250 | + */ |
|
| 251 | 251 | private function getSwiss($callsign) { |
| 252 | 252 | $Common = new Common(); |
| 253 | 253 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
| 279 | - * Get flight info from British Airways API |
|
| 280 | - * @param String $callsign The callsign |
|
| 281 | - * @param String $date date we want flight number info |
|
| 282 | - * @return Flight departure and arrival airports and time |
|
| 283 | - */ |
|
| 279 | + * Get flight info from British Airways API |
|
| 280 | + * @param String $callsign The callsign |
|
| 281 | + * @param String $date date we want flight number info |
|
| 282 | + * @return Flight departure and arrival airports and time |
|
| 283 | + */ |
|
| 284 | 284 | public function getBritishAirways($callsign, $date = 'NOW') { |
| 285 | 285 | global $globalBritishAirwaysKey; |
| 286 | 286 | $Common = new Common(); |
@@ -304,11 +304,11 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
| 307 | - * Get flight info from Lutfhansa API |
|
| 308 | - * @param String $callsign The callsign |
|
| 309 | - * @param String $date date we want flight number info |
|
| 310 | - * @return Flight departure and arrival airports and time |
|
| 311 | - */ |
|
| 307 | + * Get flight info from Lutfhansa API |
|
| 308 | + * @param String $callsign The callsign |
|
| 309 | + * @param String $date date we want flight number info |
|
| 310 | + * @return Flight departure and arrival airports and time |
|
| 311 | + */ |
|
| 312 | 312 | public function getLufthansa($callsign, $date = 'NOW') { |
| 313 | 313 | global $globalLufthansaKey; |
| 314 | 314 | $Common = new Common(); |
@@ -338,11 +338,11 @@ discard block |
||
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
| 341 | - * Get flight info from Transavia API |
|
| 342 | - * @param String $callsign The callsign |
|
| 343 | - * @param String $date date we want flight number info |
|
| 344 | - * @return Flight departure and arrival airports and time |
|
| 345 | - */ |
|
| 341 | + * Get flight info from Transavia API |
|
| 342 | + * @param String $callsign The callsign |
|
| 343 | + * @param String $date date we want flight number info |
|
| 344 | + * @return Flight departure and arrival airports and time |
|
| 345 | + */ |
|
| 346 | 346 | public function getTransavia($callsign, $date = 'NOW') { |
| 347 | 347 | global $globalTransaviaKey; |
| 348 | 348 | $Common = new Common(); |
@@ -368,10 +368,10 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | - * Get flight info from Tunisair |
|
| 372 | - * @param String $callsign The callsign |
|
| 373 | - * @return Flight departure and arrival airports and time |
|
| 374 | - */ |
|
| 371 | + * Get flight info from Tunisair |
|
| 372 | + * @param String $callsign The callsign |
|
| 373 | + * @return Flight departure and arrival airports and time |
|
| 374 | + */ |
|
| 375 | 375 | public function getTunisair($callsign) { |
| 376 | 376 | $Common = new Common(); |
| 377 | 377 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -388,10 +388,10 @@ discard block |
||
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /** |
| 391 | - * Get flight info from Vueling |
|
| 392 | - * @param String $callsign The callsign |
|
| 393 | - * @return Flight departure and arrival airports and time |
|
| 394 | - */ |
|
| 391 | + * Get flight info from Vueling |
|
| 392 | + * @param String $callsign The callsign |
|
| 393 | + * @return Flight departure and arrival airports and time |
|
| 394 | + */ |
|
| 395 | 395 | public function getVueling($callsign,$date = 'NOW') { |
| 396 | 396 | $Common = new Common(); |
| 397 | 397 | $check_date = new Datetime($date); |
@@ -413,11 +413,11 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
| 416 | - * Get flight info from Iberia |
|
| 417 | - * @param String $callsign The callsign |
|
| 418 | - * @param String $date date we want flight number info |
|
| 419 | - * @return Flight departure and arrival airports and time |
|
| 420 | - */ |
|
| 416 | + * Get flight info from Iberia |
|
| 417 | + * @param String $callsign The callsign |
|
| 418 | + * @param String $date date we want flight number info |
|
| 419 | + * @return Flight departure and arrival airports and time |
|
| 420 | + */ |
|
| 421 | 421 | public function getIberia($callsign, $date = 'NOW') { |
| 422 | 422 | $Common = new Common(); |
| 423 | 423 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -447,11 +447,11 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
| 450 | - * Get flight info from Star Alliance |
|
| 451 | - * @param String $callsign The callsign |
|
| 452 | - * @param String $date date we want flight number info |
|
| 453 | - * @return Flight departure and arrival airports and time |
|
| 454 | - */ |
|
| 450 | + * Get flight info from Star Alliance |
|
| 451 | + * @param String $callsign The callsign |
|
| 452 | + * @param String $date date we want flight number info |
|
| 453 | + * @return Flight departure and arrival airports and time |
|
| 454 | + */ |
|
| 455 | 455 | |
| 456 | 456 | private function getStarAlliance($callsign, $date = 'NOW',$carrier = '') { |
| 457 | 457 | $Common = new Common(); |
@@ -483,11 +483,11 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | |
| 485 | 485 | /** |
| 486 | - * Get flight info from Alitalia |
|
| 487 | - * @param String $callsign The callsign |
|
| 488 | - * @param String $date date we want flight number info |
|
| 489 | - * @return Flight departure and arrival airports and time |
|
| 490 | - */ |
|
| 486 | + * Get flight info from Alitalia |
|
| 487 | + * @param String $callsign The callsign |
|
| 488 | + * @param String $date date we want flight number info |
|
| 489 | + * @return Flight departure and arrival airports and time |
|
| 490 | + */ |
|
| 491 | 491 | private function getAlitalia($callsign, $date = 'NOW') { |
| 492 | 492 | $Common = new Common(); |
| 493 | 493 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -506,11 +506,11 @@ discard block |
||
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | /** |
| 509 | - * Get flight info from Brussels airlines |
|
| 510 | - * @param String $callsign The callsign |
|
| 511 | - * @param String $date date we want flight number info |
|
| 512 | - * @return Flight departure and arrival airports and time |
|
| 513 | - */ |
|
| 509 | + * Get flight info from Brussels airlines |
|
| 510 | + * @param String $callsign The callsign |
|
| 511 | + * @param String $date date we want flight number info |
|
| 512 | + * @return Flight departure and arrival airports and time |
|
| 513 | + */ |
|
| 514 | 514 | private function getBrussels($callsign, $date = 'NOW') { |
| 515 | 515 | $Common = new Common(); |
| 516 | 516 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -520,24 +520,24 @@ discard block |
||
| 520 | 520 | if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
| 521 | 521 | $data = $Common->getData($url); |
| 522 | 522 | if ($data != '') { |
| 523 | - //echo $data; |
|
| 524 | - $parsed_json = json_decode($data,true); |
|
| 525 | - if (isset($parsed_json[0]['FromAirportCode'])) { |
|
| 523 | + //echo $data; |
|
| 524 | + $parsed_json = json_decode($data,true); |
|
| 525 | + if (isset($parsed_json[0]['FromAirportCode'])) { |
|
| 526 | 526 | $DepartureAirportIata = $parsed_json[0]['FromAirportCode']; |
| 527 | 527 | $ArrivalAirportIata = $parsed_json[0]['ToAirportCode']; |
| 528 | 528 | $departureTime = date('H:i',strtotime($parsed_json[0]['ScheduledDepatureDate'])); |
| 529 | 529 | $arrivalTime = date('H:i',strtotime($parsed_json[0]['ScheduledArrivalDate'])); |
| 530 | 530 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_brussels'); |
| 531 | - } |
|
| 531 | + } |
|
| 532 | 532 | } |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | /** |
| 536 | - * Get flight info from FlightRadar24 |
|
| 537 | - * @param String $callsign The callsign |
|
| 538 | - * @param String $date date we want flight number info |
|
| 539 | - * @return Flight departure and arrival airports and time |
|
| 540 | - */ |
|
| 536 | + * Get flight info from FlightRadar24 |
|
| 537 | + * @param String $callsign The callsign |
|
| 538 | + * @param String $date date we want flight number info |
|
| 539 | + * @return Flight departure and arrival airports and time |
|
| 540 | + */ |
|
| 541 | 541 | /* |
| 542 | 542 | public function getFlightRadar24($callsign, $date = 'NOW') { |
| 543 | 543 | $Common = new Common(); |
@@ -566,11 +566,11 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | */ |
| 568 | 568 | /** |
| 569 | - * Get flight info from Lufthansa |
|
| 570 | - * @param String $callsign The callsign |
|
| 571 | - * @param String $date date we want flight number info |
|
| 572 | - * @return Flight departure and arrival airports and time |
|
| 573 | - */ |
|
| 569 | + * Get flight info from Lufthansa |
|
| 570 | + * @param String $callsign The callsign |
|
| 571 | + * @param String $date date we want flight number info |
|
| 572 | + * @return Flight departure and arrival airports and time |
|
| 573 | + */ |
|
| 574 | 574 | |
| 575 | 575 | /* private function getLufthansa($callsign, $date = 'NOW') { |
| 576 | 576 | $Common = new Common(); |
@@ -598,10 +598,10 @@ discard block |
||
| 598 | 598 | } |
| 599 | 599 | */ |
| 600 | 600 | /** |
| 601 | - * Get flight info from flytap |
|
| 602 | - * @param String $callsign The callsign |
|
| 603 | - * @return Flight departure and arrival airports and time |
|
| 604 | - */ |
|
| 601 | + * Get flight info from flytap |
|
| 602 | + * @param String $callsign The callsign |
|
| 603 | + * @return Flight departure and arrival airports and time |
|
| 604 | + */ |
|
| 605 | 605 | private function getFlyTap($callsign) { |
| 606 | 606 | $Common = new Common(); |
| 607 | 607 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -624,10 +624,10 @@ discard block |
||
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | /** |
| 627 | - * Get flight info from flightmapper |
|
| 628 | - * @param String $callsign The callsign |
|
| 629 | - * @return Flight departure and arrival airports and time |
|
| 630 | - */ |
|
| 627 | + * Get flight info from flightmapper |
|
| 628 | + * @param String $callsign The callsign |
|
| 629 | + * @return Flight departure and arrival airports and time |
|
| 630 | + */ |
|
| 631 | 631 | public function getFlightMapper($callsign) { |
| 632 | 632 | $Common = new Common(); |
| 633 | 633 | $airline_icao = ''; |
@@ -655,11 +655,11 @@ discard block |
||
| 655 | 655 | $aarr = ''; |
| 656 | 656 | $n = sscanf($sched,'%*s %5[0-9:] %*[^()] (%3[A-Z]) %5[0-9:] %*[^()] (%3[A-Z])',$dhour,$darr,$ahour,$aarr); |
| 657 | 657 | if ($n == 7) { |
| 658 | - $departureTime = $dhour; |
|
| 659 | - $arrivalTime = $ahour; |
|
| 660 | - $DepartureAirportIata = str_replace(array('(',')'),'',$darr); |
|
| 661 | - $ArrivalAirportIata = str_replace(array('(',')'),'',$aarr); |
|
| 662 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_flightmapper'); |
|
| 658 | + $departureTime = $dhour; |
|
| 659 | + $arrivalTime = $ahour; |
|
| 660 | + $DepartureAirportIata = str_replace(array('(',')'),'',$darr); |
|
| 661 | + $ArrivalAirportIata = str_replace(array('(',')'),'',$aarr); |
|
| 662 | + return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_flightmapper'); |
|
| 663 | 663 | } |
| 664 | 664 | } |
| 665 | 665 | } |
@@ -667,10 +667,10 @@ discard block |
||
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
| 670 | - * Get flight info from flightaware |
|
| 671 | - * @param String $callsign The callsign |
|
| 672 | - * @return Flight departure and arrival airports and time |
|
| 673 | - */ |
|
| 670 | + * Get flight info from flightaware |
|
| 671 | + * @param String $callsign The callsign |
|
| 672 | + * @return Flight departure and arrival airports and time |
|
| 673 | + */ |
|
| 674 | 674 | public function getFlightAware($callsign) { |
| 675 | 675 | $Common = new Common(); |
| 676 | 676 | /* |
@@ -703,10 +703,10 @@ discard block |
||
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | /** |
| 706 | - * Get flight info from CostToTravel |
|
| 707 | - * @param String $callsign The callsign |
|
| 708 | - * @return Flight departure and arrival airports and time |
|
| 709 | - */ |
|
| 706 | + * Get flight info from CostToTravel |
|
| 707 | + * @param String $callsign The callsign |
|
| 708 | + * @return Flight departure and arrival airports and time |
|
| 709 | + */ |
|
| 710 | 710 | public function getCostToTravel($callsign) { |
| 711 | 711 | $Common = new Common(); |
| 712 | 712 | $url= "http://www.costtotravel.com/flight-number/".$callsign; |
@@ -728,11 +728,11 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | /** |
| 731 | - * Get flight info from Air Canada |
|
| 732 | - * @param String $callsign The callsign |
|
| 733 | - * @param String $date date we want flight number info |
|
| 734 | - * @return Flight departure and arrival airports and time |
|
| 735 | - */ |
|
| 731 | + * Get flight info from Air Canada |
|
| 732 | + * @param String $callsign The callsign |
|
| 733 | + * @param String $date date we want flight number info |
|
| 734 | + * @return Flight departure and arrival airports and time |
|
| 735 | + */ |
|
| 736 | 736 | private function getAirCanada($callsign,$date = 'NOW') { |
| 737 | 737 | $Common = new Common(); |
| 738 | 738 | date_default_timezone_set('UTC'); |
@@ -756,11 +756,11 @@ discard block |
||
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | /** |
| 759 | - * Get flight info from Vietnam Airlines |
|
| 760 | - * @param String $callsign The callsign |
|
| 761 | - * @param String $date date we want flight number info |
|
| 762 | - * @return Flight departure and arrival airports and time |
|
| 763 | - */ |
|
| 759 | + * Get flight info from Vietnam Airlines |
|
| 760 | + * @param String $callsign The callsign |
|
| 761 | + * @param String $date date we want flight number info |
|
| 762 | + * @return Flight departure and arrival airports and time |
|
| 763 | + */ |
|
| 764 | 764 | private function getVietnamAirlines($callsign, $date = 'NOW') { |
| 765 | 765 | $Common = new Common(); |
| 766 | 766 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
@@ -782,12 +782,12 @@ discard block |
||
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | /** |
| 785 | - * Get flight info from Air Berlin |
|
| 786 | - * @param String $callsign The callsign |
|
| 787 | - * @param String $date date we want flight number info |
|
| 788 | - * @param String $carrier airline code |
|
| 789 | - * @return Flight departure and arrival airports and time |
|
| 790 | - */ |
|
| 785 | + * Get flight info from Air Berlin |
|
| 786 | + * @param String $callsign The callsign |
|
| 787 | + * @param String $date date we want flight number info |
|
| 788 | + * @param String $carrier airline code |
|
| 789 | + * @return Flight departure and arrival airports and time |
|
| 790 | + */ |
|
| 791 | 791 | private function getAirBerlin($callsign, $date = 'NOW',$carrier = 'AB') { |
| 792 | 792 | $Common = new Common(); |
| 793 | 793 | date_default_timezone_set('UTC'); |
@@ -816,11 +816,11 @@ discard block |
||
| 816 | 816 | $table = $Common->table2array($data); |
| 817 | 817 | $flight = $table; |
| 818 | 818 | if (isset($flight[5][4])) { |
| 819 | - $arrivalTime = $flight[5][4]; |
|
| 820 | - $arrivalAirport = $flight[5][3]; |
|
| 819 | + $arrivalTime = $flight[5][4]; |
|
| 820 | + $arrivalAirport = $flight[5][3]; |
|
| 821 | 821 | } else { |
| 822 | - $arrivalTime = ''; |
|
| 823 | - $arrivalAirport = ''; |
|
| 822 | + $arrivalTime = ''; |
|
| 823 | + $arrivalAirport = ''; |
|
| 824 | 824 | } |
| 825 | 825 | } else return array(); |
| 826 | 826 | $url = 'http://www.airberlin.com/en-US/site/json/suggestAirport.php?searchfor=departures&searchflightid=0&departures%5B%5D=&suggestsource%5B0%5D=activeairports&withcountries=0&withoutroutings=0&promotion%5Bid%5D=&promotion%5Btype%5D=&routesource%5B0%5D=airberlin&routesource%5B1%5D=partner'; |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | } |
| 1089 | 1089 | } |
| 1090 | 1090 | } |
| 1091 | - return array(); |
|
| 1091 | + return array(); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | <div id="showdetails" class="showdetails"></div> |
| 37 | 37 | <div id="infobox" class="infobox"><h4><?php echo _("Aircrafts detected"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div> |
| 38 | 38 | <?php |
| 39 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
| 39 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
| 40 | 40 | |
| 41 | 41 | ?> |
| 42 | 42 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script> |
| 43 | 43 | <?php |
| 44 | - } |
|
| 44 | + } |
|
| 45 | 45 | ?> |
| 46 | 46 | <div id="dialog" title="<?php echo _("Session has timed-out"); ?>"> |
| 47 | 47 | <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p> |
@@ -55,34 +55,34 @@ discard block |
||
| 55 | 55 | <li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
| 56 | 56 | <li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
| 57 | 57 | <?php |
| 58 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 58 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 59 | 59 | if (isset($globalArchive) && $globalArchive == TRUE) { |
| 60 | 60 | ?> |
| 61 | 61 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
| 62 | 62 | <?php |
| 63 | 63 | } |
| 64 | - } |
|
| 64 | + } |
|
| 65 | 65 | ?> |
| 66 | 66 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
| 67 | 67 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
| 68 | 68 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
| 69 | 69 | <?php |
| 70 | - if (isset($globalMap3D) && $globalMap3D) { |
|
| 70 | + if (isset($globalMap3D) && $globalMap3D) { |
|
| 71 | 71 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
| 72 | 72 | ?> |
| 73 | 73 | <li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
| 74 | 74 | <?php |
| 75 | - } else { |
|
| 76 | - if (isset($globalMapSatellites) && $globalMapSatellites) { |
|
| 75 | + } else { |
|
| 76 | + if (isset($globalMapSatellites) && $globalMapSatellites) { |
|
| 77 | 77 | ?> |
| 78 | 78 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
| 79 | 79 | <?php |
| 80 | - } |
|
| 80 | + } |
|
| 81 | 81 | ?> |
| 82 | 82 | <li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
| 83 | 83 | <?php |
| 84 | 84 | } |
| 85 | - } |
|
| 85 | + } |
|
| 86 | 86 | ?> |
| 87 | 87 | </ul> |
| 88 | 88 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | ?> |
| 157 | 157 | </div> |
| 158 | 158 | <?php |
| 159 | - if (isset($globalArchive) && $globalArchive == TRUE) { |
|
| 159 | + if (isset($globalArchive) && $globalArchive == TRUE) { |
|
| 160 | 160 | ?> |
| 161 | 161 | <div class="sidebar-pane" id="archive"> |
| 162 | 162 | <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | </form> |
| 217 | 217 | </div> |
| 218 | 218 | <?php |
| 219 | - } |
|
| 219 | + } |
|
| 220 | 220 | ?> |
| 221 | 221 | <div class="sidebar-pane" id="settings"> |
| 222 | 222 | <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -227,56 +227,56 @@ discard block |
||
| 227 | 227 | <?php |
| 228 | 228 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
| 229 | 229 | else $MapType = $_COOKIE['MapType']; |
| 230 | - ?> |
|
| 230 | + ?> |
|
| 231 | 231 | <?php |
| 232 | 232 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
| 233 | - ?> |
|
| 233 | + ?> |
|
| 234 | 234 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
| 235 | 235 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
| 236 | 236 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
| 237 | 237 | <?php |
| 238 | 238 | } |
| 239 | - ?> |
|
| 239 | + ?> |
|
| 240 | 240 | <?php |
| 241 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
| 242 | - ?> |
|
| 241 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
| 242 | + ?> |
|
| 243 | 243 | <?php |
| 244 | - if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
| 245 | - ?> |
|
| 244 | + if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
| 245 | + ?> |
|
| 246 | 246 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
| 247 | 247 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
| 248 | 248 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
| 249 | 249 | <?php |
| 250 | - } |
|
| 251 | - ?> |
|
| 250 | + } |
|
| 251 | + ?> |
|
| 252 | 252 | <?php |
| 253 | - if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
| 254 | - ?> |
|
| 253 | + if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
| 254 | + ?> |
|
| 255 | 255 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
| 256 | 256 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
| 257 | 257 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
| 258 | 258 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
| 259 | 259 | <?php |
| 260 | - } |
|
| 261 | - ?> |
|
| 260 | + } |
|
| 261 | + ?> |
|
| 262 | 262 | <?php |
| 263 | - if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
| 264 | - ?> |
|
| 263 | + if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
| 264 | + ?> |
|
| 265 | 265 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
| 266 | 266 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
| 267 | 267 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
| 268 | 268 | <?php |
| 269 | - } |
|
| 270 | - ?> |
|
| 269 | + } |
|
| 270 | + ?> |
|
| 271 | 271 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
| 272 | 272 | <?php |
| 273 | 273 | } |
| 274 | - ?> |
|
| 274 | + ?> |
|
| 275 | 275 | <?php |
| 276 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
| 276 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
| 277 | 277 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
| 278 | 278 | else $MapBoxId = $_COOKIE['MapTypeId']; |
| 279 | - ?> |
|
| 279 | + ?> |
|
| 280 | 280 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
| 281 | 281 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
| 282 | 282 | <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
@@ -290,13 +290,13 @@ discard block |
||
| 290 | 290 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
| 291 | 291 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
| 292 | 292 | <?php |
| 293 | - } |
|
| 294 | - ?> |
|
| 293 | + } |
|
| 294 | + ?> |
|
| 295 | 295 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
| 296 | 296 | </select> |
| 297 | 297 | </li> |
| 298 | 298 | <?php |
| 299 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 299 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 300 | 300 | ?> |
| 301 | 301 | <li><?php echo _("Type of Terrain:"); ?> |
| 302 | 302 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -306,10 +306,10 @@ discard block |
||
| 306 | 306 | </select> |
| 307 | 307 | </li> |
| 308 | 308 | <?php |
| 309 | - } |
|
| 309 | + } |
|
| 310 | 310 | ?> |
| 311 | 311 | <?php |
| 312 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 312 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 313 | 313 | ?> |
| 314 | 314 | |
| 315 | 315 | <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
@@ -317,59 +317,59 @@ discard block |
||
| 317 | 317 | <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
| 318 | 318 | <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
| 319 | 319 | <?php |
| 320 | - } |
|
| 320 | + } |
|
| 321 | 321 | ?> |
| 322 | 322 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
| 323 | 323 | <?php |
| 324 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 324 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 325 | 325 | ?> |
| 326 | 326 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
| 327 | 327 | <?php |
| 328 | - } |
|
| 329 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
| 328 | + } |
|
| 329 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
| 330 | 330 | ?> |
| 331 | 331 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
| 332 | 332 | <?php |
| 333 | - } |
|
| 333 | + } |
|
| 334 | 334 | ?> |
| 335 | 335 | |
| 336 | 336 | <?php |
| 337 | 337 | if (function_exists('array_column')) { |
| 338 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
| 339 | - ?> |
|
| 338 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
| 339 | + ?> |
|
| 340 | 340 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
| 341 | 341 | <?php |
| 342 | - } |
|
| 342 | + } |
|
| 343 | 343 | } elseif (isset($globalSources)) { |
| 344 | - $dispolar = false; |
|
| 345 | - foreach ($globalSources as $testsource) { |
|
| 346 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 347 | - } |
|
| 348 | - if ($dispolar) { |
|
| 349 | - ?> |
|
| 344 | + $dispolar = false; |
|
| 345 | + foreach ($globalSources as $testsource) { |
|
| 346 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 347 | + } |
|
| 348 | + if ($dispolar) { |
|
| 349 | + ?> |
|
| 350 | 350 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
| 351 | 351 | <?php |
| 352 | - } |
|
| 353 | - } |
|
| 354 | - ?> |
|
| 352 | + } |
|
| 353 | + } |
|
| 354 | + ?> |
|
| 355 | 355 | <?php |
| 356 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 356 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 357 | 357 | ?> |
| 358 | 358 | |
| 359 | 359 | <?php |
| 360 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 361 | - ?> |
|
| 360 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 361 | + ?> |
|
| 362 | 362 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
| 363 | 363 | <?php |
| 364 | 364 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
| 365 | - ?> |
|
| 365 | + ?> |
|
| 366 | 366 | <li><?php echo _("Aircraft icon color:"); ?> |
| 367 | 367 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
| 368 | 368 | </li> |
| 369 | 369 | <?php |
| 370 | - } |
|
| 371 | - } |
|
| 372 | - ?> |
|
| 370 | + } |
|
| 371 | + } |
|
| 372 | + ?> |
|
| 373 | 373 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
| 374 | 374 | <div class="range"> |
| 375 | 375 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | </div> |
| 378 | 378 | </li> |
| 379 | 379 | <?php |
| 380 | - } |
|
| 380 | + } |
|
| 381 | 381 | ?> |
| 382 | 382 | <li><?php echo _("Distance unit:"); ?> |
| 383 | 383 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -410,16 +410,16 @@ discard block |
||
| 410 | 410 | <ul> |
| 411 | 411 | <?php |
| 412 | 412 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
| 413 | - ?> |
|
| 413 | + ?> |
|
| 414 | 414 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
| 415 | 415 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
| 416 | 416 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
| 417 | 417 | <?php |
| 418 | 418 | } |
| 419 | - ?> |
|
| 419 | + ?> |
|
| 420 | 420 | <?php |
| 421 | 421 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
| 422 | - ?> |
|
| 422 | + ?> |
|
| 423 | 423 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
| 424 | 424 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
| 425 | 425 | <?php } ?> |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | <?php } ?> |
| 429 | 429 | <?php |
| 430 | 430 | } |
| 431 | - ?> |
|
| 431 | + ?> |
|
| 432 | 432 | <li><?php echo _("Display airlines:"); ?> |
| 433 | 433 | <br/> |
| 434 | 434 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -448,14 +448,14 @@ discard block |
||
| 448 | 448 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | - ?> |
|
| 451 | + ?> |
|
| 452 | 452 | </select> |
| 453 | 453 | </li> |
| 454 | 454 | <?php |
| 455 | 455 | $Spotter = new Spotter(); |
| 456 | 456 | $allalliancenames = $Spotter->getAllAllianceNames(); |
| 457 | 457 | if (!empty($allalliancenames)) { |
| 458 | - ?> |
|
| 458 | + ?> |
|
| 459 | 459 | <li><?php echo _("Display alliance:"); ?> |
| 460 | 460 | <br/> |
| 461 | 461 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -469,15 +469,15 @@ discard block |
||
| 469 | 469 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | - ?> |
|
| 472 | + ?> |
|
| 473 | 473 | </select> |
| 474 | 474 | </li> |
| 475 | 475 | <?php |
| 476 | 476 | } |
| 477 | - ?> |
|
| 477 | + ?> |
|
| 478 | 478 | <?php |
| 479 | 479 | if (isset($globalAPRS) && $globalAPRS) { |
| 480 | - ?> |
|
| 480 | + ?> |
|
| 481 | 481 | <li><?php echo _("Display APRS sources name:"); ?> |
| 482 | 482 | <select class="selectpicker" multiple onchange="sources(this);"> |
| 483 | 483 | <?php |
@@ -489,15 +489,15 @@ discard block |
||
| 489 | 489 | echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>'; |
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | - ?> |
|
| 492 | + ?> |
|
| 493 | 493 | </select> |
| 494 | 494 | </li> |
| 495 | 495 | <?php |
| 496 | 496 | } |
| 497 | - ?> |
|
| 497 | + ?> |
|
| 498 | 498 | <?php |
| 499 | 499 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
| 500 | - ?> |
|
| 500 | + ?> |
|
| 501 | 501 | <li><?php echo _("Display airlines of type:"); ?><br/> |
| 502 | 502 | <select class="selectpicker" onchange="airlinestype(this);"> |
| 503 | 503 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | </li> |
| 509 | 509 | <?php |
| 510 | 510 | } |
| 511 | - ?> |
|
| 511 | + ?> |
|
| 512 | 512 | <li> |
| 513 | 513 | <?php echo _("Display flight with ident:"); ?> |
| 514 | 514 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | </form> |
| 522 | 522 | </div> |
| 523 | 523 | <?php |
| 524 | - if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 524 | + if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 525 | 525 | ?> |
| 526 | 526 | <div class="sidebar-pane" id="satellites"> |
| 527 | 527 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -561,14 +561,14 @@ discard block |
||
| 561 | 561 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | - ?> |
|
| 564 | + ?> |
|
| 565 | 565 | </select> |
| 566 | 566 | </li> |
| 567 | 567 | </ul> |
| 568 | 568 | </form> |
| 569 | 569 | </div> |
| 570 | 570 | <?php |
| 571 | - } |
|
| 571 | + } |
|
| 572 | 572 | ?> |
| 573 | 573 | </div> |
| 574 | 574 | </div> |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airline'])) { |
| 7 | - header('Location: '.$globalURL.'/airline'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airline'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 7 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | 11 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airline'])) { |
| 7 | - header('Location: '.$globalURL.'/airline'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airline'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | function drawChart() { |
| 73 | 73 | var data = google.visualization.arrayToDataTable([ |
| 74 | 74 | ["'._("Country").'", "'._("# of times").'"], '; |
| 75 | - $country_data = ''; |
|
| 75 | + $country_data = ''; |
|
| 76 | 76 | foreach($airport_country_array as $airport_item) |
| 77 | 77 | { |
| 78 | 78 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airline'])) { |
| 7 | - header('Location: '.$globalURL.'/airline'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airline'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | var data = google.visualization.arrayToDataTable([ |
| 77 | 77 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 78 | - $airport_data = ''; |
|
| 78 | + $airport_data = ''; |
|
| 79 | 79 | foreach($airport_airport_array as $airport_item) |
| 80 | 80 | { |
| 81 | 81 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
@@ -4,55 +4,55 @@ |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | - //for the date manipulation into the query |
|
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | - $start_date = $_GET['start_date'].":00"; |
|
| 10 | - $end_date = $_GET['end_date'].":00"; |
|
| 11 | - $sql_date = $start_date.",".$end_date; |
|
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | - $start_date = $_GET['start_date'].":00"; |
|
| 14 | - $sql_date = $start_date; |
|
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | - $sql_date = $end_date; |
|
| 18 | - } else $sql_date = ''; |
|
| 7 | + //for the date manipulation into the query |
|
| 8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + $start_date = $_GET['start_date'].":00"; |
|
| 10 | + $end_date = $_GET['end_date'].":00"; |
|
| 11 | + $sql_date = $start_date.",".$end_date; |
|
| 12 | + } else if($_GET['start_date'] != ""){ |
|
| 13 | + $start_date = $_GET['start_date'].":00"; |
|
| 14 | + $sql_date = $start_date; |
|
| 15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | + $sql_date = $end_date; |
|
| 18 | + } else $sql_date = ''; |
|
| 19 | 19 | } else $sql_date = ''; |
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | - //for altitude manipulation |
|
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | - $end_altitude = $_GET['highest_altitude']; |
|
| 25 | - $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | - $end_altitude = $_GET['highest_altitude']; |
|
| 29 | - $sql_altitude = $end_altitude; |
|
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | - $sql_altitude = $start_altitude; |
|
| 33 | - } else $sql_altitude = ''; |
|
| 22 | + //for altitude manipulation |
|
| 23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | + $end_altitude = $_GET['highest_altitude']; |
|
| 25 | + $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | + } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | + $end_altitude = $_GET['highest_altitude']; |
|
| 29 | + $sql_altitude = $end_altitude; |
|
| 30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | + $sql_altitude = $start_altitude; |
|
| 33 | + } else $sql_altitude = ''; |
|
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | 37 | if(!isset($_GET['limit'])) |
| 38 | 38 | { |
| 39 | - if (!isset($_GET['number_results'])) |
|
| 40 | - { |
|
| 41 | - $limit_start = 0; |
|
| 42 | - $limit_end = 25; |
|
| 43 | - $absolute_difference = 25; |
|
| 44 | - } else { |
|
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | - $_GET['number_results'] = 1000; |
|
| 47 | - } |
|
| 48 | - $limit_start = 0; |
|
| 49 | - $limit_end = $_GET['number_results']; |
|
| 50 | - $absolute_difference = $_GET['number_results']; |
|
| 51 | - } |
|
| 39 | + if (!isset($_GET['number_results'])) |
|
| 40 | + { |
|
| 41 | + $limit_start = 0; |
|
| 42 | + $limit_end = 25; |
|
| 43 | + $absolute_difference = 25; |
|
| 44 | + } else { |
|
| 45 | + if ($_GET['number_results'] > 1000){ |
|
| 46 | + $_GET['number_results'] = 1000; |
|
| 47 | + } |
|
| 48 | + $limit_start = 0; |
|
| 49 | + $limit_end = $_GET['number_results']; |
|
| 50 | + $absolute_difference = $_GET['number_results']; |
|
| 51 | + } |
|
| 52 | 52 | } else { |
| 53 | - $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | - $limit_start = $limit_explode[0]; |
|
| 55 | - $limit_end = $limit_explode[1]; |
|
| 53 | + $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | + $limit_start = $limit_explode[0]; |
|
| 55 | + $limit_end = $limit_explode[1]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
| 9 | 9 | $spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($flightaware_id); |
| 10 | 10 | |
| 11 | - if ($spotter_id != "") |
|
| 12 | - { |
|
| 13 | - header('Location: '.$globalURL.'/flightid/'.$spotter_id); |
|
| 14 | - } else { |
|
| 11 | + if ($spotter_id != "") |
|
| 12 | + { |
|
| 13 | + header('Location: '.$globalURL.'/flightid/'.$spotter_id); |
|
| 14 | + } else { |
|
| 15 | 15 | header('Location: '.$globalURL); |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | } |
| 18 | 18 | ?> |
| 19 | 19 | \ No newline at end of file |