|
@@ -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 = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
|
74
|
+ $ident = urldecode(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 = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
|
96
|
+ $famtrack_id = urldecode(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 = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
|
100
|
+ $fammarine_id = urldecode(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($globalMapUseBbox) && $globalMapUseBbox && 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,17 +142,17 @@ 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 ($usecoord) { |
|
154
|
154
|
if (isset($_GET['archive'])) { |
|
155
|
|
- $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
|
155
|
+ $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
156
|
156
|
} else { |
|
157
|
157
|
if ($tracker) { |
|
158
|
158
|
$flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
|
@@ -165,9 +165,9 @@ 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
|
|
|
170
|
|
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
|
170
|
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
171
|
171
|
if ($currenttime != '') $currenttime = round($currenttime/1000); |
|
172
|
172
|
|
|
173
|
173
|
if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
@@ -186,7 +186,7 @@ discard block |
|
|
block discarded – undo |
|
186
|
186
|
if (!empty($spotter_array) && is_array($spotter_array)) |
|
187
|
187
|
{ |
|
188
|
188
|
$output .= '"features": ['; |
|
189
|
|
- foreach($spotter_array as $spotter_item) |
|
|
189
|
+ foreach ($spotter_array as $spotter_item) |
|
190
|
190
|
{ |
|
191
|
191
|
$j++; |
|
192
|
192
|
date_default_timezone_set('UTC'); |
|
@@ -242,8 +242,8 @@ discard block |
|
|
block discarded – undo |
|
242
|
242
|
*/ |
|
243
|
243
|
//$output .= '"fc": "'.$spotter_item['nb'].'",'; |
|
244
|
244
|
if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
|
245
|
|
- if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
246
|
|
- else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
|
245
|
+ if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
|
246
|
+ else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
247
|
247
|
//" |
|
248
|
248
|
} else { |
|
249
|
249
|
if ($compress) $output .= '"c": "NA",'; |
|
@@ -252,7 +252,7 @@ discard block |
|
|
block discarded – undo |
|
252
|
252
|
if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
253
|
253
|
if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
|
254
|
254
|
$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
|
255
|
|
- $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
|
255
|
+ $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
256
|
256
|
} elseif (isset($spotter_item['aircraft_type'])) { |
|
257
|
257
|
$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
|
258
|
258
|
} elseif (!$min) { |
|
@@ -395,26 +395,26 @@ discard block |
|
|
block discarded – undo |
|
395
|
395
|
if ($currenttime != '') { |
|
396
|
396
|
if (strtotime($spotter_item['date']) < $currenttime) { |
|
397
|
397
|
if (isset($archivespeed)) { |
|
398
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date'])+$globalMapRefresh); |
|
|
398
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date']) + $globalMapRefresh); |
|
399
|
399
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
400
|
400
|
} elseif ($usenextlatlon) { |
|
401
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],1,$currenttime-strtotime($spotter_item['date'])+$globalMapRefresh); |
|
|
401
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], 1, $currenttime - strtotime($spotter_item['date']) + $globalMapRefresh); |
|
402
|
402
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
403
|
403
|
} |
|
404
|
404
|
} |
|
405
|
405
|
} else { |
|
406
|
406
|
if (isset($archivespeed)) { |
|
407
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
|
407
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
408
|
408
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
409
|
409
|
} elseif ($usenextlatlon) { |
|
410
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
|
410
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
411
|
411
|
$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
412
|
412
|
} |
|
413
|
413
|
} |
|
414
|
414
|
|
|
415
|
415
|
if (!$min) $output .= '"image": "'.$image.'",'; |
|
416
|
416
|
if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
|
417
|
|
- $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
|
417
|
+ $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
418
|
418
|
} |
|
419
|
419
|
if (isset($spotter_item['image_source_website'])) { |
|
420
|
420
|
$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
|
@@ -436,7 +436,7 @@ discard block |
|
|
block discarded – undo |
|
436
|
436
|
$output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
|
437
|
437
|
} |
|
438
|
438
|
if (isset($spotter_item['acars'])) { |
|
439
|
|
- $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
|
439
|
+ $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
440
|
440
|
} |
|
441
|
441
|
// type when not aircraft ? |
|
442
|
442
|
if (isset($spotter_item['type'])) { |
|
@@ -456,7 +456,7 @@ discard block |
|
|
block discarded – undo |
|
456
|
456
|
if ($currenttime != '') { |
|
457
|
457
|
if (strtotime($spotter_item['date']) < $currenttime) { |
|
458
|
458
|
if (!isset($archivespeed)) $archivespeed = 1; |
|
459
|
|
- $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date'])); |
|
|
459
|
+ $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date'])); |
|
460
|
460
|
$output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
461
|
461
|
} else { |
|
462
|
462
|
$output .= $spotter_item['longitude'].', '; |
|
@@ -525,7 +525,7 @@ discard block |
|
|
block discarded – undo |
|
525
|
525
|
|
|
526
|
526
|
} |
|
527
|
527
|
*/ |
|
528
|
|
- $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
|
528
|
+ $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
529
|
529
|
if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
530
|
530
|
|
|
531
|
531
|
if ( |
|
@@ -533,11 +533,11 @@ discard block |
|
|
block discarded – undo |
|
533
|
533
|
|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
534
|
534
|
// || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
|
535
|
535
|
// || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
|
536
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
536
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
537
|
537
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
538
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
|
538
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
539
|
539
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
540
|
|
- || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
|
540
|
+ || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
541
|
541
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
542
|
542
|
) { |
|
543
|
543
|
if ($tracker) { |
|
@@ -574,9 +574,9 @@ discard block |
|
|
block discarded – undo |
|
574
|
574
|
else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
575
|
575
|
} |
|
576
|
576
|
$output_history .= '['; |
|
577
|
|
- $output_history .= $spotter_history['longitude'].', '; |
|
578
|
|
- $output_history .= $spotter_history['latitude'].', '; |
|
579
|
|
- $output_history .= $spotter_history['altitude']*30.48; |
|
|
577
|
+ $output_history .= $spotter_history['longitude'].', '; |
|
|
578
|
+ $output_history .= $spotter_history['latitude'].', '; |
|
|
579
|
+ $output_history .= $spotter_history['altitude']*30.48; |
|
580
|
580
|
$output_history .= '],'; |
|
581
|
581
|
/* |
|
582
|
582
|
if ($from_archive === false) { |
|
@@ -594,8 +594,8 @@ discard block |
|
|
block discarded – undo |
|
594
|
594
|
else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
595
|
595
|
} else $d = true; |
|
596
|
596
|
$output_history .= '['; |
|
597
|
|
- $output_history .= $spotter_history['longitude'].', '; |
|
598
|
|
- $output_history .= $spotter_history['latitude']; |
|
|
597
|
+ $output_history .= $spotter_history['longitude'].', '; |
|
|
598
|
+ $output_history .= $spotter_history['latitude']; |
|
599
|
599
|
$output_history .= '],'; |
|
600
|
600
|
/* |
|
601
|
601
|
if ($from_archive === false) { |
|
@@ -611,9 +611,9 @@ discard block |
|
|
block discarded – undo |
|
611
|
611
|
|
|
612
|
612
|
if ($from_archive === false) { |
|
613
|
613
|
$output_historyd = '['; |
|
614
|
|
- $output_historyd .= $spotter_item['longitude'].', '; |
|
615
|
|
- $output_historyd .= $spotter_item['latitude']; |
|
616
|
|
- if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
|
614
|
+ $output_historyd .= $spotter_item['longitude'].', '; |
|
|
615
|
+ $output_historyd .= $spotter_item['latitude']; |
|
|
616
|
+ if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
617
|
617
|
$output_historyd .= '],'; |
|
618
|
618
|
//$output_history = $output_historyd.$output_history; |
|
619
|
619
|
$output_history = $output_history.$output_historyd; |
|
@@ -627,7 +627,7 @@ discard block |
|
|
block discarded – undo |
|
627
|
627
|
} |
|
628
|
628
|
} |
|
629
|
629
|
|
|
630
|
|
- if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
630
|
+ if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
631
|
631
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
632
|
632
|
&& (isset($spotter_item['departure_airport']) |
|
633
|
633
|
&& $spotter_item['departure_airport'] != 'NA' |
|
@@ -661,7 +661,7 @@ discard block |
|
|
block discarded – undo |
|
661
|
661
|
|
|
662
|
662
|
//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))))) { |
|
663
|
663
|
//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))))) { |
|
664
|
|
- if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
|
664
|
+ if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
665
|
665
|
|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
666
|
666
|
&& (isset($spotter_item['arrival_airport']) |
|
667
|
667
|
&& $spotter_item['arrival_airport'] != 'NA' |
|
@@ -692,7 +692,7 @@ discard block |
|
|
block discarded – undo |
|
692
|
692
|
$output = substr($output, 0, -1); |
|
693
|
693
|
$output .= ']'; |
|
694
|
694
|
$output .= ',"initial_sqltime": "'.$sqltime.'",'; |
|
695
|
|
- $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
|
695
|
+ $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
696
|
696
|
if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
697
|
697
|
$output .= '"fc": "'.$j.'"'; |
|
698
|
698
|
} else { |