Completed
Push — master ( e14a40...cfb98e )
by Yannick
54:46 queued 27:34
created
location-geojson.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,52 +12,52 @@  discard block
 block discarded – undo
12 12
 if (!isset($globalDemo)) {
13 13
 	if (isset($_GET['coord'])) 
14 14
 	{
15
-		$coords = explode(',',$_GET['coord']);
15
+		$coords = explode(',', $_GET['coord']);
16 16
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
17 17
 		    || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
18 18
 			//$spotter_array = $Source->getAllLocationInfo();
19
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs',$coords));
19
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs', $coords));
20 20
 		}
21 21
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
22 22
 		    || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
23
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx',$coords));
23
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx', $coords));
24 24
 		}
25 25
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
26 26
 		    || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
27
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning',$coords));
27
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning', $coords));
28 28
 		}
29 29
 		
30 30
 		if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
31 31
 		    || (!isset($_COOKIE['show_Fire']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
32
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',$coords,true));
32
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('fires', $coords, true));
33 33
 		}
34
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
34
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
35 35
 	} else {
36 36
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
37 37
 		    || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
38 38
 			//$spotter_array = $Source->getAllLocationInfo();
39
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs'));
39
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs'));
40 40
 		}
41 41
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
42 42
 		    || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
43
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx'));
43
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx'));
44 44
 		}
45 45
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
46 46
 		    || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
47
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning'));
47
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning'));
48 48
 		}
49 49
 		if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
50 50
 		    || (!isset($_COOKIE['show_Fire']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
51
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',array(),true));
51
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('fires', array(), true));
52 52
 		}
53
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
53
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
54 54
 	}
55 55
 }
56 56
 
57 57
 $output = '{"type": "FeatureCollection","features": [';
58 58
 if (!empty($spotter_array) && count($spotter_array) > 0)
59 59
 {
60
-	foreach($spotter_array as $spotter_item)
60
+	foreach ($spotter_array as $spotter_item)
61 61
 	{
62 62
 		date_default_timezone_set('UTC');
63 63
 		$output .= '{"type": "Feature",';
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 		$output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",';
77 77
 		$output .= '"type": "'.$spotter_item['type'].'",';
78 78
 		if ($spotter_item['type'] == 'wx') {
79
-			$weather = json_decode($spotter_item['description'],true);
80
-			if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",';
79
+			$weather = json_decode($spotter_item['description'], true);
80
+			if (isset($weather['temp'])) $output .= '"temp": "'.$weather['temp'].'",';
81 81
 		}
82 82
 		$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
83 83
 		$output .= '},';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		$output .= '}';
88 88
 		$output .= '},';
89 89
 	}
90
-	$output  = substr($output, 0, -1);
90
+	$output = substr($output, 0, -1);
91 91
 }
92 92
 $output .= ']}';
93 93
 print $output;
Please login to merge, or discard this patch.
marine-data.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 
10 10
 $from_archive = false;
11 11
 if (isset($_GET['ident'])) {
12
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
13 13
 	if (isset($_GET['currenttime'])) {
14
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
14
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
15 15
 		$currenttime = round($currenttime/1000);
16
-		$spotter_array = $MarineLive->getDateLiveMarineDataByIdent($ident,$currenttime);
16
+		$spotter_array = $MarineLive->getDateLiveMarineDataByIdent($ident, $currenttime);
17 17
 		
18 18
 		if (empty($spotter_array)) {
19 19
 			$from_archive = true;
20
-			$spotter_array = $MarineArchive->getDateArchiveMarineDataByIdent($ident,$currenttime);
20
+			$spotter_array = $MarineArchive->getDateArchiveMarineDataByIdent($ident, $currenttime);
21 21
 		}
22 22
 		
23 23
 	} else {
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 }
33 33
 if (isset($_GET['fammarine_id'])) {
34
-	$fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING);
34
+	$fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING);
35 35
 	if (isset($_GET['currenttime'])) {
36
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
36
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
37 37
 		$currenttime = round($currenttime/1000);
38
-		$spotter_array = $MarineLive->getDateLiveMarineDataById($fammarine_id,$currenttime);
38
+		$spotter_array = $MarineLive->getDateLiveMarineDataById($fammarine_id, $currenttime);
39 39
 		
40 40
 		if (empty($spotter_array)) {
41 41
 			$from_archive = true;
42 42
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
43
-			$spotter_array = $MarineArchive->getDateArchiveMarineDataById($flightaware_id,$currenttime);
43
+			$spotter_array = $MarineArchive->getDateArchiveMarineDataById($flightaware_id, $currenttime);
44 44
 		}
45 45
 		
46 46
 	} else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
