Completed
Push — master ( 768300...134c31 )
by Yannick
18:23
created
live-geojson.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -55,23 +55,23 @@  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_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
65
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
66
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
67
-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_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
65
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
66
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
67
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
68 68
 
69 69
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
70 70
 	$min = true;
71 71
 } else $min = false;
72 72
 
73 73
 if (isset($_GET['ident'])) {
74
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
74
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
75 75
 	if ($tracker) {
76 76
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
77 77
 	} elseif ($marine) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 	$allhistory = true;
87 87
 } elseif (isset($_GET['flightaware_id'])) {
88
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
88
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
89 89
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
90 90
 	if (empty($spotter_array)) {
91 91
 		$from_archive = true;
@@ -93,44 +93,44 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 	$allhistory = true;
95 95
 } elseif (isset($_GET['famtrack_id'])) {
96
-	$famtrack_id = filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING);
96
+	$famtrack_id = filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING);
97 97
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
98 98
 	$allhistory = true;
99 99
 } elseif (isset($_GET['fammarine_id'])) {
100
-	$fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING);
100
+	$fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING);
101 101
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
102 102
 	$allhistory = true;
103 103
 } elseif (isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) {
104 104
 //} elseif (isset($_GET['coord'])) {
105 105
 	$usecoord = true;
106
-	$coord = explode(',',$_GET['coord']);
106
+	$coord = explode(',', $_GET['coord']);
107 107
 	if ($tracker) {
108
-		$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter);
108
+		$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter);
109 109
 	} elseif ($marine) {
110
-		$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter);
110
+		$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter);
111 111
 	} else {
112
-		$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
112
+		$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter);
113 113
 	}
114 114
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) {
115 115
 	$usecoord = true;
116
-	$coord = explode(',',$_GET['coord']);
116
+	$coord = explode(',', $_GET['coord']);
117 117
 	if ($tracker) {
118
-		$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
118
+		$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
119 119
 	} elseif ($marine) {
120
-		$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
120
+		$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
121 121
 	} else {
122
-		$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
122
+		$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
123 123
 	}
124 124
 } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) {
125 125
 	$from_archive = true;
126 126
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
127 127
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
128
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
129
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
130
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
131
-	$begindate = date('Y-m-d H:i:s',$begindate);
132
-	$enddate = date('Y-m-d H:i:s',$enddate);
133
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
128
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
129
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
130
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
131
+	$begindate = date('Y-m-d H:i:s', $begindate);
132
+	$enddate = date('Y-m-d H:i:s', $enddate);
133
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
134 134
 } elseif ($min) {
135 135
 	if ($tracker) {
136 136
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -142,18 +142,18 @@  discard block
 block discarded – undo
142 142
 #	$min = true;
143 143
 } else {
144 144
 	if ($tracker) {
145
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
145
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
146 146
 	} elseif ($marine) {
147
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
147
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
148 148
 	} else {
149
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
149
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
150 150
 	}
151 151
 }
152 152
 
153 153
 if (!empty($spotter_array) || $usecoord) {
154 154
 	if ($usecoord) {
155 155
 		if (isset($_GET['archive'])) {
156
-			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
156
+			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
157 157
 		} else {
158 158
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
159 159
 		}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	if ($flightcnt == '') $flightcnt = 0;
162 162
 } else $flightcnt = 0;
163 163
 
164
-$sqltime = round(microtime(true)-$begintime,2);
164
+$sqltime = round(microtime(true) - $begintime, 2);
165 165
 
166 166
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
167 167
 else $usenextlatlon = true;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		if (!empty($spotter_array) && is_array($spotter_array))
179 179
 		{
180 180
 			$output .= '"features": [';
181
-			foreach($spotter_array as $spotter_item)
181
+			foreach ($spotter_array as $spotter_item)
182 182
 			{
183 183
 				$j++;
184 184
 				date_default_timezone_set('UTC');
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
244 244
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
245 245
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
246
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
246
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
247 247
 						} elseif (isset($spotter_item['aircraft_type'])) {
248 248
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
249 249
 						} elseif (!$min) {
@@ -383,16 +383,16 @@  discard block
 block discarded – undo
383 383
 						else $output .= '"heading": "'.$spotter_item['heading'].'",';
384 384
 						
385 385
 						if (isset($archivespeed)) {
386
-							$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
386
+							$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
387 387
 							$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
388 388
 						} elseif ($usenextlatlon) {
389
-							$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
389
+							$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
390 390
 							$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
391 391
 						}
392 392
 
393 393
 						if (!$min) $output .= '"image": "'.$image.'",';
394 394
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
395
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
395
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
396 396
 						}
397 397
 						if (isset($spotter_item['image_source_website'])) {
398 398
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
415 415
 						}
416 416
 						if (isset($spotter_item['acars'])) {
417
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
417
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
418 418
 						}
419 419
 						// type when not aircraft ?
420 420
 						if (isset($spotter_item['type'])) {
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 
493 493
 			}
494 494
 */
495
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
495
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
496 496
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
497 497
 				
498 498
 				if (
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
501 501
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
502 502
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
503
-				    || (isset($history) && $history != '' && $history != 'NA' && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
503
+				    || (isset($history) && $history != '' && $history != 'NA' && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
504 504
 				    || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
505 505
 				    ) {
506 506
 					if ($tracker) {
@@ -529,9 +529,9 @@  discard block
 block discarded – undo
529 529
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
530 530
 							}
531 531
 							$output_history .= '[';
532
-							$output_history .=  $spotter_history['longitude'].', ';
533
-							$output_history .=  $spotter_history['latitude'].', ';
534
-							$output_history .=  $spotter_history['altitude']*30.48;
532
+							$output_history .= $spotter_history['longitude'].', ';
533
+							$output_history .= $spotter_history['latitude'].', ';
534
+							$output_history .= $spotter_history['altitude']*30.48;
535 535
 							$output_history .= '],';
536 536
 							$prev_alt = $alt;
537 537
 						} else {
@@ -540,8 +540,8 @@  discard block
 block discarded – undo
540 540
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
541 541
 							} else $d = true;
542 542
 							$output_history .= '[';
543
-							$output_history .=  $spotter_history['longitude'].', ';
544
-							$output_history .=  $spotter_history['latitude'];
543
+							$output_history .= $spotter_history['longitude'].', ';
544
+							$output_history .= $spotter_history['latitude'];
545 545
 							$output_history .= '],';
546 546
 						}
547 547
 					}
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 			$output  = substr($output, 0, -1);
581 581
 			$output .= ']';
582 582
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
583
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
583
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
584 584
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
585 585
 			$output .= '"fc": "'.$j.'"';
586 586
 		} else {
Please login to merge, or discard this patch.
live-czml.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
     $s3 = sin($bank/2);
44 44
     $c1c2 = $c1*$c2;
45 45
     $s1s2 = $s1*$s2;
46
-    $w =$c1c2*$c3 - $s1s2*$s3;
47
-    $x =$c1c2*$s3 + $s1s2*$c3;
48
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
49
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
50
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
46
+    $w = $c1c2*$c3 - $s1s2*$s3;
47
+    $x = $c1c2*$s3 + $s1s2*$c3;
48
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
49
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
50
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
51 51
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
52 52
 
53 53
 }
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
 $min = false;
69 69
 $allhistory = false;
70 70
 $filter['source'] = array();
71
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
72
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
73
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
74
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
75
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
76
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
78
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
79
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
80
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
71
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
72
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
73
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
74
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
75
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
76
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
77
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
78
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
79
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
80
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
81 81
 /*
82 82
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
83 83
 	$min = true;
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 	$from_archive = true;
125 125
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
126 126
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
127
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
128
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
129
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
130
-	$begindate = date('Y-m-d H:i:s',$begindate);
131
-	$enddate = date('Y-m-d H:i:s',$enddate);
132
-	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
127
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
128
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
129
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
130
+	$begindate = date('Y-m-d H:i:s', $begindate);
131
+	$enddate = date('Y-m-d H:i:s', $enddate);
132
+	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
133 133
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
134 134
 	$from_archive = true;
135 135
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	$begindate = $_COOKIE['archive_begin'];
140 140
 	$enddate = $_COOKIE['archive_end'];
141 141
 
142
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
143
-	$begindate = date('Y-m-d H:i:s',$begindate);
144
-	$enddate = date('Y-m-d H:i:s',$enddate);
142
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
143
+	$begindate = date('Y-m-d H:i:s', $begindate);
144
+	$enddate = date('Y-m-d H:i:s', $enddate);
145 145
 //	echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
146
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
146
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
147 147
 } elseif ($tracker) {
148 148
 	$spotter_array = $TrackerLive->getMinLastLiveTrackerData($filter);
149 149
 } elseif ($marine) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 if (!empty($spotter_array)) {
156 156
 	if (isset($_GET['archive'])) {
157
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
157
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
158 158
 	} elseif ($tracker) {
159 159
 		$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
160 160
 	} elseif ($marine) {
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
 	if ($flightcnt == '') $flightcnt = 0;
166 166
 } else $flightcnt = 0;
167 167
 
168
-$sqltime = round(microtime(true)-$begintime,2);
168
+$sqltime = round(microtime(true) - $begintime, 2);
169 169
 $minitime = time();
170 170
 $maxitime = 0;
171 171
 
172 172
 
173 173
 $modelsdb = array();
174 174
 if (file_exists('models/modelsdb')) {
175
-	if (($handle = fopen('models/modelsdb','r')) !== FALSE) {
176
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
177
-			if (isset($row[1]) ){
175
+	if (($handle = fopen('models/modelsdb', 'r')) !== FALSE) {
176
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
177
+			if (isset($row[1])) {
178 178
 				$model = $row[0];
179 179
 				$modelsdb[$model] = $row[1];
180 180
 			}
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 $output .= '},';
210 210
 if (!empty($spotter_array) && is_array($spotter_array))
211 211
 {
212
-	foreach($spotter_array as $spotter_item)
212
+	foreach ($spotter_array as $spotter_item)
213 213
 	{
214 214
 		$j++;
215 215
 		date_default_timezone_set('UTC');
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 			$output .= '"cartographicDegrees": [';
498 498
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
499 499
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
500
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
500
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
501 501
 			$output .= $spotter_item['longitude'].', ';
502 502
 			$output .= $spotter_item['latitude'];
503 503
 			$prevlong = $spotter_item['longitude'];
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
512 512
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
513 513
 		} else {
514
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
514
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
515 515
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
516 516
 			if ($spotter_item['ground_speed'] == 0) {
517 517
 				$output .= $prevlong.', ';
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	$output  = substr($output, 0, -1);
544 544
 }
545 545
 $output .= ']';
546
-$output = str_replace('%minitime%',date("c",$minitime),$output);
547
-$output = str_replace('%maxitime%',date("c",$maxitime),$output);
546
+$output = str_replace('%minitime%', date("c", $minitime), $output);
547
+$output = str_replace('%maxitime%', date("c", $maxitime), $output);
548 548
 print $output;
549 549
 ?>
Please login to merge, or discard this patch.