Completed
Push — master ( 2b882e...bc1889 )
by Yannick
32:12
created
live-geojson.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 $min = true;
56 56
 $allhistory = false;
57 57
 $filter['source'] = array();
58
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
59
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
60
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
61
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
62
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
63
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
64
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
65
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
66
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
67
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
68
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
58
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
59
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
60
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
61
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
62
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
63
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
64
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
65
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
66
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
67
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
68
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
69 69
 
70 70
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
71 71
 	$min = true;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 $spotter_array = array();
75 75
 
76 76
 if (isset($_GET['ident'])) {
77
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
77
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
78 78
 	if ($tracker) {
79 79
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
80 80
 	} elseif ($marine) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 	$allhistory = true;
90 90
 } elseif (isset($_GET['flightaware_id'])) {
91
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
91
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
92 92
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
93 93
 	if (empty($spotter_array)) {
94 94
 		$from_archive = true;
@@ -96,38 +96,38 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 	$allhistory = true;
98 98
 } elseif (isset($_GET['famtrack_id'])) {
99
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
99
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
100 100
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
101 101
 	$allhistory = true;
102 102
 } elseif (isset($_GET['fammarine_id'])) {
103
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
103
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
104 104
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
105 105
 	$allhistory = true;
106 106
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) {
107 107
 //} elseif (isset($_GET['coord'])) {
108 108
 	$usecoord = true;
109
-	$coord = explode(',',$_GET['coord']);
110
-	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) 
109
+	$coord = explode(',', $_GET['coord']);
110
+	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) 
111 111
 	    && $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) {
112 112
 		if ($tracker) {
113
-			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter);
113
+			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter);
114 114
 		} elseif ($marine) {
115
-			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter);
115
+			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter);
116 116
 		} else {
117
-			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
117
+			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter);
118 118
 		}
119 119
 	}
