@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | //waypoint plotting |
28 | 28 | $output .= '{"type": "Feature",'; |
29 | - $output .= '"properties": {'; |
|
29 | + $output .= '"properties": {'; |
|
30 | 30 | $output .= '"name": "'.str_replace('"',"'",$spotter_item['name']).'",'; |
31 | 31 | $output .= '"city": "'.$spotter_item['city'].'",'; |
32 | 32 | $output .= '"country": "'.$spotter_item['country'].'",'; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | $output .= '"homepage": "'.$spotter_item['home_link'].'",'; |
50 | 50 | $output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"'; |
51 | 51 | // $output .= '"photo": "'.$spotter_item['image_thumbnail'].'",'; |
52 | - $output .= '},'; |
|
53 | - $output .= '"geometry": {'; |
|
52 | + $output .= '},'; |
|
53 | + $output .= '"geometry": {'; |
|
54 | 54 | $output .= '"type": "Point",'; |
55 | 55 | $output .= '"coordinates": ['; |
56 | - $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
56 | + $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
57 | 57 | $output .= ']'; |
58 | - $output .= '}'; |
|
58 | + $output .= '}'; |
|
59 | 59 | $output .= '},'; |
60 | 60 | } |
61 | 61 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | header('Content-disposition: attachment; filename="atc.geojson"'); |
8 | 8 | } |
9 | 9 | header('Content-Type: text/javascript'); |
10 | -$ATC=new ATC(); |
|
10 | +$ATC = new ATC(); |
|
11 | 11 | if (isset($_GET['coord'])) |
12 | 12 | { |
13 | 13 | //$coords = explode(',',$_GET['coord']); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $output = '{"type": "FeatureCollection","features": ['; |
20 | 20 | if (!empty($spotter_array)) |
21 | 21 | { |
22 | - foreach($spotter_array as $spotter_item) |
|
22 | + foreach ($spotter_array as $spotter_item) |
|
23 | 23 | { |
24 | 24 | date_default_timezone_set('UTC'); |
25 | 25 | //waypoint plotting |
@@ -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(); |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<option></option>'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $airport_names = $tats->getAllAirportNames(); |
26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
26 | + if (empty($airport_names)) { |
|
27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
28 | + } |
|
27 | 29 | ksort($airport_names); |
28 | 30 | foreach($airport_names as $airport_name) |
29 | 31 | { |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airport'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
14 | 14 | |
15 | 15 | if (!empty($airport_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
17 | + $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
27 | 27 | ksort($airport_names); |
28 | - foreach($airport_names as $airport_name) |
|
28 | + foreach ($airport_names as $airport_name) |
|
29 | 29 | { |
30 | - if($airport == $airport_name['airport_icao']) |
|
30 | + if ($airport == $airport_name['airport_icao']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | include('airport-sub-menu.php'); |
59 | 59 | print '<div class="column">'; |
60 | 60 | print '<h2>'._("Most Common Routes").'</h2>'; |
61 | - print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
61 | + print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
62 | 62 | |
63 | 63 | $route_array = $Spotter->countAllRoutesByAirport($airport); |
64 | 64 | if (!empty($route_array)) |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | print '</thead>'; |
75 | 75 | print '<tbody>'; |
76 | 76 | $i = 1; |
77 | - foreach($route_array as $route_item) |
|
77 | + foreach ($route_array as $route_item) |
|
78 | 78 | { |
79 | 79 | print '<tr>'; |
80 | 80 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,55 +4,55 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | - //for the date manipulation into the query |
|
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | - $start_date = $_GET['start_date'].":00"; |
|
10 | - $end_date = $_GET['end_date'].":00"; |
|
11 | - $sql_date = $start_date.",".$end_date; |
|
12 | - } else if($_GET['start_date'] != ""){ |
|
13 | - $start_date = $_GET['start_date'].":00"; |
|
14 | - $sql_date = $start_date; |
|
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | - $sql_date = $end_date; |
|
18 | - } else $sql_date = ''; |
|
7 | + //for the date manipulation into the query |
|
8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | + $start_date = $_GET['start_date'].":00"; |
|
10 | + $end_date = $_GET['end_date'].":00"; |
|
11 | + $sql_date = $start_date.",".$end_date; |
|
12 | + } else if($_GET['start_date'] != ""){ |
|
13 | + $start_date = $_GET['start_date'].":00"; |
|
14 | + $sql_date = $start_date; |
|
15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | + $sql_date = $end_date; |
|
18 | + } else $sql_date = ''; |
|
19 | 19 | } else $sql_date = ''; |
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | - //for altitude manipulation |
|
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = $_GET['highest_altitude']; |
|
25 | - $start_altitude = $_GET['lowest_altitude']; |
|
26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = $_GET['highest_altitude']; |
|
29 | - $sql_altitude = $end_altitude; |
|
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | - $sql_altitude = $start_altitude; |
|
33 | - } else $sql_altitude = ''; |
|
22 | + //for altitude manipulation |
|
23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | + $end_altitude = $_GET['highest_altitude']; |
|
25 | + $start_altitude = $_GET['lowest_altitude']; |
|
26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | + } else if($_GET['highest_altitude'] != ""){ |
|
28 | + $end_altitude = $_GET['highest_altitude']; |
|
29 | + $sql_altitude = $end_altitude; |
|
30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | + $sql_altitude = $start_altitude; |
|
33 | + } else $sql_altitude = ''; |
|
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | 37 | if(!isset($_GET['limit'])) |
38 | 38 | { |
39 | - if (!isset($_GET['number_results'])) |
|
40 | - { |
|
41 | - $limit_start = 0; |
|
42 | - $limit_end = 25; |
|
43 | - $absolute_difference = 25; |
|
44 | - } else { |
|
45 | - if ($_GET['number_results'] > 1000){ |
|
46 | - $_GET['number_results'] = 1000; |
|
47 | - } |
|
48 | - $limit_start = 0; |
|
49 | - $limit_end = $_GET['number_results']; |
|
50 | - $absolute_difference = $_GET['number_results']; |
|
51 | - } |
|
39 | + if (!isset($_GET['number_results'])) |
|
40 | + { |
|
41 | + $limit_start = 0; |
|
42 | + $limit_end = 25; |
|
43 | + $absolute_difference = 25; |
|
44 | + } else { |
|
45 | + if ($_GET['number_results'] > 1000){ |
|
46 | + $_GET['number_results'] = 1000; |
|
47 | + } |
|
48 | + $limit_start = 0; |
|
49 | + $limit_end = $_GET['number_results']; |
|
50 | + $absolute_difference = $_GET['number_results']; |
|
51 | + } |
|
52 | 52 | } else { |
53 | - $limit_explode = explode(",", $_GET['limit']); |
|
54 | - $limit_start = $limit_explode[0]; |
|
55 | - $limit_end = $limit_explode[1]; |
|
53 | + $limit_explode = explode(",", $_GET['limit']); |
|
54 | + $limit_start = $limit_explode[0]; |
|
55 | + $limit_end = $limit_explode[1]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | 24 | $end_altitude = $_GET['highest_altitude']; |
25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | 28 | $end_altitude = $_GET['highest_altitude']; |
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) |
40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | $limit_end = 25; |
43 | 43 | $absolute_difference = 25; |
44 | 44 | } else { |
45 | - if ($_GET['number_results'] > 1000){ |
|
45 | + if ($_GET['number_results'] > 1000) { |
|
46 | 46 | $_GET['number_results'] = 1000; |
47 | 47 | } |
48 | 48 | $limit_start = 0; |
49 | 49 | $limit_end = $_GET['number_results']; |
50 | 50 | $absolute_difference = $_GET['number_results']; |
51 | 51 | } |
52 | -} else { |
|
52 | +} else { |
|
53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
54 | 54 | $limit_start = $limit_explode[0]; |
55 | 55 | $limit_end = $limit_explode[1]; |
@@ -69,30 +69,30 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
71 | 71 | else $sort = ''; |
72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
73 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
88 | -$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
88 | +$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
89 | 89 | |
90 | 90 | $i = 1; |
91 | 91 | //$output .= "oid;Line\n"; |
92 | 92 | $output = ''; |
93 | 93 | if (!empty($spotter_array)) |
94 | 94 | { |
95 | - foreach($spotter_array as $spotter_item) |
|
95 | + foreach ($spotter_array as $spotter_item) |
|
96 | 96 | { |
97 | 97 | if ($spotter_item['waypoints'] != '') { |
98 | 98 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
@@ -15,8 +15,12 @@ discard block |
||
15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | - } else $sql_date = ''; |
|
19 | -} else $sql_date = ''; |
|
18 | + } else { |
|
19 | + $sql_date = ''; |
|
20 | + } |
|
21 | + } else { |
|
22 | + $sql_date = ''; |
|
23 | +} |
|
20 | 24 | |
21 | 25 | if (isset($_GET['highest_altitude'])) { |
22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 36 | $sql_altitude = $start_altitude; |
33 | - } else $sql_altitude = ''; |
|
34 | -} else $sql_altitude = ''; |
|
37 | + } else { |
|
38 | + $sql_altitude = ''; |
|
39 | + } |
|
40 | + } else { |
|
41 | + $sql_altitude = ''; |
|
42 | +} |
|
35 | 43 | |
36 | 44 | //calculuation for the pagination |
37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
49 | 57 | $limit_end = $_GET['number_results']; |
50 | 58 | $absolute_difference = $_GET['number_results']; |
51 | 59 | } |
52 | -} else { |
|
60 | +} else { |
|
53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
54 | 62 | $limit_start = $limit_explode[0]; |
55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
67 | 75 | |
68 | 76 | header("Content-type: text/yaml"); |
69 | 77 | |
70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
71 | -else $sort = ''; |
|
78 | +if (isset($_GET['sort'])) { |
|
79 | + $sort = $_GET['sort']; |
|
80 | +} else { |
|
81 | + $sort = ''; |
|
82 | +} |
|
72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])){ |
|
6 | +if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | 29 | |
30 | - $departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING); |
|
31 | - $arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING); |
|
30 | + $departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING); |
|
31 | + $arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/route/'.$departure_airport.'/'.$arrival_airport; |
33 | 33 | if (isset($_GET['sort'])) { |
34 | 34 | $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, $limit_start.",".$absolute_difference, $_GET['sort']); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | if (!empty($spotter_array)) |
40 | 40 | { |
41 | - $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
41 | + $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
42 | 42 | require_once('header.php'); |
43 | 43 | print '<div class="info column">'; |
44 | 44 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | include('route-sub-menu.php'); |
50 | 50 | print '<div class="table column">'; |
51 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."),$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
51 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."), $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
52 | 52 | |
53 | 53 | include('table-output.php'); |
54 | 54 | print '<div class="pagination">'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | 6 | if (!isset($_GET['aircraft_type'])) { |
7 | - header('Location: '.$globalURL.'/aircraft'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/aircraft'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<option></option>'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $aircraft_types = $Stats->getAllAircraftTypes(); |
26 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
26 | + if (empty($aircraft_types)) { |
|
27 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | + } |
|
27 | 29 | foreach($aircraft_types as $aircrafttype) |
28 | 30 | { |
29 | 31 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('aircraft-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights from aircraft type <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights from aircraft type <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | 55 | |
56 | 56 | $aircraft_array = $Spotter->countAllAircraftRegistrationByAircraft($aircraft_type); |
57 | 57 | if (!empty($aircraft_array)) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($aircraft_array as $aircraft_item) |
|
71 | + foreach ($aircraft_array as $aircraft_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | 6 | if (!isset($_GET['aircraft_type'])) { |
7 | - header('Location: '.$globalURL.'/aircraft'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/aircraft'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<option></option>'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $aircraft_types = $Stats->getAllAircraftTypes(); |
26 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
26 | + if (empty($aircraft_types)) { |
|
27 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | + } |
|
27 | 29 | foreach($aircraft_types as $aircrafttype) |
28 | 30 | { |
29 | 31 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('aircraft-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Routes").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | 55 | |
56 | 56 | $route_array = $Spotter->countAllRoutesByAircraft($aircraft_type); |
57 | 57 | if (!empty($route_array)) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($route_array as $route_item) |
|
71 | + foreach ($route_array as $route_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $page_url = $globalURL.'/acars-archive'; |
10 | 10 | |
11 | -if(!isset($_GET['limit'])) |
|
11 | +if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
@@ -36,8 +36,12 @@ |
||
36 | 36 | if (!empty($spotter_array)) { |
37 | 37 | include('table-output.php'); |
38 | 38 | print '<div class="pagination">'; |
39 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">«'._("Previous Page").'</a>'; |
|
40 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'»</a>'; |
|
39 | + if ($limit_previous_1 >= 0) { |
|
40 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">«'._("Previous Page").'</a>'; |
|
41 | + } |
|
42 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
43 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'»</a>'; |
|
44 | + } |
|
41 | 45 | print '</div>'; |
42 | 46 | } |
43 | 47 | print '</div>'; |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | header('Content-Type: text/javascript'); |
18 | 18 | |
19 | 19 | |
20 | -$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
20 | +$polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
21 | 21 | $output = '{"type": "FeatureCollection","features": ['; |
22 | 22 | if (!empty($polar)) { |
23 | - foreach($polar as $eachpolar) { |
|
23 | + foreach ($polar as $eachpolar) { |
|
24 | 24 | $data = json_decode($eachpolar['source_data']); |
25 | 25 | $name = $eachpolar['source_name']; |
26 | 26 | $coord = $Location->getLocationInfobySourceName($name); |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | $initial_longitude = $globalCenterLongitude; |
34 | 34 | } |
35 | 35 | $first = ''; |
36 | - foreach($data as $value => $key) { |
|
37 | - $final_coord = $Common->getCoordfromDistanceBearing($initial_latitude,$initial_longitude,$value*22.5,$key); |
|
38 | - if ($first == '') $first = '['.round($final_coord['longitude'],5).','.round($final_coord['latitude'],5).']'; |
|
36 | + foreach ($data as $value => $key) { |
|
37 | + $final_coord = $Common->getCoordfromDistanceBearing($initial_latitude, $initial_longitude, $value*22.5, $key); |
|
38 | + if ($first == '') $first = '['.round($final_coord['longitude'], 5).','.round($final_coord['latitude'], 5).']'; |
|
39 | 39 | $output .= '['.$final_coord['longitude'].','.$final_coord['latitude'].'],'; |
40 | 40 | } |
41 | 41 | $output .= $first; |
42 | 42 | $output .= ']]}},'; |
43 | 43 | } |
44 | - $output = substr($output, 0, -1); |
|
44 | + $output = substr($output, 0, -1); |
|
45 | 45 | } |
46 | 46 | $output .= ']}'; |
47 | 47 | print $output; |
@@ -35,7 +35,9 @@ |
||
35 | 35 | $first = ''; |
36 | 36 | foreach($data as $value => $key) { |
37 | 37 | $final_coord = $Common->getCoordfromDistanceBearing($initial_latitude,$initial_longitude,$value*22.5,$key); |
38 | - if ($first == '') $first = '['.round($final_coord['longitude'],5).','.round($final_coord['latitude'],5).']'; |
|
38 | + if ($first == '') { |
|
39 | + $first = '['.round($final_coord['longitude'],5).','.round($final_coord['latitude'],5).']'; |
|
40 | + } |
|
39 | 41 | $output .= '['.$final_coord['longitude'].','.$final_coord['latitude'].'],'; |
40 | 42 | } |
41 | 43 | $output .= $first; |
@@ -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 | |
@@ -325,29 +325,29 @@ discard block |
||
325 | 325 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) |
326 | 326 | || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))) |
327 | 327 | || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
328 | - if ($from_archive) { |
|
329 | - $spotter_history_array = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
|
330 | - } else { |
|
331 | - $spotter_history_array = $SpotterLive->getAllLiveSpotterDataById($spotter_item['flightaware_id']); |
|
332 | - } |
|
333 | - $d = false; |
|
328 | + if ($from_archive) { |
|
329 | + $spotter_history_array = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
|
330 | + } else { |
|
331 | + $spotter_history_array = $SpotterLive->getAllLiveSpotterDataById($spotter_item['flightaware_id']); |
|
332 | + } |
|
333 | + $d = false; |
|
334 | 334 | foreach ($spotter_history_array as $key => $spotter_history) |
335 | 335 | { |
336 | - /* |
|
336 | + /* |
|
337 | 337 | if (abs($spotter_history['longitude']-$spotter_item['longitude']) > 200 || $d==true) { |
338 | 338 | if ($d == false) $d = true; |
339 | 339 | } else { |
340 | 340 | */ |
341 | 341 | $alt = round($spotter_history['altitude']/10)*10; |
342 | 342 | if (!isset($prev_alt) || $prev_alt != $alt) { |
343 | - if (isset($prev_alt)) { |
|
343 | + if (isset($prev_alt)) { |
|
344 | 344 | //$output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].','.$spotter_history['altitude'].']'; |
345 | 345 | $output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].', '.$spotter_history['altitude'].']'; |
346 | 346 | $output_history .= ']}},'; |
347 | 347 | $output .= $output_history; |
348 | - } |
|
349 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
350 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
348 | + } |
|
349 | + if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
350 | + else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
351 | 351 | } |
352 | 352 | $output_history .= '['; |
353 | 353 | $output_history .= $spotter_history['longitude'].', '; |
@@ -355,41 +355,41 @@ discard block |
||
355 | 355 | $output_history .= $spotter_history['altitude']*30.48; |
356 | 356 | $output_history .= '],'; |
357 | 357 | $prev_alt = $alt; |
358 | - //} |
|
358 | + //} |
|
359 | 359 | } |
360 | 360 | if (isset($output_history)) { |
361 | - $output_history = substr($output_history, 0, -1); |
|
362 | - $output_history .= ']}},'; |
|
363 | - $output .= $output_history; |
|
364 | - unset($prev_alt); |
|
365 | - unset($output_history); |
|
361 | + $output_history = substr($output_history, 0, -1); |
|
362 | + $output_history .= ']}},'; |
|
363 | + $output .= $output_history; |
|
364 | + unset($prev_alt); |
|
365 | + unset($output_history); |
|
366 | 366 | } |
367 | 367 | } |
368 | 368 | |
369 | 369 | 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))))) { |
370 | - $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
371 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
370 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
371 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
372 | 372 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
373 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
373 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
374 | 374 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
375 | 375 | //print_r($dairport); |
376 | 376 | //echo $spotter_item['departure_airport']; |
377 | 377 | if (isset($dairport[0]['latitude'])) { |
378 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
378 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
379 | 379 | } |
380 | - } |
|
381 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
380 | + } |
|
381 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
382 | 382 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
383 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
383 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
384 | 384 | //print_r($aairport); |
385 | 385 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
386 | 386 | if (isset($aairport[0]['latitude'])) { |
387 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
387 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
388 | 388 | } |
389 | - } |
|
390 | - $output_air .= ']}},'; |
|
391 | - $output .= $output_air; |
|
392 | - unset($output_air); |
|
389 | + } |
|
390 | + $output_air .= ']}},'; |
|
391 | + $output .= $output_air; |
|
392 | + unset($output_air); |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | $output = substr($output, 0, -1); |
@@ -25,22 +25,22 @@ discard block |
||
25 | 25 | $min = false; |
26 | 26 | $allhistory = false; |
27 | 27 | $filter['source'] = array(); |
28 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
29 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
30 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
31 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
32 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
33 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
34 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
35 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
36 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
28 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
29 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
30 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
31 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
32 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
33 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
34 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
35 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
36 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
37 | 37 | |
38 | 38 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
39 | 39 | $min = true; |
40 | 40 | } |
41 | 41 | |
42 | 42 | if (isset($_GET['ident'])) { |
43 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
43 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
44 | 44 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
45 | 45 | if (empty($spotter_array)) { |
46 | 46 | $from_archive = true; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | $allhistory = true; |
50 | 50 | } elseif (isset($_GET['flightaware_id'])) { |
51 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
51 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
52 | 52 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
53 | 53 | if (empty($spotter_array)) { |
54 | 54 | $from_archive = true; |
@@ -57,37 +57,37 @@ discard block |
||
57 | 57 | $allhistory = true; |
58 | 58 | } elseif (isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
59 | 59 | //if (isset($_GET['coord'])) { |
60 | - $coord = explode(',',$_GET['coord']); |
|
61 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
60 | + $coord = explode(',', $_GET['coord']); |
|
61 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
62 | 62 | |
63 | 63 | #} elseif (isset($globalMapPopup) && !$globalMapPopup) { |
64 | 64 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
65 | 65 | $from_archive = true; |
66 | 66 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
67 | 67 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
68 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
69 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
70 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
71 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
72 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
73 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
68 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
69 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
70 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
71 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
72 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
73 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
74 | 74 | } elseif ($min) { |
75 | 75 | $spotter_array = $SpotterLive->getMinLiveSpotterData($filter); |
76 | 76 | # $min = true; |
77 | 77 | } else { |
78 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
78 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if (!empty($spotter_array)) { |
82 | 82 | if (isset($_GET['archive'])) { |
83 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
83 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
84 | 84 | } else { |
85 | 85 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
86 | 86 | } |
87 | 87 | if ($flightcnt == '') $flightcnt = 0; |
88 | 88 | } else $flightcnt = 0; |
89 | 89 | |
90 | -$sqltime = round(microtime(true)-$begintime,2); |
|
90 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
91 | 91 | |
92 | 92 | $j = 0; |
93 | 93 | $prev_flightaware_id = ''; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if (!empty($spotter_array) && is_array($spotter_array)) |
103 | 103 | { |
104 | 104 | $output .= '"features": ['; |
105 | - foreach($spotter_array as $spotter_item) |
|
105 | + foreach ($spotter_array as $spotter_item) |
|
106 | 106 | { |
107 | 107 | $j++; |
108 | 108 | date_default_timezone_set('UTC'); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
154 | 154 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
155 | 155 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
156 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
156 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
157 | 157 | } elseif (isset($spotter_item['aircraft_type'])) { |
158 | 158 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
159 | 159 | } elseif (!$min) { |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
222 | 222 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
223 | 223 | |
224 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
225 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
224 | + if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
225 | + else $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
226 | 226 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
227 | 227 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
228 | 228 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | if (!$min) $output .= '"image": "'.$image.'",'; |
232 | 232 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
233 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
233 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
234 | 234 | } |
235 | 235 | if (isset($spotter_item['image_source_website'])) { |
236 | 236 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
253 | 253 | } |
254 | 254 | if (isset($spotter_item['acars'])) { |
255 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
255 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
256 | 256 | } |
257 | 257 | // type when not aircraft ? |
258 | 258 | if ($compress) $output .= '"t": "aircraft"'; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id'])))) { |
326 | 326 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id']))) || (isset($_GET['history']) && $_GET['history'] == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
327 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
327 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
328 | 328 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
329 | 329 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) |
330 | 330 | || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))) |
@@ -354,9 +354,9 @@ discard block |
||
354 | 354 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
355 | 355 | } |
356 | 356 | $output_history .= '['; |
357 | - $output_history .= $spotter_history['longitude'].', '; |
|
358 | - $output_history .= $spotter_history['latitude'].', '; |
|
359 | - $output_history .= $spotter_history['altitude']*30.48; |
|
357 | + $output_history .= $spotter_history['longitude'].', '; |
|
358 | + $output_history .= $spotter_history['latitude'].', '; |
|
359 | + $output_history .= $spotter_history['altitude']*30.48; |
|
360 | 360 | $output_history .= '],'; |
361 | 361 | $prev_alt = $alt; |
362 | 362 | //} |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | //$output .= ']}}'; |
401 | 401 | $output .= ']'; |
402 | 402 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
403 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
403 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
404 | 404 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
405 | 405 | $output .= '"fc": "'.$j.'"'; |
406 | 406 | } else { |
@@ -18,22 +18,43 @@ discard block |
||
18 | 18 | } |
19 | 19 | header('Content-Type: text/javascript'); |
20 | 20 | |
21 | -if (!isset($globalJsonCompress)) $compress = true; |
|
22 | -else $compress = $globalJsonCompress; |
|
21 | +if (!isset($globalJsonCompress)) { |
|
22 | + $compress = true; |
|
23 | +} else { |
|
24 | + $compress = $globalJsonCompress; |
|
25 | +} |
|
23 | 26 | |
24 | 27 | $from_archive = false; |
25 | 28 | $min = false; |
26 | 29 | $allhistory = false; |
27 | 30 | $filter['source'] = array(); |
28 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
29 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
30 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
31 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
32 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
33 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
34 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
35 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
36 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
31 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
32 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
33 | +} |
|
34 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
35 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
36 | +} |
|
37 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
38 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
39 | +} |
|
40 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
41 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
42 | +} |
|
43 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
44 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
45 | +} |
|
46 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
47 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
48 | +} |
|
49 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
50 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
51 | +} |
|
52 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
53 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
54 | +} |
|
55 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
56 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
57 | +} |
|
37 | 58 | |
38 | 59 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
39 | 60 | $min = true; |
@@ -84,8 +105,12 @@ discard block |
||
84 | 105 | } else { |
85 | 106 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
86 | 107 | } |
87 | - if ($flightcnt == '') $flightcnt = 0; |
|
88 | -} else $flightcnt = 0; |
|
108 | + if ($flightcnt == '') { |
|
109 | + $flightcnt = 0; |
|
110 | + } |
|
111 | + } else { |
|
112 | + $flightcnt = 0; |
|
113 | +} |
|
89 | 114 | |
90 | 115 | $sqltime = round(microtime(true)-$begintime,2); |
91 | 116 | |
@@ -94,8 +119,11 @@ discard block |
||
94 | 119 | |
95 | 120 | $output = '{'; |
96 | 121 | $output .= '"type": "FeatureCollection",'; |
97 | - if ($min) $output .= '"minimal": "true",'; |
|
98 | - else $output .= '"minimal": "false",'; |
|
122 | + if ($min) { |
|
123 | + $output .= '"minimal": "true",'; |
|
124 | + } else { |
|
125 | + $output .= '"minimal": "false",'; |
|
126 | + } |
|
99 | 127 | $output .= '"fc": "'.$flightcnt.'",'; |
100 | 128 | $output .= '"sqt": "'.$sqltime.'",'; |
101 | 129 | |
@@ -132,11 +160,16 @@ discard block |
||
132 | 160 | //$output .= '"sqt": "'.$sqltime.'",'; |
133 | 161 | $output .= '"id": "'.$spotter_item['flightaware_id'].'",'; |
134 | 162 | $output .= '"properties": {'; |
135 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
136 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
163 | + if ($compress) { |
|
164 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
165 | + } else { |
|
166 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
167 | + } |
|
137 | 168 | $output .= '"fc": "'.$flightcnt.'",'; |
138 | 169 | $output .= '"sqt": "'.$sqltime.'",'; |
139 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
170 | + if (isset($begindate)) { |
|
171 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
172 | + } |
|
140 | 173 | |
141 | 174 | /* |
142 | 175 | if ($min) $output .= '"minimal": "true",'; |
@@ -144,13 +177,21 @@ discard block |
||
144 | 177 | */ |
145 | 178 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
146 | 179 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
147 | - if ($compress) $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
148 | - else $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
180 | + if ($compress) { |
|
181 | + $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
182 | + } else { |
|
183 | + $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
184 | + } |
|
149 | 185 | } else { |
150 | - if ($compress) $output .= '"c": "NA",'; |
|
151 | - else $output .= '"callsign": "NA",'; |
|
186 | + if ($compress) { |
|
187 | + $output .= '"c": "NA",'; |
|
188 | + } else { |
|
189 | + $output .= '"callsign": "NA",'; |
|
190 | + } |
|
191 | + } |
|
192 | + if (isset($spotter_item['registration'])) { |
|
193 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
152 | 194 | } |
153 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
154 | 195 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
155 | 196 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
156 | 197 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -163,20 +204,31 @@ discard block |
||
163 | 204 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
164 | 205 | } |
165 | 206 | if (!isset($spotter_item['aircraft_shadow'])) { |
166 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
167 | - else { |
|
207 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
208 | + $spotter_item['aircraft_shadow'] = ''; |
|
209 | + } else { |
|
168 | 210 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
169 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
170 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
171 | - else $spotter_item['aircraft_shadow'] = ''; |
|
211 | + if (count($aircraft_info) > 0) { |
|
212 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
213 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
214 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
215 | + } else { |
|
216 | + $spotter_item['aircraft_shadow'] = ''; |
|
217 | + } |
|
172 | 218 | } |
173 | 219 | } |
174 | 220 | if ($spotter_item['aircraft_shadow'] == '') { |
175 | - if ($compress) $output .= '"as": "default.png",'; |
|
176 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
221 | + if ($compress) { |
|
222 | + $output .= '"as": "default.png",'; |
|
223 | + } else { |
|
224 | + $output .= '"aircraft_shadow": "default.png",'; |
|
225 | + } |
|
177 | 226 | } else { |
178 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
179 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
227 | + if ($compress) { |
|
228 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
229 | + } else { |
|
230 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
231 | + } |
|
180 | 232 | } |
181 | 233 | if (isset($spotter_item['airline_name'])) { |
182 | 234 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -184,8 +236,11 @@ discard block |
||
184 | 236 | $output .= '"airline_name": "NA",'; |
185 | 237 | } |
186 | 238 | if (isset($spotter_item['departure_airport'])) { |
187 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
188 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
239 | + if ($compress) { |
|
240 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
241 | + } else { |
|
242 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
243 | + } |
|
189 | 244 | } |
190 | 245 | if (isset($spotter_item['departure_airport_city'])) { |
191 | 246 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -197,8 +252,11 @@ discard block |
||
197 | 252 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
198 | 253 | } |
199 | 254 | if (isset($spotter_item['arrival_airport'])) { |
200 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
201 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
255 | + if ($compress) { |
|
256 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
257 | + } else { |
|
258 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
259 | + } |
|
202 | 260 | } |
203 | 261 | if (isset($spotter_item['arrival_airport_city'])) { |
204 | 262 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -216,19 +274,30 @@ discard block |
||
216 | 274 | $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
217 | 275 | } |
218 | 276 | |
219 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
220 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
221 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
222 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
277 | + if ($compress) { |
|
278 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
279 | + } else { |
|
280 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
281 | + } |
|
282 | + if ($compress) { |
|
283 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
284 | + } else { |
|
285 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
286 | + } |
|
223 | 287 | |
224 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
225 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
288 | + if (isset($archivespeed)) { |
|
289 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
290 | + } else { |
|
291 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
292 | + } |
|
226 | 293 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
227 | 294 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
228 | 295 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
229 | 296 | //$output .= '"nextlatlon": ['.$nextcoord['longitude'].','.$nextcoord['latitude'].'],'; |
230 | 297 | |
231 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
298 | + if (!$min) { |
|
299 | + $output .= '"image": "'.$image.'",'; |
|
300 | + } |
|
232 | 301 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
233 | 302 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
234 | 303 | } |
@@ -236,8 +305,11 @@ discard block |
||
236 | 305 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
237 | 306 | } |
238 | 307 | if (isset($spotter_item['squawk'])) { |
239 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
240 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
308 | + if ($compress) { |
|
309 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
310 | + } else { |
|
311 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
312 | + } |
|
241 | 313 | } |
242 | 314 | if (isset($spotter_item['squawk_usage'])) { |
243 | 315 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -255,8 +327,11 @@ discard block |
||
255 | 327 | $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
256 | 328 | } |
257 | 329 | // type when not aircraft ? |
258 | - if ($compress) $output .= '"t": "aircraft"'; |
|
259 | - else $output .= '"type": "aircraft"'; |
|
330 | + if ($compress) { |
|
331 | + $output .= '"t": "aircraft"'; |
|
332 | + } else { |
|
333 | + $output .= '"type": "aircraft"'; |
|
334 | + } |
|
260 | 335 | $output .= '},'; |
261 | 336 | $output .= '"geometry": {'; |
262 | 337 | $output .= '"type": "Point",'; |
@@ -325,7 +400,9 @@ discard block |
||
325 | 400 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id'])))) { |
326 | 401 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id']))) || (isset($_GET['history']) && $_GET['history'] == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
327 | 402 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
328 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
403 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
404 | + $history = $_COOKIE['history']; |
|
405 | + } |
|
329 | 406 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) |
330 | 407 | || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))) |
331 | 408 | || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
@@ -350,8 +427,11 @@ discard block |
||
350 | 427 | $output_history .= ']}},'; |
351 | 428 | $output .= $output_history; |
352 | 429 | } |
353 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
354 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
430 | + if ($compress) { |
|
431 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
432 | + } else { |
|
433 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
434 | + } |
|
355 | 435 | } |
356 | 436 | $output_history .= '['; |
357 | 437 | $output_history .= $spotter_history['longitude'].', '; |
@@ -401,7 +481,9 @@ discard block |
||
401 | 481 | $output .= ']'; |
402 | 482 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
403 | 483 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
404 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
484 | + if (isset($begindate)) { |
|
485 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
486 | + } |
|
405 | 487 | $output .= '"fc": "'.$j.'"'; |
406 | 488 | } else { |
407 | 489 | $output .= '"features": '; |