63 63
 {
64 64
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
65
-		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
65
+		$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
66 66
 	} else $image = $spotter_item['image_thumbnail'];
67 67
 
68 68
 }
Please login to merge, or discard this patch.
sitemap.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
19 19
 
20 20
 		$spotter_array = $Spotter->getAllFlightsforSitemap();
21
-		foreach($spotter_array as $spotter_item)
21
+		foreach ($spotter_array as $spotter_item)
22 22
 		{
23 23
 			$output .= '<url>';
24 24
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/flightid/'.$spotter_item['spotter_id'].'</loc>';
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 	$output .= '</urlset>';
30 30
 	
31 31
 	
32
-} else if (isset($_GET['type']) && $_GET['type'] == "aircraft"){
32
+} else if (isset($_GET['type']) && $_GET['type'] == "aircraft") {
33 33
 
34 34
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
35 35
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
36 36
 		$aircraft_types = $Stats->getAllAircraftTypes();
37 37
 		if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
38
-		foreach($aircraft_types as $aircraft_item)
38
+		foreach ($aircraft_types as $aircraft_item)
39 39
 		{
40 40
 			$output .= '<url>';
41 41
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/aircraft/'.urlencode($aircraft_item['aircraft_icao']).'</loc>';
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 	$output .= '</urlset>';
47 47
 	
48 48
 	
49
-} else if (isset($_GET['type']) && $_GET['type'] == "registration"){
49
+} else if (isset($_GET['type']) && $_GET['type'] == "registration") {
50 50
 
51 51
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
52 52
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
53 53
 
54 54
 		$aircraft_registrations = $Spotter->getAllAircraftRegistrations();
55
-		foreach($aircraft_registrations as $aircraft_item)
55
+		foreach ($aircraft_registrations as $aircraft_item)
56 56
 		{
57 57
 			$output .= '<url>';
58 58
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/registration/'.urlencode($aircraft_item['registration']).'</loc>';
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		}
63 63
 	$output .= '</urlset>';
64 64
 	
65
-} else if (isset($_GET['type']) && $_GET['type'] == "airline"){
65
+} else if (isset($_GET['type']) && $_GET['type'] == "airline") {
66 66
 
67 67
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
68 68
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
69 69
 
70 70
 		$airline_names = $Stats->getAllAirlineNames();
71
-		foreach($airline_names as $airline_item)
71
+		foreach ($airline_names as $airline_item)
72 72
 		{
73 73
 			$output .= '<url>';
74 74
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airline/'.urlencode($airline_item['airline_icao']).'</loc>';
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 	$output .= '</urlset>';
80 80
 	
81
-} else if (isset($_GET['type']) && $_GET['type'] == "airport"){
81
+} else if (isset($_GET['type']) && $_GET['type'] == "airport") {
82 82
 
83 83
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
84 84
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
85 85
 
86 86
 		$airport_names = $Stats->getAllAirportNames();
87 87
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
88
-		foreach($airport_names as $airport_item)
88
+		foreach ($airport_names as $airport_item)
89 89
 		{
90 90
 			$output .= '<url>';
91 91
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airport/'.$airport_item['airport_icao'].'</loc>';
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 		}
96 96
 	$output .= '</urlset>';
97 97
 	
98
-} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer"){
98
+} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer") {
99 99
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
100 100
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
101 101
 	$manufacturer_names = $Stats->getAllManufacturers();
102 102
 	if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers();
103
-	foreach($manufacturer_names as $manufacturer_item)
103
+	foreach ($manufacturer_names as $manufacturer_item)
104 104
 	{
105 105
 		$output .= '<url>';
106 106
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/manufacturer/'.urlencode(strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer']))).'</loc>';
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 		$output .= '</url>';
110 110
 	}
111 111
 	$output .= '</urlset>';
112
-} else if (isset($_GET['type']) && $_GET['type'] == "country"){
112
+} else if (isset($_GET['type']) && $_GET['type'] == "country") {
113 113
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
114 114
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
115 115
 	$country_names = $Spotter->getAllCountries();
116
-	foreach($country_names as $country_item)
116
+	foreach ($country_names as $country_item)
117 117
 	{
118 118
 		$output .= '<url>';
119 119
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/country/'.urlencode(strtolower(str_replace(" ", "-", $country_item['country']))).'</loc>';
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 		$output .= '</url>';
123 123
 	}
124 124
 	$output .= '</urlset>';
125
-} else if (isset($_GET['type']) && $_GET['type'] == "ident"){
125
+} else if (isset($_GET['type']) && $_GET['type'] == "ident") {
126 126
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
127 127
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
128 128
 	$ident_names = $Spotter->getAllIdents();
129
-	foreach($ident_names as $ident_item)
129
+	foreach ($ident_names as $ident_item)
130 130
 	{
131 131
 		if (ctype_alnum($ident_item['ident'])) {
132 132
 			$output .= '<url>';
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 		}
138 138
 	}
139 139
 	$output .= '</urlset>';
140
-} else if (isset($_GET['type']) && $_GET['type'] == "marine-ident"){
140
+} else if (isset($_GET['type']) && $_GET['type'] == "marine-ident") {
141 141
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
142 142
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
143 143
 	$ident_names = $Marine->getAllIdents();
144
-	foreach($ident_names as $ident_item)
144
+	foreach ($ident_names as $ident_item)
145 145
 	{
146 146
 		if (ctype_alnum($ident_item['ident'])) {
147 147
 			$output .= '<url>';
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
 		}
153 153
 	}
154 154
 	$output .= '</urlset>';
155
-} else if (isset($_GET['type']) && $_GET['type'] == "date"){
155
+} else if (isset($_GET['type']) && $_GET['type'] == "date") {
156 156
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
157 157
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
158 158
 	$date_names = $Spotter->getAllDates();
159
-	foreach($date_names as $date_item)
159
+	foreach ($date_names as $date_item)
160 160
 	{
161 161
 		$output .= '<url>';
162 162
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>';
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
 		$output .= '</url>';
166 166
 	}
167 167
 	$output .= '</urlset>';
168
-} else if (isset($_GET['type']) && $_GET['type'] == "marine-date"){
168
+} else if (isset($_GET['type']) && $_GET['type'] == "marine-date") {
169 169
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
170 170
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
171 171
 	$date_names = $Marine->getAllDates();
172
-	foreach($date_names as $date_item)
172
+	foreach ($date_names as $date_item)
173 173
 	{
174 174
 		$output .= '<url>';
175 175
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/marine/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>';
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 		$output .= '</url>';
179 179
 	}
180 180
 	$output .= '</urlset>';
181
-} else if (isset($_GET['type']) && $_GET['type'] == "tracker-date"){
181
+} else if (isset($_GET['type']) && $_GET['type'] == "tracker-date") {
182 182
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
183 183
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
184 184
 	$date_names = $Tracker->getAllDates();
185
-	foreach($date_names as $date_item)
185
+	foreach ($date_names as $date_item)
186 186
 	{
187 187
 		$output .= '<url>';
188 188
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/tracker/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>';
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 		$output .= '</url>';
192 192
 	}
193 193
 	$output .= '</urlset>';
194
-} else if (isset($_GET['type']) && $_GET['type'] == "route"){
194
+} else if (isset($_GET['type']) && $_GET['type'] == "route") {
195 195
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
196 196
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
197 197
 	$route_names = $Spotter->getAllRoutes();
198
-	foreach($route_names as $route_item)
198
+	foreach ($route_names as $route_item)
199 199
 	{
200 200
 		$output .= '<url>';
201 201
 		$output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'</loc>';
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		$output .= '</url>';
205 205
 	}
206 206
 	$output .= '</urlset>';
207
-} else if (isset($_GET['type']) && $_GET['type'] == "static"){
207
+} else if (isset($_GET['type']) && $_GET['type'] == "static") {
208 208
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
209 209
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
210 210
 	/* STATIC PAGES */
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	$output .= '<changefreq>daily</changefreq>';
323 323
 	$output .= '</url>';
324 324
 	$output .= '</urlset>';
325
-} else if (isset($_GET['type']) && $_GET['type'] == "marine-static"){
325
+} else if (isset($_GET['type']) && $_GET['type'] == "marine-static") {
326 326
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
327 327
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
328 328
 	/* STATIC PAGES */
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	$output .= '<changefreq>daily</changefreq>';
349 349
 	$output .= '</url>';
350 350
 	$output .= '</urlset>';
351
-} else if (isset($_GET['type']) && $_GET['type'] == "tracker-static"){
351
+} else if (isset($_GET['type']) && $_GET['type'] == "tracker-static") {
352 352
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
353 353
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
354 354
 	/* STATIC PAGES */
Please login to merge, or discard this patch.
statistics-country.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 } else {
20 20
 	$title = _("Statistics").' - '._("Most common Country a flight was over");
21 21
 }
22
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
22
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
23 23
 if ($airline_icao == '' && isset($globalFilter)) {
24 24
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
25 25
 }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 if ($type == 'aircraft') {
51
-	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name);
51
+	$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name);
52 52
 } elseif ($type == 'marine') {
53 53
 	$flightover_array = $Marine->countAllMarineOverCountries();
54 54
 } elseif ($type == 'tracker') {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 print '<div id="chart" class="chart" width="100%"></div><script>';
63 63
 print 'var series = [';
64 64
 $flightover_data = '';
65
-foreach($flightover_array as $flightover_item)
65
+foreach ($flightover_array as $flightover_item)
66 66
 {
67 67
 	if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
68 68
 	elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],';
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	print '</thead>';
114 114
 	print '<tbody>';
115 115
 	$i = 1;
116
-	array_splice($flightover_array,10);
117
-	foreach($flightover_array as $flightover_item)
116
+	array_splice($flightover_array, 10);
117
+	foreach ($flightover_array as $flightover_item)
118 118
 	{
119 119
 		print '<tr>';
120 120
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
search.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
 $sql_date = '';
27 27
 if (isset($_GET['start_date'])) {
28 28
 	//for the date manipulation into the query
29
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
29
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
30 30
 		if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) {
31 31
 			//$start_date = $_GET['start_date']." 00:00:00";
32
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
32
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
33 33
 			//$end_date = $_GET['end_date']." 00:00:00";
34
-			$end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
34
+			$end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
35 35
 			$sql_date = $start_date.",".$end_date;
36 36
 		}
37
-	} else if($_GET['start_date'] != ""){
37
+	} else if ($_GET['start_date'] != "") {
38 38
 		if (strtotime($_GET['start_date']) !== false) {
39 39
 			//$start_date = $_GET['start_date']." 00:00:00";
40
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
40
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
41 41
 			$sql_date = $start_date;
42 42
 		}
43
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
43
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
44 44
 		if (strtotime($_GET['end_date']) !== false) {
45 45
 			//$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
46
-			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
46
+			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49 49
 	} else $sql_date = '';
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
51 51
 
52 52
 if (isset($_GET['highest_altitude'])) {
53 53
 	//for altitude manipulation
54
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
55
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
56
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
54
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
55
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
56
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
57 57
 		$sql_altitude = $start_altitude.",".$end_altitude;
58
-	} else if($_GET['highest_altitude'] != ""){
59
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
58
+	} else if ($_GET['highest_altitude'] != "") {
59
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
60 60
 		$sql_altitude = $end_altitude;
61
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
61
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
62
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000";
63 63
 		$sql_altitude = $start_altitude;
64 64
 	} else $sql_altitude = '';
65 65
 } else $sql_altitude = '';
66 66
 
67 67
 //calculuation for the pagination
68
-if(!isset($_GET['limit']))
68
+if (!isset($_GET['limit']))
69 69
 {
70 70
 	if (!isset($_GET['number_results']))
71 71
 	{
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 		$limit_end = 25;
74 74
 		$absolute_difference = 25;
75 75
 	} else {
76
-		if ($_GET['number_results'] > 1000){
76
+		if ($_GET['number_results'] > 1000) {
77 77
 			$_GET['number_results'] = 1000;
78 78
 		}
79 79
 		$limit_start = 0;
80
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
80
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
81
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
82 82
 	}
83
-}  else {
83
+} else {
84 84
 	$limit_explode = explode(",", $_GET['limit']);
85
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
85
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
86
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
87 87
 }
88 88
 $absolute_difference = abs($limit_start - $limit_end);
89 89
 $limit_next = $limit_end + $absolute_difference;
@@ -112,31 +112,31 @@  discard block
 block discarded – undo
112 112
     ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
113 113
     (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
114 114
     (isset($_GET['dist']) && $_GET['dist'] != ''))
115
-    ){  
116
-	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
117
-	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
118
-	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
119
-	$manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING);
120
-	$highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING);
121
-	$airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING);
122
-	$airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING);
123
-	$airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING);
124
-	$airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING);
125
-	$airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING);
126
-	$callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING);
127
-	$owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING);
128
-	$pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING);
129
-	$pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING);
130
-	$mmsi = filter_input(INPUT_GET, 'mmsi',FILTER_SANITIZE_NUMBER_INT);
131
-	$imo = filter_input(INPUT_GET, 'imo',FILTER_SANITIZE_NUMBER_INT);
132
-	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING);
133
-	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING);
134
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
135
-	$archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT);
136
-	$origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT);
137
-	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT);
138
-	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
139
-	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
115
+    ) {  
116
+	$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
117
+	$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
118
+	$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
119
+	$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
120
+	$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
121
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
122
+	$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
123
+	$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
124
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
125
+	$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
126
+	$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
127
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
128
+	$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
129
+	$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
130
+	$mmsi = filter_input(INPUT_GET, 'mmsi', FILTER_SANITIZE_NUMBER_INT);
131
+	$imo = filter_input(INPUT_GET, 'imo', FILTER_SANITIZE_NUMBER_INT);
132
+	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
133
+	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
134
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
135
+	$archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT);
136
+	$origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT);
137
+	$origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT);
138
+	$dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT);
139
+	$number_results = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
140 140
 	if ($dist != '') {
141 141
 		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
142 142
 		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 	if ($archive == 1) {
146 146
 		if ($type == 'aircraft') {
147 147
 			$SpotterArchive = new SpotterArchive();
148
-			$spotter_array = $SpotterArchive->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,'',$origlat,$origlon,$dist);
148
+			$spotter_array = $SpotterArchive->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, '', $origlat, $origlon, $dist);
149 149
 		}
150 150
 	} else {
151 151
 		if ($type == 'aircraft') {
152
-			$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,'',$origlat,$origlon,$dist);
152
+			$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, '', $origlat, $origlon, $dist);
153 153
 		} elseif ($type == 'tracker') {
154
-			$spotter_array = $Tracker->searchTrackerData($q,$callsign,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
154
+			$spotter_array = $Tracker->searchTrackerData($q, $callsign, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
155 155
 		} elseif ($type == 'marine') {
156
-			$spotter_array = $Marine->searchMarineData($q,$callsign,$mmsi,$imo,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
156
+			$spotter_array = $Marine->searchMarineData($q, $callsign, $mmsi, $imo, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
157 157
 		}
158 158
 	}
159 159
 	 
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 	//remove 3D=true parameter
190 190
 	$no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
191 191
 	$kmlURL = str_replace("http://", "kml://", $globalURL);
192
-	if (!isset($_GET['3D'])){
192
+	if (!isset($_GET['3D'])) {
193 193
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
194 194
 	} else {
195 195
 		print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
196 196
 	}
197
-	if (isset($_GET['3D'])){
197
+	if (isset($_GET['3D'])) {
198 198
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
199 199
 	} else {
200 200
 		print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>';
@@ -215,32 +215,32 @@  discard block
 block discarded – undo
215 215
 		print '<div class="column">';
216 216
 		print '<div class="info">';
217 217
 		print '<h1>'._("Search Results for").' ';
218
-		if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; }
219
-		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220
-		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221
-		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
222
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
223
-		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
224
-		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225
-		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
226
-		if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; }
227
-		if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; }
228
-		if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; }
229
-		if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; }
230
-		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
231
-		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
232
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
233
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
234
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
235
-		if (isset($_GET['mmsi']) && $_GET['mmsi'] != ""){ print _("MMSI:").' <span>'.$mmsi.'</span> '; }
236
-		if (isset($_GET['imo']) && $_GET['imo'] != ""){ print _("IMO:").' <span>'.$imo.'</span> '; }
237
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; }
238
-		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; }
239
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
240
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
241
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
242
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
243
-		if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; }
218
+		if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; }
219
+		if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220
+		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221
+		if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; }
222
+		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; }
223
+		if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; }
224
+		if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225
+		if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; }
226
+		if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; }
227
+		if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; }
228
+		if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; }
229
+		if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; }
230
+		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
231
+		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
232
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
233
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
234
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
235
+		if (isset($_GET['mmsi']) && $_GET['mmsi'] != "") { print _("MMSI:").' <span>'.$mmsi.'</span> '; }
236
+		if (isset($_GET['imo']) && $_GET['imo'] != "") { print _("IMO:").' <span>'.$imo.'</span> '; }
237
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; }
238
+		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; }
239
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
240
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
241
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
242
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
243
+		if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; }
244 244
 		print '</h1>';
245 245
 		print '</div>';
246 246
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 					    </select>
375 375
 					</div>
376 376
 				</div>
377
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
377
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
378 378
 				<div class="form-group">
379 379
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
380 380
 						<div class="col-sm-10">
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 							</select>
384 384
 						</div>
385 385
 				</div>
386
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
386
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
387 387
 				<div class="form-group">
388 388
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
389 389
 					<div class="col-sm-10">
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 					</div>
407 407
 				</div>
408 408
 <?php
