Completed
Push — master ( dcc24f...94bffa )
by Yannick
37:15
created
races-geojson.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 header('Content-Type: text/javascript');
10 10
 
11
-$race_id = filter_input(INPUT_GET,'race_id',FILTER_SANITIZE_NUMBER_INT);
11
+$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT);
12 12
 if ($race_id != '') {
13 13
 	$race_array = $Marine->getRace($race_id);
14 14
 } else {
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 $output = '{"type": "FeatureCollection","features": [';
19 19
 if (!empty($race_array))
20 20
 {	
21
-	$course = json_decode($race_array['race_markers'],true);
21
+	$course = json_decode($race_array['race_markers'], true);
22 22
 	$i = 0;
23 23
 	$f = count($course);
24
-	foreach($course as $marker)
24
+	foreach ($course as $marker)
25 25
 	{
26 26
 		date_default_timezone_set('UTC');
27 27
 		$output .= '{"type": "Feature",';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$output .= '"type": "'.$marker['type'].'",';
34 34
 		if ($i == 0 || $i == 1) {
35 35
 			$output .= '"icon": "images/tsk/tsk-start.png",';
36
-		} elseif ($i == $f-1 || $i == $f-2) {
36
+		} elseif ($i == $f - 1 || $i == $f - 2) {
37 37
 			$output .= '"icon": "images/tsk/tsk-finish.png",';
38 38
 		} elseif ($marker['type'] == 4) {
39 39
 			$output .= '"icon": "images/kardinalstonne.png",';
Please login to merge, or discard this patch.
live-czml.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
     $s3 = sin($bank/2);
67 67
     $c1c2 = $c1*$c2;
68 68
     $s1s2 = $s1*$s2;
69
-    $w =$c1c2*$c3 - $s1s2*$s3;
70
-    $x =$c1c2*$s3 + $s1s2*$c3;
71
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
72
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
73
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
69
+    $w = $c1c2*$c3 - $s1s2*$s3;
70
+    $x = $c1c2*$s3 + $s1s2*$c3;
71
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
72
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
73
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
74 74
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
75 75
 
76 76
 }
@@ -91,18 +91,18 @@  discard block
 block discarded – undo
91 91
 $min = false;
92 92
 $allhistory = false;
93 93
 $filter['source'] = array();
94
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
95
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
96
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
97
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
98
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
99
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
100
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
101
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
102
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
103
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
104
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
105
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
94
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
95
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
96
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
97
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
98
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
99
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
100
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
101
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
102
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
103
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
104
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
105
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_NUMBER_INT);
106 106
 if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
107 107
 /*
108 108
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 	$from_archive = true;
151 151
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
152 152
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
153
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
154
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
155
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
156
-	$begindate = date('Y-m-d H:i:s',$begindate);
157
-	$enddate = date('Y-m-d H:i:s',$enddate);
153
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
154
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
155
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
156
+	$begindate = date('Y-m-d H:i:s', $begindate);
157
+	$enddate = date('Y-m-d H:i:s', $enddate);
158 158
 	if ($tracker) {
159
-		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter);
159
+		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter);
160 160
 	} elseif ($marine) {
161
-		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter);
161
+		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter);
162 162
 	} else {
163
-		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
163
+		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
164 164
 	}
165 165
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
166 166
 	$from_archive = true;
@@ -177,36 +177,36 @@  discard block
 block discarded – undo
177 177
 	}
178 178
 	$enddate = $_COOKIE['archive_end'];
179 179
 	$enddateinitial = $_COOKIE['archive_end'];
180
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
181
-	$begindate = date('Y-m-d H:i:s',$begindate);
182
-	$enddate = date('Y-m-d H:i:s',$enddate);
180
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
181
+	$begindate = date('Y-m-d H:i:s', $begindate);
182
+	$enddate = date('Y-m-d H:i:s', $enddate);
183 183
 	//echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
184 184
 	if ($tracker) {
185
-		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
185
+		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter);
186 186
 	} elseif ($marine) {
187
-		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
187
+		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter);
188 188
 	} else {
189
-		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
189
+		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
190 190
 	}
191 191
 } elseif ($tracker) {
192 192
 	$coord = array();
193 193
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
194
-		$coord = explode(',',$_GET['coord']);
195
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
194
+		$coord = explode(',', $_GET['coord']);
195
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
196 196
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
197 197
 			$coord = array();
198 198
 		}
199 199
 	}
200 200
 	$previous_filter = $filter;
201 201
 	if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) {
202
-		$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker']));
203
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
202
+		$filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker']));
203
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
204 204
 	/*
205 205
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) {
206 206
 		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']);
207 207
 	*/
208 208
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
209
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
209
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
210 210
 	} else {
211 211
 		$spotter_array = array();
212 212
 	}
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	$coord = array();
216 216
 	//if (isset($_GET['coord']) && $_GET['coord'] != '') {
217 217
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
218
-		$coord = explode(',',$_GET['coord']);
219
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
218
+		$coord = explode(',', $_GET['coord']);
219
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
220 220
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
221 221
 			$coord = array();
222 222
 		}
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) {
226 226
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine']));
227 227
 		//$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
228
-		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'],$filter,false);
228
+		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'], $filter, false);
229 229
 	} elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) {
230
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']);
230
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false, $_COOKIE['MapTrack']);
231 231
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
232
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
232
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false);
233 233
 	} else {
234 234
 		$spotter_array = array();
235 235
 	}
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 } else {
238 238
 	$coord = array();
239 239
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
240
-		$coord = explode(',',$_GET['coord']);
241
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
240
+		$coord = explode(',', $_GET['coord']);
241
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
242 242
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
243 243
 			$coord = array();
244 244
 		}
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
 	$previous_filter = $filter;