120 120
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) {
121 121
 	$usecoord = true;
122
-	$coord = explode(',',$_GET['coord']);
123
-	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) 
122
+	$coord = explode(',', $_GET['coord']);
123
+	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) 
124 124
 	    && $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) {
125 125
 		if ($tracker) {
126
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
126
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
127 127
 		} elseif ($marine) {
128
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
128
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
129 129
 		} else {
130
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
130
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
131 131
 		}
132 132
 	} else {
133 133
 		if ($tracker) {
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	$from_archive = true;
143 143
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
144 144
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
145
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
146
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
147
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
148
-	$begindate = date('Y-m-d H:i:s',$begindate);
149
-	$enddate = date('Y-m-d H:i:s',$enddate);
150
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
145
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
146
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
147
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
148
+	$begindate = date('Y-m-d H:i:s', $begindate);
149
+	$enddate = date('Y-m-d H:i:s', $enddate);
150
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
151 151
 } elseif ($min) {
152 152
 	if ($tracker) {
153 153
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 #	$min = true;
160 160
 } else {
161 161
 	if ($tracker) {
162
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
162
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
163 163
 	} elseif ($marine) {
164
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
164
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
165 165
 	} else {
166
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
166
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
167 167
 	}
168 168
 }
169 169
 
170 170
 if ($usecoord) {
171 171
 	if (isset($_GET['archive'])) {
172
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
172
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
173 173
 	} else {
174 174
 		if ($tracker) {
175 175
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 	if ($flightcnt == '') $flightcnt = 0;
183 183
 } else $flightcnt = 0;
184 184
 
185
-$sqltime = round(microtime(true)-$begintime,2);
185
+$sqltime = round(microtime(true) - $begintime, 2);
186 186
 
187
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
187
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
188 188
 if ($currenttime != '') $currenttime = round($currenttime/1000);
189 189
 
190 190
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		if (!empty($spotter_array) && is_array($spotter_array))
204 204
 		{
205 205
 			$output .= '"features": [';
206
-			foreach($spotter_array as $spotter_item)
206
+			foreach ($spotter_array as $spotter_item)
207 207
 			{
208 208
 				$j++;
209 209
 				date_default_timezone_set('UTC');
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
 */
260 260
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
261 261
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
262
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
263
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
262
+							if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",';
263
+							else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",';
264 264
 							//"
265 265
 						} else {
266 266
 							if ($compress) $output .= '"c": "NA",';
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
270 270
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
271 271
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
272
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
272
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
273 273
 						} elseif (isset($spotter_item['aircraft_type'])) {
274 274
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
275 275
 						} elseif (!$min) {
@@ -412,34 +412,34 @@  discard block
 block discarded – undo
412 412
 						if ($currenttime != '') {
413 413
 							if (strtotime($spotter_item['date']) < $currenttime) {
414 414
 								if (isset($archivespeed)) {
415
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
415
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
416 416
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
417 417
 								} elseif ($usenextlatlon) {
418
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
418
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
419 419
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
420 420
 								}
421 421
 							} else {
422 422
 								if (isset($archivespeed)) {
423
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
423
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
424 424
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
425 425
 								} elseif ($usenextlatlon) {
426
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
426
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
427 427
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
428 428
 								}
429 429
 							}
430 430
 						} else {
431 431
 							if (isset($archivespeed)) {
432
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
432
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
433 433
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
434 434
 							} elseif ($usenextlatlon) {
435
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
435
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
436 436
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
437 437
 							}
438 438
 						}
439 439
 
440 440
 						if (!$min) $output .= '"image": "'.$image.'",';
441 441
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
442
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
442
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
443 443
 						}
444 444
 						if (isset($spotter_item['image_source_website'])) {
445 445
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
462 462
 						}
463 463
 						if (isset($spotter_item['acars'])) {
464
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
464
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
465 465
 						}
466 466
 						// type when not aircraft ?
467 467
 						if (isset($spotter_item['type'])) {
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 								if ($currenttime != '') {
482 482
 									if (strtotime($spotter_item['date']) < $currenttime) {
483 483
 										if (!isset($archivespeed)) $archivespeed = 1;
484
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date']));
484
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date']));
485 485
 										$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
486 486
 									} else {
487 487
 										$output .= $spotter_item['longitude'].', ';
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
                 
551 551
 			}
552 552
 */
553
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
553
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
554 554
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
555 555
 				
556 556
 				if (
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
559 559
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
560 560
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
561
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
561
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
562 562
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
563
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
563
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
564 564
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
565
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
565
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
566 566
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
567 567
 				    ) {
568 568
 					if ($tracker) {
@@ -599,9 +599,9 @@  discard block
 block discarded – undo
599 599
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
600 600
 							}
601 601
 							$output_history .= '[';
602
-							$output_history .=  $spotter_history['longitude'].', ';
603
-							$output_history .=  $spotter_history['latitude'].', ';
604
-							$output_history .=  $spotter_history['altitude']*30.48;
602
+							$output_history .= $spotter_history['longitude'].', ';
603
+							$output_history .= $spotter_history['latitude'].', ';
604
+							$output_history .= $spotter_history['altitude']*30.48;
605 605
 							$output_history .= '],';
606 606
 							/*
607 607
 							if ($from_archive === false) {
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
620 620
 							} else $d = true;
621 621
 							$output_history .= '[';
622
-							$output_history .=  $spotter_history['longitude'].', ';
623
-							$output_history .=  $spotter_history['latitude'];
622
+							$output_history .= $spotter_history['longitude'].', ';
623
+							$output_history .= $spotter_history['latitude'];
624 624
 							$output_history .= '],';
625 625
 							/*
626 626
 							if ($from_archive === false) {
@@ -636,9 +636,9 @@  discard block
 block discarded – undo
636 636
 					
637 637
 						if ($from_archive === false) {
638 638
 							$output_historyd = '[';
639
-							$output_historyd .=  $spotter_item['longitude'].', ';
640
-							$output_historyd .=  $spotter_item['latitude'];
641
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
639
+							$output_historyd .= $spotter_item['longitude'].', ';
640
+							$output_historyd .= $spotter_item['latitude'];
641
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
642 642
 							$output_historyd .= '],';
643 643
 							//$output_history = $output_historyd.$output_history;
644 644
 							$output_history = $output_history.$output_historyd;
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 					}
653 653
 				}
654 654
 				
655
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
655
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
656 656
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
657 657
 				     && (isset($spotter_item['departure_airport']) 
658 658
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 
687 687
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
688 688
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
689
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
689
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
690 690
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
691 691
 				     && (isset($spotter_item['arrival_airport']) 
692 692
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$output  = substr($output, 0, -1);
718 718
 			$output .= ']';
719 719
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
720
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
720
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
721 721
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
722 722
 			$output .= '"fc": "'.$j.'"';
723 723
 		} else {
Please login to merge, or discard this patch.