@@ -12,7 +12,9 @@ discard block |
||
| 12 | 12 | $tracker = false; |
| 13 | 13 | $marine = false; |
| 14 | 14 | $usecoord = false; |
| 15 | -if (isset($_GET['test'])) exit(); |
|
| 15 | +if (isset($_GET['test'])) { |
|
| 16 | + exit(); |
|
| 17 | +} |
|
| 16 | 18 | if (isset($_GET['tracker'])) { |
| 17 | 19 | $tracker = true; |
| 18 | 20 | } |
@@ -57,29 +59,58 @@ discard block |
||
| 57 | 59 | } |
| 58 | 60 | header('Content-Type: text/javascript'); |
| 59 | 61 | |
| 60 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 61 | -else $compress = $globalJsonCompress; |
|
| 62 | +if (!isset($globalJsonCompress)) { |
|
| 63 | + $compress = true; |
|
| 64 | +} else { |
|
| 65 | + $compress = $globalJsonCompress; |
|
| 66 | +} |
|
| 62 | 67 | |
| 63 | 68 | $from_archive = false; |
| 64 | 69 | $min = true; |
| 65 | 70 | $allhistory = false; |
| 66 | 71 | $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); |
|
| 78 | -if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
| 72 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
| 73 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 74 | +} |
|
| 75 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
| 76 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 77 | +} |
|
| 78 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
| 79 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 80 | +} |
|
| 81 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
| 82 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 83 | +} |
|
| 84 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
| 85 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 86 | +} |
|
| 87 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
| 88 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 89 | +} |
|
| 90 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
| 91 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 92 | +} |
|
| 93 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
| 94 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 95 | +} |
|
| 96 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
| 97 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 98 | +} |
|
| 99 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
| 100 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 101 | +} |
|
| 102 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
| 103 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 104 | +} |
|
| 105 | +if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') { |
|
| 106 | + $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
| 107 | +} |
|
| 79 | 108 | |
| 80 | 109 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 81 | 110 | $min = true; |
| 82 | -} else $min = false; |
|
| 111 | +} else { |
|
| 112 | + $min = false; |
|
| 113 | +} |
|
| 83 | 114 | |
| 84 | 115 | $spotter_array = array(); |
| 85 | 116 | |
@@ -190,24 +221,38 @@ discard block |
||
| 190 | 221 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 191 | 222 | } |
| 192 | 223 | } |
| 193 | - if ($flightcnt == '') $flightcnt = 0; |
|
| 194 | -} else $flightcnt = 0; |
|
| 224 | + if ($flightcnt == '') { |
|
| 225 | + $flightcnt = 0; |
|
| 226 | + } |
|
| 227 | + } else { |
|
| 228 | + $flightcnt = 0; |
|
| 229 | +} |
|
| 195 | 230 | |
| 196 | 231 | $sqltime = round(microtime(true)-$begintime,2); |
| 197 | 232 | |
| 198 | 233 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
| 199 | -if ($currenttime != '') $currenttime = round($currenttime/1000); |
|
| 234 | +if ($currenttime != '') { |
|
| 235 | + $currenttime = round($currenttime/1000); |
|
| 236 | +} |
|
| 200 | 237 | |
| 201 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
| 202 | -else $usenextlatlon = true; |
|
| 203 | -if ($usenextlatlon === false) $currenttime = ''; |
|
| 238 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
| 239 | + $usenextlatlon = false; |
|
| 240 | +} else { |
|
| 241 | + $usenextlatlon = true; |
|
| 242 | +} |
|
| 243 | +if ($usenextlatlon === false) { |
|
| 244 | + $currenttime = ''; |
|
| 245 | +} |
|
| 204 | 246 | $j = 0; |
| 205 | 247 | $prev_flightaware_id = ''; |
| 206 | 248 | $aircrafts_shadow = array(); |
| 207 | 249 | $output = '{'; |
| 208 | 250 | $output .= '"type": "FeatureCollection",'; |
| 209 | - if ($min) $output .= '"minimal": "true",'; |
|
| 210 | - else $output .= '"minimal": "false",'; |
|
| 251 | + if ($min) { |
|
| 252 | + $output .= '"minimal": "true",'; |
|
| 253 | + } else { |
|
| 254 | + $output .= '"minimal": "false",'; |
|
| 255 | + } |
|
| 211 | 256 | //$output .= '"fc": "'.$flightcnt.'",'; |
| 212 | 257 | $output .= '"sqt": "'.$sqltime.'",'; |
| 213 | 258 | |
@@ -252,18 +297,29 @@ discard block |
||
| 252 | 297 | } |
| 253 | 298 | $output .= '"properties": {'; |
| 254 | 299 | if (isset($spotter_item['flightaware_id'])) { |
| 255 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
| 256 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
| 300 | + if ($compress) { |
|
| 301 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
| 302 | + } else { |
|
| 303 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
| 304 | + } |
|
| 257 | 305 | } elseif (isset($spotter_item['famtrackid'])) { |
| 258 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
| 259 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
| 306 | + if ($compress) { |
|
| 307 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
| 308 | + } else { |
|
| 309 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
| 310 | + } |
|
| 260 | 311 | } elseif (isset($spotter_item['fammarine_id'])) { |
| 261 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
| 262 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
| 312 | + if ($compress) { |
|
| 313 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
| 314 | + } else { |
|
| 315 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
| 316 | + } |
|
| 263 | 317 | } |
| 264 | 318 | $output .= '"fc": "'.$flightcnt.'",'; |
| 265 | 319 | $output .= '"sqt": "'.$sqltime.'",'; |
| 266 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
| 320 | + if (isset($begindate)) { |
|
| 321 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
| 322 | + } |
|
| 267 | 323 | |
| 268 | 324 | /* |
| 269 | 325 | if ($min) $output .= '"minimal": "true",'; |
@@ -271,16 +327,25 @@ discard block |
||
| 271 | 327 | */ |
| 272 | 328 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 273 | 329 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 274 | - if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).','; |
|
| 275 | - else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).','; |
|
| 330 | + if ($compress) { |
|
| 331 | + $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).','; |
|
| 332 | + } else { |
|
| 333 | + $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).','; |
|
| 334 | + } |
|
| 276 | 335 | //' |
| 277 | 336 | } else { |
| 278 | - if ($compress) $output .= '"c": "NA",'; |
|
| 279 | - else $output .= '"callsign": "NA",'; |
|
| 337 | + if ($compress) { |
|
| 338 | + $output .= '"c": "NA",'; |
|
| 339 | + } else { |
|
| 340 | + $output .= '"callsign": "NA",'; |
|
| 341 | + } |
|
| 280 | 342 | } |
| 281 | 343 | if (isset($spotter_item['registration'])) { |
| 282 | - if ($compress) $output .= '"reg": '.json_encode($spotter_item['registration']).','; |
|
| 283 | - else $output .= '"registration": '.json_encode($spotter_item['registration']).','; |
|
| 344 | + if ($compress) { |
|
| 345 | + $output .= '"reg": '.json_encode($spotter_item['registration']).','; |
|
| 346 | + } else { |
|
| 347 | + $output .= '"registration": '.json_encode($spotter_item['registration']).','; |
|
| 348 | + } |
|
| 284 | 349 | } |
| 285 | 350 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 286 | 351 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
@@ -291,20 +356,30 @@ discard block |
||
| 291 | 356 | $output .= '"aircraft_name": "NA",'; |
| 292 | 357 | } |
| 293 | 358 | if (isset($spotter_item['aircraft_icao'])) { |
| 294 | - if ($compress) $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 295 | - else $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 359 | + if ($compress) { |
|
| 360 | + $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 361 | + } else { |
|
| 362 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 363 | + } |
|
| 296 | 364 | } |
| 297 | 365 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) { |
| 298 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
| 299 | - else { |
|
| 366 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
| 367 | + $spotter_item['aircraft_shadow'] = ''; |
|
| 368 | + } else { |
|
| 300 | 369 | $aircraft_icao = $spotter_item['aircraft_icao']; |
| 301 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
| 302 | - else { |
|
| 370 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
| 371 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
| 372 | + } else { |
|
| 303 | 373 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
| 304 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
| 305 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
| 306 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
| 307 | - else $spotter_item['aircraft_shadow'] = ''; |
|
| 374 | + if (count($aircraft_info) > 0) { |
|
| 375 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
| 376 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
| 377 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
| 378 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
| 379 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
| 380 | + } else { |
|
| 381 | + $spotter_item['aircraft_shadow'] = ''; |
|
| 382 | + } |
|
| 308 | 383 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
| 309 | 384 | } |
| 310 | 385 | } |
@@ -312,90 +387,171 @@ discard block |
||
| 312 | 387 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
| 313 | 388 | if ($tracker) { |
| 314 | 389 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
| 315 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
| 316 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
| 390 | + if ($compress) { |
|
| 391 | + $output .= '"as": "ambulance.png",'; |
|
| 392 | + } else { |
|
| 393 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
| 394 | + } |
|
| 317 | 395 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
| 318 | - if ($compress) $output .= '"as": "police.png",'; |
|
| 319 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
| 396 | + if ($compress) { |
|
| 397 | + $output .= '"as": "police.png",'; |
|
| 398 | + } else { |
|
| 399 | + $output .= '"aircraft_shadow": "police.png",'; |
|
| 400 | + } |
|
| 320 | 401 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
| 321 | - if ($compress) $output .= '"as": "ship.png",'; |
|
| 322 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
| 402 | + if ($compress) { |
|
| 403 | + $output .= '"as": "ship.png",'; |
|
| 404 | + } else { |
|
| 405 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
| 406 | + } |
|
| 323 | 407 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
| 324 | - if ($compress) $output .= '"as": "ship.png",'; |
|
| 325 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
| 408 | + if ($compress) { |
|
| 409 | + $output .= '"as": "ship.png",'; |
|
| 410 | + } else { |
|
| 411 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
| 412 | + } |
|
| 326 | 413 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
| 327 | - if ($compress) $output .= '"as": "ship.png",'; |
|
| 328 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
| 414 | + if ($compress) { |
|
| 415 | + $output .= '"as": "ship.png",'; |
|
| 416 | + } else { |
|
| 417 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
| 418 | + } |
|
| 329 | 419 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
| 330 | - if ($compress) $output .= '"as": "truck.png",'; |
|
| 331 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
| 420 | + if ($compress) { |
|
| 421 | + $output .= '"as": "truck.png",'; |
|
| 422 | + } else { |
|
| 423 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
| 424 | + } |
|
| 332 | 425 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
| 333 | - if ($compress) $output .= '"as": "truck.png",'; |
|
| 334 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
| 426 | + if ($compress) { |
|
| 427 | + $output .= '"as": "truck.png",'; |
|
| 428 | + } else { |
|
| 429 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
| 430 | + } |
|
| 335 | 431 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
| 336 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
| 337 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
| 432 | + if ($compress) { |
|
| 433 | + $output .= '"as": "aircraft.png",'; |
|
| 434 | + } else { |
|
| 435 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
| 436 | + } |
|
| 338 | 437 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
| 339 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
| 340 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
| 438 | + if ($compress) { |
|
| 439 | + $output .= '"as": "aircraft.png",'; |
|
| 440 | + } else { |
|
| 441 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
| 442 | + } |
|
| 341 | 443 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
| 342 | - if ($compress) $output .= '"as": "helico.png",'; |
|
| 343 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
| 444 | + if ($compress) { |
|
| 445 | + $output .= '"as": "helico.png",'; |
|
| 446 | + } else { |
|
| 447 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
| 448 | + } |
|
| 344 | 449 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
| 345 | - if ($compress) $output .= '"as": "rail.png",'; |
|
| 346 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
| 450 | + if ($compress) { |
|
| 451 | + $output .= '"as": "rail.png",'; |
|
| 452 | + } else { |
|
| 453 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
| 454 | + } |
|
| 347 | 455 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
| 348 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
| 349 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
| 456 | + if ($compress) { |
|
| 457 | + $output .= '"as": "firetruck.png",'; |
|
| 458 | + } else { |
|
| 459 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
| 460 | + } |
|
| 350 | 461 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
| 351 | - if ($compress) $output .= '"as": "bus.png",'; |
|
| 352 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
| 462 | + if ($compress) { |
|
| 463 | + $output .= '"as": "bus.png",'; |
|
| 464 | + } else { |
|
| 465 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
| 466 | + } |
|
| 353 | 467 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
| 354 | - if ($compress) $output .= '"as": "phone.png",'; |
|
| 355 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
| 468 | + if ($compress) { |
|
| 469 | + $output .= '"as": "phone.png",'; |
|
| 470 | + } else { |
|
| 471 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
| 472 | + } |
|
| 356 | 473 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
| 357 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
| 358 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
| 474 | + if ($compress) { |
|
| 475 | + $output .= '"as": "jogger.png",'; |
|
| 476 | + } else { |
|
| 477 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
| 478 | + } |
|
| 359 | 479 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
| 360 | - if ($compress) $output .= '"as": "bike.png",'; |
|
| 361 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
| 480 | + if ($compress) { |
|
| 481 | + $output .= '"as": "bike.png",'; |
|
| 482 | + } else { |
|
| 483 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
| 484 | + } |
|
| 362 | 485 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
| 363 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
| 364 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
| 486 | + if ($compress) { |
|
| 487 | + $output .= '"as": "motorcycle.png",'; |
|
| 488 | + } else { |
|
| 489 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
| 490 | + } |
|
| 365 | 491 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
| 366 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
| 367 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
| 492 | + if ($compress) { |
|
| 493 | + $output .= '"as": "balloon.png",'; |
|
| 494 | + } else { |
|
| 495 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
| 496 | + } |
|
| 368 | 497 | } else { |
| 369 | - if ($compress) $output .= '"as": "car.png",'; |
|
| 370 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
| 498 | + if ($compress) { |
|
| 499 | + $output .= '"as": "car.png",'; |
|
| 500 | + } else { |
|
| 501 | + $output .= '"aircraft_shadow": "car.png",'; |
|
| 502 | + } |
|
| 371 | 503 | } |
| 372 | 504 | } elseif ($marine) { |
| 373 | 505 | if (isset($spotter_item['type']) && ($spotter_item['type'] == '50' Performance Cruiser' || $spotter_item['type'] == 'Sail')) { |
| 374 | - if ($compress) $output .= '"as": "50perfcruiser.png",'; |
|
| 375 | - else $output .= '"aircraft_shadow": "50perfcruiser.png",'; |
|
| 506 | + if ($compress) { |
|
| 507 | + $output .= '"as": "50perfcruiser.png",'; |
|
| 508 | + } else { |
|
| 509 | + $output .= '"aircraft_shadow": "50perfcruiser.png",'; |
|
| 510 | + } |
|
| 376 | 511 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Sailaway Cruiser 38') { |
| 377 | - if ($compress) $output .= '"as": "cruiser38.png",'; |
|
| 378 | - else $output .= '"aircraft_shadow": "cruiser38.png",'; |
|
| 512 | + if ($compress) { |
|
| 513 | + $output .= '"as": "cruiser38.png",'; |
|
| 514 | + } else { |
|
| 515 | + $output .= '"aircraft_shadow": "cruiser38.png",'; |
|
| 516 | + } |
|
| 379 | 517 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Mini Transat') { |
| 380 | - if ($compress) $output .= '"as": "transat.png",'; |
|
| 381 | - else $output .= '"aircraft_shadow": "transat.png",'; |
|
| 518 | + if ($compress) { |
|
| 519 | + $output .= '"as": "transat.png",'; |
|
| 520 | + } else { |
|
| 521 | + $output .= '"aircraft_shadow": "transat.png",'; |
|
| 522 | + } |
|
| 382 | 523 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == '52' Cruising Cat') { |
| 383 | - if ($compress) $output .= '"as": "catamaran.png",'; |
|
| 384 | - else $output .= '"aircraft_shadow": "catamaran.png",'; |
|
| 524 | + if ($compress) { |
|
| 525 | + $output .= '"as": "catamaran.png",'; |
|
| 526 | + } else { |
|
| 527 | + $output .= '"aircraft_shadow": "catamaran.png",'; |
|
| 528 | + } |
|
| 385 | 529 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Caribbean Rose') { |
| 386 | - if ($compress) $output .= '"as": "carib.png",'; |
|
| 387 | - else $output .= '"aircraft_shadow": "carib.png",'; |
|
| 530 | + if ($compress) { |
|
| 531 | + $output .= '"as": "carib.png",'; |
|
| 532 | + } else { |
|
| 533 | + $output .= '"aircraft_shadow": "carib.png",'; |
|
| 534 | + } |
|
| 388 | 535 | } else { |
| 389 | - if ($compress) $output .= '"as": "ship.png",'; |
|
| 390 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
| 536 | + if ($compress) { |
|
| 537 | + $output .= '"as": "ship.png",'; |
|
| 538 | + } else { |
|
| 539 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
| 540 | + } |
|
| 391 | 541 | } |
| 392 | 542 | } else { |
| 393 | - if ($compress) $output .= '"as": "default.png",'; |
|
| 394 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
| 543 | + if ($compress) { |
|
| 544 | + $output .= '"as": "default.png",'; |
|
| 545 | + } else { |
|
| 546 | + $output .= '"aircraft_shadow": "default.png",'; |
|
| 547 | + } |
|
| 395 | 548 | } |
| 396 | 549 | } else { |
| 397 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 398 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 550 | + if ($compress) { |
|
| 551 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 552 | + } else { |
|
| 553 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 554 | + } |
|
| 399 | 555 | } |
| 400 | 556 | if (isset($spotter_item['airline_name'])) { |
| 401 | 557 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -403,8 +559,11 @@ discard block |
||
| 403 | 559 | $output .= '"airline_name": "NA",'; |
| 404 | 560 | } |
| 405 | 561 | if (isset($spotter_item['departure_airport'])) { |
| 406 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
| 407 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
| 562 | + if ($compress) { |
|
| 563 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
| 564 | + } else { |
|
| 565 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
| 566 | + } |
|
| 408 | 567 | } |
| 409 | 568 | if (isset($spotter_item['departure_airport_city'])) { |
| 410 | 569 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -416,8 +575,11 @@ discard block |
||
| 416 | 575 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
| 417 | 576 | } |
| 418 | 577 | if (isset($spotter_item['arrival_airport'])) { |
| 419 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
| 420 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
| 578 | + if ($compress) { |
|
| 579 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
| 580 | + } else { |
|
| 581 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
| 582 | + } |
|
| 421 | 583 | } |
| 422 | 584 | if (isset($spotter_item['arrival_airport_city'])) { |
| 423 | 585 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -436,11 +598,17 @@ discard block |
||
| 436 | 598 | } |
| 437 | 599 | |
| 438 | 600 | if (isset($spotter_item['real_altitude'])) { |
| 439 | - if ($compress) $output .= '"a": "'.($spotter_item['real_altitude']/100).'",'; |
|
| 440 | - else $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",'; |
|
| 601 | + if ($compress) { |
|
| 602 | + $output .= '"a": "'.($spotter_item['real_altitude']/100).'",'; |
|
| 603 | + } else { |
|
| 604 | + $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",'; |
|
| 605 | + } |
|
| 441 | 606 | } elseif (isset($spotter_item['altitude'])) { |
| 442 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
| 443 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 607 | + if ($compress) { |
|
| 608 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
| 609 | + } else { |
|
| 610 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 611 | + } |
|
| 444 | 612 | } |
| 445 | 613 | |
| 446 | 614 | $heading = $spotter_item['heading']; |
@@ -464,19 +632,24 @@ discard block |
||
| 464 | 632 | } |
| 465 | 633 | } |
| 466 | 634 | |
| 467 | - if ($compress)$output .= '"h": "'.$heading.'",'; |
|
| 468 | - else $output .= '"heading": "'.$heading.'",'; |
|
| 635 | + if ($compress) { |
|
| 636 | + $output .= '"h": "'.$heading.'",'; |
|
| 637 | + } else { |
|
| 638 | + $output .= '"heading": "'.$heading.'",'; |
|
| 639 | + } |
|
| 469 | 640 | if ($currenttime != '') { |
| 470 | 641 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 471 | 642 | if (isset($archivespeed)) { |
| 472 | 643 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
| 473 | 644 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 474 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 475 | - else { |
|
| 645 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 646 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 647 | + } else { |
|
| 476 | 648 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
| 477 | 649 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 478 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 479 | - else { |
|
| 650 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 651 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 652 | + } else { |
|
| 480 | 653 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
| 481 | 654 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 482 | 655 | } |
@@ -484,12 +657,14 @@ discard block |
||
| 484 | 657 | } elseif ($usenextlatlon) { |
| 485 | 658 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
| 486 | 659 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 487 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 488 | - else { |
|
| 660 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 661 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 662 | + } else { |
|
| 489 | 663 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
| 490 | 664 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 491 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 492 | - else { |
|
| 665 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 666 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
| 667 | + } else { |
|
| 493 | 668 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
| 494 | 669 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 495 | 670 | } |
@@ -528,7 +703,9 @@ discard block |
||
| 528 | 703 | } |
| 529 | 704 | } |
| 530 | 705 | |
| 531 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
| 706 | + if (!$min) { |
|
| 707 | + $output .= '"image": "'.$image.'",'; |
|
| 708 | + } |
|
| 532 | 709 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 533 | 710 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
| 534 | 711 | } |
@@ -536,8 +713,11 @@ discard block |
||
| 536 | 713 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
| 537 | 714 | } |
| 538 | 715 | if (isset($spotter_item['squawk'])) { |
| 539 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
| 540 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
| 716 | + if ($compress) { |
|
| 717 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
| 718 | + } else { |
|
| 719 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
| 720 | + } |
|
| 541 | 721 | } |
| 542 | 722 | if (isset($spotter_item['squawk_usage'])) { |
| 543 | 723 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -562,14 +742,23 @@ discard block |
||
| 562 | 742 | } |
| 563 | 743 | // type when not aircraft ? |
| 564 | 744 | if (isset($spotter_item['type'])) { |
| 565 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
| 566 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
| 745 | + if ($compress) { |
|
| 746 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
| 747 | + } else { |
|
| 748 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
| 749 | + } |
|
| 567 | 750 | } elseif ($marine) { |
| 568 | - if ($compress) $output .= '"t": "ship"'; |
|
| 569 | - else $output .= '"type": "ship"'; |
|
| 751 | + if ($compress) { |
|
| 752 | + $output .= '"t": "ship"'; |
|
| 753 | + } else { |
|
| 754 | + $output .= '"type": "ship"'; |
|
| 755 | + } |
|
| 570 | 756 | } else { |
| 571 | - if ($compress) $output .= '"t": "aircraft"'; |
|
| 572 | - else $output .= '"type": "aircraft"'; |
|
| 757 | + if ($compress) { |
|
| 758 | + $output .= '"t": "aircraft"'; |
|
| 759 | + } else { |
|
| 760 | + $output .= '"type": "aircraft"'; |
|
| 761 | + } |
|
| 573 | 762 | } |
| 574 | 763 | $output .= '},'; |
| 575 | 764 | $output .= '"geometry": {'; |
@@ -577,15 +766,19 @@ discard block |
||
| 577 | 766 | $output .= '"coordinates": ['; |
| 578 | 767 | if ($currenttime != '') { |
| 579 | 768 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 580 | - if (!isset($archivespeed)) $archivespeed = 1; |
|
| 769 | + if (!isset($archivespeed)) { |
|
| 770 | + $archivespeed = 1; |
|
| 771 | + } |
|
| 581 | 772 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
| 582 | 773 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 583 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
| 584 | - else { |
|
| 774 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 775 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
| 776 | + } else { |
|
| 585 | 777 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
| 586 | 778 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 587 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
| 588 | - else { |
|
| 779 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
| 780 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
| 781 | + } else { |
|
| 589 | 782 | $output .= $spotter_item['longitude'].', '; |
| 590 | 783 | $output .= $spotter_item['latitude']; |
| 591 | 784 | } |
@@ -663,7 +856,9 @@ discard block |
||
| 663 | 856 | } |
| 664 | 857 | */ |
| 665 | 858 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
| 666 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
| 859 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
| 860 | + $history = $_COOKIE['history']; |
|
| 861 | + } |
|
| 667 | 862 | |
| 668 | 863 | if ( |
| 669 | 864 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -733,8 +928,11 @@ discard block |
||
| 733 | 928 | $output_history .= ']}},'; |
| 734 | 929 | $output .= $output_history; |
| 735 | 930 | } |
| 736 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 737 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 931 | + if ($compress) { |
|
| 932 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 933 | + } else { |
|
| 934 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 935 | + } |
|
| 738 | 936 | } |
| 739 | 937 | $output_history .= '['; |
| 740 | 938 | $output_history .= $spotter_history['longitude'].', '; |
@@ -755,10 +953,15 @@ discard block |
||
| 755 | 953 | if ($d == false) { |
| 756 | 954 | if ($compress) { |
| 757 | 955 | $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",'; |
| 758 | - if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
| 759 | - elseif (isset($spotter_history_array[0]['mapmatching_engine'])) $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
| 956 | + if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') { |
|
| 957 | + $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
| 958 | + } elseif (isset($spotter_history_array[0]['mapmatching_engine'])) { |
|
| 959 | + $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
| 960 | + } |
|
| 760 | 961 | $output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
| 761 | - } else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 962 | + } else { |
|
| 963 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 964 | + } |
|
| 762 | 965 | $d = true; |
| 763 | 966 | } |
| 764 | 967 | $output_history .= '['; |
@@ -781,7 +984,9 @@ discard block |
||
| 781 | 984 | $output_historyd = '['; |
| 782 | 985 | $output_historyd .= $spotter_item['longitude'].', '; |
| 783 | 986 | $output_historyd .= $spotter_item['latitude']; |
| 784 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 987 | + if (isset($spotter_history['altitude'])) { |
|
| 988 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 989 | + } |
|
| 785 | 990 | $output_historyd .= '],'; |
| 786 | 991 | //$output_history = $output_historyd.$output_history; |
| 787 | 992 | $output_history = $output_history.$output_historyd; |
@@ -809,8 +1014,11 @@ discard block |
||
| 809 | 1014 | && $spotter_item['arrival_airport'] != 'NA' |
| 810 | 1015 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
| 811 | 1016 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
| 812 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 813 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1017 | + if ($compress) { |
|
| 1018 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1019 | + } else { |
|
| 1020 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1021 | + } |
|
| 814 | 1022 | if (isset($spotter_item['departure_airport_latitude'])) { |
| 815 | 1023 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
| 816 | 1024 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -843,8 +1051,11 @@ discard block |
||
| 843 | 1051 | || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
| 844 | 1052 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
| 845 | 1053 | $havedata = false; |
| 846 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 847 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1054 | + if ($compress) { |
|
| 1055 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1056 | + } else { |
|
| 1057 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 1058 | + } |
|
| 848 | 1059 | |
| 849 | 1060 | //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
| 850 | 1061 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -869,7 +1080,9 @@ discard block |
||
| 869 | 1080 | $output_dest = substr($output_dest, 0, -1); |
| 870 | 1081 | } |
| 871 | 1082 | $output_dest .= ']}},'; |
| 872 | - if ($havedata) $output .= $output_dest; |
|
| 1083 | + if ($havedata) { |
|
| 1084 | + $output .= $output_dest; |
|
| 1085 | + } |
|
| 873 | 1086 | unset($output_dest); |
| 874 | 1087 | } |
| 875 | 1088 | } |
@@ -877,7 +1090,9 @@ discard block |
||
| 877 | 1090 | $output .= ']'; |
| 878 | 1091 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 879 | 1092 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
| 880 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
| 1093 | + if (isset($begindate)) { |
|
| 1094 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
| 1095 | + } |
|
| 881 | 1096 | $output .= '"fc": "'.$j.'"'; |
| 882 | 1097 | } else { |
| 883 | 1098 | $output .= '"features": '; |