247 247
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) {
248 248
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack']));
249
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false);
249
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'], $filter, false);
250 250
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false);
251 251
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') {
252 252
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false);
253 253
 		//if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']);
254
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']);
254
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false, $_COOKIE['MapTrack']);
255 255
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
256
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false);
256
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false);
257 257
 	} else {
258 258
 		$spotter_array = array();
259 259
 	}
@@ -263,19 +263,19 @@  discard block
 block discarded – undo
263 263
 if (!empty($spotter_array) && isset($coord)) {
264 264
 	if ($tracker) {
265 265
 		if (isset($_GET['archive'])) {
266
-			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter);
266
+			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter);
267 267
 		} else {
268 268
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
269 269
 		}
270 270
 	} elseif ($marine) {
271 271
 		if (isset($_GET['archive'])) {
272
-			$flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter);
272
+			$flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter);
273 273
 		} else {
274 274
 			$flightcnt = $MarineLive->getLiveMarineCount($filter);
275 275
 		}
276 276
 	} else {
277 277
 		if (isset($_GET['archive'])) {
278
-			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
278
+			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
279 279
 		} else {
280 280
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
281 281
 		}
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
 	if ($flightcnt == '') $flightcnt = 0;
284 284
 } else $flightcnt = 0;
285 285
 
286
-$sqltime = round(microtime(true)-$begintime,2);
286
+$sqltime = round(microtime(true) - $begintime, 2);
287 287
 $minitime = time();
288 288
 $minitracktime_begin = time();
289 289
 $minitracktime = $minitracktime_begin;
290 290
 $maxitime = 0;
291
-$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
291
+$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT);
292 292
 $modelsdb = array();
293 293
 if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
294
-	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
295
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
296
-			if (isset($row[1]) ){
294
+	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) {
295
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
296
+			if (isset($row[1])) {
297 297
 				$model = $row[0];
298 298
 				$modelsdb[$model] = $row[1];
299 299
 			}
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 }
304 304
 $modelsdb2 = array();
305 305
 if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
306
-	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
307
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
308
-			if (isset($row[1]) ){
306
+	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) {
307
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
308
+			if (isset($row[1])) {
309 309
 				$model = $row[0];
310 310
 				$glb = $row[1];
311 311
 				if (isset($row[2])) {
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 if (!empty($spotter_array) && is_array($spotter_array))
352 352
 {
353 353
 	$nblatlong = 0;
354
-	foreach($spotter_array as $spotter_item)
354
+	foreach ($spotter_array as $spotter_item)
355 355
 	{
356 356
 		$j++;
357 357
 		//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
 			}
406 406
 			if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
407 407
 			if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",';
408
-			if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).',';
408
+			if (isset($spotter_item['ident'])) $output .= '"ident": '.json_encode($spotter_item['ident']).',';
409 409
 			if ($tracker) {
410 410
 				if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
411
-				$output.= '"type": "tracker"';
411
+				$output .= '"type": "tracker"';
412 412
 			} elseif ($marine) {
413 413
 				if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).',';
414 414
 				if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
415 415
 				if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].',';
416 416
 				if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).',';
417 417
 				if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",';
418
-				$output.= '"type": "marine"';
418
+				$output .= '"type": "marine"';
419 419
 			} else {
420 420
 				if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) {
421 421
 					$aircraft_icao = $spotter_item['aircraft_icao'];
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
 						if (isset($airline_icao)) {
430 430
 							$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
431 431
 							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
432
-								$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
432
+								$output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
433 433
 							}
434 434
 						}
