@@ -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 | |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | / @param String $source source of data |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | - public function addSchedule($ident,$departure_airport_icao,$departure_airport_time,$arrival_airport_icao,$arrival_airport_time,$source = 'website') { |
|
| 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 | - $date = date("Y-m-d H:i:s",time()); |
|
| 29 | + $date = date("Y-m-d H:i:s", time()); |
|
| 30 | 30 | //if ($departure_airport_time == '' && $arrival_airport_time == '') exit; |
| 31 | 31 | //$query = "SELECT COUNT(*) FROM schedule WHERE ident = :ident"; |
| 32 | 32 | $query = "SELECT COUNT(*) FROM routes WHERE CallSign = :ident"; |
@@ -34,69 +34,69 @@ discard block |
||
| 34 | 34 | try { |
| 35 | 35 | $sth = $this->db->prepare($query); |
| 36 | 36 | $sth->execute($query_values); |
| 37 | - } catch(PDOException $e) { |
|
| 37 | + } catch (PDOException $e) { |
|
| 38 | 38 | return "error : ".$e->getMessage(); |
| 39 | 39 | } |
| 40 | 40 | if ($sth->fetchColumn() > 0) { |
| 41 | 41 | if ($departure_airport_time == '' && $arrival_airport_time == '') { |
| 42 | 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); |
|
| 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 | 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); |
|
| 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 | 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); |
|
| 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 | 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 | 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); |
|
| 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); |
| 57 | 57 | $sth->execute($query_values); |
| 58 | - } catch(PDOException $e) { |
|
| 58 | + } catch (PDOException $e) { |
|
| 59 | 59 | return "error : ".$e->getMessage(); |
| 60 | 60 | } |
| 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 | 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); |
|
| 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 | 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); |
|
| 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 | 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); |
|
| 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 | 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); |
|
| 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); |
| 78 | 78 | $sth->execute($query_values); |
| 79 | - } catch(PDOException $e) { |
|
| 79 | + } catch (PDOException $e) { |
|
| 80 | 80 | return "error : ".$e->getMessage(); |
| 81 | 81 | } |
| 82 | 82 | } else { |
| 83 | 83 | //$query = 'UPDATE schedule SET date_lastseen = :date WHERE ident = :ident'; |
| 84 | 84 | $query = 'UPDATE routes SET date_lastseen = :date WHERE CallSign = :ident'; |
| 85 | - $query_values = array(':ident' => $ident,':date' => $date); |
|
| 85 | + $query_values = array(':ident' => $ident, ':date' => $date); |
|
| 86 | 86 | try { |
| 87 | 87 | $sth = $this->db->prepare($query); |
| 88 | 88 | $sth->execute($query_values); |
| 89 | - } catch(PDOException $e) { |
|
| 89 | + } catch (PDOException $e) { |
|
| 90 | 90 | return "error : ".$e->getMessage(); |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } else { |
| 94 | 94 | $query = 'INSERT INTO routes (CallSign,FromAirport_ICAO, FromAirport_Time, ToAirport_ICAO, ToAirport_Time,date_added,source) VALUES (:ident,:departure_airport_icao,:departure_airport_time,:arrival_airport_icao,:arrival_airport_time,:date,:source)'; |
| 95 | - $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); |
|
| 95 | + $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); |
|
| 96 | 96 | try { |
| 97 | 97 | $sth = $this->db->prepare($query); |
| 98 | 98 | $sth->execute($query_values); |
| 99 | - } catch(PDOException $e) { |
|
| 99 | + } catch (PDOException $e) { |
|
| 100 | 100 | return "error : ".$e->getMessage(); |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | public function getSchedule($ident) { |
| 107 | 107 | $Translation = new Translation($this->db); |
| 108 | - $operator = $Translation->checkTranslation($ident,false); |
|
| 108 | + $operator = $Translation->checkTranslation($ident, false); |
|
| 109 | 109 | if ($ident != $operator) { |
| 110 | 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); |
|
| 111 | + $query_values = array(':ident' => $ident, 'operator' => $operator); |
|
| 112 | 112 | } else { |
| 113 | 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 | 114 | $query_values = array(':ident' => $ident); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | try { |
| 117 | 117 | $sth = $this->db->prepare($query); |
| 118 | 118 | $sth->execute($query_values); |
| 119 | - } catch(PDOException $e) { |
|
| 119 | + } catch (PDOException $e) { |
|
| 120 | 120 | return "error : ".$e->getMessage(); |
| 121 | 121 | } |
| 122 | 122 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | try { |
| 141 | 141 | $sth = $this->db->prepare($query); |
| 142 | 142 | $sth->execute($query_values); |
| 143 | - } catch(PDOException $e) { |
|
| 143 | + } catch (PDOException $e) { |
|
| 144 | 144 | return "error : ".$e->getMessage(); |
| 145 | 145 | } |
| 146 | 146 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -155,16 +155,16 @@ discard block |
||
| 155 | 155 | * @param String $carrier IATA code |
| 156 | 156 | * @return Flight departure and arrival airports and time |
| 157 | 157 | */ |
| 158 | - private function getAirFrance($callsign, $date = 'NOW',$carrier = 'AF') { |
|
| 158 | + private function getAirFrance($callsign, $date = 'NOW', $carrier = 'AF') { |
|
| 159 | 159 | $Common = new Common(); |
| 160 | 160 | $check_date = new Datetime($date); |
| 161 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 162 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 161 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 162 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 163 | 163 | $url = "http://www.airfrance.fr/cgi-bin/AF/FR/fr/local/resainfovol/infovols/detailsVolJson.do?codeCompagnie[0]=".$carrier."&numeroVol[0]=".$numvol."&dayFlightDate=".$check_date->format('d')."&yearMonthFlightDate=".$check_date->format('Ym'); |
| 164 | 164 | $json = $Common->getData($url); |
| 165 | 165 | |
| 166 | 166 | $parsed_json = json_decode($json); |
| 167 | - if (property_exists($parsed_json,'errors') === false) { |
|
| 167 | + if (property_exists($parsed_json, 'errors') === false) { |
|
| 168 | 168 | //$originLong = $parsed_json->{'flightsList'}[0]->{'segmentsList'}[0]->{'originLong'}; |
| 169 | 169 | $originShort = $parsed_json->{'flightsList'}[0]->{'segmentsList'}[0]->{'originShort'}; |
| 170 | 170 | //$departureDateMedium = $parsed_json->{'flightsList'}[0]->{'segmentsList'}[0]->{'departureDateMedium'}; |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | //$arrivalDateMedium = $parsed_json->{'flightsList'}[0]->{'segmentsList'}[0]->{'arrivalDateMedium'}; |
| 175 | 175 | $arrivalTime = $parsed_json->{'flightsList'}[0]->{'segmentsList'}[0]->{'arrivalTime'}; |
| 176 | 176 | |
| 177 | - preg_match('/\((.*?)\)/',$originShort,$originiata); |
|
| 177 | + preg_match('/\((.*?)\)/', $originShort, $originiata); |
|
| 178 | 178 | $DepartureAirportIata = $originiata[1]; |
| 179 | - preg_match('/\((.*?)\)/',$destinationShort,$destinationiata); |
|
| 179 | + preg_match('/\((.*?)\)/', $destinationShort, $destinationiata); |
|
| 180 | 180 | $ArrivalAirportIata = $destinationiata[1]; |
| 181 | 181 | |
| 182 | 182 | /* |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $arrivalTime = gmdate('H:i',strtotime($arrivalTime)); |
| 186 | 186 | */ |
| 187 | 187 | |
| 188 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_airfrance'); |
|
| 188 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_airfrance'); |
|
| 189 | 189 | } else return array(); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | $Common = new Common(); |
| 201 | 201 | date_default_timezone_set($globalTimezone); |
| 202 | 202 | $check_date = new Datetime($date); |
| 203 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 204 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 203 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 204 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 205 | 205 | $url = "http://www.easyjet.com/ft/api/flights?date=".$check_date->format('Y-m-d')."&fn=".$callsign; |
| 206 | 206 | $json = $Common->getData($url); |
| 207 | 207 | $parsed_json = json_decode($json); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $departureTime = $parsed_json->{'flights'}[0]->{'dates'}->{'fstd'}; |
| 214 | 214 | $arrivalTime = $parsed_json->{'flights'}[0]->{'dates'}->{'fsta'}; |
| 215 | 215 | |
| 216 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_easyjet'); |
|
| 216 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_easyjet'); |
|
| 217 | 217 | } else return array(); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -224,12 +224,12 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | private function getRyanair($callsign) { |
| 226 | 226 | $Common = new Common(); |
| 227 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 228 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 227 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 228 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 229 | 229 | $url = "http://www.ryanair.com/fr/api/2/flight-info/0/50/"; |
| 230 | 230 | $post = '{"flight":"'.$numvol.'","minDepartureTime":"00:00","maxDepartureTime":"23:59"}'; |
| 231 | - $headers = array('Content-Type: application/json','Content-Length: ' . strlen($post)); |
|
| 232 | - $json = $Common->getData($url,'post',$post,$headers); |
|
| 231 | + $headers = array('Content-Type: application/json', 'Content-Length: '.strlen($post)); |
|
| 232 | + $json = $Common->getData($url, 'post', $post, $headers); |
|
| 233 | 233 | $parsed_json = json_decode($json); |
| 234 | 234 | if (isset($parsed_json->{'flightInfo'})) { |
| 235 | 235 | $flights = $parsed_json->{'flightInfo'}; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $ArrivalAirportIata = $parsed_json->{'flightInfo'}[0]->{'arrivalAirport'}->{'iata'}; //name |
| 239 | 239 | $departureTime = $parsed_json->{'flightInfo'}[0]->{'departureTime'}; |
| 240 | 240 | $arrivalTime = $parsed_json->{'flightInfo'}[0]->{'arrivalTime'}; |
| 241 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime, 'Source' => 'website_ryanair'); |
|
| 241 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_ryanair'); |
|
| 242 | 242 | } else return array(); |
| 243 | 243 | } else return array(); |
| 244 | 244 | } |
@@ -250,8 +250,8 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | private function getSwiss($callsign) { |
| 252 | 252 | $Common = new Common(); |
| 253 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 254 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 253 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 254 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 255 | 255 | $url = "http://www.world-of-swiss.com/fr/routenetwork.json"; |
| 256 | 256 | $json = $Common->getData($url); |
| 257 | 257 | $parsed_json = json_decode($json); |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | if ($flight->{'no'} == "Vol LX ".$numvol) { |
| 266 | 266 | $DepartureAirportIata = $flight->{'from'}->{'code'}; //city |
| 267 | 267 | $ArrivalAirportIata = $flight->{'to'}->{'code'}; //city |
| 268 | - $departureTime = substr($flight->{'from'}->{'hour'},0,5); |
|
| 269 | - $arrivalTime = substr($flight->{'to'}->{'hour'},0,5); |
|
| 268 | + $departureTime = substr($flight->{'from'}->{'hour'},0, 5); |
|
| 269 | + $arrivalTime = substr($flight->{'to'}->{'hour'},0, 5); |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | if (isset($DepartureAirportIata) && isset($ArrivalAirportIata)) { |
| 273 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_swiss'); |
|
| 273 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_swiss'); |
|
| 274 | 274 | } else return array(); |
| 275 | 275 | } else return array(); |
| 276 | 276 | } |
@@ -285,21 +285,21 @@ discard block |
||
| 285 | 285 | global $globalBritishAirwaysKey; |
| 286 | 286 | $Common = new Common(); |
| 287 | 287 | $check_date = new Datetime($date); |
| 288 | - $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
|
| 289 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 288 | + $numvol = sprintf('%04d', preg_replace('/^[A-Z]*/', '', $callsign)); |
|
| 289 | + if (!filter_var(preg_replace('/^[A-Z]*/', '', $callsign), FILTER_VALIDATE_INT)) return array(); |
|
| 290 | 290 | if ($globalBritishAirwaysKey == '') return array(); |
| 291 | 291 | $url = "https://api.ba.com/rest-v1/v1/flights;flightNumber=".$numvol.";scheduledDepartureDate=".$check_date->format('Y-m-d').".json"; |
| 292 | 292 | $headers = array('Client-Key: '.$globalBritishAirwaysKey); |
| 293 | - $json = $Common->getData($url,'get','',$headers); |
|
| 293 | + $json = $Common->getData($url, 'get', '', $headers); |
|
| 294 | 294 | if ($json == '') return array(); |
| 295 | 295 | $parsed_json = json_decode($json); |
| 296 | 296 | $flights = $parsed_json->{'FlightsResponse'}; |
| 297 | 297 | if (count($flights) > 0) { |
| 298 | 298 | $DepartureAirportIata = $parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'DepartureAirport'}; |
| 299 | 299 | $ArrivalAirportIata = $parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ArrivalAirport'}; |
| 300 | - $departureTime = date('H:i',strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledDepartureDateTime'})); |
|
| 301 | - $arrivalTime = date('H:i',strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledArrivalDateTime'})); |
|
| 302 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_britishairways'); |
|
| 300 | + $departureTime = date('H:i', strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledDepartureDateTime'})); |
|
| 301 | + $arrivalTime = date('H:i', strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledArrivalDateTime'})); |
|
| 302 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_britishairways'); |
|
| 303 | 303 | } else return array(); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -313,27 +313,27 @@ discard block |
||
| 313 | 313 | global $globalLufthansaKey; |
| 314 | 314 | $Common = new Common(); |
| 315 | 315 | $check_date = new Datetime($date); |
| 316 | - $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
|
| 317 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 316 | + $numvol = sprintf('%04d', preg_replace('/^[A-Z]*/', '', $callsign)); |
|
| 317 | + if (!filter_var(preg_replace('/^[A-Z]*/', '', $callsign), FILTER_VALIDATE_INT)) return array(); |
|
| 318 | 318 | if (!isset($globalLufthansaKey) || $globalLufthansaKey == '' || !isset($globalLufthansaKey['key']) || $globalLufthansaKey['key'] == '') return array(); |
| 319 | 319 | $url = "https://api.lufthansa.com/v1/oauth/token"; |
| 320 | - $post = array('client_id' => $globalLufthansaKey['key'],'client_secret' => $globalLufthansaKey['secret'],'grant_type' => 'client_credentials'); |
|
| 321 | - $data = $Common->getData($url,'post',$post); |
|
| 320 | + $post = array('client_id' => $globalLufthansaKey['key'], 'client_secret' => $globalLufthansaKey['secret'], 'grant_type' => 'client_credentials'); |
|
| 321 | + $data = $Common->getData($url, 'post', $post); |
|
| 322 | 322 | $parsed_data = json_decode($data); |
| 323 | 323 | if (!isset($parsed_data->{'access_token'})) return array(); |
| 324 | 324 | $token = $parsed_data->{'access_token'}; |
| 325 | 325 | |
| 326 | 326 | $url = "https://api.lufthansa.com/v1/operations/flightstatus/LH".$numvol."/".$check_date->format('Y-m-d'); |
| 327 | - $headers = array('Authorization: Bearer '.$token,'Accept: application/json'); |
|
| 328 | - $json = $Common->getData($url,'get','',$headers); |
|
| 327 | + $headers = array('Authorization: Bearer '.$token, 'Accept: application/json'); |
|
| 328 | + $json = $Common->getData($url, 'get', '', $headers); |
|
| 329 | 329 | if ($json == '') return array(); |
| 330 | 330 | $parsed_json = json_decode($json); |
| 331 | 331 | if (isset($parsed_json->{'FlightStatusResource'}) && count($parsed_json->{'FlightStatusResource'}) > 0) { |
| 332 | 332 | $DepartureAirportIata = $parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Departure'}->{'AirportCode'}; |
| 333 | - $departureTime = date('H:i',strtotime($parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Departure'}->{'ScheduledTimeLocal'}->{'DateTime'})); |
|
| 333 | + $departureTime = date('H:i', strtotime($parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Departure'}->{'ScheduledTimeLocal'}->{'DateTime'})); |
|
| 334 | 334 | $ArrivalAirportIata = $parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Arrival'}->{'AirportCode'}; |
| 335 | - $arrivalTime = date('H:i',strtotime($parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Arrival'}->{'ScheduledTimeLocal'}->{'DateTime'})); |
|
| 336 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_lufthansa'); |
|
| 335 | + $arrivalTime = date('H:i', strtotime($parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Arrival'}->{'ScheduledTimeLocal'}->{'DateTime'})); |
|
| 336 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_lufthansa'); |
|
| 337 | 337 | } else return array(); |
| 338 | 338 | } |
| 339 | 339 | |
@@ -347,23 +347,23 @@ discard block |
||
| 347 | 347 | global $globalTransaviaKey; |
| 348 | 348 | $Common = new Common(); |
| 349 | 349 | $check_date = new Datetime($date); |
| 350 | - $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
|
| 351 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 350 | + $numvol = sprintf('%04d', preg_replace('/^[A-Z]*/', '', $callsign)); |
|
| 351 | + if (!filter_var(preg_replace('/^[A-Z]*/', '', $callsign), FILTER_VALIDATE_INT)) return array(); |
|
| 352 | 352 | if ($globalTransaviaKey == '') return array(); |
| 353 | 353 | $url = "https://tst.api.transavia.com/v1/flightstatus/departuredate/".$check_date->format('Ymd').'/flightnumber/HV'.$numvol; |
| 354 | 354 | //$url = "https://api.transavia.com/v1/flightstatus/departuredate/".$check_date->format('Ymd').'/flightnumber/HV'.$numvol; |
| 355 | 355 | $headers = array('apikey: '.$globalTransaviaKey); |
| 356 | - $json = $Common->getData($url,'get','',$headers); |
|
| 356 | + $json = $Common->getData($url, 'get', '', $headers); |
|
| 357 | 357 | //echo 'result : '.$json; |
| 358 | 358 | if ($json == '') return array(); |
| 359 | 359 | $parsed_json = json_decode($json); |
| 360 | 360 | |
| 361 | 361 | if (isset($parsed_json->{'data'}[0])) { |
| 362 | 362 | $DepartureAirportIata = $parsed_json->{'data'}[0]->{'flight'}->{'departureAirport'}->{'locationCode'}; |
| 363 | - $departureTime = date('H:i',strtotime($parsed_json->{'data'}[0]->{'flight'}->{'departureDateTime'})); |
|
| 363 | + $departureTime = date('H:i', strtotime($parsed_json->{'data'}[0]->{'flight'}->{'departureDateTime'})); |
|
| 364 | 364 | $ArrivalAirportIata = $parsed_json->{'data'}[0]->{'flight'}->{'arrivalAirport'}->{'locationCode'}; |
| 365 | - $arrivalTime = date('H:i',strtotime($parsed_json->{'data'}[0]->{'flight'}->{'arrivalDateTime'})); |
|
| 366 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_transavia'); |
|
| 365 | + $arrivalTime = date('H:i', strtotime($parsed_json->{'data'}[0]->{'flight'}->{'arrivalDateTime'})); |
|
| 366 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_transavia'); |
|
| 367 | 367 | } else return array(); |
| 368 | 368 | } |
| 369 | 369 | |
@@ -374,14 +374,14 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function getTunisair($callsign) { |
| 376 | 376 | $Common = new Common(); |
| 377 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 378 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 377 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 378 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 379 | 379 | $url = "http://www.tunisair.com/site/publish/module/Volj/fr/Flight_List.asp"; |
| 380 | 380 | $data = $Common->getData($url); |
| 381 | 381 | $table = $Common->table2array($data); |
| 382 | 382 | foreach ($table as $flight) { |
| 383 | - if (isset($flight[1]) && $flight[1] == "TU ".sprintf('%04d',$numvol)) { |
|
| 384 | - return array('DepartureAirportIATA' => $flight[2],'DepartureTime' => str_replace('.',':',$flight[5]),'ArrivalAirportIATA' => $flight[3],'ArrivalTime' => str_replace('.',':',$flight[6]),'Source' => 'website_tunisair'); |
|
| 383 | + if (isset($flight[1]) && $flight[1] == "TU ".sprintf('%04d', $numvol)) { |
|
| 384 | + return array('DepartureAirportIATA' => $flight[2], 'DepartureTime' => str_replace('.', ':', $flight[5]), 'ArrivalAirportIATA' => $flight[3], 'ArrivalTime' => str_replace('.', ':', $flight[6]), 'Source' => 'website_tunisair'); |
|
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | return array(); |
@@ -392,21 +392,21 @@ discard block |
||
| 392 | 392 | * @param String $callsign The callsign |
| 393 | 393 | * @return Flight departure and arrival airports and time |
| 394 | 394 | */ |
| 395 | - public function getVueling($callsign,$date = 'NOW') { |
|
| 395 | + public function getVueling($callsign, $date = 'NOW') { |
|
| 396 | 396 | $Common = new Common(); |
| 397 | 397 | $check_date = new Datetime($date); |
| 398 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 399 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 400 | - $final_date = str_replace('/','%2F',$check_date->format('d/m/Y')); |
|
| 398 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 399 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 400 | + $final_date = str_replace('/', '%2F', $check_date->format('d/m/Y')); |
|
| 401 | 401 | $url = "http://www.vueling.com/Base/BaseProxy/RenderMacro/?macroalias=FlightStatusResult&searchBy=bycode&date=".$final_date."&flightNumber=".$numvol."&idioma=en-GB"; |
| 402 | 402 | $data = $Common->getData($url); |
| 403 | - $data=trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$data)); |
|
| 403 | + $data = trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $data)); |
|
| 404 | 404 | if ($data != '') { |
| 405 | - preg_match('/flightOri=[A-Z]{3}/',$data,$result); |
|
| 406 | - $DepartureAirportIata = str_replace('flightOri=','',$result[0]); |
|
| 407 | - preg_match('/flightDest=[A-Z]{3}/',$data,$result); |
|
| 408 | - $ArrivalAirportIata = str_replace('flightDest=','',$result[0]); |
|
| 409 | - if ($DepartureAirportIata != '' && $ArrivalAirportIata != '') return array('DepartureAirportIATA' => $DepartureAirportIata,'ArrivalAirportIATA' => $ArrivalAirportIata,'Source' => 'website_vueling'); |
|
| 405 | + preg_match('/flightOri=[A-Z]{3}/', $data, $result); |
|
| 406 | + $DepartureAirportIata = str_replace('flightOri=', '', $result[0]); |
|
| 407 | + preg_match('/flightDest=[A-Z]{3}/', $data, $result); |
|
| 408 | + $ArrivalAirportIata = str_replace('flightDest=', '', $result[0]); |
|
| 409 | + if ($DepartureAirportIata != '' && $ArrivalAirportIata != '') return array('DepartureAirportIATA' => $DepartureAirportIata, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'Source' => 'website_vueling'); |
|
| 410 | 410 | else return array(); |
| 411 | 411 | } |
| 412 | 412 | return array(); |
@@ -420,27 +420,27 @@ discard block |
||
| 420 | 420 | */ |
| 421 | 421 | public function getIberia($callsign, $date = 'NOW') { |
| 422 | 422 | $Common = new Common(); |
| 423 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 423 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 424 | 424 | $check_date = new Datetime($date); |
| 425 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 425 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 426 | 426 | $url = "https://www.iberia.com/web/flightDetail.do"; |
| 427 | - $post = array('numvuelo' => $numvol,'fecha' => $check_date->format('Ymd'),'airlineID' => 'IB'); |
|
| 428 | - $data = $Common->getData($url,'post',$post); |
|
| 427 | + $post = array('numvuelo' => $numvol, 'fecha' => $check_date->format('Ymd'), 'airlineID' => 'IB'); |
|
| 428 | + $data = $Common->getData($url, 'post', $post); |
|
| 429 | 429 | if ($data != '') { |
| 430 | 430 | $table = $Common->table2array($data); |
| 431 | 431 | //print_r($table); |
| 432 | 432 | if (count($table) > 0) { |
| 433 | 433 | $flight = $table; |
| 434 | - preg_match('/([A-Z]{3})/',$flight[3][0],$DepartureAirportIataMatch); |
|
| 435 | - preg_match('/([A-Z]{3})/',$flight[5][0],$ArrivalAirportIataMatch); |
|
| 434 | + preg_match('/([A-Z]{3})/', $flight[3][0], $DepartureAirportIataMatch); |
|
| 435 | + preg_match('/([A-Z]{3})/', $flight[5][0], $ArrivalAirportIataMatch); |
|
| 436 | 436 | $DepartureAirportIata = $DepartureAirportIataMatch[0]; |
| 437 | 437 | $ArrivalAirportIata = $ArrivalAirportIataMatch[0]; |
| 438 | - $departureTime = substr(trim(str_replace(' lunes','',str_replace(' ','',$flight[3][2]))),0,5); |
|
| 439 | - $arrivalTime = trim(str_replace(' lunes','',str_replace(' ','',$flight[5][1]))); |
|
| 438 | + $departureTime = substr(trim(str_replace(' lunes', '', str_replace(' ', '', $flight[3][2]))), 0, 5); |
|
| 439 | + $arrivalTime = trim(str_replace(' lunes', '', str_replace(' ', '', $flight[5][1]))); |
|
| 440 | 440 | if ($arrivalTime == 'Hora estimada de llegada') { |
| 441 | - $arrivalTime = substr(trim(str_replace(' lunes','',str_replace(' ','',$flight[5][2]))),0,5); |
|
| 442 | - } else $arrivalTime = substr($arrivalTime,0,5); |
|
| 443 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_iberia'); |
|
| 441 | + $arrivalTime = substr(trim(str_replace(' lunes', '', str_replace(' ', '', $flight[5][2]))), 0, 5); |
|
| 442 | + } else $arrivalTime = substr($arrivalTime, 0, 5); |
|
| 443 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_iberia'); |
|
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 | return array(); |
@@ -453,11 +453,11 @@ discard block |
||
| 453 | 453 | * @return Flight departure and arrival airports and time |
| 454 | 454 | */ |
| 455 | 455 | |
| 456 | - private function getStarAlliance($callsign, $date = 'NOW',$carrier = '') { |
|
| 456 | + private function getStarAlliance($callsign, $date = 'NOW', $carrier = '') { |
|
| 457 | 457 | $Common = new Common(); |
| 458 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 458 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 459 | 459 | $check_date = new Datetime($date); |
| 460 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 460 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 461 | 461 | $url = "http://www.staralliance.com/flifoQueryAction.do?myAirline=&airlineCode=".$carrier."&flightNo=".$numvol."&day=".$check_date->format('d')."&month=".$check_date->format('m')."&year=".$check_date->format('Y')."&departuredate=".$check_date->format('d-M-Y'); |
| 462 | 462 | $data = $Common->getData($url); |
| 463 | 463 | if ($data != '') { |
@@ -466,13 +466,13 @@ discard block |
||
| 466 | 466 | $flight = $table; |
| 467 | 467 | //print_r($table); |
| 468 | 468 | if (isset($flight[25]) && isset($flight[29])) { |
| 469 | - preg_match('/([A-Z]{3})/',$flight[25][1],$DepartureAirportIataMatch); |
|
| 470 | - preg_match('/([A-Z]{3})/',$flight[25][3],$ArrivalAirportIataMatch); |
|
| 469 | + preg_match('/([A-Z]{3})/', $flight[25][1], $DepartureAirportIataMatch); |
|
| 470 | + preg_match('/([A-Z]{3})/', $flight[25][3], $ArrivalAirportIataMatch); |
|
| 471 | 471 | $DepartureAirportIata = $DepartureAirportIataMatch[0]; |
| 472 | 472 | $ArrivalAirportIata = $ArrivalAirportIataMatch[0]; |
| 473 | - $departureTime = substr(trim(str_replace('Scheduled: ','',$flight[29][0])),0,5); |
|
| 474 | - $arrivalTime = substr(trim(str_replace('Scheduled: ','',$flight[29][1])),0,5); |
|
| 475 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_staralliance'); |
|
| 473 | + $departureTime = substr(trim(str_replace('Scheduled: ', '', $flight[29][0])), 0, 5); |
|
| 474 | + $arrivalTime = substr(trim(str_replace('Scheduled: ', '', $flight[29][1])), 0, 5); |
|
| 475 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_staralliance'); |
|
| 476 | 476 | } else return array(); |
| 477 | 477 | } |
| 478 | 478 | |
@@ -490,10 +490,10 @@ discard block |
||
| 490 | 490 | */ |
| 491 | 491 | private function getAlitalia($callsign, $date = 'NOW') { |
| 492 | 492 | $Common = new Common(); |
| 493 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 493 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 494 | 494 | $check_date = new Datetime($date); |
| 495 | - $url= "http://booking.alitalia.com/FlightStatus/fr_fr/FlightInfo?Brand=az&NumeroVolo=".$numvol."&DataCompleta=".$check_date->format('d/m/Y'); |
|
| 496 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 495 | + $url = "http://booking.alitalia.com/FlightStatus/fr_fr/FlightInfo?Brand=az&NumeroVolo=".$numvol."&DataCompleta=".$check_date->format('d/m/Y'); |
|
| 496 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 497 | 497 | $data = $Common->getData($url); |
| 498 | 498 | if ($data != '') { |
| 499 | 499 | $table = $Common->text2array($data); |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | $ArrivalAirportIata = ''; |
| 502 | 502 | $departureTime = $table[4]; |
| 503 | 503 | $arrivalTime = $table[5]; |
| 504 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_alitalia'); |
|
| 504 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_alitalia'); |
|
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | |
@@ -513,21 +513,21 @@ discard block |
||
| 513 | 513 | */ |
| 514 | 514 | private function getBrussels($callsign, $date = 'NOW') { |
| 515 | 515 | $Common = new Common(); |
| 516 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 516 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 517 | 517 | $check_date = new Datetime($date); |
| 518 | - $url= "http://www.brusselsairlines.com/api/flightstatus/getresults?from=NA&to=NA&date=".$check_date->format('d/m/Y')."&hour=NA&lookup=flightnumber&flightnumber=".$numvol."&publicationID=302"; |
|
| 518 | + $url = "http://www.brusselsairlines.com/api/flightstatus/getresults?from=NA&to=NA&date=".$check_date->format('d/m/Y')."&hour=NA&lookup=flightnumber&flightnumber=".$numvol."&publicationID=302"; |
|
| 519 | 519 | //http://www.brusselsairlines.com/fr-fr/informations-pratiques/statut-de-votre-vol/resultat.aspx?flightnumber=".$numvol."&date=".$check_date->format('d/m/Y')."&lookup=flightnumber"; |
| 520 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 520 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 521 | 521 | $data = $Common->getData($url); |
| 522 | 522 | if ($data != '') { |
| 523 | 523 | //echo $data; |
| 524 | - $parsed_json = json_decode($data,true); |
|
| 524 | + $parsed_json = json_decode($data, true); |
|
| 525 | 525 | if (isset($parsed_json[0]['FromAirportCode'])) { |
| 526 | 526 | $DepartureAirportIata = $parsed_json[0]['FromAirportCode']; |
| 527 | 527 | $ArrivalAirportIata = $parsed_json[0]['ToAirportCode']; |
| 528 | - $departureTime = date('H:i',strtotime($parsed_json[0]['ScheduledDepatureDate'])); |
|
| 529 | - $arrivalTime = date('H:i',strtotime($parsed_json[0]['ScheduledArrivalDate'])); |
|
| 530 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_brussels'); |
|
| 528 | + $departureTime = date('H:i', strtotime($parsed_json[0]['ScheduledDepatureDate'])); |
|
| 529 | + $arrivalTime = date('H:i', strtotime($parsed_json[0]['ScheduledArrivalDate'])); |
|
| 530 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_brussels'); |
|
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | } |
@@ -604,21 +604,21 @@ discard block |
||
| 604 | 604 | */ |
| 605 | 605 | private function getFlyTap($callsign) { |
| 606 | 606 | $Common = new Common(); |
| 607 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 608 | - $url= "http://www.flytap.com/France/fr/PlanifierEtReserver/Outils/DepartsEtArrivees"; |
|
| 607 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 608 | + $url = "http://www.flytap.com/France/fr/PlanifierEtReserver/Outils/DepartsEtArrivees"; |
|
| 609 | 609 | //$check_date = new Datetime($date); |
| 610 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 611 | - $post = array('arrivalsdepartures_content' => 'number','arrivalsdepartures_tp' => $numvol,'arrivalsdepartures_trk' => 'ARR','arrivalsdepartures_date_trk' => '1','aptCode' => '','arrivalsdepartures' => 'DEP','arrivalsdepartures_date' => '1','aptCodeFrom' => '','aptCodeTo' => '','arrivalsdepartures2' => 'DEP','arrivalsdepartures_date2' => '1'); |
|
| 612 | - $data = $Common->getData($url,'post',$post); |
|
| 610 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 611 | + $post = array('arrivalsdepartures_content' => 'number', 'arrivalsdepartures_tp' => $numvol, 'arrivalsdepartures_trk' => 'ARR', 'arrivalsdepartures_date_trk' => '1', 'aptCode' => '', 'arrivalsdepartures' => 'DEP', 'arrivalsdepartures_date' => '1', 'aptCodeFrom' => '', 'aptCodeTo' => '', 'arrivalsdepartures2' => 'DEP', 'arrivalsdepartures_date2' => '1'); |
|
| 612 | + $data = $Common->getData($url, 'post', $post); |
|
| 613 | 613 | if ($data != '') { |
| 614 | 614 | $table = $Common->table2array($data); |
| 615 | - $departureTime = trim(substr($table[15][0],0,5)); |
|
| 616 | - $arrivalTime = trim(substr($table[35][0],0,5)); |
|
| 617 | - preg_match('/([A-Z]{3})/',$table[11][0],$DepartureAirportIataMatch); |
|
| 618 | - preg_match('/([A-Z]{3})/',$table[31][0],$ArrivalAirportIataMatch); |
|
| 615 | + $departureTime = trim(substr($table[15][0], 0, 5)); |
|
| 616 | + $arrivalTime = trim(substr($table[35][0], 0, 5)); |
|
| 617 | + preg_match('/([A-Z]{3})/', $table[11][0], $DepartureAirportIataMatch); |
|
| 618 | + preg_match('/([A-Z]{3})/', $table[31][0], $ArrivalAirportIataMatch); |
|
| 619 | 619 | $DepartureAirportIata = $DepartureAirportIataMatch[0]; |
| 620 | 620 | $ArrivalAirportIata = $ArrivalAirportIataMatch[0]; |
| 621 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_flytap'); |
|
| 621 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_flytap'); |
|
| 622 | 622 | } |
| 623 | 623 | return array(); |
| 624 | 624 | } |
@@ -640,10 +640,10 @@ discard block |
||
| 640 | 640 | } |
| 641 | 641 | } |
| 642 | 642 | if ($airline_icao == '') return array(); |
| 643 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 644 | - $url= "http://info.flightmapper.net/flight/".$airline_icao.'_'.$numvol; |
|
| 643 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 644 | + $url = "http://info.flightmapper.net/flight/".$airline_icao.'_'.$numvol; |
|
| 645 | 645 | //$check_date = new Datetime($date); |
| 646 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 646 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 647 | 647 | $data = $Common->getData($url); |
| 648 | 648 | if ($data != '') { |
| 649 | 649 | $table = $Common->table2array($data); |
@@ -653,13 +653,13 @@ discard block |
||
| 653 | 653 | $darr = ''; |
| 654 | 654 | $ahour = ''; |
| 655 | 655 | $aarr = ''; |
| 656 | - $n = sscanf($sched,'%*s %5[0-9:] %*[^()] (%3[A-Z]) %5[0-9:] %*[^()] (%3[A-Z])',$dhour,$darr,$ahour,$aarr); |
|
| 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 | 658 | $departureTime = $dhour; |
| 659 | 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'); |
|
| 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 | } |
@@ -683,20 +683,20 @@ discard block |
||
| 683 | 683 | } |
| 684 | 684 | } |
| 685 | 685 | */ |
| 686 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 687 | - $url= "http://fr.flightaware.com/live/flight/".$callsign; |
|
| 686 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 687 | + $url = "http://fr.flightaware.com/live/flight/".$callsign; |
|
| 688 | 688 | //$check_date = new Datetime($date); |
| 689 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 689 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 690 | 690 | $data = $Common->getData($url); |
| 691 | 691 | if ($data != '') { |
| 692 | 692 | $table = $Common->table2array($data); |
| 693 | 693 | if (isset($table[11][0])) { |
| 694 | - $departureTime = str_replace('h',':',substr($table[5][0],0,5)); |
|
| 695 | - $arrivalTime = str_replace('h',':',substr($table[5][1],0,5)); |
|
| 694 | + $departureTime = str_replace('h', ':', substr($table[5][0], 0, 5)); |
|
| 695 | + $arrivalTime = str_replace('h', ':', substr($table[5][1], 0, 5)); |
|
| 696 | 696 | echo $table[3][0]; |
| 697 | - sscanf($table[3][0],'%*[^(] (%3[A-Z] / %*4[A-Z])',$DepartureAirportIata); |
|
| 698 | - sscanf($table[3][1],'%*[^(] (%3[A-Z] / %*4[A-Z])',$ArrivalAirportIata); |
|
| 699 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_flightaware'); |
|
| 697 | + sscanf($table[3][0], '%*[^(] (%3[A-Z] / %*4[A-Z])', $DepartureAirportIata); |
|
| 698 | + sscanf($table[3][1], '%*[^(] (%3[A-Z] / %*4[A-Z])', $ArrivalAirportIata); |
|
| 699 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_flightaware'); |
|
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | return array(); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | */ |
| 710 | 710 | public function getCostToTravel($callsign) { |
| 711 | 711 | $Common = new Common(); |
| 712 | - $url= "http://www.costtotravel.com/flight-number/".$callsign; |
|
| 712 | + $url = "http://www.costtotravel.com/flight-number/".$callsign; |
|
| 713 | 713 | //$check_date = new Datetime($date); |
| 714 | 714 | //if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
| 715 | 715 | $data = $Common->getData($url); |
@@ -717,11 +717,11 @@ discard block |
||
| 717 | 717 | $table = $Common->table2array($data); |
| 718 | 718 | //print_r($table); |
| 719 | 719 | if (isset($table[11][1])) { |
| 720 | - $departureTime = substr($table[11][1],0,5); |
|
| 721 | - $arrivalTime = substr($table[17][1],0,5); |
|
| 722 | - $DepartureAirportIata = substr($table[13][1],0,3); |
|
| 723 | - $ArrivalAirportIata = substr($table[15][1],0,3); |
|
| 724 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_costtotravel'); |
|
| 720 | + $departureTime = substr($table[11][1], 0, 5); |
|
| 721 | + $arrivalTime = substr($table[17][1], 0, 5); |
|
| 722 | + $DepartureAirportIata = substr($table[13][1], 0, 3); |
|
| 723 | + $ArrivalAirportIata = substr($table[15][1], 0, 3); |
|
| 724 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_costtotravel'); |
|
| 725 | 725 | } |
| 726 | 726 | } |
| 727 | 727 | return array(); |
@@ -733,13 +733,13 @@ discard block |
||
| 733 | 733 | * @param String $date date we want flight number info |
| 734 | 734 | * @return Flight departure and arrival airports and time |
| 735 | 735 | */ |
| 736 | - private function getAirCanada($callsign,$date = 'NOW') { |
|
| 736 | + private function getAirCanada($callsign, $date = 'NOW') { |
|
| 737 | 737 | $Common = new Common(); |
| 738 | 738 | date_default_timezone_set('UTC'); |
| 739 | 739 | $check_date = new Datetime($date); |
| 740 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 741 | - $url= "http://services.aircanada.com/portal/rest/getFlightsByFlightNumber?forceTimetable=true&flightNumber=".$numvol."&carrierCode=AC&date=".$check_date->format('m-d-Y')."&app_key=AE919FDCC80311DF9BABC975DFD72085&cache=74249"; |
|
| 742 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 740 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 741 | + $url = "http://services.aircanada.com/portal/rest/getFlightsByFlightNumber?forceTimetable=true&flightNumber=".$numvol."&carrierCode=AC&date=".$check_date->format('m-d-Y')."&app_key=AE919FDCC80311DF9BABC975DFD72085&cache=74249"; |
|
| 742 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 743 | 743 | $data = $Common->getData($url); |
| 744 | 744 | $dom = new DomDocument(); |
| 745 | 745 | $dom->loadXML($data); |
@@ -747,11 +747,11 @@ discard block |
||
| 747 | 747 | $departure = $dom->getElementsByTagName('DepartureStationInfo')->item(0); |
| 748 | 748 | if (isset($departure->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue)) { |
| 749 | 749 | $DepartureAirportIata = $departure->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue; |
| 750 | - $departureTime = date('H:i',strtotime($departure->getElementsByTagName('ScheduledTime')->item(0)->firstChild->nodeValue)); |
|
| 750 | + $departureTime = date('H:i', strtotime($departure->getElementsByTagName('ScheduledTime')->item(0)->firstChild->nodeValue)); |
|
| 751 | 751 | $arrival = $dom->getElementsByTagName('ArrivalStationInfo')->item(0); |
| 752 | 752 | $ArrivalAirportIata = $arrival->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue; |
| 753 | - $arrivalTime = date('H:i',strtotime($arrival->getElementsByTagName('ScheduledTime')->item(0)->firstChild->nodeValue)); |
|
| 754 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_aircanada'); |
|
| 753 | + $arrivalTime = date('H:i', strtotime($arrival->getElementsByTagName('ScheduledTime')->item(0)->firstChild->nodeValue)); |
|
| 754 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_aircanada'); |
|
| 755 | 755 | } else return array(); |
| 756 | 756 | } |
| 757 | 757 | |
@@ -763,21 +763,21 @@ discard block |
||
| 763 | 763 | */ |
| 764 | 764 | private function getVietnamAirlines($callsign, $date = 'NOW') { |
| 765 | 765 | $Common = new Common(); |
| 766 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 766 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 767 | 767 | $check_date = new Datetime($date); |
| 768 | - $url= "https://cat.sabresonicweb.com/SSWVN/meridia?posid=VNVN&page=flifoFlightInfoDetailsMessage_learn&action=flightInfoDetails&airline=VN&language=fr&depDay=".$check_date->format('j')."&depMonth=".strtoupper($check_date->format('M'))."&=&flight=".$numvol."&"; |
|
| 769 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 768 | + $url = "https://cat.sabresonicweb.com/SSWVN/meridia?posid=VNVN&page=flifoFlightInfoDetailsMessage_learn&action=flightInfoDetails&airline=VN&language=fr&depDay=".$check_date->format('j')."&depMonth=".strtoupper($check_date->format('M'))."&=&flight=".$numvol."&"; |
|
| 769 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 770 | 770 | $data = $Common->getData($url); |
| 771 | 771 | if ($data != '') { |
| 772 | 772 | $table = $Common->table2array($data); |
| 773 | 773 | $flight = $table; |
| 774 | - preg_match('/([A-Z]{3})/',$flight[3][0],$DepartureAirportIataMatch); |
|
| 775 | - preg_match('/([A-Z]{3})/',$flight[21][0],$ArrivalAirportIataMatch); |
|
| 774 | + preg_match('/([A-Z]{3})/', $flight[3][0], $DepartureAirportIataMatch); |
|
| 775 | + preg_match('/([A-Z]{3})/', $flight[21][0], $ArrivalAirportIataMatch); |
|
| 776 | 776 | $DepartureAirportIata = $DepartureAirportIataMatch[0]; |
| 777 | 777 | $ArrivalAirportIata = $ArrivalAirportIataMatch[0]; |
| 778 | 778 | $departureTime = $flight[5][1]; |
| 779 | 779 | $arrivalTime = $flight[23][1]; |
| 780 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_vietnamairlines'); |
|
| 780 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_vietnamairlines'); |
|
| 781 | 781 | } |
| 782 | 782 | } |
| 783 | 783 | |
@@ -788,16 +788,16 @@ discard block |
||
| 788 | 788 | * @param String $carrier airline code |
| 789 | 789 | * @return Flight departure and arrival airports and time |
| 790 | 790 | */ |
| 791 | - private function getAirBerlin($callsign, $date = 'NOW',$carrier = 'AB') { |
|
| 791 | + private function getAirBerlin($callsign, $date = 'NOW', $carrier = 'AB') { |
|
| 792 | 792 | $Common = new Common(); |
| 793 | 793 | date_default_timezone_set('UTC'); |
| 794 | 794 | //AB = airberlin, HG/NLY = NIKI, 4T/BHP = Belair |
| 795 | - $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
|
| 795 | + $numvol = preg_replace('/^[A-Z]*/', '', $callsign); |
|
| 796 | 796 | $check_date = new Datetime($date); |
| 797 | - $url= "http://www.airberlin.com/en-US/site/aims.php"; |
|
| 798 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 799 | - $post = array('type' => 'departure','searchFlightNo' => '1','requestsent' => 'true', 'flightno' => $numvol,'date' => $check_date->format('Y-m-d'),'carrier' => $carrier); |
|
| 800 | - $data = $Common->getData($url,'post',$post); |
|
| 797 | + $url = "http://www.airberlin.com/en-US/site/aims.php"; |
|
| 798 | + if (!filter_var($numvol, FILTER_VALIDATE_INT)) return array(); |
|
| 799 | + $post = array('type' => 'departure', 'searchFlightNo' => '1', 'requestsent' => 'true', 'flightno' => $numvol, 'date' => $check_date->format('Y-m-d'), 'carrier' => $carrier); |
|
| 800 | + $data = $Common->getData($url, 'post', $post); |
|
| 801 | 801 | //echo $data; |
| 802 | 802 | $DepartureAirportIata = ''; |
| 803 | 803 | $ArrivalAirportIata = ''; |
@@ -810,8 +810,8 @@ discard block |
||
| 810 | 810 | if (isset($flight[5][2])) $departureAirport = $flight[5][2]; |
| 811 | 811 | else $departureAirport = ''; |
| 812 | 812 | } else return array(); |
| 813 | - $post = array('type' => 'arrival','searchFlightNo' => '1','requestsent' => 'true', 'flightno' => $numvol,'date' => $check_date->format('Y-m-d'),'carrier' => 'AB'); |
|
| 814 | - $data = $Common->getData($url,'post',$post); |
|
| 813 | + $post = array('type' => 'arrival', 'searchFlightNo' => '1', 'requestsent' => 'true', 'flightno' => $numvol, 'date' => $check_date->format('Y-m-d'), 'carrier' => 'AB'); |
|
| 814 | + $data = $Common->getData($url, 'post', $post); |
|
| 815 | 815 | if ($data != '') { |
| 816 | 816 | $table = $Common->table2array($data); |
| 817 | 817 | $flight = $table; |
@@ -839,13 +839,13 @@ discard block |
||
| 839 | 839 | } |
| 840 | 840 | } |
| 841 | 841 | if (isset($DepartureAirportIata)) { |
| 842 | - return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_airberlin'); |
|
| 842 | + return array('DepartureAirportIATA' => $DepartureAirportIata, 'DepartureTime' => $departureTime, 'ArrivalAirportIATA' => $ArrivalAirportIata, 'ArrivalTime' => $arrivalTime, 'Source' => 'website_airberlin'); |
|
| 843 | 843 | } else return array(); |
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | |
| 847 | 847 | |
| 848 | - public function fetchSchedule($ident,$date = 'NOW') { |
|
| 848 | + public function fetchSchedule($ident, $date = 'NOW') { |
|
| 849 | 849 | global $globalSchedulesSources, $globalSchedulesFetch; |
| 850 | 850 | //$Common = new Common(); |
| 851 | 851 | if (!$globalSchedulesFetch) return array(); |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | // Brussels Airlines |
| 916 | 916 | case "BEL": |
| 917 | 917 | case "SN": |
| 918 | - return $this->getBrussels($ident,$date); |
|
| 918 | + return $this->getBrussels($ident, $date); |
|
| 919 | 919 | /* |
| 920 | 920 | // Copa Airlines |
| 921 | 921 | case "CMP": |
@@ -1000,17 +1000,17 @@ discard block |
||
| 1000 | 1000 | // Air France |
| 1001 | 1001 | case "AF": |
| 1002 | 1002 | case "AFR": |
| 1003 | - return $this->getAirFrance($ident,$date,'AF'); |
|
| 1003 | + return $this->getAirFrance($ident, $date, 'AF'); |
|
| 1004 | 1004 | // HOP |
| 1005 | 1005 | case "A5": |
| 1006 | 1006 | case "HOP": |
| 1007 | - return $this->getAirFrance($ident,$date,'A5'); |
|
| 1007 | + return $this->getAirFrance($ident, $date, 'A5'); |
|
| 1008 | 1008 | // EasyJet |
| 1009 | 1009 | case "U2": |
| 1010 | 1010 | case "DS": |
| 1011 | 1011 | case "EZY": |
| 1012 | 1012 | case "EZS": |
| 1013 | - return $this->getEasyJet($ident,$date); |
|
| 1013 | + return $this->getEasyJet($ident, $date); |
|
| 1014 | 1014 | // Ryanair |
| 1015 | 1015 | case "FR": |
| 1016 | 1016 | case "RYR": |
@@ -1060,25 +1060,25 @@ discard block |
||
| 1060 | 1060 | return $this->getIberia($ident); |
| 1061 | 1061 | // Vietnam Airlines |
| 1062 | 1062 | case "HVN": |
| 1063 | - return $this->getVietnamAirlines($ident,$date); |
|
| 1063 | + return $this->getVietnamAirlines($ident, $date); |
|
| 1064 | 1064 | // Air Berlin |
| 1065 | 1065 | case "AB": |
| 1066 | 1066 | case "BER": |
| 1067 | - return $this->getAirBerlin($ident,$date,'AB'); |
|
| 1067 | + return $this->getAirBerlin($ident, $date, 'AB'); |
|
| 1068 | 1068 | // NIKI |
| 1069 | 1069 | case "HG": |
| 1070 | 1070 | case "NLY": |
| 1071 | - return $this->getAirBerlin($ident,$date,'HG'); |
|
| 1071 | + return $this->getAirBerlin($ident, $date, 'HG'); |
|
| 1072 | 1072 | // BelAir |
| 1073 | 1073 | case "4T": |
| 1074 | 1074 | case "BHP": |
| 1075 | - return $this->getAirBerlin($ident,$date,'4T'); |
|
| 1075 | + return $this->getAirBerlin($ident, $date, '4T'); |
|
| 1076 | 1076 | default: |
| 1077 | 1077 | // Randomly use a generic function to get hours |
| 1078 | 1078 | if (strlen($airline_icao) == 2) { |
| 1079 | - if (!isset($globalSchedulesSources)) $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1079 | + if (!isset($globalSchedulesSources)) $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
| 1080 | 1080 | if (count($globalSchedulesSources) > 0) { |
| 1081 | - $rand = mt_rand(0,count($globalSchedulesSources)-1); |
|
| 1081 | + $rand = mt_rand(0, count($globalSchedulesSources) - 1); |
|
| 1082 | 1082 | $source = $globalSchedulesSources[$rand]; |
| 1083 | 1083 | if ($source == 'flightmapper') return $this->getFlightMapper($ident); |
| 1084 | 1084 | elseif ($source == 'costtotravel') return $this->getCostToTravel($ident); |
@@ -123,7 +123,9 @@ discard block |
||
| 123 | 123 | $sth->closeCursor(); |
| 124 | 124 | if (count($row) > 0) { |
| 125 | 125 | return $row; |
| 126 | - } else return array(); |
|
| 126 | + } else { |
|
| 127 | + return array(); |
|
| 128 | + } |
|
| 127 | 129 | } |
| 128 | 130 | |
| 129 | 131 | public function checkSchedule($ident) { |
@@ -159,7 +161,9 @@ discard block |
||
| 159 | 161 | $Common = new Common(); |
| 160 | 162 | $check_date = new Datetime($date); |
| 161 | 163 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 162 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 164 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 165 | + return array(); |
|
| 166 | + } |
|
| 163 | 167 | $url = "http://www.airfrance.fr/cgi-bin/AF/FR/fr/local/resainfovol/infovols/detailsVolJson.do?codeCompagnie[0]=".$carrier."&numeroVol[0]=".$numvol."&dayFlightDate=".$check_date->format('d')."&yearMonthFlightDate=".$check_date->format('Ym'); |
| 164 | 168 | $json = $Common->getData($url); |
| 165 | 169 | |
@@ -186,7 +190,9 @@ discard block |
||
| 186 | 190 | */ |
| 187 | 191 | |
| 188 | 192 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_airfrance'); |
| 189 | - } else return array(); |
|
| 193 | + } else { |
|
| 194 | + return array(); |
|
| 195 | + } |
|
| 190 | 196 | } |
| 191 | 197 | |
| 192 | 198 | /** |
@@ -201,7 +207,9 @@ discard block |
||
| 201 | 207 | date_default_timezone_set($globalTimezone); |
| 202 | 208 | $check_date = new Datetime($date); |
| 203 | 209 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 204 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 210 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 211 | + return array(); |
|
| 212 | + } |
|
| 205 | 213 | $url = "http://www.easyjet.com/ft/api/flights?date=".$check_date->format('Y-m-d')."&fn=".$callsign; |
| 206 | 214 | $json = $Common->getData($url); |
| 207 | 215 | $parsed_json = json_decode($json); |
@@ -214,7 +222,9 @@ discard block |
||
| 214 | 222 | $arrivalTime = $parsed_json->{'flights'}[0]->{'dates'}->{'fsta'}; |
| 215 | 223 | |
| 216 | 224 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_easyjet'); |
| 217 | - } else return array(); |
|
| 225 | + } else { |
|
| 226 | + return array(); |
|
| 227 | + } |
|
| 218 | 228 | } |
| 219 | 229 | |
| 220 | 230 | /** |
@@ -225,7 +235,9 @@ discard block |
||
| 225 | 235 | private function getRyanair($callsign) { |
| 226 | 236 | $Common = new Common(); |
| 227 | 237 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 228 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 238 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 239 | + return array(); |
|
| 240 | + } |
|
| 229 | 241 | $url = "http://www.ryanair.com/fr/api/2/flight-info/0/50/"; |
| 230 | 242 | $post = '{"flight":"'.$numvol.'","minDepartureTime":"00:00","maxDepartureTime":"23:59"}'; |
| 231 | 243 | $headers = array('Content-Type: application/json','Content-Length: ' . strlen($post)); |
@@ -239,8 +251,12 @@ discard block |
||
| 239 | 251 | $departureTime = $parsed_json->{'flightInfo'}[0]->{'departureTime'}; |
| 240 | 252 | $arrivalTime = $parsed_json->{'flightInfo'}[0]->{'arrivalTime'}; |
| 241 | 253 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime, 'Source' => 'website_ryanair'); |
| 242 | - } else return array(); |
|
| 243 | - } else return array(); |
|
| 254 | + } else { |
|
| 255 | + return array(); |
|
| 256 | + } |
|
| 257 | + } else { |
|
| 258 | + return array(); |
|
| 259 | + } |
|
| 244 | 260 | } |
| 245 | 261 | |
| 246 | 262 | /** |
@@ -251,7 +267,9 @@ discard block |
||
| 251 | 267 | private function getSwiss($callsign) { |
| 252 | 268 | $Common = new Common(); |
| 253 | 269 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 254 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 270 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 271 | + return array(); |
|
| 272 | + } |
|
| 255 | 273 | $url = "http://www.world-of-swiss.com/fr/routenetwork.json"; |
| 256 | 274 | $json = $Common->getData($url); |
| 257 | 275 | $parsed_json = json_decode($json); |
@@ -271,8 +289,12 @@ discard block |
||
| 271 | 289 | } |
| 272 | 290 | if (isset($DepartureAirportIata) && isset($ArrivalAirportIata)) { |
| 273 | 291 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_swiss'); |
| 274 | - } else return array(); |
|
| 275 | - } else return array(); |
|
| 292 | + } else { |
|
| 293 | + return array(); |
|
| 294 | + } |
|
| 295 | + } else { |
|
| 296 | + return array(); |
|
| 297 | + } |
|
| 276 | 298 | } |
| 277 | 299 | |
| 278 | 300 | /** |
@@ -286,12 +308,18 @@ discard block |
||
| 286 | 308 | $Common = new Common(); |
| 287 | 309 | $check_date = new Datetime($date); |
| 288 | 310 | $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
| 289 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 290 | - if ($globalBritishAirwaysKey == '') return array(); |
|
| 311 | + if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) { |
|
| 312 | + return array(); |
|
| 313 | + } |
|
| 314 | + if ($globalBritishAirwaysKey == '') { |
|
| 315 | + return array(); |
|
| 316 | + } |
|
| 291 | 317 | $url = "https://api.ba.com/rest-v1/v1/flights;flightNumber=".$numvol.";scheduledDepartureDate=".$check_date->format('Y-m-d').".json"; |
| 292 | 318 | $headers = array('Client-Key: '.$globalBritishAirwaysKey); |
| 293 | 319 | $json = $Common->getData($url,'get','',$headers); |
| 294 | - if ($json == '') return array(); |
|
| 320 | + if ($json == '') { |
|
| 321 | + return array(); |
|
| 322 | + } |
|
| 295 | 323 | $parsed_json = json_decode($json); |
| 296 | 324 | $flights = $parsed_json->{'FlightsResponse'}; |
| 297 | 325 | if (count($flights) > 0) { |
@@ -300,7 +328,9 @@ discard block |
||
| 300 | 328 | $departureTime = date('H:i',strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledDepartureDateTime'})); |
| 301 | 329 | $arrivalTime = date('H:i',strtotime($parsed_json->{'FlightsResponse'}->{'Flight'}->{'Sector'}->{'ScheduledArrivalDateTime'})); |
| 302 | 330 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_britishairways'); |
| 303 | - } else return array(); |
|
| 331 | + } else { |
|
| 332 | + return array(); |
|
| 333 | + } |
|
| 304 | 334 | } |
| 305 | 335 | |
| 306 | 336 | /** |
@@ -314,19 +344,27 @@ discard block |
||
| 314 | 344 | $Common = new Common(); |
| 315 | 345 | $check_date = new Datetime($date); |
| 316 | 346 | $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
| 317 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 318 | - if (!isset($globalLufthansaKey) || $globalLufthansaKey == '' || !isset($globalLufthansaKey['key']) || $globalLufthansaKey['key'] == '') return array(); |
|
| 347 | + if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) { |
|
| 348 | + return array(); |
|
| 349 | + } |
|
| 350 | + if (!isset($globalLufthansaKey) || $globalLufthansaKey == '' || !isset($globalLufthansaKey['key']) || $globalLufthansaKey['key'] == '') { |
|
| 351 | + return array(); |
|
| 352 | + } |
|
| 319 | 353 | $url = "https://api.lufthansa.com/v1/oauth/token"; |
| 320 | 354 | $post = array('client_id' => $globalLufthansaKey['key'],'client_secret' => $globalLufthansaKey['secret'],'grant_type' => 'client_credentials'); |
| 321 | 355 | $data = $Common->getData($url,'post',$post); |
| 322 | 356 | $parsed_data = json_decode($data); |
| 323 | - if (!isset($parsed_data->{'access_token'})) return array(); |
|
| 357 | + if (!isset($parsed_data->{'access_token'})) { |
|
| 358 | + return array(); |
|
| 359 | + } |
|
| 324 | 360 | $token = $parsed_data->{'access_token'}; |
| 325 | 361 | |
| 326 | 362 | $url = "https://api.lufthansa.com/v1/operations/flightstatus/LH".$numvol."/".$check_date->format('Y-m-d'); |
| 327 | 363 | $headers = array('Authorization: Bearer '.$token,'Accept: application/json'); |
| 328 | 364 | $json = $Common->getData($url,'get','',$headers); |
| 329 | - if ($json == '') return array(); |
|
| 365 | + if ($json == '') { |
|
| 366 | + return array(); |
|
| 367 | + } |
|
| 330 | 368 | $parsed_json = json_decode($json); |
| 331 | 369 | if (isset($parsed_json->{'FlightStatusResource'}) && count($parsed_json->{'FlightStatusResource'}) > 0) { |
| 332 | 370 | $DepartureAirportIata = $parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Departure'}->{'AirportCode'}; |
@@ -334,7 +372,9 @@ discard block |
||
| 334 | 372 | $ArrivalAirportIata = $parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Arrival'}->{'AirportCode'}; |
| 335 | 373 | $arrivalTime = date('H:i',strtotime($parsed_json->{'FlightStatusResource'}->{'Flights'}->{'Flight'}->{'Arrival'}->{'ScheduledTimeLocal'}->{'DateTime'})); |
| 336 | 374 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_lufthansa'); |
| 337 | - } else return array(); |
|
| 375 | + } else { |
|
| 376 | + return array(); |
|
| 377 | + } |
|
| 338 | 378 | } |
| 339 | 379 | |
| 340 | 380 | /** |
@@ -348,14 +388,20 @@ discard block |
||
| 348 | 388 | $Common = new Common(); |
| 349 | 389 | $check_date = new Datetime($date); |
| 350 | 390 | $numvol = sprintf('%04d',preg_replace('/^[A-Z]*/','',$callsign)); |
| 351 | - if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) return array(); |
|
| 352 | - if ($globalTransaviaKey == '') return array(); |
|
| 391 | + if (!filter_var(preg_replace('/^[A-Z]*/','',$callsign),FILTER_VALIDATE_INT)) { |
|
| 392 | + return array(); |
|
| 393 | + } |
|
| 394 | + if ($globalTransaviaKey == '') { |
|
| 395 | + return array(); |
|
| 396 | + } |
|
| 353 | 397 | $url = "https://tst.api.transavia.com/v1/flightstatus/departuredate/".$check_date->format('Ymd').'/flightnumber/HV'.$numvol; |
| 354 | 398 | //$url = "https://api.transavia.com/v1/flightstatus/departuredate/".$check_date->format('Ymd').'/flightnumber/HV'.$numvol; |
| 355 | 399 | $headers = array('apikey: '.$globalTransaviaKey); |
| 356 | 400 | $json = $Common->getData($url,'get','',$headers); |
| 357 | 401 | //echo 'result : '.$json; |
| 358 | - if ($json == '') return array(); |
|
| 402 | + if ($json == '') { |
|
| 403 | + return array(); |
|
| 404 | + } |
|
| 359 | 405 | $parsed_json = json_decode($json); |
| 360 | 406 | |
| 361 | 407 | if (isset($parsed_json->{'data'}[0])) { |
@@ -364,7 +410,9 @@ discard block |
||
| 364 | 410 | $ArrivalAirportIata = $parsed_json->{'data'}[0]->{'flight'}->{'arrivalAirport'}->{'locationCode'}; |
| 365 | 411 | $arrivalTime = date('H:i',strtotime($parsed_json->{'data'}[0]->{'flight'}->{'arrivalDateTime'})); |
| 366 | 412 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_transavia'); |
| 367 | - } else return array(); |
|
| 413 | + } else { |
|
| 414 | + return array(); |
|
| 415 | + } |
|
| 368 | 416 | } |
| 369 | 417 | |
| 370 | 418 | /** |
@@ -375,7 +423,9 @@ discard block |
||
| 375 | 423 | public function getTunisair($callsign) { |
| 376 | 424 | $Common = new Common(); |
| 377 | 425 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 378 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 426 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 427 | + return array(); |
|
| 428 | + } |
|
| 379 | 429 | $url = "http://www.tunisair.com/site/publish/module/Volj/fr/Flight_List.asp"; |
| 380 | 430 | $data = $Common->getData($url); |
| 381 | 431 | $table = $Common->table2array($data); |
@@ -396,7 +446,9 @@ discard block |
||
| 396 | 446 | $Common = new Common(); |
| 397 | 447 | $check_date = new Datetime($date); |
| 398 | 448 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 399 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 449 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 450 | + return array(); |
|
| 451 | + } |
|
| 400 | 452 | $final_date = str_replace('/','%2F',$check_date->format('d/m/Y')); |
| 401 | 453 | $url = "http://www.vueling.com/Base/BaseProxy/RenderMacro/?macroalias=FlightStatusResult&searchBy=bycode&date=".$final_date."&flightNumber=".$numvol."&idioma=en-GB"; |
| 402 | 454 | $data = $Common->getData($url); |
@@ -406,8 +458,11 @@ discard block |
||
| 406 | 458 | $DepartureAirportIata = str_replace('flightOri=','',$result[0]); |
| 407 | 459 | preg_match('/flightDest=[A-Z]{3}/',$data,$result); |
| 408 | 460 | $ArrivalAirportIata = str_replace('flightDest=','',$result[0]); |
| 409 | - if ($DepartureAirportIata != '' && $ArrivalAirportIata != '') return array('DepartureAirportIATA' => $DepartureAirportIata,'ArrivalAirportIATA' => $ArrivalAirportIata,'Source' => 'website_vueling'); |
|
| 410 | - else return array(); |
|
| 461 | + if ($DepartureAirportIata != '' && $ArrivalAirportIata != '') { |
|
| 462 | + return array('DepartureAirportIATA' => $DepartureAirportIata,'ArrivalAirportIATA' => $ArrivalAirportIata,'Source' => 'website_vueling'); |
|
| 463 | + } else { |
|
| 464 | + return array(); |
|
| 465 | + } |
|
| 411 | 466 | } |
| 412 | 467 | return array(); |
| 413 | 468 | } |
@@ -422,7 +477,9 @@ discard block |
||
| 422 | 477 | $Common = new Common(); |
| 423 | 478 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 424 | 479 | $check_date = new Datetime($date); |
| 425 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 480 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 481 | + return array(); |
|
| 482 | + } |
|
| 426 | 483 | $url = "https://www.iberia.com/web/flightDetail.do"; |
| 427 | 484 | $post = array('numvuelo' => $numvol,'fecha' => $check_date->format('Ymd'),'airlineID' => 'IB'); |
| 428 | 485 | $data = $Common->getData($url,'post',$post); |
@@ -439,7 +496,9 @@ discard block |
||
| 439 | 496 | $arrivalTime = trim(str_replace(' lunes','',str_replace(' ','',$flight[5][1]))); |
| 440 | 497 | if ($arrivalTime == 'Hora estimada de llegada') { |
| 441 | 498 | $arrivalTime = substr(trim(str_replace(' lunes','',str_replace(' ','',$flight[5][2]))),0,5); |
| 442 | - } else $arrivalTime = substr($arrivalTime,0,5); |
|
| 499 | + } else { |
|
| 500 | + $arrivalTime = substr($arrivalTime,0,5); |
|
| 501 | + } |
|
| 443 | 502 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_iberia'); |
| 444 | 503 | } |
| 445 | 504 | } |
@@ -457,7 +516,9 @@ discard block |
||
| 457 | 516 | $Common = new Common(); |
| 458 | 517 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 459 | 518 | $check_date = new Datetime($date); |
| 460 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 519 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 520 | + return array(); |
|
| 521 | + } |
|
| 461 | 522 | $url = "http://www.staralliance.com/flifoQueryAction.do?myAirline=&airlineCode=".$carrier."&flightNo=".$numvol."&day=".$check_date->format('d')."&month=".$check_date->format('m')."&year=".$check_date->format('Y')."&departuredate=".$check_date->format('d-M-Y'); |
| 462 | 523 | $data = $Common->getData($url); |
| 463 | 524 | if ($data != '') { |
@@ -473,7 +534,9 @@ discard block |
||
| 473 | 534 | $departureTime = substr(trim(str_replace('Scheduled: ','',$flight[29][0])),0,5); |
| 474 | 535 | $arrivalTime = substr(trim(str_replace('Scheduled: ','',$flight[29][1])),0,5); |
| 475 | 536 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_staralliance'); |
| 476 | - } else return array(); |
|
| 537 | + } else { |
|
| 538 | + return array(); |
|
| 539 | + } |
|
| 477 | 540 | } |
| 478 | 541 | |
| 479 | 542 | |
@@ -493,7 +556,9 @@ discard block |
||
| 493 | 556 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 494 | 557 | $check_date = new Datetime($date); |
| 495 | 558 | $url= "http://booking.alitalia.com/FlightStatus/fr_fr/FlightInfo?Brand=az&NumeroVolo=".$numvol."&DataCompleta=".$check_date->format('d/m/Y'); |
| 496 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 559 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 560 | + return array(); |
|
| 561 | + } |
|
| 497 | 562 | $data = $Common->getData($url); |
| 498 | 563 | if ($data != '') { |
| 499 | 564 | $table = $Common->text2array($data); |
@@ -517,7 +582,9 @@ discard block |
||
| 517 | 582 | $check_date = new Datetime($date); |
| 518 | 583 | $url= "http://www.brusselsairlines.com/api/flightstatus/getresults?from=NA&to=NA&date=".$check_date->format('d/m/Y')."&hour=NA&lookup=flightnumber&flightnumber=".$numvol."&publicationID=302"; |
| 519 | 584 | //http://www.brusselsairlines.com/fr-fr/informations-pratiques/statut-de-votre-vol/resultat.aspx?flightnumber=".$numvol."&date=".$check_date->format('d/m/Y')."&lookup=flightnumber"; |
| 520 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 585 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 586 | + return array(); |
|
| 587 | + } |
|
| 521 | 588 | $data = $Common->getData($url); |
| 522 | 589 | if ($data != '') { |
| 523 | 590 | //echo $data; |
@@ -607,7 +674,9 @@ discard block |
||
| 607 | 674 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 608 | 675 | $url= "http://www.flytap.com/France/fr/PlanifierEtReserver/Outils/DepartsEtArrivees"; |
| 609 | 676 | //$check_date = new Datetime($date); |
| 610 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 677 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 678 | + return array(); |
|
| 679 | + } |
|
| 611 | 680 | $post = array('arrivalsdepartures_content' => 'number','arrivalsdepartures_tp' => $numvol,'arrivalsdepartures_trk' => 'ARR','arrivalsdepartures_date_trk' => '1','aptCode' => '','arrivalsdepartures' => 'DEP','arrivalsdepartures_date' => '1','aptCodeFrom' => '','aptCodeTo' => '','arrivalsdepartures2' => 'DEP','arrivalsdepartures_date2' => '1'); |
| 612 | 681 | $data = $Common->getData($url,'post',$post); |
| 613 | 682 | if ($data != '') { |
@@ -639,11 +708,15 @@ discard block |
||
| 639 | 708 | $airline_icao = substr($callsign, 0, 3); |
| 640 | 709 | } |
| 641 | 710 | } |
| 642 | - if ($airline_icao == '') return array(); |
|
| 711 | + if ($airline_icao == '') { |
|
| 712 | + return array(); |
|
| 713 | + } |
|
| 643 | 714 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 644 | 715 | $url= "http://info.flightmapper.net/flight/".$airline_icao.'_'.$numvol; |
| 645 | 716 | //$check_date = new Datetime($date); |
| 646 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 717 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 718 | + return array(); |
|
| 719 | + } |
|
| 647 | 720 | $data = $Common->getData($url); |
| 648 | 721 | if ($data != '') { |
| 649 | 722 | $table = $Common->table2array($data); |
@@ -686,7 +759,9 @@ discard block |
||
| 686 | 759 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 687 | 760 | $url= "http://fr.flightaware.com/live/flight/".$callsign; |
| 688 | 761 | //$check_date = new Datetime($date); |
| 689 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 762 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 763 | + return array(); |
|
| 764 | + } |
|
| 690 | 765 | $data = $Common->getData($url); |
| 691 | 766 | if ($data != '') { |
| 692 | 767 | $table = $Common->table2array($data); |
@@ -739,11 +814,15 @@ discard block |
||
| 739 | 814 | $check_date = new Datetime($date); |
| 740 | 815 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 741 | 816 | $url= "http://services.aircanada.com/portal/rest/getFlightsByFlightNumber?forceTimetable=true&flightNumber=".$numvol."&carrierCode=AC&date=".$check_date->format('m-d-Y')."&app_key=AE919FDCC80311DF9BABC975DFD72085&cache=74249"; |
| 742 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 817 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 818 | + return array(); |
|
| 819 | + } |
|
| 743 | 820 | $data = $Common->getData($url); |
| 744 | 821 | $dom = new DomDocument(); |
| 745 | 822 | $dom->loadXML($data); |
| 746 | - if ($dom->getElementsByTagName('DepartureStationInfo')->length == 0) return array(); |
|
| 823 | + if ($dom->getElementsByTagName('DepartureStationInfo')->length == 0) { |
|
| 824 | + return array(); |
|
| 825 | + } |
|
| 747 | 826 | $departure = $dom->getElementsByTagName('DepartureStationInfo')->item(0); |
| 748 | 827 | if (isset($departure->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue)) { |
| 749 | 828 | $DepartureAirportIata = $departure->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue; |
@@ -752,7 +831,9 @@ discard block |
||
| 752 | 831 | $ArrivalAirportIata = $arrival->getElementsByTagName('Airport')->item(0)->firstChild->nodeValue; |
| 753 | 832 | $arrivalTime = date('H:i',strtotime($arrival->getElementsByTagName('ScheduledTime')->item(0)->firstChild->nodeValue)); |
| 754 | 833 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_aircanada'); |
| 755 | - } else return array(); |
|
| 834 | + } else { |
|
| 835 | + return array(); |
|
| 836 | + } |
|
| 756 | 837 | } |
| 757 | 838 | |
| 758 | 839 | /** |
@@ -766,7 +847,9 @@ discard block |
||
| 766 | 847 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 767 | 848 | $check_date = new Datetime($date); |
| 768 | 849 | $url= "https://cat.sabresonicweb.com/SSWVN/meridia?posid=VNVN&page=flifoFlightInfoDetailsMessage_learn&action=flightInfoDetails&airline=VN&language=fr&depDay=".$check_date->format('j')."&depMonth=".strtoupper($check_date->format('M'))."&=&flight=".$numvol."&"; |
| 769 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 850 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 851 | + return array(); |
|
| 852 | + } |
|
| 770 | 853 | $data = $Common->getData($url); |
| 771 | 854 | if ($data != '') { |
| 772 | 855 | $table = $Common->table2array($data); |
@@ -795,7 +878,9 @@ discard block |
||
| 795 | 878 | $numvol = preg_replace('/^[A-Z]*/','',$callsign); |
| 796 | 879 | $check_date = new Datetime($date); |
| 797 | 880 | $url= "http://www.airberlin.com/en-US/site/aims.php"; |
| 798 | - if (!filter_var($numvol,FILTER_VALIDATE_INT)) return array(); |
|
| 881 | + if (!filter_var($numvol,FILTER_VALIDATE_INT)) { |
|
| 882 | + return array(); |
|
| 883 | + } |
|
| 799 | 884 | $post = array('type' => 'departure','searchFlightNo' => '1','requestsent' => 'true', 'flightno' => $numvol,'date' => $check_date->format('Y-m-d'),'carrier' => $carrier); |
| 800 | 885 | $data = $Common->getData($url,'post',$post); |
| 801 | 886 | //echo $data; |
@@ -805,11 +890,19 @@ discard block |
||
| 805 | 890 | if ($data != '') { |
| 806 | 891 | $table = $Common->table2array($data); |
| 807 | 892 | $flight = $table; |
| 808 | - if (isset($flight[5][4])) $departureTime = $flight[5][4]; |
|
| 809 | - else $departureTime = ''; |
|
| 810 | - if (isset($flight[5][2])) $departureAirport = $flight[5][2]; |
|
| 811 | - else $departureAirport = ''; |
|
| 812 | - } else return array(); |
|
| 893 | + if (isset($flight[5][4])) { |
|
| 894 | + $departureTime = $flight[5][4]; |
|
| 895 | + } else { |
|
| 896 | + $departureTime = ''; |
|
| 897 | + } |
|
| 898 | + if (isset($flight[5][2])) { |
|
| 899 | + $departureAirport = $flight[5][2]; |
|
| 900 | + } else { |
|
| 901 | + $departureAirport = ''; |
|
| 902 | + } |
|
| 903 | + } else { |
|
| 904 | + return array(); |
|
| 905 | + } |
|
| 813 | 906 | $post = array('type' => 'arrival','searchFlightNo' => '1','requestsent' => 'true', 'flightno' => $numvol,'date' => $check_date->format('Y-m-d'),'carrier' => 'AB'); |
| 814 | 907 | $data = $Common->getData($url,'post',$post); |
| 815 | 908 | if ($data != '') { |
@@ -822,10 +915,14 @@ discard block |
||
| 822 | 915 | $arrivalTime = ''; |
| 823 | 916 | $arrivalAirport = ''; |
| 824 | 917 | } |
| 825 | - } else return array(); |
|
| 918 | + } else { |
|
| 919 | + return array(); |
|
| 920 | + } |
|
| 826 | 921 | $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'; |
| 827 | 922 | $json = $Common->getData($url); |
| 828 | - if ($json == '') return array(); |
|
| 923 | + if ($json == '') { |
|
| 924 | + return array(); |
|
| 925 | + } |
|
| 829 | 926 | $parsed_json = json_decode($json); |
| 830 | 927 | $airports = $parsed_json->{'suggestList'}; |
| 831 | 928 | if (count($airports) > 0) { |
@@ -840,7 +937,9 @@ discard block |
||
| 840 | 937 | } |
| 841 | 938 | if (isset($DepartureAirportIata)) { |
| 842 | 939 | return array('DepartureAirportIATA' => $DepartureAirportIata,'DepartureTime' => $departureTime,'ArrivalAirportIATA' => $ArrivalAirportIata,'ArrivalTime' => $arrivalTime,'Source' => 'website_airberlin'); |
| 843 | - } else return array(); |
|
| 940 | + } else { |
|
| 941 | + return array(); |
|
| 942 | + } |
|
| 844 | 943 | } |
| 845 | 944 | |
| 846 | 945 | |
@@ -848,7 +947,9 @@ discard block |
||
| 848 | 947 | public function fetchSchedule($ident,$date = 'NOW') { |
| 849 | 948 | global $globalSchedulesSources, $globalSchedulesFetch; |
| 850 | 949 | //$Common = new Common(); |
| 851 | - if (!$globalSchedulesFetch) return array(); |
|
| 950 | + if (!$globalSchedulesFetch) { |
|
| 951 | + return array(); |
|
| 952 | + } |
|
| 852 | 953 | $airline_icao = ''; |
| 853 | 954 | if (!is_numeric(substr($ident, 0, 3))) |
| 854 | 955 | { |
@@ -1076,14 +1177,21 @@ discard block |
||
| 1076 | 1177 | default: |
| 1077 | 1178 | // Randomly use a generic function to get hours |
| 1078 | 1179 | if (strlen($airline_icao) == 2) { |
| 1079 | - if (!isset($globalSchedulesSources)) $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1180 | + if (!isset($globalSchedulesSources)) { |
|
| 1181 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1182 | + } |
|
| 1080 | 1183 | if (count($globalSchedulesSources) > 0) { |
| 1081 | 1184 | $rand = mt_rand(0,count($globalSchedulesSources)-1); |
| 1082 | 1185 | $source = $globalSchedulesSources[$rand]; |
| 1083 | - if ($source == 'flightmapper') return $this->getFlightMapper($ident); |
|
| 1084 | - elseif ($source == 'costtotravel') return $this->getCostToTravel($ident); |
|
| 1186 | + if ($source == 'flightmapper') { |
|
| 1187 | + return $this->getFlightMapper($ident); |
|
| 1188 | + } elseif ($source == 'costtotravel') { |
|
| 1189 | + return $this->getCostToTravel($ident); |
|
| 1190 | + } |
|
| 1085 | 1191 | //elseif ($source == 'flightradar24') return $this->getFlightRadar24($ident,$date); |
| 1086 | - elseif ($source == 'flightaware') return $this->getFlightAware($ident); |
|
| 1192 | + elseif ($source == 'flightaware') { |
|
| 1193 | + return $this->getFlightAware($ident); |
|
| 1194 | + } |
|
| 1087 | 1195 | } |
| 1088 | 1196 | } |
| 1089 | 1197 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -$date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
|
| 2 | +$date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); |
|
| 3 | 3 | if ($date == '') $date = date('Y-m-d'); |
| 4 | 4 | header('Location: '.$globalURL.'/accident/'.$date); |
| 5 | 5 | ?> |
| 6 | 6 | \ No newline at end of file |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 3 | -if ($date == '') $date = date('Y-m-d'); |
|
| 3 | +if ($date == '') { |
|
| 4 | + $date = date('Y-m-d'); |
|
| 5 | +} |
|
| 4 | 6 | header('Location: '.$globalURL.'/accident/'.$date); |
| 5 | 7 | ?> |
| 6 | 8 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -$date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
|
| 2 | +$date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); |
|
| 3 | 3 | if ($date == '') $date = date('Y-m-d'); |
| 4 | 4 | header('Location: '.$globalURL.'/date/'.$date); |
| 5 | 5 | ?> |
| 6 | 6 | \ No newline at end of file |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 3 | -if ($date == '') $date = date('Y-m-d'); |
|
| 3 | +if ($date == '') { |
|
| 4 | + $date = date('Y-m-d'); |
|
| 5 | +} |
|
| 4 | 6 | header('Location: '.$globalURL.'/date/'.$date); |
| 5 | 7 | ?> |
| 6 | 8 | \ No newline at end of file |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | $date = date('Y-m-d'); |
| 12 | 12 | } else { |
| 13 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
| 13 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if(!isset($_GET['limit'])) |
|
| 16 | +if (!isset($_GET['limit'])) |
|
| 17 | 17 | { |
| 18 | 18 | $limit_start = 0; |
| 19 | 19 | $limit_end = 25; |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | print '<br />'; |
| 49 | 49 | |
| 50 | 50 | print '<div class="info column">'; |
| 51 | -print '<h1>'.sprintf(_("Incidents from %s"),date("l F j, Y",strtotime($date))).'</h1>'; |
|
| 51 | +print '<h1>'.sprintf(_("Incidents from %s"), date("l F j, Y", strtotime($date))).'</h1>'; |
|
| 52 | 52 | print '</div>'; |
| 53 | 53 | |
| 54 | 54 | print '<div class="table column">'; |
| 55 | -print '<p>'.sprintf(_("The table below shows the Incidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>'; |
|
| 56 | -$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'incident',$date); |
|
| 55 | +print '<p>'.sprintf(_("The table below shows the Incidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>'; |
|
| 56 | +$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'incident', $date); |
|
| 57 | 57 | //print_r($spotter_array); |
| 58 | 58 | if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) { |
| 59 | 59 | include('table-output.php'); |
@@ -58,8 +58,12 @@ |
||
| 58 | 58 | if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) { |
| 59 | 59 | include('table-output.php'); |
| 60 | 60 | print '<div class="pagination">'; |
| 61 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 62 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 61 | + if ($limit_previous_1 >= 0) { |
|
| 62 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 63 | + } |
|
| 64 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 65 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 66 | + } |
|
| 63 | 67 | print '</div>'; |
| 64 | 68 | } |
| 65 | 69 | print '</div>'; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -$date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
|
| 2 | +$date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); |
|
| 3 | 3 | if ($date == '') $date = date('Y-m-d'); |
| 4 | 4 | header('Location: '.$globalURL.'/incident/'.$date); |
| 5 | 5 | ?> |
| 6 | 6 | \ No newline at end of file |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 3 | -if ($date == '') $date = date('Y-m-d'); |
|
| 3 | +if ($date == '') { |
|
| 4 | + $date = date('Y-m-d'); |
|
| 5 | +} |
|
| 4 | 6 | header('Location: '.$globalURL.'/incident/'.$date); |
| 5 | 7 | ?> |
| 6 | 8 | \ No newline at end of file |
@@ -5,11 +5,11 @@ |
||
| 5 | 5 | |
| 6 | 6 | if ($_POST['aircraft_manufacturer'] != "") |
| 7 | 7 | { |
| 8 | - $aircraft_manufacturer = filter_input(INPUT_POST,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
| 8 | + $aircraft_manufacturer = filter_input(INPUT_POST, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
| 10 | 10 | } elseif ($_GET['aircraft_manufacturer'] != "") |
| 11 | 11 | { |
| 12 | - $aircraft_manufacturer = filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
| 12 | + $aircraft_manufacturer = filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
| 14 | 14 | } else { |
| 15 | 15 | header('Location: '.$globalURL); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | if ($_POST['registration'] != "") |
| 7 | 7 | { |
| 8 | - $registration = filter_input(INPUT_POST,'registration',FILTER_SANITIZE_STRING); |
|
| 8 | + $registration = filter_input(INPUT_POST, 'registration', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | header('Location: '.$globalURL.'/registration/'.$registration); |
| 10 | 10 | } else { |
| 11 | 11 | header('Location: '.$globalURL); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | 4 | |
| 5 | -setcookie("MapFormat",'2d'); |
|
| 5 | +setcookie("MapFormat", '2d'); |
|
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
| 19 | 19 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
| 20 | 20 | else $enddate = time(); |
| 21 | - setcookie("archive_begin",$begindate); |
|
| 22 | - setcookie("archive_end",$enddate); |
|
| 23 | - setcookie("archive_update",$lastupd); |
|
| 24 | - setcookie("archive_speed",$archivespeed); |
|
| 21 | + setcookie("archive_begin", $begindate); |
|
| 22 | + setcookie("archive_end", $enddate); |
|
| 23 | + setcookie("archive_update", $lastupd); |
|
| 24 | + setcookie("archive_speed", $archivespeed); |
|
| 25 | 25 | ?> |
| 26 | 26 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
| 27 | 27 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | <?php |
| 93 | 93 | } |
| 94 | 94 | if (isset($_GET['ident'])) { |
| 95 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 95 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 96 | 96 | } |
| 97 | 97 | if (isset($_GET['flightaware_id'])) { |
| 98 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 98 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 99 | 99 | } |
| 100 | 100 | if (isset($_GET['latitude'])) { |
| 101 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
| 101 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
| 102 | 102 | } |
| 103 | 103 | if (isset($_GET['longitude'])) { |
| 104 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
| 104 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
| 105 | 105 | } |
| 106 | 106 | ?> |
| 107 | 107 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | || navigator.userAgent.match(/BlackBerry/i) |
| 137 | 137 | || navigator.userAgent.match(/Windows Phone/i)) |
| 138 | 138 | { |
| 139 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
| 139 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
| 140 | 140 | } else { |
| 141 | 141 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
| 142 | 142 | } |
@@ -230,19 +230,19 @@ discard block |
||
| 230 | 230 | map.addLayer(yandexLayer); |
| 231 | 231 | <?php |
| 232 | 232 | } elseif ($MapType == 'Bing-Aerial') { |
| 233 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 233 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 234 | 234 | ?> |
| 235 | 235 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 236 | 236 | map.addLayer(bingLayer); |
| 237 | 237 | <?php |
| 238 | 238 | } elseif ($MapType == 'Bing-Hybrid') { |
| 239 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 239 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 240 | 240 | ?> |
| 241 | 241 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 242 | 242 | map.addLayer(bingLayer); |
| 243 | 243 | <?php |
| 244 | 244 | } elseif ($MapType == 'Bing-Road') { |
| 245 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 245 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 246 | 246 | ?> |
| 247 | 247 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 248 | 248 | map.addLayer(bingLayer); |
@@ -534,10 +534,10 @@ discard block |
||
| 534 | 534 | }; |
| 535 | 535 | archive.update = function (props) { |
| 536 | 536 | if (typeof props != 'undefined') { |
| 537 | - //this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
| 538 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
| 537 | + //this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
| 538 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
| 539 | 539 | } else { |
| 540 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
| 540 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | }; |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | <?php |
| 738 | 738 | } else { |
| 739 | 739 | ?> |
| 740 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 740 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 741 | 741 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 742 | 742 | <?php |
| 743 | 743 | } |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | /* |
| 754 | 754 | shadowUrl: iconURLShadowpath, |
| 755 | 755 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 756 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 756 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 757 | 757 | */ |
| 758 | 758 | }) |
| 759 | 759 | }) |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | <?php |
| 787 | 787 | } else { |
| 788 | 788 | ?> |
| 789 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 789 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 790 | 790 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 791 | 791 | <?php |
| 792 | 792 | } |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | <?php |
| 835 | 835 | } else { |
| 836 | 836 | ?> |
| 837 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 837 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 838 | 838 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 839 | 839 | <?php |
| 840 | 840 | } |
@@ -1460,23 +1460,23 @@ discard block |
||
| 1460 | 1460 | airs.push(air.value); |
| 1461 | 1461 | } |
| 1462 | 1462 | } |
| 1463 | - document.cookie = 'filter_Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1463 | + document.cookie = 'filter_Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1464 | 1464 | } |
| 1465 | 1465 | function airlinestype(selectObj) { |
| 1466 | 1466 | var idx = selectObj.selectedIndex; |
| 1467 | 1467 | var airtype = selectObj.options[idx].value; |
| 1468 | - document.cookie = 'filter_airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1468 | + document.cookie = 'filter_airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1469 | 1469 | } |
| 1470 | 1470 | function alliance(selectObj) { |
| 1471 | 1471 | var idx = selectObj.selectedIndex; |
| 1472 | 1472 | var alliance = selectObj.options[idx].value; |
| 1473 | - document.cookie = 'filter_alliance='+alliance+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1473 | + document.cookie = 'filter_alliance='+alliance+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1474 | 1474 | } |
| 1475 | 1475 | |
| 1476 | 1476 | function identfilter() { |
| 1477 | 1477 | var ident = $('#identfilter').val(); |
| 1478 | 1478 | console.log('Filter with '+ident); |
| 1479 | - document.cookie = 'filter_ident='+ident+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1479 | + document.cookie = 'filter_ident='+ident+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1480 | 1480 | } |
| 1481 | 1481 | function removefilters() { |
| 1482 | 1482 | // Get an array of all cookie names (the regex matches what we don't want) |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | } |
| 1499 | 1499 | } |
| 1500 | 1500 | //document.cookie = 'Sources='+sources.join()+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1501 | - document.cookie = 'filter_Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1501 | + document.cookie = 'filter_Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1502 | 1502 | } |
| 1503 | 1503 | |
| 1504 | 1504 | function show3D() { |
@@ -1521,23 +1521,23 @@ discard block |
||
| 1521 | 1521 | |
| 1522 | 1522 | function clickVATSIM(cb) { |
| 1523 | 1523 | //document.cookie = 'ShowVATSIM='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1524 | - document.cookie = 'filter_ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1524 | + document.cookie = 'filter_ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1525 | 1525 | } |
| 1526 | 1526 | function clickIVAO(cb) { |
| 1527 | 1527 | //document.cookie = 'ShowIVAO='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1528 | - document.cookie = 'filter_ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1528 | + document.cookie = 'filter_ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1529 | 1529 | } |
| 1530 | 1530 | function clickphpVMS(cb) { |
| 1531 | 1531 | //document.cookie = 'ShowVMS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1532 | - document.cookie = 'filter_ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1532 | + document.cookie = 'filter_ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1533 | 1533 | } |
| 1534 | 1534 | function clickSBS1(cb) { |
| 1535 | 1535 | //document.cookie = 'ShowSBS1='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1536 | - document.cookie = 'filter_ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1536 | + document.cookie = 'filter_ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1537 | 1537 | } |
| 1538 | 1538 | function clickAPRS(cb) { |
| 1539 | 1539 | //document.cookie = 'ShowAPRS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1540 | - document.cookie = 'filter_ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1540 | + document.cookie = 'filter_ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1541 | 1541 | } |
| 1542 | 1542 | function clickFlightPopup(cb) { |
| 1543 | 1543 | document.cookie = 'flightpopup='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | setcookie("MapFormat",'2d'); |
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 9 | -else $compress = $globalJsonCompress; |
|
| 8 | +if (!isset($globalJsonCompress)) { |
|
| 9 | + $compress = true; |
|
| 10 | +} else { |
|
| 11 | + $compress = $globalJsonCompress; |
|
| 12 | +} |
|
| 10 | 13 | if (isset($_GET['archive'])) { |
| 11 | 14 | //$archiveupdatetime = 50; |
| 12 | 15 | $archiveupdatetime = $globalMapRefresh; |
@@ -16,8 +19,11 @@ discard block |
||
| 16 | 19 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
| 17 | 20 | //$lastupd = 20; |
| 18 | 21 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
| 19 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
| 20 | - else $enddate = time(); |
|
| 22 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
| 23 | + $enddate = $_GET['enddate']; |
|
| 24 | + } else { |
|
| 25 | + $enddate = time(); |
|
| 26 | + } |
|
| 21 | 27 | setcookie("archive_begin",$begindate); |
| 22 | 28 | setcookie("archive_end",$enddate); |
| 23 | 29 | setcookie("archive_update",$lastupd); |
@@ -123,7 +129,17 @@ discard block |
||
| 123 | 129 | } |
| 124 | 130 | |
| 125 | 131 | //create the map |
| 126 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
| 132 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
| 133 | + print $latitude; |
|
| 134 | +} else { |
|
| 135 | + print $globalCenterLatitude; |
|
| 136 | +} |
|
| 137 | +?>,<?php if (isset($longitude)) { |
|
| 138 | + print $longitude; |
|
| 139 | +} else { |
|
| 140 | + print $globalCenterLongitude; |
|
| 141 | +} |
|
| 142 | +?>], zoom); |
|
| 127 | 143 | <?php |
| 128 | 144 | } else { |
| 129 | 145 | ?> |
@@ -136,9 +152,19 @@ discard block |
||
| 136 | 152 | || navigator.userAgent.match(/BlackBerry/i) |
| 137 | 153 | || navigator.userAgent.match(/Windows Phone/i)) |
| 138 | 154 | { |
| 139 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
| 155 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 156 | + print $globalLiveZoom-1; |
|
| 157 | +} else { |
|
| 158 | + print '8'; |
|
| 159 | +} |
|
| 160 | +?>; |
|
| 140 | 161 | } else { |
| 141 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
| 162 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 163 | + print $globalLiveZoom; |
|
| 164 | +} else { |
|
| 165 | + print '9'; |
|
| 166 | +} |
|
| 167 | +?>; |
|
| 142 | 168 | } |
| 143 | 169 | |
| 144 | 170 | //create the map |
@@ -163,16 +189,27 @@ discard block |
||
| 163 | 189 | bounds = L.latLngBounds(southWest,northEast); |
| 164 | 190 | //a few title layers |
| 165 | 191 | <?php |
| 166 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
| 167 | - else $MapType = $globalMapProvider; |
|
| 192 | + if (isset($_COOKIE['MapType'])) { |
|
| 193 | + $MapType = $_COOKIE['MapType']; |
|
| 194 | + } else { |
|
| 195 | + $MapType = $globalMapProvider; |
|
| 196 | + } |
|
| 168 | 197 | |
| 169 | 198 | if ($MapType == 'Mapbox') { |
| 170 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
| 171 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 172 | -?> |
|
| 199 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
| 200 | + $MapBoxId = $globalMapboxId; |
|
| 201 | + } else { |
|
| 202 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 203 | + } |
|
| 204 | + ?> |
|
| 173 | 205 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
| 174 | 206 | maxZoom: 18, |
| 175 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 207 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 208 | + print 'false'; |
|
| 209 | +} else { |
|
| 210 | + print 'true'; |
|
| 211 | +} |
|
| 212 | +?>, |
|
| 176 | 213 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 177 | 214 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
| 178 | 215 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -184,7 +221,12 @@ discard block |
||
| 184 | 221 | ?> |
| 185 | 222 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
| 186 | 223 | maxZoom: 18, |
| 187 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 224 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 225 | + print 'false'; |
|
| 226 | +} else { |
|
| 227 | + print 'true'; |
|
| 228 | +} |
|
| 229 | +?>, |
|
| 188 | 230 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 189 | 231 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
| 190 | 232 | }).addTo(map); |
@@ -230,20 +272,26 @@ discard block |
||
| 230 | 272 | map.addLayer(yandexLayer); |
| 231 | 273 | <?php |
| 232 | 274 | } elseif ($MapType == 'Bing-Aerial') { |
| 233 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 234 | -?> |
|
| 275 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 276 | + setcookie('MapType','OpenStreetMap'); |
|
| 277 | + } |
|
| 278 | + ?> |
|
| 235 | 279 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 236 | 280 | map.addLayer(bingLayer); |
| 237 | 281 | <?php |
| 238 | 282 | } elseif ($MapType == 'Bing-Hybrid') { |
| 239 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 240 | -?> |
|
| 283 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 284 | + setcookie('MapType','OpenStreetMap'); |
|
| 285 | + } |
|
| 286 | + ?> |
|
| 241 | 287 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 242 | 288 | map.addLayer(bingLayer); |
| 243 | 289 | <?php |
| 244 | 290 | } elseif ($MapType == 'Bing-Road') { |
| 245 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 246 | -?> |
|
| 291 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 292 | + setcookie('MapType','OpenStreetMap'); |
|
| 293 | + } |
|
| 294 | + ?> |
|
| 247 | 295 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 248 | 296 | map.addLayer(bingLayer); |
| 249 | 297 | <?php |
@@ -291,7 +339,12 @@ discard block |
||
| 291 | 339 | } |
| 292 | 340 | } elseif ($globalBounding == 'circle') { |
| 293 | 341 | ?> |
| 294 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
| 342 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
| 343 | + print $globalBoundingCircleSize; |
|
| 344 | +} else { |
|
| 345 | + print '70000'; |
|
| 346 | +} |
|
| 347 | +?>,{ |
|
| 295 | 348 | color: '#92C7D1', |
| 296 | 349 | fillColor: '#92C7D1', |
| 297 | 350 | fillOpacity: 0.3, |
@@ -350,8 +403,11 @@ discard block |
||
| 350 | 403 | |
| 351 | 404 | function update_airportsLayer() { |
| 352 | 405 | <?php |
| 353 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
| 354 | - else $getZoom = '7'; |
|
| 406 | + if (isset($_COOKIE['AirportZoom'])) { |
|
| 407 | + $getZoom = $_COOKIE['AirportZoom']; |
|
| 408 | + } else { |
|
| 409 | + $getZoom = '7'; |
|
| 410 | + } |
|
| 355 | 411 | ?> |
| 356 | 412 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
| 357 | 413 | if (typeof airportsLayer != 'undefined') { |
@@ -687,9 +743,13 @@ discard block |
||
| 687 | 743 | if (callsign != ""){ markerLabel += callsign; } |
| 688 | 744 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
| 689 | 745 | <?php |
| 690 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
| 691 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
| 692 | - else $IconColor = '1a3151'; |
|
| 746 | + if (isset($_COOKIE['IconColor'])) { |
|
| 747 | + $IconColor = $_COOKIE['IconColor']; |
|
| 748 | + } elseif (isset($globalAircraftIconColor)) { |
|
| 749 | + $IconColor = $globalAircraftIconColor; |
|
| 750 | + } else { |
|
| 751 | + $IconColor = '1a3151'; |
|
| 752 | + } |
|
| 693 | 753 | if (!isset($ident) && !isset($flightaware_id)) { |
| 694 | 754 | ?> |
| 695 | 755 | info_update(feature.properties.fc); |
@@ -737,7 +797,12 @@ discard block |
||
| 737 | 797 | <?php |
| 738 | 798 | } else { |
| 739 | 799 | ?> |
| 740 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 800 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 801 | + print $archiveupdatetime*1000; |
|
| 802 | +} else { |
|
| 803 | + print $globalMapRefresh*1000+20000; |
|
| 804 | +} |
|
| 805 | +?>+feature.properties.sqt*1000); |
|
| 741 | 806 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 742 | 807 | <?php |
| 743 | 808 | } |
@@ -786,7 +851,12 @@ discard block |
||
| 786 | 851 | <?php |
| 787 | 852 | } else { |
| 788 | 853 | ?> |
| 789 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 854 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 855 | + print $archiveupdatetime*1000; |
|
| 856 | +} else { |
|
| 857 | + print $globalMapRefresh*1000+20000; |
|
| 858 | +} |
|
| 859 | +?>+feature.properties.sqt*1000); |
|
| 790 | 860 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 791 | 861 | <?php |
| 792 | 862 | } |
@@ -834,7 +904,12 @@ discard block |
||
| 834 | 904 | <?php |
| 835 | 905 | } else { |
| 836 | 906 | ?> |
| 837 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 907 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 908 | + print $archiveupdatetime*1000; |
|
| 909 | +} else { |
|
| 910 | + print $globalMapRefresh*1000+20000; |
|
| 911 | +} |
|
| 912 | +?>+feature.properties.sqt*1000); |
|
| 838 | 913 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 839 | 914 | <?php |
| 840 | 915 | } |
@@ -1177,14 +1252,24 @@ discard block |
||
| 1177 | 1252 | if (isset($_GET['archive'])) { |
| 1178 | 1253 | ?> |
| 1179 | 1254 | //then load it again every 30 seconds |
| 1180 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
| 1255 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 1256 | + print ($globalMapRefresh*1000)/2; |
|
| 1257 | +} else { |
|
| 1258 | + print '15000'; |
|
| 1259 | +} |
|
| 1260 | +?>); |
|
| 1181 | 1261 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
| 1182 | 1262 | <?php |
| 1183 | 1263 | } else { |
| 1184 | 1264 | ?> |
| 1185 | 1265 | //then load it again every 30 seconds |
| 1186 | 1266 | reloadPage = setInterval( |
| 1187 | - function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 1267 | + function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 1268 | + print $globalMapRefresh*1000; |
|
| 1269 | +} else { |
|
| 1270 | + print '30000'; |
|
| 1271 | +} |
|
| 1272 | +?>); |
|
| 1188 | 1273 | var currentdate = new Date(); |
| 1189 | 1274 | var currentyear = new Date().getFullYear(); |
| 1190 | 1275 | var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0)); |
@@ -1196,7 +1281,12 @@ discard block |
||
| 1196 | 1281 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
| 1197 | 1282 | ?> |
| 1198 | 1283 | update_polarLayer(); |
| 1199 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 1284 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 1285 | + print $globalMapRefresh*1000*2; |
|
| 1286 | +} else { |
|
| 1287 | + print '60000'; |
|
| 1288 | +} |
|
| 1289 | +?>); |
|
| 1200 | 1290 | <?php |
| 1201 | 1291 | } |
| 1202 | 1292 | ?> |
@@ -1212,7 +1302,12 @@ discard block |
||
| 1212 | 1302 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
| 1213 | 1303 | ?> |
| 1214 | 1304 | update_atcLayer(); |
| 1215 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 1305 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 1306 | + print $globalMapRefresh*1000*2; |
|
| 1307 | +} else { |
|
| 1308 | + print '60000'; |
|
| 1309 | +} |
|
| 1310 | +?>); |
|
| 1216 | 1311 | <?php |
| 1217 | 1312 | } |
| 1218 | 1313 | ?> |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | <?php |
| 353 | 353 | if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
| 354 | 354 | else $getZoom = '7'; |
| 355 | - ?> |
|
| 355 | + ?> |
|
| 356 | 356 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
| 357 | 357 | if (typeof airportsLayer != 'undefined') { |
| 358 | 358 | if (map.hasLayer(airportsLayer) == true) { |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | update_locationsLayer(); |
| 513 | 513 | |
| 514 | 514 | <?php |
| 515 | - if (!isset($ident) && !isset($flightaware_id)) { |
|
| 515 | + if (!isset($ident) && !isset($flightaware_id)) { |
|
| 516 | 516 | ?> |
| 517 | 517 | |
| 518 | 518 | function info_update (props) { |
@@ -520,11 +520,11 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | <?php |
| 523 | - } |
|
| 523 | + } |
|
| 524 | 524 | ?> |
| 525 | 525 | |
| 526 | 526 | <?php |
| 527 | - if (isset($_GET['archive'])) { |
|
| 527 | + if (isset($_GET['archive'])) { |
|
| 528 | 528 | ?> |
| 529 | 529 | var archive = L.control(); |
| 530 | 530 | archive.onAdd = function (map) { |
@@ -543,12 +543,12 @@ discard block |
||
| 543 | 543 | }; |
| 544 | 544 | archive.addTo(map); |
| 545 | 545 | <?php |
| 546 | - } |
|
| 546 | + } |
|
| 547 | 547 | ?> |
| 548 | 548 | |
| 549 | 549 | |
| 550 | 550 | <?php |
| 551 | - //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
| 551 | + //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
| 552 | 552 | ?> |
| 553 | 553 | |
| 554 | 554 | $(".showdetails").on("click",".close",function(){ |
@@ -1041,15 +1041,15 @@ discard block |
||
| 1041 | 1041 | if (map.getZoom() > 7) { |
| 1042 | 1042 | var style = { |
| 1043 | 1043 | <?php |
| 1044 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1044 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1045 | 1045 | ?> |
| 1046 | 1046 | "color": "#1a3151", |
| 1047 | 1047 | <?php |
| 1048 | - } else { |
|
| 1048 | + } else { |
|
| 1049 | 1049 | ?> |
| 1050 | 1050 | "color": getAltitudeColor(altitude), |
| 1051 | 1051 | <?php |
| 1052 | - } |
|
| 1052 | + } |
|
| 1053 | 1053 | ?> |
| 1054 | 1054 | "weight": 3, |
| 1055 | 1055 | "opacity": 1 |
@@ -1059,15 +1059,15 @@ discard block |
||
| 1059 | 1059 | } else { |
| 1060 | 1060 | var style = { |
| 1061 | 1061 | <?php |
| 1062 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1062 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1063 | 1063 | ?> |
| 1064 | 1064 | "color": "#1a3151", |
| 1065 | 1065 | <?php |
| 1066 | - } else { |
|
| 1066 | + } else { |
|
| 1067 | 1067 | ?> |
| 1068 | 1068 | "color": getAltitudeColor(altitude), |
| 1069 | 1069 | <?php |
| 1070 | - } |
|
| 1070 | + } |
|
| 1071 | 1071 | ?> |
| 1072 | 1072 | "weight": 2, |
| 1073 | 1073 | "opacity": 1 |
@@ -1079,15 +1079,15 @@ discard block |
||
| 1079 | 1079 | if (map.getZoom() > 7) { |
| 1080 | 1080 | var style = { |
| 1081 | 1081 | <?php |
| 1082 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1082 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1083 | 1083 | ?> |
| 1084 | 1084 | "color": "#1a3151", |
| 1085 | 1085 | <?php |
| 1086 | - } else { |
|
| 1086 | + } else { |
|
| 1087 | 1087 | ?> |
| 1088 | 1088 | "color": getAltitudeColor(altitude), |
| 1089 | 1089 | <?php |
| 1090 | - } |
|
| 1090 | + } |
|
| 1091 | 1091 | ?> |
| 1092 | 1092 | "weight": 3, |
| 1093 | 1093 | "opacity": 0.6 |
@@ -1097,15 +1097,15 @@ discard block |
||
| 1097 | 1097 | } else { |
| 1098 | 1098 | var style = { |
| 1099 | 1099 | <?php |
| 1100 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1100 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1101 | 1101 | ?> |
| 1102 | 1102 | "color": "#1a3151", |
| 1103 | 1103 | <?php |
| 1104 | - } else { |
|
| 1104 | + } else { |
|
| 1105 | 1105 | ?> |
| 1106 | 1106 | "color": getAltitudeColor(altitude), |
| 1107 | 1107 | <?php |
| 1108 | - } |
|
| 1108 | + } |
|
| 1109 | 1109 | ?> |
| 1110 | 1110 | "weight": 2, |
| 1111 | 1111 | "opacity": 0.6 |
@@ -1115,21 +1115,21 @@ discard block |
||
| 1115 | 1115 | } |
| 1116 | 1116 | } |
| 1117 | 1117 | <?php |
| 1118 | - } else { |
|
| 1119 | - ?> |
|
| 1118 | + } else { |
|
| 1119 | + ?> |
|
| 1120 | 1120 | if (map.getZoom() > 7) { |
| 1121 | 1121 | var style = { |
| 1122 | 1122 | <?php |
| 1123 | 1123 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
| 1124 | - ?> |
|
| 1124 | + ?> |
|
| 1125 | 1125 | "color": "#1a3151", |
| 1126 | 1126 | <?php |
| 1127 | 1127 | } else { |
| 1128 | - ?> |
|
| 1128 | + ?> |
|
| 1129 | 1129 | "color": getAltitudeColor(altitude), |
| 1130 | 1130 | <?php |
| 1131 | 1131 | } |
| 1132 | - ?> |
|
| 1132 | + ?> |
|
| 1133 | 1133 | "weight": 3, |
| 1134 | 1134 | "opacity": 0.6 |
| 1135 | 1135 | }; |
@@ -1139,15 +1139,15 @@ discard block |
||
| 1139 | 1139 | var style = { |
| 1140 | 1140 | <?php |
| 1141 | 1141 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
| 1142 | - ?> |
|
| 1142 | + ?> |
|
| 1143 | 1143 | "color": "#1a3151", |
| 1144 | 1144 | <?php |
| 1145 | 1145 | } else { |
| 1146 | - ?> |
|
| 1146 | + ?> |
|
| 1147 | 1147 | "color": getAltitudeColor(altitude), |
| 1148 | 1148 | <?php |
| 1149 | 1149 | } |
| 1150 | - ?> |
|
| 1150 | + ?> |
|
| 1151 | 1151 | "weight": 2, |
| 1152 | 1152 | "opacity": 0.6 |
| 1153 | 1153 | }; |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | layer_data.addLayer(layer); |
| 1156 | 1156 | } |
| 1157 | 1157 | <?php |
| 1158 | - } |
|
| 1158 | + } |
|
| 1159 | 1159 | ?> |
| 1160 | 1160 | } |
| 1161 | 1161 | } |
@@ -1220,10 +1220,10 @@ discard block |
||
| 1220 | 1220 | |
| 1221 | 1221 | |
| 1222 | 1222 | <?php |
| 1223 | - // Add support for custom json via $globalMapJson |
|
| 1224 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
| 1223 | + // Add support for custom json via $globalMapJson |
|
| 1224 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
| 1225 | 1225 | foreach ($globalMapJson as $json) { |
| 1226 | - if (isset($json['url'])) { |
|
| 1226 | + if (isset($json['url'])) { |
|
| 1227 | 1227 | ?> |
| 1228 | 1228 | update_genLayer('<?php print $json['url']; ?>'); |
| 1229 | 1229 | <?php |
@@ -1232,9 +1232,9 @@ discard block |
||
| 1232 | 1232 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
| 1233 | 1233 | <?php |
| 1234 | 1234 | } |
| 1235 | - } |
|
| 1235 | + } |
|
| 1236 | + } |
|
| 1236 | 1237 | } |
| 1237 | - } |
|
| 1238 | 1238 | |
| 1239 | 1239 | ?> |
| 1240 | 1240 | |
@@ -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,7 +4,7 @@ discard block |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | require_once('require/class.Satellite.php'); |
| 6 | 6 | |
| 7 | -$trackident = filter_input(INPUT_GET,'trackid',FILTER_SANITIZE_STRING); |
|
| 7 | +$trackident = filter_input(INPUT_GET, 'trackid', FILTER_SANITIZE_STRING); |
|
| 8 | 8 | if ($trackident != '') { |
| 9 | 9 | require_once('require/class.SpotterLive.php'); |
| 10 | 10 | $SpotterLive = new SpotterLive(); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $spotterid = $Spotter->getSpotterIDBasedOnFlightAwareID($trackident); |
| 15 | 15 | header('Location: '.$globalURL.'/flightid/'.$spotterid); |
| 16 | 16 | } else { |
| 17 | - setcookie('MapTrack',$resulttrackident[0]['flightaware_id']); |
|
| 17 | + setcookie('MapTrack', $resulttrackident[0]['flightaware_id']); |
|
| 18 | 18 | } |
| 19 | 19 | } else { |
| 20 | 20 | unset($_COOKIE['MapTrack']); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | <div class="form-group"> |
| 168 | 168 | <label>From (UTC):</label> |
| 169 | 169 | <div class='input-group date' id='datetimepicker1'> |
| 170 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required /> |
|
| 170 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a", $_COOKIE['archive_begin']); ?>" required /> |
|
| 171 | 171 | <span class="input-group-addon"> |
| 172 | 172 | <span class="glyphicon glyphicon-calendar"></span> |
| 173 | 173 | </span> |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | <div class="form-group"> |
| 177 | 177 | <label>To (UTC):</label> |
| 178 | 178 | <div class='input-group date' id='datetimepicker2'> |
| 179 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" /> |
|
| 179 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a", $_COOKIE['archive_end']); ?>" /> |
|
| 180 | 180 | <span class="input-group-addon"> |
| 181 | 181 | <span class="glyphicon glyphicon-calendar"></span> |
| 182 | 182 | </span> |
@@ -301,8 +301,8 @@ discard block |
||
| 301 | 301 | <li><?php echo _("Type of Terrain:"); ?> |
| 302 | 302 | <select class="selectpicker" onchange="terrainType(this);"> |
| 303 | 303 | <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
| 304 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
| 305 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
| 304 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option> |
|
| 305 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option> |
|
| 306 | 306 | </select> |
| 307 | 307 | </li> |
| 308 | 308 | <?php |
@@ -326,7 +326,7 @@ discard block |
||
| 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 | 328 | } |
| 329 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
| 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 |
@@ -439,10 +439,10 @@ discard block |
||
| 439 | 439 | $Spotter = new Spotter(); |
| 440 | 440 | $allairlinenames = $Spotter->getAllAirlineNames(); |
| 441 | 441 | } |
| 442 | - foreach($allairlinenames as $airline) { |
|
| 442 | + foreach ($allairlinenames as $airline) { |
|
| 443 | 443 | $airline_name = $airline['airline_name']; |
| 444 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
| 445 | - if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
|
| 444 | + if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...'; |
|
| 445 | + if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['filter_Airlines']))) { |
|
| 446 | 446 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
| 447 | 447 | } else { |
| 448 | 448 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
| 462 | 462 | <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
| 463 | 463 | <?php |
| 464 | - foreach($allalliancenames as $alliance) { |
|
| 464 | + foreach ($allalliancenames as $alliance) { |
|
| 465 | 465 | $alliance_name = $alliance['alliance']; |
| 466 | 466 | if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] == $alliance_name) { |
| 467 | 467 | echo '<option value="'.$alliance_name.'" selected>'.$alliance_name.'</option>'; |
@@ -482,8 +482,8 @@ discard block |
||
| 482 | 482 | <select class="selectpicker" multiple onchange="sources(this);"> |
| 483 | 483 | <?php |
| 484 | 484 | $Spotter = new Spotter(); |
| 485 | - foreach($Spotter->getAllSourceName('aprs') as $source) { |
|
| 486 | - if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'],explode(',',$_COOKIE['filter_Sources']))) { |
|
| 485 | + foreach ($Spotter->getAllSourceName('aprs') as $source) { |
|
| 486 | + if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'], explode(',', $_COOKIE['filter_Sources']))) { |
|
| 487 | 487 | echo '<option value="'.$source['source_name'].'" selected>'.$source['source_name'].'</option>'; |
| 488 | 488 | } else { |
| 489 | 489 | echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>'; |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
| 556 | 556 | else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
| 557 | 557 | |
| 558 | - if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
|
| 558 | + if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) { |
|
| 559 | 559 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |
| 560 | 560 | } else { |
| 561 | 561 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
@@ -135,11 +135,26 @@ discard block |
||
| 135 | 135 | <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li> |
| 136 | 136 | <li><?php echo _("NOTAM scope:"); ?> |
| 137 | 137 | <select class="selectpicker" onchange="notamscope(this);"> |
| 138 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option> |
|
| 139 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option> |
|
| 140 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option> |
|
| 141 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option> |
|
| 142 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option> |
|
| 138 | + <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { |
|
| 139 | + print ' selected'; |
|
| 140 | +} |
|
| 141 | +?>>All</option> |
|
| 142 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { |
|
| 143 | + print ' selected'; |
|
| 144 | +} |
|
| 145 | +?>>Airport/Enroute warning</option> |
|
| 146 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { |
|
| 147 | + print ' selected'; |
|
| 148 | +} |
|
| 149 | +?>>Airport warning</option> |
|
| 150 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { |
|
| 151 | + print ' selected'; |
|
| 152 | +} |
|
| 153 | +?>>Navigation warning</option> |
|
| 154 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { |
|
| 155 | + print ' selected'; |
|
| 156 | +} |
|
| 157 | +?>>Enroute warning</option> |
|
| 143 | 158 | </select |
| 144 | 159 | </li> |
| 145 | 160 | </ul> |
@@ -167,7 +182,12 @@ discard block |
||
| 167 | 182 | <div class="form-group"> |
| 168 | 183 | <label>From (UTC):</label> |
| 169 | 184 | <div class='input-group date' id='datetimepicker1'> |
| 170 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required /> |
|
| 185 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) { |
|
| 186 | + print $_POST['start_date']; |
|
| 187 | +} elseif (isset($_COOKIE['archive_begin'])) { |
|
| 188 | + print date("m/d/Y h:i a",$_COOKIE['archive_begin']); |
|
| 189 | +} |
|
| 190 | +?>" required /> |
|
| 171 | 191 | <span class="input-group-addon"> |
| 172 | 192 | <span class="glyphicon glyphicon-calendar"></span> |
| 173 | 193 | </span> |
@@ -176,7 +196,12 @@ discard block |
||
| 176 | 196 | <div class="form-group"> |
| 177 | 197 | <label>To (UTC):</label> |
| 178 | 198 | <div class='input-group date' id='datetimepicker2'> |
| 179 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" /> |
|
| 199 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) { |
|
| 200 | + print $_POST['end_date']; |
|
| 201 | +} elseif (isset($_COOKIE['archive_end'])) { |
|
| 202 | + print date("m/d/Y h:i a",$_COOKIE['archive_end']); |
|
| 203 | +} |
|
| 204 | +?>" /> |
|
| 180 | 205 | <span class="input-group-addon"> |
| 181 | 206 | <span class="glyphicon glyphicon-calendar"></span> |
| 182 | 207 | </span> |
@@ -202,8 +227,20 @@ discard block |
||
| 202 | 227 | |
| 203 | 228 | <li><?php echo _("Playback speed:"); ?> |
| 204 | 229 | <div class="range"> |
| 205 | - <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>"> |
|
| 206 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output> |
|
| 230 | + <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) { |
|
| 231 | + print $_POST['archivespeed']; |
|
| 232 | +} elseif (isset($_COOKIE['archive_speed'])) { |
|
| 233 | + print $_COOKIE['archive_speed']; |
|
| 234 | +} else { |
|
| 235 | + print '1'; |
|
| 236 | +} |
|
| 237 | +?>"> |
|
| 238 | + <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) { |
|
| 239 | + print $_COOKIE['archive_speed']; |
|
| 240 | +} else { |
|
| 241 | + print '1'; |
|
| 242 | +} |
|
| 243 | +?></output> |
|
| 207 | 244 | </div> |
| 208 | 245 | </li> |
| 209 | 246 | <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li> |
@@ -225,15 +262,27 @@ discard block |
||
| 225 | 262 | <li><?php echo _("Type of Map:"); ?> |
| 226 | 263 | <select class="selectpicker" onchange="mapType(this);"> |
| 227 | 264 | <?php |
| 228 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
|
| 229 | - else $MapType = $_COOKIE['MapType']; |
|
| 265 | + if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { |
|
| 266 | + $MapType = $globalMapProvider; |
|
| 267 | + } else { |
|
| 268 | + $MapType = $_COOKIE['MapType']; |
|
| 269 | + } |
|
| 230 | 270 | ?> |
| 231 | 271 | <?php |
| 232 | 272 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
| 233 | 273 | ?> |
| 234 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
|
| 235 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
|
| 236 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
|
| 274 | + <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { |
|
| 275 | + print ' selected'; |
|
| 276 | +} |
|
| 277 | +?>>Bing-Aerial</option> |
|
| 278 | + <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { |
|
| 279 | + print ' selected'; |
|
| 280 | +} |
|
| 281 | +?>>Bing-Hybrid</option> |
|
| 282 | + <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { |
|
| 283 | + print ' selected'; |
|
| 284 | +} |
|
| 285 | +?>>Bing-Road</option> |
|
| 237 | 286 | <?php |
| 238 | 287 | } |
| 239 | 288 | ?> |
@@ -243,56 +292,131 @@ discard block |
||
| 243 | 292 | <?php |
| 244 | 293 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
| 245 | 294 | ?> |
| 246 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
|
| 247 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
|
| 248 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
|
| 295 | + <option value="Here-Aerial"<?php if ($MapType == 'Here') { |
|
| 296 | + print ' selected'; |
|
| 297 | +} |
|
| 298 | +?>>Here-Aerial</option> |
|
| 299 | + <option value="Here-Hybrid"<?php if ($MapType == 'Here') { |
|
| 300 | + print ' selected'; |
|
| 301 | +} |
|
| 302 | +?>>Here-Hybrid</option> |
|
| 303 | + <option value="Here-Road"<?php if ($MapType == 'Here') { |
|
| 304 | + print ' selected'; |
|
| 305 | +} |
|
| 306 | +?>>Here-Road</option> |
|
| 249 | 307 | <?php |
| 250 | 308 | } |
| 251 | 309 | ?> |
| 252 | 310 | <?php |
| 253 | 311 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
| 254 | 312 | ?> |
| 255 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
|
| 256 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
|
| 257 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
|
| 258 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
|
| 313 | + <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { |
|
| 314 | + print ' selected'; |
|
| 315 | +} |
|
| 316 | +?>>Google Roadmap</option> |
|
| 317 | + <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { |
|
| 318 | + print ' selected'; |
|
| 319 | +} |
|
| 320 | +?>>Google Satellite</option> |
|
| 321 | + <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { |
|
| 322 | + print ' selected'; |
|
| 323 | +} |
|
| 324 | +?>>Google Hybrid</option> |
|
| 325 | + <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { |
|
| 326 | + print ' selected'; |
|
| 327 | +} |
|
| 328 | +?>>Google Terrain</option> |
|
| 259 | 329 | <?php |
| 260 | 330 | } |
| 261 | 331 | ?> |
| 262 | 332 | <?php |
| 263 | 333 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
| 264 | 334 | ?> |
| 265 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
|
| 266 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
|
| 267 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
|
| 335 | + <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { |
|
| 336 | + print ' selected'; |
|
| 337 | +} |
|
| 338 | +?>>MapQuest-OSM</option> |
|
| 339 | + <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { |
|
| 340 | + print ' selected'; |
|
| 341 | +} |
|
| 342 | +?>>MapQuest-Aerial</option> |
|
| 343 | + <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { |
|
| 344 | + print ' selected'; |
|
| 345 | +} |
|
| 346 | +?>>MapQuest-Hybrid</option> |
|
| 268 | 347 | <?php |
| 269 | 348 | } |
| 270 | 349 | ?> |
| 271 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
|
| 350 | + <option value="Yandex"<?php if ($MapType == 'Yandex') { |
|
| 351 | + print ' selected'; |
|
| 352 | +} |
|
| 353 | +?>>Yandex</option> |
|
| 272 | 354 | <?php |
| 273 | 355 | } |
| 274 | 356 | ?> |
| 275 | 357 | <?php |
| 276 | 358 | if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
| 277 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
|
| 278 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 359 | + if (!isset($_COOKIE['MapTypeId'])) { |
|
| 360 | + $MapBoxId = 'default'; |
|
| 361 | + } else { |
|
| 362 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 363 | + } |
|
| 279 | 364 | ?> |
| 280 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
|
| 281 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
|
| 282 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
|
| 283 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option> |
|
| 284 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option> |
|
| 285 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option> |
|
| 286 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option> |
|
| 287 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option> |
|
| 288 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option> |
|
| 289 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option> |
|
| 290 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
|
| 291 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
|
| 365 | + <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { |
|
| 366 | + print ' selected'; |
|
| 367 | +} |
|
| 368 | +?>>Mapbox default</option> |
|
| 369 | + <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { |
|
| 370 | + print ' selected'; |
|
| 371 | +} |
|
| 372 | +?>>Mapbox streets</option> |
|
| 373 | + <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { |
|
| 374 | + print ' selected'; |
|
| 375 | +} |
|
| 376 | +?>>Mapbox light</option> |
|
| 377 | + <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { |
|
| 378 | + print ' selected'; |
|
| 379 | +} |
|
| 380 | +?>>Mapbox dark</option> |
|
| 381 | + <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { |
|
| 382 | + print ' selected'; |
|
| 383 | +} |
|
| 384 | +?>>Mapbox satellite</option> |
|
| 385 | + <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { |
|
| 386 | + print ' selected'; |
|
| 387 | +} |
|
| 388 | +?>>Mapbox streets-satellite</option> |
|
| 389 | + <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { |
|
| 390 | + print ' selected'; |
|
| 391 | +} |
|
| 392 | +?>>Mapbox streets-basic</option> |
|
| 393 | + <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { |
|
| 394 | + print ' selected'; |
|
| 395 | +} |
|
| 396 | +?>>Mapbox comic</option> |
|
| 397 | + <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { |
|
| 398 | + print ' selected'; |
|
| 399 | +} |
|
| 400 | +?>>Mapbox outdoors</option> |
|
| 401 | + <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { |
|
| 402 | + print ' selected'; |
|
| 403 | +} |
|
| 404 | +?>>Mapbox pencil</option> |
|
| 405 | + <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { |
|
| 406 | + print ' selected'; |
|
| 407 | +} |
|
| 408 | +?>>Mapbox pirates</option> |
|
| 409 | + <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { |
|
| 410 | + print ' selected'; |
|
| 411 | +} |
|
| 412 | +?>>Mapbox emerald</option> |
|
| 292 | 413 | <?php |
| 293 | 414 | } |
| 294 | 415 | ?> |
| 295 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
|
| 416 | + <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { |
|
| 417 | + print ' selected'; |
|
| 418 | +} |
|
| 419 | +?>>OpenStreetMap</option> |
|
| 296 | 420 | </select> |
| 297 | 421 | </li> |
| 298 | 422 | <?php |
@@ -300,9 +424,18 @@ discard block |
||
| 300 | 424 | ?> |
| 301 | 425 | <li><?php echo _("Type of Terrain:"); ?> |
| 302 | 426 | <select class="selectpicker" onchange="terrainType(this);"> |
| 303 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
|
| 304 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
| 305 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
| 427 | + <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
|
| 428 | + print ' selected'; |
|
| 429 | +} |
|
| 430 | +?>>stk terrain</option> |
|
| 431 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { |
|
| 432 | + print ' selected'; |
|
| 433 | +} |
|
| 434 | +?>>ellipsoid</option> |
|
| 435 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { |
|
| 436 | + print ' selected'; |
|
| 437 | +} |
|
| 438 | +?>>vr terrain</option> |
|
| 306 | 439 | </select> |
| 307 | 440 | </li> |
| 308 | 441 | <?php |
@@ -312,18 +445,36 @@ discard block |
||
| 312 | 445 | if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
| 313 | 446 | ?> |
| 314 | 447 | |
| 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> |
|
| 316 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || !isset($_COOKIE['flightpath'])) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
| 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 | - <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> |
|
| 448 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { |
|
| 449 | + print 'checked'; |
|
| 450 | +} |
|
| 451 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
|
| 452 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || !isset($_COOKIE['flightpath'])) { |
|
| 453 | + print 'checked'; |
|
| 454 | +} |
|
| 455 | +?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
| 456 | + <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'])) { |
|
| 457 | + print 'checked'; |
|
| 458 | +} |
|
| 459 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
| 460 | + <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)) { |
|
| 461 | + print 'checked'; |
|
| 462 | +} |
|
| 463 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
| 319 | 464 | <?php |
| 320 | 465 | } |
| 321 | 466 | ?> |
| 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> |
|
| 467 | + <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') { |
|
| 468 | + print 'checked'; |
|
| 469 | +} |
|
| 470 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
| 323 | 471 | <?php |
| 324 | 472 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
| 325 | 473 | ?> |
| 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> |
|
| 474 | + <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')) { |
|
| 475 | + print 'checked'; |
|
| 476 | +} |
|
| 477 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
| 327 | 478 | <?php |
| 328 | 479 | } |
| 329 | 480 | if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
@@ -337,17 +488,25 @@ discard block |
||
| 337 | 488 | if (function_exists('array_column')) { |
| 338 | 489 | if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
| 339 | 490 | ?> |
| 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> |
|
| 491 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
| 492 | + print 'checked'; |
|
| 493 | +} |
|
| 494 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 341 | 495 | <?php |
| 342 | 496 | } |
| 343 | 497 | } elseif (isset($globalSources)) { |
| 344 | 498 | $dispolar = false; |
| 345 | 499 | foreach ($globalSources as $testsource) { |
| 346 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 500 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { |
|
| 501 | + $dispolar = true; |
|
| 502 | + } |
|
| 347 | 503 | } |
| 348 | 504 | if ($dispolar) { |
| 349 | 505 | ?> |
| 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> |
|
| 506 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
| 507 | + print 'checked'; |
|
| 508 | +} |
|
| 509 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 351 | 510 | <?php |
| 352 | 511 | } |
| 353 | 512 | } |
@@ -359,12 +518,22 @@ discard block |
||
| 359 | 518 | <?php |
| 360 | 519 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 361 | 520 | ?> |
| 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> |
|
| 521 | + <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { |
|
| 522 | + print 'checked'; |
|
| 523 | +} |
|
| 524 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
| 363 | 525 | <?php |
| 364 | 526 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
| 365 | 527 | ?> |
| 366 | 528 | <li><?php echo _("Aircraft icon color:"); ?> |
| 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'; ?>"> |
|
| 529 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
| 530 | + print $_COOKIE['IconColor']; |
|
| 531 | +} elseif (isset($globalAircraftIconColor)) { |
|
| 532 | + print $globalAircraftIconColor; |
|
| 533 | +} else { |
|
| 534 | + print '1a3151'; |
|
| 535 | +} |
|
| 536 | +?>"> |
|
| 368 | 537 | </li> |
| 369 | 538 | <?php |
| 370 | 539 | } |
@@ -372,8 +541,22 @@ discard block |
||
| 372 | 541 | ?> |
| 373 | 542 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
| 374 | 543 | <div class="range"> |
| 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'; ?>"> |
|
| 376 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output> |
|
| 544 | + <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { |
|
| 545 | + print $_COOKIE['AirportZoom']; |
|
| 546 | +} elseif (isset($globalAirportZoom)) { |
|
| 547 | + print $globalAirportZoom; |
|
| 548 | +} else { |
|
| 549 | + print '7'; |
|
| 550 | +} |
|
| 551 | +?>"> |
|
| 552 | + <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { |
|
| 553 | + print $_COOKIE['AirportZoom']; |
|
| 554 | +} elseif (isset($globalAirportZoom)) { |
|
| 555 | + print $globalAirportZoom; |
|
| 556 | +} else { |
|
| 557 | + print '7'; |
|
| 558 | +} |
|
| 559 | +?></output> |
|
| 377 | 560 | </div> |
| 378 | 561 | </li> |
| 379 | 562 | <?php |
@@ -381,22 +564,46 @@ discard block |
||
| 381 | 564 | ?> |
| 382 | 565 | <li><?php echo _("Distance unit:"); ?> |
| 383 | 566 | <select class="selectpicker" onchange="unitdistance(this);"> |
| 384 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option> |
|
| 385 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option> |
|
| 386 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option> |
|
| 567 | + <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 568 | + echo ' selected'; |
|
| 569 | +} |
|
| 570 | +?>>km</option> |
|
| 571 | + <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 572 | + echo ' selected'; |
|
| 573 | +} |
|
| 574 | +?>>nm</option> |
|
| 575 | + <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 576 | + echo ' selected'; |
|
| 577 | +} |
|
| 578 | +?>>mi</option> |
|
| 387 | 579 | </select> |
| 388 | 580 | </li> |
| 389 | 581 | <li><?php echo _("Altitude unit:"); ?> |
| 390 | 582 | <select class="selectpicker" onchange="unitaltitude(this);"> |
| 391 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option> |
|
| 392 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option> |
|
| 583 | + <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { |
|
| 584 | + echo ' selected'; |
|
| 585 | +} |
|
| 586 | +?>>m</option> |
|
| 587 | + <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
| 588 | + echo ' selected'; |
|
| 589 | +} |
|
| 590 | +?>>feet</option> |
|
| 393 | 591 | </select> |
| 394 | 592 | </li> |
| 395 | 593 | <li><?php echo _("Speed unit:"); ?> |
| 396 | 594 | <select class="selectpicker" onchange="unitspeed(this);"> |
| 397 | - <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option> |
|
| 398 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option> |
|
| 399 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option> |
|
| 595 | + <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { |
|
| 596 | + echo ' selected'; |
|
| 597 | +} |
|
| 598 | +?>>km/h</option> |
|
| 599 | + <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
|
| 600 | + echo ' selected'; |
|
| 601 | +} |
|
| 602 | +?>>mph</option> |
|
| 603 | + <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
|
| 604 | + echo ' selected'; |
|
| 605 | +} |
|
| 606 | +?>>knots</option> |
|
| 400 | 607 | </select> |
| 401 | 608 | </li> |
| 402 | 609 | |
@@ -411,9 +618,18 @@ discard block |
||
| 411 | 618 | <?php |
| 412 | 619 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
| 413 | 620 | ?> |
| 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 | - <?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 | - <?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 } ?> |
|
| 621 | + <?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'])) { |
|
| 622 | + print 'checked'; |
|
| 623 | +} |
|
| 624 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
| 625 | + <?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'])) { |
|
| 626 | + print 'checked'; |
|
| 627 | +} |
|
| 628 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
| 629 | + <?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'])) { |
|
| 630 | + print 'checked'; |
|
| 631 | +} |
|
| 632 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
| 417 | 633 | <?php |
| 418 | 634 | } |
| 419 | 635 | ?> |
@@ -421,10 +637,16 @@ discard block |
||
| 421 | 637 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
| 422 | 638 | ?> |
| 423 | 639 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
| 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> |
|
| 640 | + <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'])) { |
|
| 641 | + print 'checked'; |
|
| 642 | +} |
|
| 643 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
| 425 | 644 | <?php } ?> |
| 426 | 645 | <?php if (isset($globalAPRS) && $globalAPRS) { ?> |
| 427 | - <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
| 646 | + <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) { |
|
| 647 | + print 'checked'; |
|
| 648 | +} |
|
| 649 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
| 428 | 650 | <?php } ?> |
| 429 | 651 | <?php |
| 430 | 652 | } |
@@ -441,7 +663,9 @@ discard block |
||
| 441 | 663 | } |
| 442 | 664 | foreach($allairlinenames as $airline) { |
| 443 | 665 | $airline_name = $airline['airline_name']; |
| 444 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
| 666 | + if (strlen($airline_name) > 30) { |
|
| 667 | + $airline_name = substr($airline_name,0,30).'...'; |
|
| 668 | + } |
|
| 445 | 669 | if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
| 446 | 670 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
| 447 | 671 | } else { |
@@ -459,7 +683,10 @@ discard block |
||
| 459 | 683 | <li><?php echo _("Display alliance:"); ?> |
| 460 | 684 | <br/> |
| 461 | 685 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
| 462 | - <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
| 686 | + <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { |
|
| 687 | + echo ' selected'; |
|
| 688 | +} |
|
| 689 | +?>><?php echo _("All"); ?></option> |
|
| 463 | 690 | <?php |
| 464 | 691 | foreach($allalliancenames as $alliance) { |
| 465 | 692 | $alliance_name = $alliance['alliance']; |
@@ -500,10 +727,22 @@ discard block |
||
| 500 | 727 | ?> |
| 501 | 728 | <li><?php echo _("Display airlines of type:"); ?><br/> |
| 502 | 729 | <select class="selectpicker" onchange="airlinestype(this);"> |
| 503 | - <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
| 504 | - <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> |
|
| 505 | - <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> |
|
| 506 | - <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> |
|
| 730 | + <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { |
|
| 731 | + echo ' selected'; |
|
| 732 | +} |
|
| 733 | +?>><?php echo _("All"); ?></option> |
|
| 734 | + <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { |
|
| 735 | + echo ' selected'; |
|
| 736 | +} |
|
| 737 | +?>><?php echo _("Passenger"); ?></option> |
|
| 738 | + <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { |
|
| 739 | + echo ' selected'; |
|
| 740 | +} |
|
| 741 | +?>><?php echo _("Cargo"); ?></option> |
|
| 742 | + <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { |
|
| 743 | + echo ' selected'; |
|
| 744 | +} |
|
| 745 | +?>><?php echo _("Military"); ?></option> |
|
| 507 | 746 | </select> |
| 508 | 747 | </li> |
| 509 | 748 | <?php |
@@ -511,7 +750,10 @@ discard block |
||
| 511 | 750 | ?> |
| 512 | 751 | <li> |
| 513 | 752 | <?php echo _("Display flight with ident:"); ?> |
| 514 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
|
| 753 | + <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { |
|
| 754 | + print $_COOKIE['filter_ident']; |
|
| 755 | +} |
|
| 756 | +?>" /> |
|
| 515 | 757 | </li> |
| 516 | 758 | </ul> |
| 517 | 759 | </form> |
@@ -527,7 +769,10 @@ discard block |
||
| 527 | 769 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
| 528 | 770 | <form> |
| 529 | 771 | <ul> |
| 530 | - <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
| 772 | + <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') { |
|
| 773 | + print 'checked'; |
|
| 774 | +} |
|
| 775 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
| 531 | 776 | <li><?php echo _("Type:"); ?> |
| 532 | 777 | <select class="selectpicker" multiple onchange="sattypes(this);"> |
| 533 | 778 | <?php |
@@ -535,25 +780,45 @@ discard block |
||
| 535 | 780 | $types = $Satellite->get_tle_types(); |
| 536 | 781 | foreach ($types as $type) { |
| 537 | 782 | $type_name = $type['tle_type']; |
| 538 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation'; |
|
| 539 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System'; |
|
| 540 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System'; |
|
| 541 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational'; |
|
| 542 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational'; |
|
| 543 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System'; |
|
| 544 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System'; |
|
| 545 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue'; |
|
| 546 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring'; |
|
| 547 | - else if ($type_name == 'resource') $type_name = 'Earth Resources'; |
|
| 548 | - else if ($type_name == 'stations') $type_name = 'Space Stations'; |
|
| 549 | - else if ($type_name == 'geo') $type_name = 'Geostationary'; |
|
| 550 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio'; |
|
| 551 | - else if ($type_name == 'x-comm') $type_name = 'Experimental'; |
|
| 552 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm'; |
|
| 553 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science'; |
|
| 554 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military'; |
|
| 555 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
|
| 556 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
|
| 783 | + if ($type_name == 'musson') { |
|
| 784 | + $type_name = 'Russian LEO Navigation'; |
|
| 785 | + } else if ($type_name == 'nnss') { |
|
| 786 | + $type_name = 'Navi Navigation Satellite System'; |
|
| 787 | + } else if ($type_name == 'sbas') { |
|
| 788 | + $type_name = 'Satellite-Based Augmentation System'; |
|
| 789 | + } else if ($type_name == 'glo-ops') { |
|
| 790 | + $type_name = 'Glonass Operational'; |
|
| 791 | + } else if ($type_name == 'gps-ops') { |
|
| 792 | + $type_name = 'GPS Operational'; |
|
| 793 | + } else if ($type_name == 'argos') { |
|
| 794 | + $type_name = 'ARGOS Data Collection System'; |
|
| 795 | + } else if ($type_name == 'tdrss') { |
|
| 796 | + $type_name = 'Tracking and Data Relay Satellite System'; |
|
| 797 | + } else if ($type_name == 'sarsat') { |
|
| 798 | + $type_name = 'Search & Rescue'; |
|
| 799 | + } else if ($type_name == 'dmc') { |
|
| 800 | + $type_name = 'Disaster Monitoring'; |
|
| 801 | + } else if ($type_name == 'resource') { |
|
| 802 | + $type_name = 'Earth Resources'; |
|
| 803 | + } else if ($type_name == 'stations') { |
|
| 804 | + $type_name = 'Space Stations'; |
|
| 805 | + } else if ($type_name == 'geo') { |
|
| 806 | + $type_name = 'Geostationary'; |
|
| 807 | + } else if ($type_name == 'amateur') { |
|
| 808 | + $type_name = 'Amateur Radio'; |
|
| 809 | + } else if ($type_name == 'x-comm') { |
|
| 810 | + $type_name = 'Experimental'; |
|
| 811 | + } else if ($type_name == 'other-comm') { |
|
| 812 | + $type_name = 'Other Comm'; |
|
| 813 | + } else if ($type_name == 'science') { |
|
| 814 | + $type_name = 'Space & Earth Science'; |
|
| 815 | + } else if ($type_name == 'military') { |
|
| 816 | + $type_name = 'Miscellaneous Military'; |
|
| 817 | + } else if ($type_name == 'radar') { |
|
| 818 | + $type_name = 'Radar Calibration'; |
|
| 819 | + } else if ($type_name == 'tle-new') { |
|
| 820 | + $type_name = 'Last 30 days launches'; |
|
| 821 | + } |
|
| 557 | 822 | |
| 558 | 823 | if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
| 559 | 824 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |