|
@@ -64,17 +64,17 @@ discard block |
|
|
block discarded – undo |
|
64
|
64
|
$min = true; |
|
65
|
65
|
$allhistory = false; |
|
66
|
66
|
$filter['source'] = array(); |
|
67
|
|
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
68
|
|
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
69
|
|
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
70
|
|
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
71
|
|
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
72
|
|
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
73
|
|
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
74
|
|
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
75
|
|
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76
|
|
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
77
|
|
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
|
67
|
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
|
68
|
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
|
69
|
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
|
70
|
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
|
71
|
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
|
72
|
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
|
73
|
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
|
74
|
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
|
75
|
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
|
76
|
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
|
77
|
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
78
|
78
|
|
|
79
|
79
|
if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
|
80
|
80
|
$min = true; |
|
@@ -83,7 +83,7 @@ discard block |
|
|
block discarded – undo |
|
83
|
83
|
$spotter_array = array(); |
|
84
|
84
|
|
|
85
|
85
|
if (isset($_GET['ident'])) { |
|
86
|
|
- $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
|
86
|
+ $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
87
|
87
|
if ($tracker) { |
|
88
|
88
|
$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
|
89
|
89
|
} elseif ($marine) { |
|
@@ -97,7 +97,7 @@ discard block |
|
|
block discarded – undo |
|
97
|
97
|
} |
|
98
|
98
|
$allhistory = true; |
|
99
|
99
|
} elseif (isset($_GET['flightaware_id'])) { |
|
100
|
|
- $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
|
100
|
+ $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
101
|
101
|
$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
|
102
|
102
|
if (empty($spotter_array)) { |
|
103
|
103
|
$from_archive = true; |
|
@@ -105,11 +105,11 @@ discard block |
|
|
block discarded – undo |
|
105
|
105
|
} |
|
106
|
106
|
$allhistory = true; |
|
107
|
107
|
} elseif (isset($_GET['famtrack_id'])) { |
|
108
|
|
- $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
|
108
|
+ $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
109
|
109
|
$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
|
110
|
110
|
$allhistory = true; |
|
111
|
111
|
} elseif (isset($_GET['fammarine_id'])) { |
|
112
|
|
- $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
|
112
|
+ $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
113
|
113
|
$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
|
114
|
114
|
$allhistory = true; |
|
115
|
115
|
/* |
|
@@ -129,15 +129,15 @@ discard block |
|
|
block discarded – undo |
|
129
|
129
|
*/ |
|
130
|
130
|
} elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
|
131
|
131
|
$usecoord = true; |
|
132
|
|
- $coord = explode(',',$_GET['coord']); |
|
133
|
|
- 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) |
|
|
132
|
+ $coord = explode(',', $_GET['coord']); |
|
|
133
|
+ 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) |
|
134
|
134
|
&& $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) { |
|
135
|
135
|
if ($tracker) { |
|
136
|
|
- $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
|
136
|
+ $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
137
|
137
|
} elseif ($marine) { |
|
138
|
|
- $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
|
138
|
+ $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
139
|
139
|
} else { |
|
140
|
|
- $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
|
140
|
+ $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
141
|
141
|
} |
|
142
|
142
|
} else { |
|
143
|
143
|
if ($tracker) { |
|
@@ -152,12 +152,12 @@ discard block |
|
|
block discarded – undo |
|
152
|
152
|
$from_archive = true; |
|
153
|
153
|
// $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
|
154
|
154
|
// $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
|
155
|
|
- $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
156
|
|
- $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
157
|
|
- $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
158
|
|
- $begindate = date('Y-m-d H:i:s',$begindate); |
|
159
|
|
- $enddate = date('Y-m-d H:i:s',$enddate); |
|
160
|
|
- $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
|
155
|
+ $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
|
156
|
+ $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
|
157
|
+ $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
|
158
|
+ $begindate = date('Y-m-d H:i:s', $begindate); |
|
|
159
|
+ $enddate = date('Y-m-d H:i:s', $enddate); |
|
|
160
|
+ $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
161
|
161
|
} elseif ($min) { |
|
162
|
162
|
if ($tracker) { |
|
163
|
163
|
$spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
|
@@ -169,17 +169,17 @@ discard block |
|
|
block discarded – undo |
|
169
|
169
|
# $min = true; |
|
170
|
170
|
} else { |
|
171
|
171
|
if ($tracker) { |
|
172
|
|
- $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
|
172
|
+ $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
173
|
173
|
} elseif ($marine) { |
|
174
|
|
- $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
|
174
|
+ $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
175
|
175
|
} else { |
|
176
|
|
- $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
|
176
|
+ $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
177
|
177
|
} |
|
178
|
178
|
} |
|
179
|
179
|
|
|
180
|
180
|
if ($usecoord) { |
|
181
|
181
|
if (isset($_GET['archive'])) { |
|
182
|
|
- $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
|
182
|
+ $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
183
|
183
|
} else { |
|
184
|
184
|
if ($tracker) { |
|
185
|
185
|
$flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
|
@@ -192,9 +192,9 @@ discard block |
|
|
block discarded – undo |
|
192
|
192
|
if ($flightcnt == '') $flightcnt = 0; |
|
193
|
193
|
} else $flightcnt = 0; |
|
194
|
194
|
|
|
195
|
|
-$sqltime = round(microtime(true)-$begintime,2); |
|
|
195
|
+$sqltime = round(microtime(true) - $begintime, 2); |
|
196
|
196
|
|
|
197
|
|
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
|
197
|
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
198
|
198
|
if ($currenttime != '') $currenttime = round($currenttime/1000); |
|
199
|
199
|
|
|
200
|
200
|
if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
@@ -213,7 +213,7 @@ discard block |
|
|
block discarded – undo |
|
213
|
213
|
if (!empty($spotter_array) && is_array($spotter_array)) |
|
214
|
214
|
{ |
|
215
|
215
|
$output .= '"features": ['; |
|
216
|
|
- foreach($spotter_array as $spotter_item) |
|
|
216
|
+ foreach ($spotter_array as $spotter_item) |
|
217
|
217
|
{ |
|
218
|
218
|
$j++; |
|
219
|
219
|
unset($idistance); |
|
@@ -270,8 +270,8 @@ discard block |
|
|
block discarded – undo |
|
270
|
270
|
*/ |
|
271
|
271
|
//$output .= '"fc": "'.$spotter_item['nb'].'",'; |
|
272
|
272
|
if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
|
273
|
|
- if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
274
|
|
- else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
|
273
|
+ if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
|
274
|
+ else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
275
|
275
|
//" |
|
276
|
276
|
} else { |
|
277
|
277
|
if ($compress) $output .= '"c": "NA",'; |
|
@@ -280,7 +280,7 @@ discard block |
|
|
block discarded – undo |
|
280
|
280
|
if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
281
|
281
|
if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
|
282
|
282
|
$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
|
283
|
|
- $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
|
283
|
+ $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
284
|
284
|
} elseif (isset($spotter_item['aircraft_type'])) { |
|
285
|
285
|
$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
|
286
|
286
|
} elseif (!$min) { |
|
@@ -423,15 +423,15 @@ discard block |
|
|
block discarded – undo |
|
423
|
423
|
if (isset($archivespeed) || $usenextlatlon) { |
|
424
|
424
|
if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
425
|
425
|
if (isset($spotter_item['arrival_airport_latitude'])) { |
|
426
|
|
- $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
427
|
|
- $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
|
426
|
+ $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
|
427
|
+ $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
428
|
428
|
$farr_lat = $spotter_item['arrival_airport_latitude']; |
|
429
|
429
|
$farr_lon = $spotter_item['arrival_airport_longitude']; |
|
430
|
430
|
} else { |
|
431
|
431
|
$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
|
432
|
432
|
if (isset($aairport[0]['latitude'])) { |
|
433
|
|
- $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
434
|
|
- $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
|
433
|
+ $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
|
434
|
+ $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
435
|
435
|
$farr_lat = $aairport[0]['latitude']; |
|
436
|
436
|
$farr_lon = $aairport[0]['longitude']; |
|
437
|
437
|
} |
|
@@ -444,59 +444,59 @@ discard block |
|
|
block discarded – undo |
|
444
|
444
|
if ($currenttime != '') { |
|
445
|
445
|
if (strtotime($spotter_item['date']) < $currenttime) { |
|
446
|
446
|
if (isset($archivespeed)) { |
|
447
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
448
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
447
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
|
448
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
449
|
449
|
if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
450
|
450
|
else { |
|
451
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
452
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
451
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
|
452
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
453
|
453
|
if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
454
|
454
|
else { |
|
455
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
|
455
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
456
|
456
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
457
|
457
|
} |
|
458
|
458
|
} |
|
459
|
459
|
} elseif ($usenextlatlon) { |
|
460
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
461
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
460
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
|
461
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
462
|
462
|
if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
463
|
463
|
else { |
|
464
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
465
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
464
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
|
465
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
466
|
466
|
if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
467
|
467
|
else { |
|
468
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
|
468
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
469
|
469
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
470
|
470
|
} |
|
471
|
471
|
} |
|
472
|
472
|
} |
|
473
|
473
|
} else { |
|
474
|
474
|
if (isset($archivespeed)) { |
|
475
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
|
475
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
476
|
476
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
477
|
477
|
} elseif ($usenextlatlon) { |
|
478
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
|
478
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
479
|
479
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
480
|
480
|
} |
|
481
|
481
|
} |
|
482
|
482
|
} else { |
|
483
|
483
|
if (isset($archivespeed)) { |
|
484
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
485
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
484
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
|
485
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
486
|
486
|
if (!isset($idistance) || $fdistance < $idistance) { |
|
487
|
487
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
488
|
488
|
} else { |
|
489
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed); |
|
|
489
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed); |
|
490
|
490
|
//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
491
|
491
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
492
|
492
|
} |
|
493
|
493
|
} elseif ($usenextlatlon) { |
|
494
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
495
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
494
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
|
495
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
496
|
496
|
if (!isset($idistance) || $fdistance < $idistance) { |
|
497
|
497
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
498
|
498
|
} else { |
|
499
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading); |
|
|
499
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading); |
|
500
|
500
|
//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
501
|
501
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
502
|
502
|
} |
|
@@ -505,7 +505,7 @@ discard block |
|
|
block discarded – undo |
|
505
|
505
|
|
|
506
|
506
|
if (!$min) $output .= '"image": "'.$image.'",'; |
|
507
|
507
|
if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
|
508
|
|
- $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
|
508
|
+ $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
509
|
509
|
} |
|
510
|
510
|
if (isset($spotter_item['image_source_website'])) { |
|
511
|
511
|
$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
|
@@ -527,7 +527,7 @@ discard block |
|
|
block discarded – undo |
|
527
|
527
|
$output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
|
528
|
528
|
} |
|
529
|
529
|
if (isset($spotter_item['acars'])) { |
|
530
|
|
- $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
|
530
|
+ $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
531
|
531
|
} |
|
532
|
532
|
// type when not aircraft ? |
|
533
|
533
|
if (isset($spotter_item['type'])) { |
|
@@ -547,12 +547,12 @@ discard block |
|
|
block discarded – undo |
|
547
|
547
|
if ($currenttime != '') { |
|
548
|
548
|
if (strtotime($spotter_item['date']) < $currenttime) { |
|
549
|
549
|
if (!isset($archivespeed)) $archivespeed = 1; |
|
550
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
551
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
550
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
|
551
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
552
|
552
|
if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
553
|
553
|
else { |
|
554
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
555
|
|
- $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
|
554
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
|
555
|
+ $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
556
|
556
|
if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
557
|
557
|
else { |
|
558
|
558
|
$output .= $spotter_item['longitude'].', '; |
|
@@ -631,7 +631,7 @@ discard block |
|
|
block discarded – undo |
|
631
|
631
|
|
|
632
|
632
|
} |
|
633
|
633
|
*/ |
|
634
|
|
- $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
|
634
|
+ $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
635
|
635
|
if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
636
|
636
|
|
|
637
|
637
|
if ( |
|
@@ -639,11 +639,11 @@ discard block |
|
|
block discarded – undo |
|
639
|
639
|
|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
640
|
640
|
// || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
|
641
|
641
|
// || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
|
642
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
642
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
643
|
643
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
644
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
|
644
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
645
|
645
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
646
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
|
646
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
647
|
647
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
648
|
648
|
) { |
|
649
|
649
|
if ($tracker) { |
|
@@ -672,9 +672,9 @@ discard block |
|
|
block discarded – undo |
|
672
|
672
|
require(dirname(__FILE__).'/require/class.MapMatching.php'); |
|
673
|
673
|
$MapMatching = new MapMatching(); |
|
674
|
674
|
if (isset($spotter_item['date_iso_8601'])) { |
|
675
|
|
- $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date_iso_8601']))))); |
|
|
675
|
+ $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date_iso_8601']))))); |
|
676
|
676
|
} else { |
|
677
|
|
- $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date']))))); |
|
|
677
|
+ $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date']))))); |
|
678
|
678
|
} |
|
679
|
679
|
$spotter_history_array = $MapMatching->match($spotter_history_array_mm); |
|
680
|
680
|
} |
|
@@ -706,9 +706,9 @@ discard block |
|
|
block discarded – undo |
|
706
|
706
|
else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
707
|
707
|
} |
|
708
|
708
|
$output_history .= '['; |
|
709
|
|
- $output_history .= $spotter_history['longitude'].', '; |
|
710
|
|
- $output_history .= $spotter_history['latitude'].', '; |
|
711
|
|
- $output_history .= $spotter_history['altitude']*30.48; |
|
|
709
|
+ $output_history .= $spotter_history['longitude'].', '; |
|
|
710
|
+ $output_history .= $spotter_history['latitude'].', '; |
|
|
711
|
+ $output_history .= $spotter_history['altitude']*30.48; |
|
712
|
712
|
$output_history .= '],'; |
|
713
|
713
|
/* |
|
714
|
714
|
if ($from_archive === false) { |
|
@@ -731,8 +731,8 @@ discard block |
|
|
block discarded – undo |
|
731
|
731
|
$d = true; |
|
732
|
732
|
} |
|
733
|
733
|
$output_history .= '['; |
|
734
|
|
- $output_history .= $spotter_history['longitude'].', '; |
|
735
|
|
- $output_history .= $spotter_history['latitude']; |
|
|
734
|
+ $output_history .= $spotter_history['longitude'].', '; |
|
|
735
|
+ $output_history .= $spotter_history['latitude']; |
|
736
|
736
|
$output_history .= '],'; |
|
737
|
737
|
/* |
|
738
|
738
|
if ($from_archive === false) { |
|
@@ -748,9 +748,9 @@ discard block |
|
|
block discarded – undo |
|
748
|
748
|
//echo $output_history; |
|
749
|
749
|
if ($from_archive === false && !isset($spotter_history_array[0]['mapmatching_engine'])) { |
|
750
|
750
|
$output_historyd = '['; |
|
751
|
|
- $output_historyd .= $spotter_item['longitude'].', '; |
|
752
|
|
- $output_historyd .= $spotter_item['latitude']; |
|
753
|
|
- if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
|
751
|
+ $output_historyd .= $spotter_item['longitude'].', '; |
|
|
752
|
+ $output_historyd .= $spotter_item['latitude']; |
|
|
753
|
+ if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
754
|
754
|
$output_historyd .= '],'; |
|
755
|
755
|
//$output_history = $output_historyd.$output_history; |
|
756
|
756
|
$output_history = $output_history.$output_historyd; |
|
@@ -758,7 +758,7 @@ discard block |
|
|
block discarded – undo |
|
758
|
758
|
$last = array_pop($spotter_history_array); |
|
759
|
759
|
$latitude = $last['latitude']; |
|
760
|
760
|
$longitude = $last['longitude']; |
|
761
|
|
- $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}','"coordinates": ['.$longitude.', '.$latitude.']}',$output); |
|
|
761
|
+ $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}', '"coordinates": ['.$longitude.', '.$latitude.']}', $output); |
|
762
|
762
|
} |
|
763
|
763
|
|
|
764
|
764
|
$output_history = substr($output_history, 0, -1); |
|
@@ -769,7 +769,7 @@ discard block |
|
|
block discarded – undo |
|
769
|
769
|
} |
|
770
|
770
|
} |
|
771
|
771
|
|
|
772
|
|
- if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
772
|
+ if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
773
|
773
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
774
|
774
|
&& (isset($spotter_item['departure_airport']) |
|
775
|
775
|
&& $spotter_item['departure_airport'] != 'NA' |
|
@@ -803,7 +803,7 @@ discard block |
|
|
block discarded – undo |
|
803
|
803
|
|
|
804
|
804
|
//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))))) { |
|
805
|
805
|
//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))))) { |
|
806
|
|
- if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
806
|
+ if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
807
|
807
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
808
|
808
|
&& (isset($spotter_item['arrival_airport']) |
|
809
|
809
|
&& $spotter_item['arrival_airport'] != 'NA' |
|
@@ -834,7 +834,7 @@ discard block |
|
|
block discarded – undo |
|
834
|
834
|
$output = substr($output, 0, -1); |
|
835
|
835
|
$output .= ']'; |
|
836
|
836
|
$output .= ',"initial_sqltime": "'.$sqltime.'",'; |
|
837
|
|
- $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
|
837
|
+ $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
838
|
838
|
if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
839
|
839
|
$output .= '"fc": "'.$j.'"'; |
|
840
|
840
|
} else { |