@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | $page_url = $globalURL.'/tools-metar'; |
12 | 12 | |
13 | -$message = filter_input(INPUT_POST,'metar_message',FILTER_SANITIZE_STRING); |
|
13 | +$message = filter_input(INPUT_POST, 'metar_message', FILTER_SANITIZE_STRING); |
|
14 | 14 | |
15 | 15 | print '<div class="info column">'; |
16 | 16 | print '<h1>'._("Parse METAR messages").'</h1>'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | print '<b>'._("Dew point:").'</b> '.$metar_parse['dew'].' °C'." "; |
72 | 72 | } |
73 | 73 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
74 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
74 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
75 | 75 | print '<b>'._("Humidity:").'</b> '.$humidity.'%'." "; |
76 | 76 | } |
77 | 77 | if (isset($metar_parse['QNH'])) { |
@@ -23,7 +23,9 @@ discard block |
||
23 | 23 | print '<fieldset class="form-group">'; |
24 | 24 | print '<label for="metar_message">'._("METAR Message").'</label>'; |
25 | 25 | print '<textarea class="form-control" name="metar_message" id="metar_message" rows="5">'; |
26 | -if ($message != '') print $message; |
|
26 | +if ($message != '') { |
|
27 | + print $message; |
|
28 | +} |
|
27 | 29 | print '</textarea>'; |
28 | 30 | print '</fieldset>'; |
29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -59,7 +61,9 @@ discard block |
||
59 | 61 | if (isset($metar_parse['cloud'])) { |
60 | 62 | print '<b>'._("Cloud:").'</b> '; |
61 | 63 | foreach ($metar_parse['cloud'] as $key => $cloud) { |
62 | - if ($key > 0) print ' / '; |
|
64 | + if ($key > 0) { |
|
65 | + print ' / '; |
|
66 | + } |
|
63 | 67 | print $cloud['type'].' at '.$cloud['level'].' m'; |
64 | 68 | } |
65 | 69 | print " "; |
@@ -4,55 +4,55 @@ discard block |
||
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); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | print '<subtitle>The latest airplanes</subtitle>'; |
99 | 99 | print '<updated>'.$date.'</updated>'; |
100 | 100 | print '<author>'; |
101 | - print '<name>FlightAirMap</name>'; |
|
102 | - print '<email>[email protected]</email>'; |
|
101 | + print '<name>FlightAirMap</name>'; |
|
102 | + print '<email>[email protected]</email>'; |
|
103 | 103 | print '</author>'; |
104 | 104 | print '<id>FlightAirMap</id>'; |
105 | 105 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | |
111 | 111 | |
112 | 112 | print '<entry>'; |
113 | - print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>'; |
|
114 | - print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>'; |
|
115 | - print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>'; |
|
116 | - print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>'; |
|
117 | - print '<updated>'.$date.'</updated>'; |
|
118 | - if ($spotter_item['waypoints'] != "") |
|
119 | - { |
|
120 | - print '<georss:where>'; |
|
113 | + print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>'; |
|
114 | + print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>'; |
|
115 | + print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>'; |
|
116 | + print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>'; |
|
117 | + print '<updated>'.$date.'</updated>'; |
|
118 | + if ($spotter_item['waypoints'] != "") |
|
119 | + { |
|
120 | + print '<georss:where>'; |
|
121 | 121 | print '<gml:LineString>'; |
122 | 122 | print '<gml:posList>'; |
123 | 123 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | foreach ($waypoint_pieces as $waypoint_coordinate) |
127 | 127 | { |
128 | - print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' '; |
|
128 | + print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' '; |
|
129 | 129 | |
130 | 130 | } |
131 | 131 | print '</gml:posList>'; |
@@ -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]; |
@@ -72,23 +72,23 @@ discard block |
||
72 | 72 | |
73 | 73 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
74 | 74 | else $sort = ''; |
75 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
76 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
77 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
78 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
79 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
80 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
81 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
82 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
83 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
84 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
85 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
86 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
87 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
88 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
89 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
90 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
91 | -$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,''); |
|
75 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
76 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
77 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
78 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
79 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
80 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
81 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
82 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
83 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
84 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
85 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
86 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
87 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
88 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
89 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
90 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
91 | +$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, ''); |
|
92 | 92 | |
93 | 93 | print '<?xml version="1.0" encoding="UTF-8" ?>'; |
94 | 94 | print '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | if (!empty($spotter_array)) |
107 | 107 | { |
108 | - foreach($spotter_array as $spotter_item) |
|
108 | + foreach ($spotter_array as $spotter_item) |
|
109 | 109 | { |
110 | 110 | |
111 | 111 |
@@ -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); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | <?php |
333 | 333 | if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
334 | 334 | else $getZoom = '7'; |
335 | - ?> |
|
335 | + ?> |
|
336 | 336 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
337 | 337 | if (typeof airportsLayer != 'undefined') { |
338 | 338 | if (map.hasLayer(airportsLayer) == true) { |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | update_locationsLayer(); |
486 | 486 | |
487 | 487 | <?php |
488 | - if (!isset($ident) && !isset($flightaware_id)) { |
|
488 | + if (!isset($ident) && !isset($flightaware_id)) { |
|
489 | 489 | ?> |
490 | 490 | |
491 | 491 | var info = L.control(); |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | |
507 | 507 | |
508 | 508 | <?php |
509 | - } |
|
509 | + } |
|
510 | 510 | ?> |
511 | 511 | |
512 | 512 | <?php |
513 | - if (isset($_GET['archive'])) { |
|
513 | + if (isset($_GET['archive'])) { |
|
514 | 514 | ?> |
515 | 515 | var archive = L.control(); |
516 | 516 | archive.onAdd = function (map) { |
@@ -529,12 +529,12 @@ discard block |
||
529 | 529 | }; |
530 | 530 | archive.addTo(map); |
531 | 531 | <?php |
532 | - } |
|
532 | + } |
|
533 | 533 | ?> |
534 | 534 | |
535 | 535 | |
536 | 536 | <?php |
537 | - //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
537 | + //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
538 | 538 | ?> |
539 | 539 | var showdetails = L.control(); |
540 | 540 | showdetails.onAdd = function (map) { |
@@ -1016,15 +1016,15 @@ discard block |
||
1016 | 1016 | if (map.getZoom() > 7) { |
1017 | 1017 | var style = { |
1018 | 1018 | <?php |
1019 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1019 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1020 | 1020 | ?> |
1021 | 1021 | "color": "#1a3151", |
1022 | 1022 | <?php |
1023 | - } else { |
|
1023 | + } else { |
|
1024 | 1024 | ?> |
1025 | 1025 | "color": getAltitudeColor(altitude), |
1026 | 1026 | <?php |
1027 | - } |
|
1027 | + } |
|
1028 | 1028 | ?> |
1029 | 1029 | "weight": 3, |
1030 | 1030 | "opacity": 1 |
@@ -1034,15 +1034,15 @@ discard block |
||
1034 | 1034 | } else { |
1035 | 1035 | var style = { |
1036 | 1036 | <?php |
1037 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1037 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1038 | 1038 | ?> |
1039 | 1039 | "color": "#1a3151", |
1040 | 1040 | <?php |
1041 | - } else { |
|
1041 | + } else { |
|
1042 | 1042 | ?> |
1043 | 1043 | "color": getAltitudeColor(altitude), |
1044 | 1044 | <?php |
1045 | - } |
|
1045 | + } |
|
1046 | 1046 | ?> |
1047 | 1047 | "weight": 2, |
1048 | 1048 | "opacity": 1 |
@@ -1054,15 +1054,15 @@ discard block |
||
1054 | 1054 | if (map.getZoom() > 7) { |
1055 | 1055 | var style = { |
1056 | 1056 | <?php |
1057 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1057 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1058 | 1058 | ?> |
1059 | 1059 | "color": "#1a3151", |
1060 | 1060 | <?php |
1061 | - } else { |
|
1061 | + } else { |
|
1062 | 1062 | ?> |
1063 | 1063 | "color": getAltitudeColor(altitude), |
1064 | 1064 | <?php |
1065 | - } |
|
1065 | + } |
|
1066 | 1066 | ?> |
1067 | 1067 | "weight": 3, |
1068 | 1068 | "opacity": 0.6 |
@@ -1072,15 +1072,15 @@ discard block |
||
1072 | 1072 | } else { |
1073 | 1073 | var style = { |
1074 | 1074 | <?php |
1075 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1075 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
1076 | 1076 | ?> |
1077 | 1077 | "color": "#1a3151", |
1078 | 1078 | <?php |
1079 | - } else { |
|
1079 | + } else { |
|
1080 | 1080 | ?> |
1081 | 1081 | "color": getAltitudeColor(altitude), |
1082 | 1082 | <?php |
1083 | - } |
|
1083 | + } |
|
1084 | 1084 | ?> |
1085 | 1085 | "weight": 2, |
1086 | 1086 | "opacity": 0.6 |
@@ -1090,21 +1090,21 @@ discard block |
||
1090 | 1090 | } |
1091 | 1091 | } |
1092 | 1092 | <?php |
1093 | - } else { |
|
1094 | - ?> |
|
1093 | + } else { |
|
1094 | + ?> |
|
1095 | 1095 | if (map.getZoom() > 7) { |
1096 | 1096 | var style = { |
1097 | 1097 | <?php |
1098 | 1098 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
1099 | - ?> |
|
1099 | + ?> |
|
1100 | 1100 | "color": "#1a3151", |
1101 | 1101 | <?php |
1102 | 1102 | } else { |
1103 | - ?> |
|
1103 | + ?> |
|
1104 | 1104 | "color": getAltitudeColor(altitude), |
1105 | 1105 | <?php |
1106 | 1106 | } |
1107 | - ?> |
|
1107 | + ?> |
|
1108 | 1108 | "weight": 3, |
1109 | 1109 | "opacity": 0.6 |
1110 | 1110 | }; |
@@ -1114,15 +1114,15 @@ discard block |
||
1114 | 1114 | var style = { |
1115 | 1115 | <?php |
1116 | 1116 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
1117 | - ?> |
|
1117 | + ?> |
|
1118 | 1118 | "color": "#1a3151", |
1119 | 1119 | <?php |
1120 | 1120 | } else { |
1121 | - ?> |
|
1121 | + ?> |
|
1122 | 1122 | "color": getAltitudeColor(altitude), |
1123 | 1123 | <?php |
1124 | 1124 | } |
1125 | - ?> |
|
1125 | + ?> |
|
1126 | 1126 | "weight": 2, |
1127 | 1127 | "opacity": 0.6 |
1128 | 1128 | }; |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | layer_data.addLayer(layer); |
1131 | 1131 | } |
1132 | 1132 | <?php |
1133 | - } |
|
1133 | + } |
|
1134 | 1134 | ?> |
1135 | 1135 | } |
1136 | 1136 | } |
@@ -1190,10 +1190,10 @@ discard block |
||
1190 | 1190 | |
1191 | 1191 | |
1192 | 1192 | <?php |
1193 | - // Add support for custom json via $globalMapJson |
|
1194 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
1193 | + // Add support for custom json via $globalMapJson |
|
1194 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
1195 | 1195 | foreach ($globalMapJson as $json) { |
1196 | - if (isset($json['url'])) { |
|
1196 | + if (isset($json['url'])) { |
|
1197 | 1197 | ?> |
1198 | 1198 | update_genLayer('<?php print $json['url']; ?>'); |
1199 | 1199 | <?php |
@@ -1202,9 +1202,9 @@ discard block |
||
1202 | 1202 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
1203 | 1203 | <?php |
1204 | 1204 | } |
1205 | - } |
|
1205 | + } |
|
1206 | + } |
|
1206 | 1207 | } |
1207 | - } |
|
1208 | 1208 | |
1209 | 1209 | ?> |
1210 | 1210 |
@@ -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 | |
27 | 27 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | <?php |
77 | 77 | } |
78 | 78 | if (isset($_GET['ident'])) { |
79 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
79 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
80 | 80 | } |
81 | 81 | if (isset($_GET['flightaware_id'])) { |
82 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
82 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
83 | 83 | } |
84 | 84 | if (isset($_GET['latitude'])) { |
85 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
85 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
86 | 86 | } |
87 | 87 | if (isset($_GET['longitude'])) { |
88 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
88 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
89 | 89 | } |
90 | 90 | ?> |
91 | 91 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | || navigator.userAgent.match(/BlackBerry/i) |
121 | 121 | || navigator.userAgent.match(/Windows Phone/i)) |
122 | 122 | { |
123 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
123 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
124 | 124 | } else { |
125 | 125 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
126 | 126 | } |
@@ -520,10 +520,10 @@ discard block |
||
520 | 520 | }; |
521 | 521 | archive.update = function (props) { |
522 | 522 | if (typeof props != 'undefined') { |
523 | - //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>'; |
|
524 | - 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>'; |
|
523 | + //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>'; |
|
524 | + 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>'; |
|
525 | 525 | } else { |
526 | - 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>'; |
|
526 | + 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>'; |
|
527 | 527 | } |
528 | 528 | |
529 | 529 | }; |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | <?php |
725 | 725 | } else { |
726 | 726 | ?> |
727 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
727 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
728 | 728 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
729 | 729 | <?php |
730 | 730 | } |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | iconAnchor: [<?php print $globalAircraftSize/2; ?>, <?php print $globalAircraftSize; ?>], |
740 | 740 | shadowUrl: iconURLShadowpath, |
741 | 741 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
742 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
742 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
743 | 743 | }) |
744 | 744 | }) |
745 | 745 | <?php |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | <?php |
770 | 770 | } else { |
771 | 771 | ?> |
772 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
772 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
773 | 773 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
774 | 774 | <?php |
775 | 775 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | <?php |
814 | 814 | } else { |
815 | 815 | ?> |
816 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
816 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
817 | 817 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
818 | 818 | <?php |
819 | 819 | } |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | $('.button').tooltip({ placement: 'right' }); |
1180 | 1180 | |
1181 | 1181 | <?php |
1182 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) ) { |
|
1182 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
1183 | 1183 | ?> |
1184 | 1184 | update_atcLayer(); |
1185 | 1185 | setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
@@ -1392,12 +1392,12 @@ discard block |
||
1392 | 1392 | airs.push(air.value); |
1393 | 1393 | } |
1394 | 1394 | } |
1395 | - document.cookie = 'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1395 | + document.cookie = 'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1396 | 1396 | } |
1397 | 1397 | function airlinestype(selectObj) { |
1398 | 1398 | var idx = selectObj.selectedIndex; |
1399 | 1399 | var airtype = selectObj.options[idx].value; |
1400 | - document.cookie = 'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1400 | + document.cookie = 'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1401 | 1401 | } |
1402 | 1402 | function sources(selectObj) { |
1403 | 1403 | var sources = [], source; |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | } |
1409 | 1409 | } |
1410 | 1410 | //document.cookie = 'Sources='+sources.join()+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1411 | - document.cookie = 'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1411 | + document.cookie = 'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | function iconColor(color) { |
@@ -1427,23 +1427,23 @@ discard block |
||
1427 | 1427 | |
1428 | 1428 | function clickVATSIM(cb) { |
1429 | 1429 | //document.cookie = 'ShowVATSIM='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1430 | - document.cookie = '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=/' |
|
1430 | + document.cookie = '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=/' |
|
1431 | 1431 | } |
1432 | 1432 | function clickIVAO(cb) { |
1433 | 1433 | //document.cookie = 'ShowIVAO='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1434 | - document.cookie = '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=/' |
|
1434 | + document.cookie = '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=/' |
|
1435 | 1435 | } |
1436 | 1436 | function clickphpVMS(cb) { |
1437 | 1437 | //document.cookie = 'ShowVMS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1438 | - document.cookie = '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=/' |
|
1438 | + document.cookie = '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=/' |
|
1439 | 1439 | } |
1440 | 1440 | function clickSBS1(cb) { |
1441 | 1441 | //document.cookie = 'ShowSBS1='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1442 | - document.cookie = '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=/' |
|
1442 | + document.cookie = '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=/' |
|
1443 | 1443 | } |
1444 | 1444 | function clickAPRS(cb) { |
1445 | 1445 | //document.cookie = 'ShowAPRS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1446 | - document.cookie = '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=/' |
|
1446 | + document.cookie = '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=/' |
|
1447 | 1447 | } |
1448 | 1448 | function clickFlightPopup(cb) { |
1449 | 1449 | document.cookie = 'flightpopup='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -3,8 +3,11 @@ discard block |
||
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | 5 | // Compressed GeoJson is used if true |
6 | -if (!isset($globalJsonCompress)) $compress = true; |
|
7 | -else $compress = $globalJsonCompress; |
|
6 | +if (!isset($globalJsonCompress)) { |
|
7 | + $compress = true; |
|
8 | +} else { |
|
9 | + $compress = $globalJsonCompress; |
|
10 | +} |
|
8 | 11 | ?> |
9 | 12 | <?php |
10 | 13 | if (isset($_GET['archive'])) { |
@@ -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); |
@@ -107,7 +113,17 @@ discard block |
||
107 | 113 | } |
108 | 114 | |
109 | 115 | //create the map |
110 | - 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); |
|
116 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
117 | + print $latitude; |
|
118 | +} else { |
|
119 | + print $globalCenterLatitude; |
|
120 | +} |
|
121 | +?>,<?php if (isset($longitude)) { |
|
122 | + print $longitude; |
|
123 | +} else { |
|
124 | + print $globalCenterLongitude; |
|
125 | +} |
|
126 | +?>], zoom); |
|
111 | 127 | <?php |
112 | 128 | } else { |
113 | 129 | ?> |
@@ -120,9 +136,19 @@ discard block |
||
120 | 136 | || navigator.userAgent.match(/BlackBerry/i) |
121 | 137 | || navigator.userAgent.match(/Windows Phone/i)) |
122 | 138 | { |
123 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
139 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
140 | + print $globalLiveZoom-1; |
|
141 | +} else { |
|
142 | + print '8'; |
|
143 | +} |
|
144 | +?>; |
|
124 | 145 | } else { |
125 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
146 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
147 | + print $globalLiveZoom; |
|
148 | +} else { |
|
149 | + print '9'; |
|
150 | +} |
|
151 | +?>; |
|
126 | 152 | } |
127 | 153 | |
128 | 154 | //create the map |
@@ -146,16 +172,27 @@ discard block |
||
146 | 172 | bounds = L.latLngBounds(southWest,northEast); |
147 | 173 | //a few title layers |
148 | 174 | <?php |
149 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
150 | - else $MapType = $globalMapProvider; |
|
175 | + if (isset($_COOKIE['MapType'])) { |
|
176 | + $MapType = $_COOKIE['MapType']; |
|
177 | + } else { |
|
178 | + $MapType = $globalMapProvider; |
|
179 | + } |
|
151 | 180 | |
152 | 181 | if ($MapType == 'Mapbox') { |
153 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
154 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
155 | -?> |
|
182 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
183 | + $MapBoxId = $globalMapboxId; |
|
184 | + } else { |
|
185 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
186 | + } |
|
187 | + ?> |
|
156 | 188 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
157 | 189 | maxZoom: 18, |
158 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
190 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
191 | + print 'false'; |
|
192 | +} else { |
|
193 | + print 'true'; |
|
194 | +} |
|
195 | +?>, |
|
159 | 196 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
160 | 197 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
161 | 198 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -167,7 +204,12 @@ discard block |
||
167 | 204 | ?> |
168 | 205 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
169 | 206 | maxZoom: 18, |
170 | - 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 | +?>, |
|
171 | 213 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
172 | 214 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
173 | 215 | }).addTo(map); |
@@ -271,7 +313,12 @@ discard block |
||
271 | 313 | } |
272 | 314 | } elseif ($globalBounding == 'circle') { |
273 | 315 | ?> |
274 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
316 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
317 | + print $globalBoundingCircleSize; |
|
318 | +} else { |
|
319 | + print '70000'; |
|
320 | +} |
|
321 | +?>,{ |
|
275 | 322 | color: '#92C7D1', |
276 | 323 | fillColor: '#92C7D1', |
277 | 324 | fillOpacity: 0.3, |
@@ -330,8 +377,11 @@ discard block |
||
330 | 377 | |
331 | 378 | function update_airportsLayer() { |
332 | 379 | <?php |
333 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
334 | - else $getZoom = '7'; |
|
380 | + if (isset($_COOKIE['AirportZoom'])) { |
|
381 | + $getZoom = $_COOKIE['AirportZoom']; |
|
382 | + } else { |
|
383 | + $getZoom = '7'; |
|
384 | + } |
|
335 | 385 | ?> |
336 | 386 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
337 | 387 | if (typeof airportsLayer != 'undefined') { |
@@ -674,9 +724,13 @@ discard block |
||
674 | 724 | if (callsign != ""){ markerLabel += callsign; } |
675 | 725 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
676 | 726 | <?php |
677 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
678 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
679 | - else $IconColor = '1a3151'; |
|
727 | + if (isset($_COOKIE['IconColor'])) { |
|
728 | + $IconColor = $_COOKIE['IconColor']; |
|
729 | + } elseif (isset($globalAircraftIconColor)) { |
|
730 | + $IconColor = $globalAircraftIconColor; |
|
731 | + } else { |
|
732 | + $IconColor = '1a3151'; |
|
733 | + } |
|
680 | 734 | if (!isset($ident) && !isset($flightaware_id)) { |
681 | 735 | ?> |
682 | 736 | info.update(feature.properties.fc); |
@@ -724,7 +778,12 @@ discard block |
||
724 | 778 | <?php |
725 | 779 | } else { |
726 | 780 | ?> |
727 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
781 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
782 | + print $archiveupdatetime*1000; |
|
783 | +} else { |
|
784 | + print $globalMapRefresh*1000+20000; |
|
785 | +} |
|
786 | +?>+feature.properties.sqt*1000); |
|
728 | 787 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
729 | 788 | <?php |
730 | 789 | } |
@@ -769,7 +828,12 @@ discard block |
||
769 | 828 | <?php |
770 | 829 | } else { |
771 | 830 | ?> |
772 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
831 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
832 | + print $archiveupdatetime*1000; |
|
833 | +} else { |
|
834 | + print $globalMapRefresh*1000+20000; |
|
835 | +} |
|
836 | +?>+feature.properties.sqt*1000); |
|
773 | 837 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
774 | 838 | <?php |
775 | 839 | } |
@@ -813,7 +877,12 @@ discard block |
||
813 | 877 | <?php |
814 | 878 | } else { |
815 | 879 | ?> |
816 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
880 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
881 | + print $archiveupdatetime*1000; |
|
882 | +} else { |
|
883 | + print $globalMapRefresh*1000+20000; |
|
884 | +} |
|
885 | +?>+feature.properties.sqt*1000); |
|
817 | 886 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
818 | 887 | <?php |
819 | 888 | } |
@@ -1155,19 +1224,34 @@ discard block |
||
1155 | 1224 | if (isset($_GET['archive'])) { |
1156 | 1225 | ?> |
1157 | 1226 | //then load it again every 30 seconds |
1158 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
1227 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1228 | + print ($globalMapRefresh*1000)/2; |
|
1229 | +} else { |
|
1230 | + print '15000'; |
|
1231 | +} |
|
1232 | +?>); |
|
1159 | 1233 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
1160 | 1234 | <?php |
1161 | 1235 | } else { |
1162 | 1236 | ?> |
1163 | 1237 | //then load it again every 30 seconds |
1164 | -reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1238 | +reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1239 | + print $globalMapRefresh*1000; |
|
1240 | +} else { |
|
1241 | + print '30000'; |
|
1242 | +} |
|
1243 | +?>); |
|
1165 | 1244 | |
1166 | 1245 | <?php |
1167 | 1246 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
1168 | 1247 | ?> |
1169 | 1248 | update_polarLayer(); |
1170 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1249 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1250 | + print $globalMapRefresh*1000*2; |
|
1251 | +} else { |
|
1252 | + print '60000'; |
|
1253 | +} |
|
1254 | +?>); |
|
1171 | 1255 | <?php |
1172 | 1256 | } |
1173 | 1257 | ?> |
@@ -1182,7 +1266,12 @@ discard block |
||
1182 | 1266 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) ) { |
1183 | 1267 | ?> |
1184 | 1268 | update_atcLayer(); |
1185 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1269 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1270 | + print $globalMapRefresh*1000*2; |
|
1271 | +} else { |
|
1272 | + print '60000'; |
|
1273 | +} |
|
1274 | +?>); |
|
1186 | 1275 | <?php |
1187 | 1276 | } |
1188 | 1277 | ?> |
@@ -4,55 +4,55 @@ discard block |
||
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); |
@@ -95,39 +95,39 @@ discard block |
||
95 | 95 | { |
96 | 96 | |
97 | 97 | array_push($flights, array( |
98 | - "id" => $spotter_item['spotter_id'], |
|
98 | + "id" => $spotter_item['spotter_id'], |
|
99 | 99 | "ident" => $spotter_item['ident'], |
100 | 100 | "registration" => $spotter_item['registration'], |
101 | 101 | "aircraft_icao" => $spotter_item['aircraft_type'], |
102 | - "aircraft_name" => $spotter_item['aircraft_name'], |
|
103 | - "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'], |
|
102 | + "aircraft_name" => $spotter_item['aircraft_name'], |
|
103 | + "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'], |
|
104 | 104 | "airline_name" => $spotter_item['airline_name'], |
105 | - "airline_icao" => $spotter_item['airline_icao'], |
|
106 | - "airline_iata" => $spotter_item['airline_iata'], |
|
107 | - "airline_country" => $spotter_item['airline_country'], |
|
108 | - "airline_callsign" => $spotter_item['airline_callsign'], |
|
109 | - "airline_type" => $spotter_item['airline_type'], |
|
110 | - "departure_airport_city" => $spotter_item['departure_airport_city'], |
|
111 | - "departure_airport_country" => $spotter_item['departure_airport_country'], |
|
112 | - "departure_airport_iata" => $spotter_item['departure_airport_iata'], |
|
113 | - "departure_airport_icao" => $spotter_item['departure_airport_icao'], |
|
114 | - "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], |
|
115 | - "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], |
|
116 | - "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], |
|
117 | - "arrival_airport_city" => $spotter_item['arrival_airport_city'], |
|
118 | - "arrival_airport_country" => $spotter_item['arrival_airport_country'], |
|
119 | - "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], |
|
120 | - "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], |
|
121 | - "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], |
|
122 | - "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], |
|
123 | - "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'], |
|
124 | - "latitude" => $spotter_item['latitude'], |
|
125 | - "longitude" => $spotter_item['longitude'], |
|
126 | - "altitude" => $spotter_item['altitude'], |
|
127 | - "ground_speed" => $spotter_item['ground_speed'], |
|
128 | - "heading" => $spotter_item['heading'], |
|
129 | - "heading_name" => $spotter_item['heading_name'], |
|
130 | - "waypoints" => $spotter_item['waypoints'], |
|
105 | + "airline_icao" => $spotter_item['airline_icao'], |
|
106 | + "airline_iata" => $spotter_item['airline_iata'], |
|
107 | + "airline_country" => $spotter_item['airline_country'], |
|
108 | + "airline_callsign" => $spotter_item['airline_callsign'], |
|
109 | + "airline_type" => $spotter_item['airline_type'], |
|
110 | + "departure_airport_city" => $spotter_item['departure_airport_city'], |
|
111 | + "departure_airport_country" => $spotter_item['departure_airport_country'], |
|
112 | + "departure_airport_iata" => $spotter_item['departure_airport_iata'], |
|
113 | + "departure_airport_icao" => $spotter_item['departure_airport_icao'], |
|
114 | + "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], |
|
115 | + "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], |
|
116 | + "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], |
|
117 | + "arrival_airport_city" => $spotter_item['arrival_airport_city'], |
|
118 | + "arrival_airport_country" => $spotter_item['arrival_airport_country'], |
|
119 | + "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], |
|
120 | + "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], |
|
121 | + "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], |
|
122 | + "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], |
|
123 | + "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'], |
|
124 | + "latitude" => $spotter_item['latitude'], |
|
125 | + "longitude" => $spotter_item['longitude'], |
|
126 | + "altitude" => $spotter_item['altitude'], |
|
127 | + "ground_speed" => $spotter_item['ground_speed'], |
|
128 | + "heading" => $spotter_item['heading'], |
|
129 | + "heading_name" => $spotter_item['heading_name'], |
|
130 | + "waypoints" => $spotter_item['waypoints'], |
|
131 | 131 | "date" => date("c", strtotime($spotter_item['date_iso_8601'])) |
132 | 132 | ) |
133 | 133 | ); |
@@ -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,29 +69,29 @@ 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 | $output = "-flights:\n"; |
91 | 91 | |
92 | 92 | if (!empty($spotter_array)) |
93 | 93 | { |
94 | - foreach($spotter_array as $spotter_item) |
|
94 | + foreach ($spotter_array as $spotter_item) |
|
95 | 95 | { |
96 | 96 | |
97 | 97 | $output .= ' - id: '.$spotter_item['spotter_id']; |
@@ -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); |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | |
11 | 11 | $Spotter = new Spotter(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | 15 | } else $spotter_array = array(); |
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - $title = sprintf(_("Most Common Aircraft Manufacturer 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']); |
|
19 | + $title = sprintf(_("Most Common Aircraft Manufacturer 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']); |
|
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="info column">'; |
22 | 22 | 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>'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | include('route-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$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']).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $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']).'</p>'; |
|
31 | 31 | |
32 | 32 | $manufacturers_array = $Spotter->countAllAircraftManufacturerByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
33 | 33 | if (!empty($manufacturers_array)) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | print '</thead>'; |
43 | 43 | print '<tbody>'; |
44 | 44 | $i = 1; |
45 | - foreach($manufacturers_array as $manufacturer_item) |
|
45 | + foreach ($manufacturers_array as $manufacturer_item) |
|
46 | 46 | { |
47 | 47 | print '<tr>'; |
48 | 48 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -12,7 +12,9 @@ |
||
12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | -} else $spotter_array = array(); |
|
15 | +} else { |
|
16 | + $spotter_array = array(); |
|
17 | +} |
|
16 | 18 | |
17 | 19 | if (!empty($spotter_array)) |
18 | 20 | { |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | |
11 | 11 | $Spotter = new Spotter(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | 15 | } else $spotter_array = array(); |
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - $title = sprintf(_("Most Common Aircraft by Registration 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']); |
|
19 | + $title = sprintf(_("Most Common Aircraft by Registration 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']); |
|
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="info column">'; |
22 | 22 | 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>'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | include('route-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$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']).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $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']).'</p>'; |
|
31 | 31 | |
32 | 32 | $aircraft_array = $Spotter->countAllAircraftRegistrationByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
33 | 33 | if (!empty($aircraft_array)) |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | print '</thead>'; |
45 | 45 | print '<tbody>'; |
46 | 46 | $i = 1; |
47 | - foreach($aircraft_array as $aircraft_item) |
|
47 | + foreach ($aircraft_array as $aircraft_item) |
|
48 | 48 | { |
49 | 49 | print '<tr>'; |
50 | 50 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -12,7 +12,9 @@ |
||
12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | -} else $spotter_array = array(); |
|
15 | +} else { |
|
16 | + $spotter_array = array(); |
|
17 | +} |
|
16 | 18 | |
17 | 19 | if (!empty($spotter_array)) |
18 | 20 | { |
@@ -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(); |
@@ -7,23 +7,23 @@ 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 Airlines from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Airlines 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">'; |
21 | 21 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
22 | 22 | print '<option></option>'; |
23 | 23 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
24 | - foreach($aircraft_types as $aircrafttype) |
|
24 | + foreach ($aircraft_types as $aircrafttype) |
|
25 | 25 | { |
26 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
26 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
27 | 27 | { |
28 | 28 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
29 | 29 | } else { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | include('aircraft-sub-menu.php'); |
50 | 50 | print '<div class="column">'; |
51 | 51 | print '<h2>'._("Most Common Airlines").'</h2>'; |
52 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
52 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
53 | 53 | |
54 | 54 | $airline_array = $Spotter->countAllAirlinesByAircraft($aircraft_type); |
55 | 55 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | print '</thead>'; |
68 | 68 | print '<tbody>'; |
69 | 69 | $i = 1; |
70 | - foreach($airline_array as $airline_item) |
|
70 | + foreach ($airline_array as $airline_item) |
|
71 | 71 | { |
72 | 72 | print '<tr>'; |
73 | 73 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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))); |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
10 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Airlines by Country from %s"),$manufacturer); |
|
16 | + $title = sprintf(_("Most Common Airlines by Country from %s"), $manufacturer); |
|
17 | 17 | |
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
22 | 22 | print '<option></option>'; |
23 | 23 | $all_manufacturers = $Spotter->getAllManufacturers(); |
24 | - foreach($all_manufacturers as $all_manufacturer) |
|
24 | + foreach ($all_manufacturers as $all_manufacturer) |
|
25 | 25 | { |
26 | - if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
26 | + if ($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
27 | 27 | { |
28 | 28 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
29 | 29 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | include('manufacturer-sub-menu.php'); |
43 | 43 | print '<div class="column">'; |
44 | 44 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
45 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
45 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
46 | 46 | $airline_array = $Spotter->countAllAirlineCountriesByManufacturer($manufacturer); |
47 | 47 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
48 | 48 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ["'._("Country").'", "'._("# of times").'"], '; |
55 | 55 | |
56 | 56 | $country_data = ''; |
57 | - foreach($airline_array as $airline_item) |
|
57 | + foreach ($airline_array as $airline_item) |
|
58 | 58 | { |
59 | 59 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
60 | 60 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | print '</thead>'; |
89 | 89 | print '<tbody>'; |
90 | 90 | $i = 1; |
91 | - foreach($airline_array as $airline_item) |
|
91 | + foreach ($airline_array as $airline_item) |
|
92 | 92 | { |
93 | 93 | print '<tr>'; |
94 | 94 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | $orderby = $Spotter->getOrderBy(); |
8 | 8 | |
9 | -$ask = filter_input(INPUT_GET,'ask',FILTER_SANITIZE_STRING); |
|
9 | +$ask = filter_input(INPUT_GET, 'ask', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($ask == 'manufacturer') { |
11 | 11 | $manufacturers = $Spotter->getAllManufacturers(); |
12 | 12 | $all_manufacturers = array(); |
13 | - foreach($manufacturers as $manufacturer) |
|
13 | + foreach ($manufacturers as $manufacturer) |
|
14 | 14 | { |
15 | - $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ','-',$manufacturer['aircraft_manufacturer']))); |
|
15 | + $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ', '-', $manufacturer['aircraft_manufacturer']))); |
|
16 | 16 | } |
17 | 17 | echo json_encode($all_manufacturers); |
18 | 18 | } elseif ($ask == 'aircrafttypes') { |
19 | 19 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
20 | 20 | $all_aircraft_types = array(); |
21 | - foreach($aircraft_types as $aircraft_type) |
|
21 | + foreach ($aircraft_types as $aircraft_type) |
|
22 | 22 | { |
23 | 23 | $all_aircraft_types[] = array('id' => $aircraft_type['aircraft_icao'], 'value' => $aircraft_type['aircraft_name'].' ('.$aircraft_type['aircraft_icao'].')'); |
24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | } elseif ($ask == 'airlinenames') { |
27 | 27 | $airline_names = $Spotter->getAllAirlineNames(); |
28 | 28 | $all_airline_names = array(); |
29 | - foreach($airline_names as $airline_name) |
|
29 | + foreach ($airline_names as $airline_name) |
|
30 | 30 | { |
31 | 31 | $all_airline_names[] = array('id' => $airline_name['airline_icao'], 'value' => $airline_name['airline_name'].' ('.$airline_name['airline_icao'].')'); |
32 | 32 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } elseif ($ask == 'airlinecountries') { |
35 | 35 | $airline_countries = $Spotter->getAllAirlineCountries(); |
36 | 36 | $all_airline_countries = array(); |
37 | - foreach($airline_countries as $airline_country) |
|
37 | + foreach ($airline_countries as $airline_country) |
|
38 | 38 | { |
39 | 39 | $all_airline_countries[] = array('id' => $airline_country['airline_country'], 'value' => $airline_country['airline_country']); |
40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $airport_names = $Spotter->getAllAirportNames(); |
44 | 44 | ksort($airport_names); |
45 | 45 | $all_airport_names = array(); |
46 | - foreach($airport_names as $airport_name) |
|
46 | + foreach ($airport_names as $airport_name) |
|
47 | 47 | { |
48 | 48 | $all_airport_names[] = array('id' => $airport_name['airport_icao'], 'value' => $airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')'); |
49 | 49 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } elseif ($ask == 'airportcountries') { |
52 | 52 | $airport_countries = $Spotter->getAllAirportCountries(); |
53 | 53 | $all_airport_countries = array(); |
54 | - foreach($airport_countries as $airport_country) |
|
54 | + foreach ($airport_countries as $airport_country) |
|
55 | 55 | { |
56 | 56 | $all_airport_countries[] = array('id' => $airport_country['airport_country'], 'value' => $airport_country['airport_country']); |
57 | 57 | } |