435 435
 					}
436 436
 					//if ($ident != '') $output.= '"ident": "'.$ident.'",';
437 437
 				}
438
-				$output.= '"gltf2": %gltf2%,';
439
-				$output.= '"type": "flight"';
438
+				$output .= '"gltf2": %gltf2%,';
439
+				$output .= '"type": "flight"';
440 440
 			}
441 441
 			$output .= '},';
442 442
 
@@ -811,8 +811,8 @@  discard block
 block discarded – undo
811 811
 					$output .= '},';
812 812
 				}
813 813
 			}
814
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
815
-			else $output = str_replace('%onground%','false',$output);
814
+			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output);
815
+			else $output = str_replace('%onground%', 'false', $output);
816 816
 
817 817
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
818 818
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
829 829
 			if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']);
830 830
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
831
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
831
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
832 832
 			$output .= $spotter_item['longitude'].', ';
833 833
 			$output .= $spotter_item['latitude'];
834 834
 			$prevlong = $spotter_item['longitude'];
@@ -856,8 +856,8 @@  discard block
 block discarded – undo
856 856
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
857 857
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
858 858
 		} else {
859
-			$nblatlong = $nblatlong+1;
860
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
859
+			$nblatlong = $nblatlong + 1;
860
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
861 861
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
862 862
 			if ($spotter_item['ground_speed'] == 0) {
863 863
 				$output .= $prevlong.', ';
@@ -898,26 +898,26 @@  discard block
 block discarded – undo
898 898
 $output .= ']';
899 899
 if (isset($globalArchive) && $globalArchive === TRUE) {
900 900
 	if (isset($begindateinitial)) {
901
-		$output = str_replace('%minitime%',date("c",$begindateinitial),$output);
902
-	} elseif ((time()-$globalLiveInterval) > $minitime) {
903
-		if (time()-$globalLiveInterval > $maxitime) {
904
-			$output = str_replace('%minitime%',date("c",$maxitime),$output);
901
+		$output = str_replace('%minitime%', date("c", $begindateinitial), $output);
902
+	} elseif ((time() - $globalLiveInterval) > $minitime) {
903
+		if (time() - $globalLiveInterval > $maxitime) {
904
+			$output = str_replace('%minitime%', date("c", $maxitime), $output);
905 905
 		} else {
906
-			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
906
+			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output);
907 907
 		}
908 908
 	}
909
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
909
+	else $output = str_replace('%minitime%', date("c", $minitime), $output);
910 910
 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
911
-	$output = str_replace('%minitime%',date("c",$minitracktime),$output);
911
+	$output = str_replace('%minitime%', date("c", $minitracktime), $output);
912 912
 } else {
913
-	$output = str_replace('%minitime%',date("c",$minitime),$output);
913
+	$output = str_replace('%minitime%', date("c", $minitime), $output);
914 914
 }
915 915
 if (isset($enddateinitial)) {
916
-	$output = str_replace('%maxitime%',date("c",$enddateinitial),$output);
916
+	$output = str_replace('%maxitime%', date("c", $enddateinitial), $output);
917 917
 } else {
918
-	$output = str_replace('%maxitime%',date("c",$maxitime),$output);
918
+	$output = str_replace('%maxitime%', date("c", $maxitime), $output);
919 919
 }
920
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
921
-else $output = str_replace('%gltf2%','false',$output);
920
+if ($gltf2) $output = str_replace('%gltf2%', 'true', $output);
921
+else $output = str_replace('%gltf2%', 'false', $output);
922 922
 print $output;
923 923
 ?>
Please login to merge, or discard this patch.