@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // This script can be slow... |
3 | 3 | set_time_limit(0); |
4 | -ini_set('max_execution_time',6000); |
|
4 | +ini_set('max_execution_time', 6000); |
|
5 | 5 | require_once('require/class.Connection.php'); |
6 | 6 | require_once('require/class.Common.php'); |
7 | 7 | |
@@ -63,24 +63,24 @@ discard block |
||
63 | 63 | $min = false; |
64 | 64 | $allhistory = false; |
65 | 65 | $filter['source'] = array(); |
66 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
71 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
72 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
66 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
69 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
71 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
72 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
73 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
74 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
75 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
76 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
77 | 77 | |
78 | 78 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
79 | 79 | $min = true; |
80 | 80 | } else $min = false; |
81 | 81 | |
82 | 82 | if (isset($_GET['ident'])) { |
83 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
83 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
84 | 84 | $from_archive = true; |
85 | 85 | if ($tracker) { |
86 | 86 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $allhistory = true; |
95 | 95 | } |
96 | 96 | elseif (isset($_GET['flightaware_id'])) { |
97 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
97 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
98 | 98 | $from_archive = true; |
99 | 99 | if ($tracker) { |
100 | 100 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($flightaware_id); |
@@ -109,23 +109,23 @@ discard block |
||
109 | 109 | } |
110 | 110 | elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
111 | 111 | $from_archive = true; |
112 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
112 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
113 | 113 | if (isset($globalAircraftMaxUpdate)) $begindate = $begindate - $globalAircraftMaxUpdate; |
114 | 114 | else $begindate = $begindate - 3000; |
115 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
116 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
115 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
116 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
117 | 117 | if ($begindate != '' && $enddate != '') { |
118 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
119 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
118 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
119 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
120 | 120 | //$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
121 | 121 | if ($tracker) { |
122 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
122 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
123 | 123 | } |
124 | 124 | elseif ($marine) { |
125 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
125 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
126 | 126 | } |
127 | 127 | else { |
128 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
128 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ($flightcnt == '') $flightcnt = 0; |
137 | 137 | } else $flightcnt = 0; |
138 | 138 | |
139 | -$sqltime = round(microtime(true)-$begintime,2); |
|
139 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
140 | 140 | |
141 | 141 | $pfi = ''; |
142 | 142 | //var_dump($spotter_array); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $begin = true; |
152 | 152 | if (!empty($spotter_array) && is_array($spotter_array)) { |
153 | 153 | $output .= '"features": ['; |
154 | - foreach($spotter_array as $spotter_item) { |
|
154 | + foreach ($spotter_array as $spotter_item) { |
|
155 | 155 | $j++; |
156 | 156 | date_default_timezone_set('UTC'); |
157 | 157 | if ($tracker) { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if ($begin) { |
176 | 176 | if ($j > 1) { |
177 | 177 | if (isset($output_time)) { |
178 | - $output_time = substr($output_time, 0, -1); |
|
178 | + $output_time = substr($output_time, 0, -1); |
|
179 | 179 | $output .= '"time": ['.$output_time.']'; |
180 | 180 | } |
181 | 181 | $output .= '},'; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $output .= '"type": "LineString",'; |
185 | 185 | $output .= '"coordinates": ['; |
186 | 186 | if (isset($output_history)) { |
187 | - $output_history = substr($output_history, 0, -1); |
|
187 | + $output_history = substr($output_history, 0, -1); |
|
188 | 188 | $output .= $output_history; |
189 | 189 | } |
190 | 190 | $output .= ']}},'; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | |
349 | 349 | if ($j > 1) { |
350 | 350 | if (isset($output_time)) { |
351 | - $output_time = substr($output_time, 0, -1); |
|
351 | + $output_time = substr($output_time, 0, -1); |
|
352 | 352 | $output .= '"time": ['.$output_time.']'; |
353 | 353 | } |
354 | 354 | $output .= '},'; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $output .= '"type": "LineString",'; |
358 | 358 | $output .= '"coordinates": ['; |
359 | 359 | if (isset($output_history)) { |
360 | - $output_history = substr($output_history, 0, -1); |
|
360 | + $output_history = substr($output_history, 0, -1); |
|
361 | 361 | $output .= $output_history; |
362 | 362 | } |
363 | 363 | $output .= ']'; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $output = substr($output, 0, -1); |
369 | 369 | $output .= ']'; |
370 | 370 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
371 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
371 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
372 | 372 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
373 | 373 | $output .= '"fc": "'.$flightcnt.'"'; |
374 | 374 | } else { |