Completed
Push — master ( 2ab4e5...560446 )
by Yannick
32:23
created
live-geojson.php 1 patch
Spacing   +63 added lines, -63 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,26 +412,26 @@  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
 							}
422 422
 						} else {
423 423
 							if (isset($archivespeed)) {
424
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
424
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
425 425
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
426 426
 							} elseif ($usenextlatlon) {
427
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
427
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
428 428
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
429 429
 							}
430 430
 						}
431 431
 
432 432
 						if (!$min) $output .= '"image": "'.$image.'",';
433 433
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
434
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
434
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
435 435
 						}
436 436
 						if (isset($spotter_item['image_source_website'])) {
437 437
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
454 454
 						}
455 455
 						if (isset($spotter_item['acars'])) {
456
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
456
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
457 457
 						}
458 458
 						// type when not aircraft ?
459 459
 						if (isset($spotter_item['type'])) {
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 								if ($currenttime != '') {
474 474
 									if (strtotime($spotter_item['date']) < $currenttime) {
475 475
 										if (!isset($archivespeed)) $archivespeed = 1;
476
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date']));
476
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date']));
477 477
 										$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
478 478
 									} else {
479 479
 										$output .= $spotter_item['longitude'].', ';
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                 
543 543
 			}
544 544
 */
545
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
545
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
546 546
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
547 547
 				
548 548
 				if (
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
551 551
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
552 552
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
553
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
553
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
554 554
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
555
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
555
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
556 556
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
557
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
557
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
558 558
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
559 559
 				    ) {
560 560
 					if ($tracker) {
@@ -591,9 +591,9 @@  discard block
 block discarded – undo
591 591
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
592 592
 							}
593 593
 							$output_history .= '[';
594
-							$output_history .=  $spotter_history['longitude'].', ';
595
-							$output_history .=  $spotter_history['latitude'].', ';
596
-							$output_history .=  $spotter_history['altitude']*30.48;
594
+							$output_history .= $spotter_history['longitude'].', ';
595
+							$output_history .= $spotter_history['latitude'].', ';
596
+							$output_history .= $spotter_history['altitude']*30.48;
597 597
 							$output_history .= '],';
598 598
 							/*
599 599
 							if ($from_archive === false) {
@@ -611,8 +611,8 @@  discard block
 block discarded – undo
611 611
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
612 612
 							} else $d = true;
613 613
 							$output_history .= '[';
614
-							$output_history .=  $spotter_history['longitude'].', ';
615
-							$output_history .=  $spotter_history['latitude'];
614
+							$output_history .= $spotter_history['longitude'].', ';
615
+							$output_history .= $spotter_history['latitude'];
616 616
 							$output_history .= '],';
617 617
 							/*
618 618
 							if ($from_archive === false) {
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
 					
629 629
 						if ($from_archive === false) {
630 630
 							$output_historyd = '[';
631
-							$output_historyd .=  $spotter_item['longitude'].', ';
632
-							$output_historyd .=  $spotter_item['latitude'];
633
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
631
+							$output_historyd .= $spotter_item['longitude'].', ';
632
+							$output_historyd .= $spotter_item['latitude'];
633
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
634 634
 							$output_historyd .= '],';
635 635
 							//$output_history = $output_historyd.$output_history;
636 636
 							$output_history = $output_history.$output_historyd;
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 					}
645 645
 				}
646 646
 				
647
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
647
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
648 648
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
649 649
 				     && (isset($spotter_item['departure_airport']) 
650 650
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 
679 679
 				//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))))) {
680 680
 				//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))))) {
681
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
681
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
682 682
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
683 683
 				     && (isset($spotter_item['arrival_airport']) 
684 684
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output  = substr($output, 0, -1);
710 710
 			$output .= ']';
711 711
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
712
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
712
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
713 713
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
714 714
 			$output .= '"fc": "'.$j.'"';
715 715
 		} else {
Please login to merge, or discard this patch.