409
-	}else {
409
+	} else {
410 410
 ?>
411 411
 				<div class="form-group">
412 412
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 ?>
420 420
 				<div class="form-group">
421 421
 					<div class="col-sm-offset-2 col-sm-10">
422
-					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label>
422
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label>
424 424
 					</div>
425 425
 				</div>
426 426
 			</fieldset>
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 						</select>
435 435
 					</div>
436 436
 				</div>
437
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
437
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script>
438 438
 				<div class="form-group">
439 439
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
440 440
 					<div class="col-sm-10">
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 						</select>
444 444
 					</div>
445 445
 				</div>
446
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
446
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script>
447 447
 				<div class="form-group">
448 448
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
449 449
 					<div class="col-sm-10">
@@ -452,10 +452,10 @@  discard block
 block discarded – undo
452 452
 				</div>
453 453
 				<div class="form-group">
454 454
 					<div class="col-sm-offset-2 col-sm-10">
455
-						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
-						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
-						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
-						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
455
+						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all") { print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger") { print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "cargo") { print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "military") { print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
459 459
 					</div>
460 460
 				</div>
461 461
 			</fieldset>
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 						</select>
470 470
 					</div>
471 471
 				</div>
472
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
472
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
473 473
 				<div class="form-group">
474 474
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
475 475
 					<div class="col-sm-10">
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 						</select>
479 479
 					</div>
480 480
 				</div>
481
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
481
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script>
482 482
 			</fieldset>
483 483
 			<fieldset>
484 484
 				<legend><?php echo _("Route"); ?></legend>
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 						</select>
491 491
 					</div>
492 492
 				</div>
493
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
493
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
494 494
 				<div class="form-group">
495 495
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
496 496
 					<div class="col-sm-10">
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 						</select>
500 500
 					</div>
501 501
 				</div>
502
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
502
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
503 503
 			</fieldset>
504 504
 			<fieldset>
505 505
 				<legend>Altitude</legend>
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 							<option></option>
511 511
 <?php
512 512
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
513
-foreach($altitude_array as $altitude)
513
+foreach ($altitude_array as $altitude)
514 514
 {
515
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
515
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
516 516
 	{
517 517
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
518 518
 	} else {
@@ -530,9 +530,9 @@  discard block
 block discarded – undo
530 530
 							<option></option>
531 531
 <?php
532 532
 	$altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
533
-	foreach($altitude_array as $altitude)
533
+	foreach ($altitude_array as $altitude)
534 534
 	{
535
-		if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
535
+		if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
536 536
 		{
537 537
 			print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
538 538
 		} else {
@@ -655,10 +655,10 @@  discard block
 block discarded – undo
655 655
 				<div class="col-sm-10">
656 656
 					<select class="form-control" name="number_results">
657 657
 <?php
658
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
659
-foreach($number_results_array as $number)
658
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
659
+foreach ($number_results_array as $number)
660 660
 {
661
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
661
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
662 662
 	{
663 663
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
664 664
 	} else {
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 		<fieldset>
678 678
 			<div class="form-group">
679 679
 				<div class="col-sm-offset-2 col-sm-10">
680
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
680
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
681 681
 					<p class="help-block">Disabled in demo</p>
682 682
 				</div>
683 683
 			</div>
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 		<fieldset>
689 689
 			<div class="form-group">
690 690
 				<div class="col-sm-offset-2 col-sm-10">
691
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
691
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
692 692
 				</div>
693 693
 			</div>
694 694
 		</fieldset>
Please login to merge, or discard this patch.
require/class.Elevation.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			default:
42 42
 				throw new \Exception("bad resolution can be only one of 1,3");
43 43
 		}
44
-		register_shutdown_function(function () {
44
+		register_shutdown_function(function() {
45 45
 			$this->closeAllFiles();
46 46
 		});
47 47
 	}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 
56 56
 	private function getElevationAtPosition($fileName, $row, $column) {
57 57
 		if (!array_key_exists($fileName, $this->openedFiles)) {
58
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
58
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
59 59
 				throw new \Exception("File '{$fileName}' not exists.");
60 60
 			}
61
-			$file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r");
61
+			$file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r");
62 62
 			if ($file === false) {
63 63
 				throw new \Exception("Cant open file '{$fileName}' for reading.");
64 64
 			}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			throw new \Exception("Not implemented yet");
73 73
 		}
74 74
 		$aRow     = $this->measPerDeg - $row;
75
-		$position = ($this->measPerDeg * ($aRow - 1)) + $column;
75
+		$position = ($this->measPerDeg*($aRow - 1)) + $column;
76 76
 		$position *= 2;
77 77
 		fseek($file, $position);
78 78
 		$short  = fread($file, 2);
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 		$latSec = $this->getSec($lat);
101 101
 		$lonSec = $this->getSec($lon);
102 102
 
103
-		$Xn = round($latSec / $this->resolution, 3);
104
-		$Yn = round($lonSec / $this->resolution, 3);
103
+		$Xn = round($latSec/$this->resolution, 3);
104
+		$Yn = round($lonSec/$this->resolution, 3);
105 105
 
106 106
 		$a1 = round($Xn);
107 107
 		$a2 = round($Yn);
@@ -133,55 +133,55 @@  discard block
 block discarded – undo
133 133
 		$b3 = $this->getElevationAtPosition($fName, $b1, $b2);
134 134
 		$c3 = $this->getElevationAtPosition($fName, $c1, $c2);
135 135
 
136
-		$n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2);
137
-		$n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3);
138
-		$n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1);
136
+		$n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2);
137
+		$n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3);
138
+		$n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1);
139 139
 
140
-		$d  = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3;
141
-		$zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3;
140
+		$d  = -$n1*$a1 - $n2*$a2 - $n3*$a3;
141
+		$zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3;
142 142
 
143 143
 		return $zN;
144 144
 	}
145 145
 
146 146
 	private function getDeg($deg, $numPrefix) {
147 147
 		$deg = abs($deg);
148
-		$d   = floor($deg);     // round degrees
148
+		$d   = floor($deg); // round degrees
149 149
 		if ($numPrefix >= 3) {
150 150
 			if ($d < 100) {
151
-				$d = '0' . $d;
151
+				$d = '0'.$d;
152 152
 			}
153 153
 		} // pad with leading zeros
154 154
 		if ($d < 10) {
155
-			$d = '0' . $d;
155
+			$d = '0'.$d;
156 156
 		}
157 157
 		return $d;
158 158
 	}
159 159
 
160 160
 	private function getSec($deg) {
161 161
 		$deg = abs($deg);
162
-		$sec = round($deg * 3600, 4);
163
-		$m   = fmod(floor($sec / 60), 60);
162
+		$sec = round($deg*3600, 4);
163
+		$m   = fmod(floor($sec/60), 60);
164 164
 		$s   = round(fmod($sec, 60), 4);
165
-		return ($m * 60) + $s;
165
+		return ($m*60) + $s;
166 166
 	}
167 167
 
168
-	public function download($lat,$lon, $debug = false) {
168
+	public function download($lat, $lon, $debug = false) {
169 169
 		$N      = $this->getDeg($lat, 2);
170 170
 		$E      = $this->getDeg($lon, 3);
171
-		$fileName  = "N{$N}E{$E}.hgt";
172
-		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
171
+		$fileName = "N{$N}E{$E}.hgt";
172
+		if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
173 173
 			$Common = new Common();
174 174
 			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
175
-			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
175
+			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
176
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) {
177 177
 				if ($debug) echo "File '{$fileName}.gz' not exists.";
178 178
 				return false;
179 179
 			}
180 180
 			if ($debug) echo 'Done'."\n";
181 181
 			if ($debug) echo 'Decompress '.$fileName.' ....';
182
-			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
182
+			$Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName);
183 183
 			if ($debug) echo 'Done'."\n";
184
-			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
184
+			unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
185 185
 		}
186 186
 		return true;
187 187
 	}
@@ -194,22 +194,22 @@  discard block
 block discarded – undo
194 194
 		try {
195 195
 			$sth = $db->prepare($query);
196 196
 			$sth->execute($query_values);
197
-		} catch(PDOException $e) {
197
+		} catch (PDOException $e) {
198 198
 			return "error : ".$e->getMessage();
199 199
 		}
200 200
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
201
-			$this->download($data['latitude'],$data['longitude'],true);
201
+			$this->download($data['latitude'], $data['longitude'], true);
202 202
 		}
203 203
 		$query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10';
204 204
 		$query_values = array();
205 205
 		try {
206 206
 			$sth = $db->prepare($query);
207 207
 			$sth->execute($query_values);
208
-		} catch(PDOException $e) {
208
+		} catch (PDOException $e) {
209 209
 			return "error : ".$e->getMessage();
210 210
 		}
211 211
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
212
-			$this->download($data['latitude'],$data['longitude'],true);
212
+			$this->download($data['latitude'], $data['longitude'], true);
213 213
 		}
214 214
 	}
215 215
 }
Please login to merge, or discard this patch.
airline-statistics-aircraft.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
10
+$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 //	$spotter_array = $Spotter->getSpotterDataByAirline('',"0,1","",array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline))));
15 15
 	$alliance = true;
16 16
 } else {
17
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
17
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
18 18
 }
19 19
 
20 20
 if (!empty($spotter_array) || $alliance === true)
21 21
 {
22 22
 	if ($alliance) {
23
-		$title = sprintf(_("Most Common Aircraft from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
23
+		$title = sprintf(_("Most Common Aircraft from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
24 24
 	} else {
25
-		$title = sprintf(_("Most Common Aircraft from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
25
+		$title = sprintf(_("Most Common Aircraft from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
26 26
 	}
27 27
 	require_once('header.php');
28 28
 	print '<div class="select-item">';
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	$alliances = $Spotter->getAllAllianceNames();
33 33
 	if (!empty($alliances)) {
34 34
 		foreach ($alliances as $al) {
35
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
36
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
35
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
36
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
37 37
 			} else {
38
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
38
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
39 39
 			}
40 40
 		}
41 41
 		print '<option disabled>────────────────</option>';
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	$Stats = new Stats();
44 44
 	$airline_names = $Stats->getAllAirlineNames();
45 45
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
46
-	foreach($airline_names as $airline_name)
46
+	foreach ($airline_names as $airline_name)
47 47
 	{
48
-		if($airline == $airline_name['airline_icao'])
48
+		if ($airline == $airline_name['airline_icao'])
49 49
 		{
50 50
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
51 51
 		} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			print '</div>';
80 80
 		} else {
81 81
 			print '<div class="info column">';
82
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
83
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
82
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
83
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
84 84
 			{
85
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
85
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
86 86
 			}
87
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
87
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
88 88
 			print '</div>';
89 89
 		}
90 90
 	} else {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	print '<div class="column">';
96 96
 	print '<h2>'._("Most Common Aircraft").'</h2>';
97 97
 	if ($alliance === false) {
98
-		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
98
+		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
99 99
 	} else {
100
-		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
100
+		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
101 101
 	}
102 102
 
103 103
 	/*
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$aircraft_array = $Spotter->countAllAircraftTypesByAirline($airline);
108 108
 	}
109 109
 	*/
110
-	$aircraft_array = $Stats->countAllAircraftTypes(true,$airline);
110
+	$aircraft_array = $Stats->countAllAircraftTypes(true, $airline);
111 111
 	if (!empty($aircraft_array))
112 112
 	{
113 113
 		print '<div class="table-responsive">';
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		print '</thead>';
121 121
 		print '<tbody>';
122 122
 		$i = 1;
123
-		foreach($aircraft_array as $aircraft_item)
123
+		foreach ($aircraft_array as $aircraft_item)
124 124
 		{
125 125
 			print '<tr>';
126 126
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
owner-statistics-departure-airport-country.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
12
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
13
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
12
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
13
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
14 14
 $filter = array();
15
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
16
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
15
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
16
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
17
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Departure Airports by Owner of %s"),$spotter_array[0]['aircraft_owner']);
21
+	$title = sprintf(_("Most Common Departure Airports by Owner of %s"), $spotter_array[0]['aircraft_owner']);
22 22
 	require_once('header.php');
23 23
 	print '<div class="info column">';
24 24
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	include('owner-sub-menu.php');
29 29
 	print '<div class="column">';
30 30
 	print '<h2>'._("Most Common Departure Airports by Country").'</h2>';
31
-	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
31
+	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
32 32
 
33
-	$airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner,$filter);
33
+	$airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner, $filter);
34 34
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
35 35
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
36 36
 	print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';
37 37
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
38 38
 	print 'var series = [';
39 39
 	$country_data = '';
40
-	foreach($airport_country_array as $airport_item)
40
+	foreach ($airport_country_array as $airport_item)
41 41
 	{
42 42
 		$country_data .= '[ "'.$airport_item['airport_departure_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],';
43 43
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		print '</thead>';
85 85
 		print '<tbody>';
86 86
 		$i = 1;
87
-		foreach($airport_country_array as $airport_item)
87
+		foreach ($airport_country_array as $airport_item)
88 88
 		{
89 89
 			print '<tr>';
90 90
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-route.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
10
+$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Routes from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Routes from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>───────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($airline == $airline_name['airline_icao'])
47
+		if ($airline == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 			print '</div>';
79 79
 		} else {
80 80
 			print '<div class="info column">';
81
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
82
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
81
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
82
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
83 83
 			{
84
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
84
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
85 85
 			}
86
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
86
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
87 87
 			print '</div>';
88 88
 		}
89 89
 	} else {
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	 print '<div class="column">';
95 95
 	print '<h2>'._("Most Common Routes").'</h2>';
96 96
 	if ($alliance) {
97
-		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
97
+		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
98 98
 	} else {
99
-		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
100 100
 	}
101 101
 	if ($alliance) {
102
-		$route_array = $Spotter->countAllRoutesByAirline('',array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline))));
102
+		$route_array = $Spotter->countAllRoutesByAirline('', array('alliance' => str_replace('_', ' ', str_replace('alliance_', '', $airline))));
103 103
 	} else {
104 104
 		$route_array = $Spotter->countAllRoutesByAirline($airline);
105 105
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		print '</thead>';
118 118
 		print '<tbody>';
119 119
 		$i = 1;
120
-		foreach($route_array as $route_item)
120
+		foreach ($route_array as $route_item)
121 121
 		{
122 122
 			print '<tr>';
123 123
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.