@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['country'])) { |
| 6 | - header('Location: '.$globalURL.'/country'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/country'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | function drawChart() { |
| 62 | 62 | var data = google.visualization.arrayToDataTable([ |
| 63 | 63 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 64 | - $hour_data = ''; |
|
| 64 | + $hour_data = ''; |
|
| 65 | 65 | foreach($hour_array as $hour_item) |
| 66 | 66 | { |
| 67 | 67 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['country'])) { |
| 6 | - header('Location: '.$globalURL.'/country'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/country'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -11,10 +11,10 @@ discard block |
||
| 11 | 11 | $Common = new Common(); |
| 12 | 12 | |
| 13 | 13 | if (isset($_GET['download'])) { |
| 14 | - if ($_GET['download'] == "true") |
|
| 15 | - { |
|
| 14 | + if ($_GET['download'] == "true") |
|
| 15 | + { |
|
| 16 | 16 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
| 17 | - } |
|
| 17 | + } |
|
| 18 | 18 | } |
| 19 | 19 | header('Content-Type: text/javascript'); |
| 20 | 20 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | //waypoint plotting |
| 116 | - /* |
|
| 116 | + /* |
|
| 117 | 117 | $output .= '{'; |
| 118 | 118 | $output .= '"type": "Feature",'; |
| 119 | 119 | $output .= '"properties": {'; |
@@ -343,29 +343,29 @@ discard block |
||
| 343 | 343 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) |
| 344 | 344 | || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))) |
| 345 | 345 | || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
| 346 | - if ($from_archive) { |
|
| 347 | - $spotter_history_array = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
|
| 348 | - } else { |
|
| 349 | - $spotter_history_array = $SpotterLive->getAllLiveSpotterDataById($spotter_item['flightaware_id']); |
|
| 350 | - } |
|
| 351 | - $d = false; |
|
| 346 | + if ($from_archive) { |
|
| 347 | + $spotter_history_array = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
|
| 348 | + } else { |
|
| 349 | + $spotter_history_array = $SpotterLive->getAllLiveSpotterDataById($spotter_item['flightaware_id']); |
|
| 350 | + } |
|
| 351 | + $d = false; |
|
| 352 | 352 | foreach ($spotter_history_array as $key => $spotter_history) |
| 353 | 353 | { |
| 354 | - /* |
|
| 354 | + /* |
|
| 355 | 355 | if (abs($spotter_history['longitude']-$spotter_item['longitude']) > 200 || $d==true) { |
| 356 | 356 | if ($d == false) $d = true; |
| 357 | 357 | } else { |
| 358 | 358 | */ |
| 359 | 359 | $alt = round($spotter_history['altitude']/10)*10; |
| 360 | 360 | if (!isset($prev_alt) || $prev_alt != $alt) { |
| 361 | - if (isset($prev_alt)) { |
|
| 361 | + if (isset($prev_alt)) { |
|
| 362 | 362 | //$output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].','.$spotter_history['altitude'].']'; |
| 363 | 363 | $output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].']'; |
| 364 | 364 | $output_history .= ']}},'; |
| 365 | 365 | $output .= $output_history; |
| 366 | - } |
|
| 367 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 368 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 366 | + } |
|
| 367 | + if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 368 | + else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 369 | 369 | } |
| 370 | 370 | $output_history .= '['; |
| 371 | 371 | $output_history .= $spotter_history['longitude'].', '; |
@@ -373,41 +373,41 @@ discard block |
||
| 373 | 373 | //$output_history .= $spotter_history['altitude']; |
| 374 | 374 | $output_history .= '],'; |
| 375 | 375 | $prev_alt = $alt; |
| 376 | - //} |
|
| 376 | + //} |
|
| 377 | 377 | } |
| 378 | 378 | if (isset($output_history)) { |
| 379 | - $output_history = substr($output_history, 0, -1); |
|
| 380 | - $output_history .= ']}},'; |
|
| 381 | - $output .= $output_history; |
|
| 382 | - unset($prev_alt); |
|
| 383 | - unset($output_history); |
|
| 379 | + $output_history = substr($output_history, 0, -1); |
|
| 380 | + $output_history .= ']}},'; |
|
| 381 | + $output .= $output_history; |
|
| 382 | + unset($prev_alt); |
|
| 383 | + unset($output_history); |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | if (isset($history) && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
| 388 | - $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 389 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
| 388 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 389 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
| 390 | 390 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
| 391 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
| 391 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
| 392 | 392 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
| 393 | 393 | //print_r($dairport); |
| 394 | 394 | //echo $spotter_item['departure_airport']; |
| 395 | 395 | if (isset($dairport[0]['latitude'])) { |
| 396 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
| 396 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
| 397 | 397 | } |
| 398 | - } |
|
| 399 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 398 | + } |
|
| 399 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 400 | 400 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
| 401 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 401 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 402 | 402 | //print_r($aairport); |
| 403 | 403 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 404 | 404 | if (isset($aairport[0]['latitude'])) { |
| 405 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
| 405 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
| 406 | + } |
|
| 406 | 407 | } |
| 407 | - } |
|
| 408 | - $output_air .= ']}},'; |
|
| 409 | - $output .= $output_air; |
|
| 410 | - unset($output_air); |
|
| 408 | + $output_air .= ']}},'; |
|
| 409 | + $output .= $output_air; |
|
| 410 | + unset($output_air); |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | $output = substr($output, 0, -1); |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['aircraft_type'])) { |
| 6 | - header('Location: '.$globalURL.'/aircraft'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/aircraft'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['airline'])) { |
| 6 | - header('Location: '.$globalURL.'/airline'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/airline'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['country'])) { |
| 6 | - header('Location: '.$globalURL.'/country'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/country'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | function drawChart6() { |
| 63 | 63 | var data = google.visualization.arrayToDataTable([ |
| 64 | 64 | ["Hour","Altitude","Speed"], '; |
| 65 | - $altitude_data = ''; |
|
| 65 | + $altitude_data = ''; |
|
| 66 | 66 | foreach($all_data as $data) |
| 67 | 67 | { |
| 68 | 68 | $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['airport'])) { |
| 6 | - header('Location: '.$globalURL.'/airport'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/airport'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 6 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |