@@ -18,21 +18,40 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | header('Content-Type: text/javascript'); |
| 20 | 20 | |
| 21 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 22 | -else $compress = $globalJsonCompress; |
|
| 21 | +if (!isset($globalJsonCompress)) { |
|
| 22 | + $compress = true; |
|
| 23 | +} else { |
|
| 24 | + $compress = $globalJsonCompress; |
|
| 25 | +} |
|
| 23 | 26 | |
| 24 | 27 | $from_archive = false; |
| 25 | 28 | $min = false; |
| 26 | 29 | $allhistory = false; |
| 27 | 30 | $filter['source'] = array(); |
| 28 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 29 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 30 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 31 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
| 32 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 33 | -if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
| 34 | -if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
| 35 | -if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') $filter['airlinestype'] = $_COOKIE['airlinestype']; |
|
| 31 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') { |
|
| 32 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 33 | +} |
|
| 34 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') { |
|
| 35 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 36 | +} |
|
| 37 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') { |
|
| 38 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 39 | +} |
|
| 40 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') { |
|
| 41 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
| 42 | +} |
|
| 43 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') { |
|
| 44 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 45 | +} |
|
| 46 | +if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') { |
|
| 47 | + $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
| 48 | +} |
|
| 49 | +if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') { |
|
| 50 | + $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
| 51 | +} |
|
| 52 | +if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') { |
|
| 53 | + $filter['airlinestype'] = $_COOKIE['airlinestype']; |
|
| 54 | +} |
|
| 36 | 55 | |
| 37 | 56 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 38 | 57 | $min = true; |
@@ -83,8 +102,12 @@ discard block |
||
| 83 | 102 | } else { |
| 84 | 103 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 85 | 104 | } |
| 86 | - if ($flightcnt == '') $flightcnt = 0; |
|
| 87 | -} else $flightcnt = 0; |
|
| 105 | + if ($flightcnt == '') { |
|
| 106 | + $flightcnt = 0; |
|
| 107 | + } |
|
| 108 | + } else { |
|
| 109 | + $flightcnt = 0; |
|
| 110 | +} |
|
| 88 | 111 | |
| 89 | 112 | $sqltime = round(microtime(true)-$begintime,2); |
| 90 | 113 | |
@@ -92,8 +115,11 @@ discard block |
||
| 92 | 115 | |
| 93 | 116 | $output = '{'; |
| 94 | 117 | $output .= '"type": "FeatureCollection",'; |
| 95 | - if ($min) $output .= '"minimal": "true",'; |
|
| 96 | - else $output .= '"minimal": "false",'; |
|
| 118 | + if ($min) { |
|
| 119 | + $output .= '"minimal": "true",'; |
|
| 120 | + } else { |
|
| 121 | + $output .= '"minimal": "false",'; |
|
| 122 | + } |
|
| 97 | 123 | $output .= '"fc": "'.$flightcnt.'",'; |
| 98 | 124 | $output .= '"sqt": "'.$sqltime.'",'; |
| 99 | 125 | |
@@ -162,11 +188,16 @@ discard block |
||
| 162 | 188 | //$output .= '"fc": "'.$flightcnt.'",'; |
| 163 | 189 | //$output .= '"sqt": "'.$sqltime.'",'; |
| 164 | 190 | $output .= '"properties": {'; |
| 165 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
| 166 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
| 191 | + if ($compress) { |
|
| 192 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
| 193 | + } else { |
|
| 194 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
| 195 | + } |
|
| 167 | 196 | $output .= '"fc": "'.$flightcnt.'",'; |
| 168 | 197 | $output .= '"sqt": "'.$sqltime.'",'; |
| 169 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
| 198 | + if (isset($begindate)) { |
|
| 199 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
| 200 | + } |
|
| 170 | 201 | |
| 171 | 202 | /* |
| 172 | 203 | if ($min) $output .= '"minimal": "true",'; |
@@ -174,13 +205,21 @@ discard block |
||
| 174 | 205 | */ |
| 175 | 206 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 176 | 207 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 177 | - if ($compress) $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
| 178 | - else $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
| 208 | + if ($compress) { |
|
| 209 | + $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
| 210 | + } else { |
|
| 211 | + $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
| 212 | + } |
|
| 179 | 213 | } else { |
| 180 | - if ($compress) $output .= '"c": "NA",'; |
|
| 181 | - else $output .= '"callsign": "NA",'; |
|
| 214 | + if ($compress) { |
|
| 215 | + $output .= '"c": "NA",'; |
|
| 216 | + } else { |
|
| 217 | + $output .= '"callsign": "NA",'; |
|
| 218 | + } |
|
| 219 | + } |
|
| 220 | + if (isset($spotter_item['registration'])) { |
|
| 221 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 182 | 222 | } |
| 183 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 184 | 223 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 185 | 224 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 186 | 225 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -193,19 +232,29 @@ discard block |
||
| 193 | 232 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
| 194 | 233 | } |
| 195 | 234 | if (!isset($spotter_item['aircraft_shadow'])) { |
| 196 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
| 197 | - else { |
|
| 235 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
| 236 | + $spotter_item['aircraft_shadow'] = ''; |
|
| 237 | + } else { |
|
| 198 | 238 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
| 199 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
| 200 | - else $spotter_item['aircraft_shadow'] = ''; |
|
| 239 | + if (count($aircraft_info) > 0) { |
|
| 240 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
| 241 | + } else { |
|
| 242 | + $spotter_item['aircraft_shadow'] = ''; |
|
| 243 | + } |
|
| 201 | 244 | } |
| 202 | 245 | } |
| 203 | 246 | if ($spotter_item['aircraft_shadow'] == '') { |
| 204 | - if ($compress) $output .= '"as": "default.png",'; |
|
| 205 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
| 247 | + if ($compress) { |
|
| 248 | + $output .= '"as": "default.png",'; |
|
| 249 | + } else { |
|
| 250 | + $output .= '"aircraft_shadow": "default.png",'; |
|
| 251 | + } |
|
| 206 | 252 | } else { |
| 207 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 208 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 253 | + if ($compress) { |
|
| 254 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 255 | + } else { |
|
| 256 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
| 257 | + } |
|
| 209 | 258 | } |
| 210 | 259 | if (isset($spotter_item['airline_name'])) { |
| 211 | 260 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -213,8 +262,11 @@ discard block |
||
| 213 | 262 | $output .= '"airline_name": "NA",'; |
| 214 | 263 | } |
| 215 | 264 | if (isset($spotter_item['departure_airport'])) { |
| 216 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
| 217 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
| 265 | + if ($compress) { |
|
| 266 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
| 267 | + } else { |
|
| 268 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
| 269 | + } |
|
| 218 | 270 | } |
| 219 | 271 | if (isset($spotter_item['departure_airport_city'])) { |
| 220 | 272 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -226,8 +278,11 @@ discard block |
||
| 226 | 278 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
| 227 | 279 | } |
| 228 | 280 | if (isset($spotter_item['arrival_airport'])) { |
| 229 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
| 230 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
| 281 | + if ($compress) { |
|
| 282 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
| 283 | + } else { |
|
| 284 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
| 285 | + } |
|
| 231 | 286 | } |
| 232 | 287 | if (isset($spotter_item['arrival_airport_city'])) { |
| 233 | 288 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -245,18 +300,29 @@ discard block |
||
| 245 | 300 | $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
| 246 | 301 | } |
| 247 | 302 | |
| 248 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
| 249 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 250 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
| 251 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 303 | + if ($compress) { |
|
| 304 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
| 305 | + } else { |
|
| 306 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 307 | + } |
|
| 308 | + if ($compress) { |
|
| 309 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
| 310 | + } else { |
|
| 311 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 312 | + } |
|
| 252 | 313 | |
| 253 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 254 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 314 | + if (isset($archivespeed)) { |
|
| 315 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 316 | + } else { |
|
| 317 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 318 | + } |
|
| 255 | 319 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
| 256 | 320 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
| 257 | 321 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 258 | 322 | |
| 259 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
| 323 | + if (!$min) { |
|
| 324 | + $output .= '"image": "'.$image.'",'; |
|
| 325 | + } |
|
| 260 | 326 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 261 | 327 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
| 262 | 328 | } |
@@ -264,8 +330,11 @@ discard block |
||
| 264 | 330 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
| 265 | 331 | } |
| 266 | 332 | if (isset($spotter_item['squawk'])) { |
| 267 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
| 268 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
| 333 | + if ($compress) { |
|
| 334 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
| 335 | + } else { |
|
| 336 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
| 337 | + } |
|
| 269 | 338 | } |
| 270 | 339 | if (isset($spotter_item['squawk_usage'])) { |
| 271 | 340 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -283,8 +352,11 @@ discard block |
||
| 283 | 352 | $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
| 284 | 353 | } |
| 285 | 354 | // FIXME : type when not aircraft ? |
| 286 | - if ($compress) $output .= '"t": "aircraft"'; |
|
| 287 | - else $output .= '"type": "aircraft"'; |
|
| 355 | + if ($compress) { |
|
| 356 | + $output .= '"t": "aircraft"'; |
|
| 357 | + } else { |
|
| 358 | + $output .= '"type": "aircraft"'; |
|
| 359 | + } |
|
| 288 | 360 | $output .= '},'; |
| 289 | 361 | $output .= '"geometry": {'; |
| 290 | 362 | $output .= '"type": "Point",'; |
@@ -339,7 +411,9 @@ discard block |
||
| 339 | 411 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id'])))) { |
| 340 | 412 | //if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) || (isset($_GET['history']) && $_GET['history'] != '' && $_GET['history'] != 'NA' && ($_GET['history'] == $spotter_item['ident'] || $_GET['history'] == $spotter_item['flightaware_id']))) || (isset($_GET['history']) && $_GET['history'] == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
| 341 | 413 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
| 342 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
| 414 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
| 415 | + $history = $_COOKIE['history']; |
|
| 416 | + } |
|
| 343 | 417 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || (!isset($_COOKIE['flightpath']) && (!isset($globalMapHistory) || $globalMapHistory || $allhistory) |
| 344 | 418 | || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))) |
| 345 | 419 | || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) { |
@@ -364,8 +438,11 @@ discard block |
||
| 364 | 438 | $output_history .= ']}},'; |
| 365 | 439 | $output .= $output_history; |
| 366 | 440 | } |
| 367 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 368 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 441 | + if ($compress) { |
|
| 442 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 443 | + } else { |
|
| 444 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 445 | + } |
|
| 369 | 446 | } |
| 370 | 447 | $output_history .= '['; |
| 371 | 448 | $output_history .= $spotter_history['longitude'].', '; |
@@ -414,7 +491,9 @@ discard block |
||
| 414 | 491 | $output .= ']'; |
| 415 | 492 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 416 | 493 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
| 417 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
| 494 | + if (isset($begindate)) { |
|
| 495 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
| 496 | + } |
|
| 418 | 497 | $output .= '"fc": "'.$j.'"'; |
| 419 | 498 | } else { |
| 420 | 499 | $output .= '"features": '; |
@@ -41,7 +41,9 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | if (isset($globalTimezone)) { |
| 43 | 43 | date_default_timezone_set($globalTimezone); |
| 44 | - } else date_default_timezone_set('UTC'); |
|
| 44 | + } else { |
|
| 45 | + date_default_timezone_set('UTC'); |
|
| 46 | + } |
|
| 45 | 47 | print '<tr>'; |
| 46 | 48 | if (isset($_GET['image']) && $_GET['image'] == "true") |
| 47 | 49 | { |
@@ -98,10 +100,14 @@ discard block |
||
| 98 | 100 | print '</div>'; |
| 99 | 101 | print '<div class="other2">'; |
| 100 | 102 | print '<span><i class="fa fa-arrow-up"></i> '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country']; |
| 101 | - if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') print ' ('.$spotter_item['departure_airport_time'].')'; |
|
| 103 | + if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
|
| 104 | + print ' ('.$spotter_item['departure_airport_time'].')'; |
|
| 105 | + } |
|
| 102 | 106 | print '</span>'; |
| 103 | 107 | print '<span><i class="fa fa-arrow-down"></i> '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country']; |
| 104 | - if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') print ' ('.$spotter_item['arrival_airport_time'].')'; |
|
| 108 | + if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') { |
|
| 109 | + print ' ('.$spotter_item['arrival_airport_time'].')'; |
|
| 110 | + } |
|
| 105 | 111 | print '</span>'; |
| 106 | 112 | print '</div>'; |
| 107 | 113 | print '<div class="other3">'; |
@@ -51,7 +51,9 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if (isset($globalTimezone)) { |
| 53 | 53 | date_default_timezone_set($globalTimezone); |
| 54 | - } else date_default_timezone_set('UTC'); |
|
| 54 | + } else { |
|
| 55 | + date_default_timezone_set('UTC'); |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | //date_default_timezone_set('UTC'); |
| 57 | 59 | if (is_array($all_data) && count($all_data) > 0) { |
@@ -300,9 +302,13 @@ discard block |
||
| 300 | 302 | print '<div>'; |
| 301 | 303 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
| 302 | 304 | { |
| 303 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 304 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 305 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 305 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
| 306 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 307 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
| 308 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 309 | + } else { |
|
| 310 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 311 | + } |
|
| 306 | 312 | } else { |
| 307 | 313 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
| 308 | 314 | { |
@@ -71,8 +71,12 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
| 73 | 73 | $ident = $spotter_array[0]['ident']; |
| 74 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
| 75 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
| 74 | + if (isset($spotter_array[0]['latitude'])) { |
|
| 75 | + $latitude = $spotter_array[0]['latitude']; |
|
| 76 | + } |
|
| 77 | + if (isset($spotter_array[0]['longitude'])) { |
|
| 78 | + $longitude = $spotter_array[0]['longitude']; |
|
| 79 | + } |
|
| 76 | 80 | require_once('header.php'); |
| 77 | 81 | if (isset($globalArchive) && $globalArchive) { |
| 78 | 82 | // Requirement for altitude graph |
@@ -80,7 +84,9 @@ discard block |
||
| 80 | 84 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
| 81 | 85 | if (isset($globalTimezone)) { |
| 82 | 86 | date_default_timezone_set($globalTimezone); |
| 83 | - } else date_default_timezone_set('UTC'); |
|
| 87 | + } else { |
|
| 88 | + date_default_timezone_set('UTC'); |
|
| 89 | + } |
|
| 84 | 90 | if (count($all_data) > 0) { |
| 85 | 91 | print '<div id="chart6" class="chart" width="100%"></div> |
| 86 | 92 | <script> |
@@ -5,8 +5,11 @@ |
||
| 5 | 5 | |
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 8 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 9 | -else $spotter_array = ''; |
|
| 8 | +if (isset($_GET['date'])) { |
|
| 9 | + $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 10 | +} else { |
|
| 11 | + $spotter_array = ''; |
|
| 12 | +} |
|
| 10 | 13 | |
| 11 | 14 | if (!empty($spotter_array)) |
| 12 | 15 | { |
@@ -11,10 +11,21 @@ |
||
| 11 | 11 | <p>You can contribute to <?php print $globalName; ?> if you have an ADS-B receiver.</p> |
| 12 | 12 | <h3>You need to : </h3> |
| 13 | 13 | <ul> |
| 14 | - <li>Create an account on <a href="<?php if (isset($globalContributeLogin)) print $globalContributeLogin.'">'.$globalContributeLogin; else print 'https://login.flightairmap.fr">login.flightairmap.fr'; ?></a></li> |
|
| 14 | + <li>Create an account on <a href="<?php if (isset($globalContributeLogin)) { |
|
| 15 | + print $globalContributeLogin.'">'.$globalContributeLogin; |
|
| 16 | +} else { |
|
| 17 | + print 'https://login.flightairmap.fr">login.flightairmap.fr'; |
|
| 18 | +} |
|
| 19 | +?></a></li> |
|
| 15 | 20 | <li>Download dump1090 fork from <a href="https://github.com/Ysurac/dump1090">https://github.com/Ysurac/dump1090</a></li> |
| 16 | 21 | <li>Compile zfamup1090 with <em>make zfamup1090</em> (you need to have libcurl installed)</li> |
| 17 | - <li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) print ' --net-zfam-addr '.$globalContributeURL; if (isset($globalContributePort)) print ' --net-zfam-port '.$globalContributePort; ?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li> |
|
| 22 | + <li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) { |
|
| 23 | + print ' --net-zfam-addr '.$globalContributeURL; |
|
| 24 | +} |
|
| 25 | +if (isset($globalContributePort)) { |
|
| 26 | + print ' --net-zfam-port '.$globalContributePort; |
|
| 27 | +} |
|
| 28 | +?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li> |
|
| 18 | 29 | </ul> |
| 19 | 30 | </div> |
| 20 | 31 | <?php |
@@ -26,8 +26,12 @@ discard block |
||
| 26 | 26 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 27 | 27 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00"; |
| 28 | 28 | $sql_date = $end_date; |
| 29 | - } else $sql_date = ''; |
|
| 30 | -} else $sql_date = ''; |
|
| 29 | + } else { |
|
| 30 | + $sql_date = ''; |
|
| 31 | + } |
|
| 32 | + } else { |
|
| 33 | + $sql_date = ''; |
|
| 34 | +} |
|
| 31 | 35 | |
| 32 | 36 | if (isset($_GET['highest_altitude'])) { |
| 33 | 37 | //for altitude manipulation |
@@ -41,8 +45,12 @@ discard block |
||
| 41 | 45 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 42 | 46 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 43 | 47 | $sql_altitude = $start_altitude; |
| 44 | - } else $sql_altitude = ''; |
|
| 45 | -} else $sql_altitude = ''; |
|
| 48 | + } else { |
|
| 49 | + $sql_altitude = ''; |
|
| 50 | + } |
|
| 51 | + } else { |
|
| 52 | + $sql_altitude = ''; |
|
| 53 | +} |
|
| 46 | 54 | |
| 47 | 55 | //calculuation for the pagination |
| 48 | 56 | if(!isset($_GET['limit'])) |
@@ -60,7 +68,7 @@ discard block |
||
| 60 | 68 | $limit_end = $_GET['number_results']; |
| 61 | 69 | $absolute_difference = $_GET['number_results']; |
| 62 | 70 | } |
| 63 | -} else { |
|
| 71 | +} else { |
|
| 64 | 72 | $limit_explode = explode(",", $_GET['limit']); |
| 65 | 73 | $limit_start = $limit_explode[0]; |
| 66 | 74 | $limit_end = $limit_explode[1]; |
@@ -93,10 +101,15 @@ discard block |
||
| 93 | 101 | $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING); |
| 94 | 102 | $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
| 95 | 103 | if ($dist != '') { |
| 96 | - if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
|
| 97 | - elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
|
| 104 | + if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') { |
|
| 105 | + $dist = $dist*1.60934; |
|
| 106 | + } elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') { |
|
| 107 | + $dist = $dist*1.852; |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + if (!isset($sql_date)) { |
|
| 111 | + $sql_date = ''; |
|
| 98 | 112 | } |
| 99 | - if (!isset($sql_date)) $sql_date = ''; |
|
| 100 | 113 | if ($archive == 1) { |
| 101 | 114 | $SpotterArchive = new SpotterArchive(); |
| 102 | 115 | $spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist); |
@@ -164,7 +177,10 @@ discard block |
||
| 164 | 177 | if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$_GET['aircraft'].'</span> '; } |
| 165 | 178 | if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$_GET['manufacturer'].'</span> '; } |
| 166 | 179 | if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$_GET['registration'].'</span> '; } |
| 167 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; } |
|
| 180 | + if (isset($_GET['highlights'])) { |
|
| 181 | + if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; |
|
| 182 | + } |
|
| 183 | + } |
|
| 168 | 184 | if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$_GET['airline'].'</span> '; } |
| 169 | 185 | if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$_GET['airline_country'].'</span> '; } |
| 170 | 186 | if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$_GET['airline_type'].'</span> '; } |
@@ -274,7 +290,10 @@ discard block |
||
| 274 | 290 | <fieldset> |
| 275 | 291 | <div class="form-group"> |
| 276 | 292 | <label><?php echo _("Keywords"); ?></label> |
| 277 | - <input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) print $_GET['q']; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 293 | + <input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) { |
|
| 294 | + print $_GET['q']; |
|
| 295 | +} |
|
| 296 | +?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 278 | 297 | </div> |
| 279 | 298 | </fieldset> |
| 280 | 299 | <div class="advanced-form"> |
@@ -286,41 +305,62 @@ discard block |
||
| 286 | 305 | <option></option> |
| 287 | 306 | </select> |
| 288 | 307 | </div> |
| 289 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $_GET['manufacturer']; ?>')</script> |
|
| 308 | + <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) { |
|
| 309 | + print $_GET['manufacturer']; |
|
| 310 | +} |
|
| 311 | +?>')</script> |
|
| 290 | 312 | <div class="form-group"> |
| 291 | 313 | <label><?php echo _("Type"); ?></label> |
| 292 | 314 | <select name="aircraft" id="aircrafttypes" class="selectpicker" data-live-search="true"> |
| 293 | 315 | <option></option> |
| 294 | 316 | </select> |
| 295 | 317 | </div> |
| 296 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $_GET['aircraft_icao']; ?>');</script> |
|
| 318 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) { |
|
| 319 | + print $_GET['aircraft_icao']; |
|
| 320 | +} |
|
| 321 | +?>');</script> |
|
| 297 | 322 | <div class="form-group"> |
| 298 | 323 | <label><?php echo _("Registration"); ?></label> |
| 299 | - <input type="text" name="registration" value="<?php if (isset($_GET['registration'])) print $_GET['registration']; ?>" size="8" /> |
|
| 324 | + <input type="text" name="registration" value="<?php if (isset($_GET['registration'])) { |
|
| 325 | + print $_GET['registration']; |
|
| 326 | +} |
|
| 327 | +?>" size="8" /> |
|
| 300 | 328 | </div> |
| 301 | 329 | <?php |
| 302 | 330 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 303 | 331 | ?> |
| 304 | 332 | <div class="form-group"> |
| 305 | 333 | <label><?php echo _("Pilot id"); ?></label> |
| 306 | - <input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $_GET['pilot_id']; ?>" size="15" /> |
|
| 334 | + <input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) { |
|
| 335 | + print $_GET['pilot_id']; |
|
| 336 | +} |
|
| 337 | +?>" size="15" /> |
|
| 307 | 338 | </div> |
| 308 | 339 | <div class="form-group"> |
| 309 | 340 | <label><?php echo _("Pilot name"); ?></label> |
| 310 | - <input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $_GET['pilot_name']; ?>" size="15" /> |
|
| 341 | + <input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) { |
|
| 342 | + print $_GET['pilot_name']; |
|
| 343 | +} |
|
| 344 | +?>" size="15" /> |
|
| 311 | 345 | </div> |
| 312 | 346 | <?php |
| 313 | -}else { |
|
| 347 | +} else { |
|
| 314 | 348 | ?> |
| 315 | 349 | <div class="form-group"> |
| 316 | 350 | <label><?php echo _("Owner name"); ?></label> |
| 317 | - <input type="text" name="owner" value="<?php if (isset($_GET['owner'])) print $_GET['owner']; ?>" size="15" /> |
|
| 351 | + <input type="text" name="owner" value="<?php if (isset($_GET['owner'])) { |
|
| 352 | + print $_GET['owner']; |
|
| 353 | +} |
|
| 354 | +?>" size="15" /> |
|
| 318 | 355 | </div> |
| 319 | 356 | <?php |
| 320 | 357 | } |
| 321 | 358 | ?> |
| 322 | 359 | <div class="form-group checkbox"> |
| 323 | - <div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div> |
|
| 360 | + <div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
| 361 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
| 362 | +} |
|
| 363 | +} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div> |
|
| 324 | 364 | </div> |
| 325 | 365 | </fieldset> |
| 326 | 366 | <fieldset> |
@@ -331,23 +371,41 @@ discard block |
||
| 331 | 371 | <option></option> |
| 332 | 372 | </select> |
| 333 | 373 | </div> |
| 334 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $_GET['airline']; ?>');</script> |
|
| 374 | + <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) { |
|
| 375 | + print $_GET['airline']; |
|
| 376 | +} |
|
| 377 | +?>');</script> |
|
| 335 | 378 | <div class="form-group"> |
| 336 | 379 | <label><?php echo _("Country"); ?></label> |
| 337 | 380 | <select name="airline_country" id="airlinecountries" class="selectpicker" data-live-search="true"> |
| 338 | 381 | <option></option> |
| 339 | 382 | </select> |
| 340 | 383 | </div> |
| 341 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $_GET['airline_country']; ?>');</script> |
|
| 384 | + <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) { |
|
| 385 | + print $_GET['airline_country']; |
|
| 386 | +} |
|
| 387 | +?>');</script> |
|
| 342 | 388 | <div class="form-group"> |
| 343 | 389 | <label><?php echo _("Callsign"); ?></label> |
| 344 | - <input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) print $_GET['callsign']; ?>" size="8" /> |
|
| 390 | + <input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) { |
|
| 391 | + print $_GET['callsign']; |
|
| 392 | +} |
|
| 393 | +?>" size="8" /> |
|
| 345 | 394 | </div> |
| 346 | 395 | <div class="form-group radio"> |
| 347 | 396 | <div><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <label for="airline_type_all"><?php echo _("All airlines types"); ?></label></div> |
| 348 | - <div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div> |
|
| 349 | - <div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div> |
|
| 350 | - <div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div> |
|
| 397 | + <div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) { |
|
| 398 | + if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; |
|
| 399 | +} |
|
| 400 | +} ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div> |
|
| 401 | + <div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) { |
|
| 402 | + if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; |
|
| 403 | +} |
|
| 404 | +} ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div> |
|
| 405 | + <div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) { |
|
| 406 | + if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; |
|
| 407 | +} |
|
| 408 | +} ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div> |
|
| 351 | 409 | </div> |
| 352 | 410 | </fieldset> |
| 353 | 411 | <fieldset> |
@@ -358,14 +416,20 @@ discard block |
||
| 358 | 416 | <option></option> |
| 359 | 417 | </select> |
| 360 | 418 | </div> |
| 361 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $_GET['airport_icao']; ?>');</script> |
|
| 419 | + <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) { |
|
| 420 | + print $_GET['airport_icao']; |
|
| 421 | +} |
|
| 422 | +?>');</script> |
|
| 362 | 423 | <div class="form-group"> |
| 363 | 424 | <label><?php echo _("Country"); ?></label> |
| 364 | 425 | <select name="airport_country" id="airportcountries" class="selectpicker" data-live-search="true"> |
| 365 | 426 | <option></option> |
| 366 | 427 | </select> |
| 367 | 428 | </div> |
| 368 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $_GET['airport_country']; ?>');</script> |
|
| 429 | + <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) { |
|
| 430 | + print $_GET['airport_country']; |
|
| 431 | +} |
|
| 432 | +?>');</script> |
|
| 369 | 433 | </fieldset> |
| 370 | 434 | <fieldset> |
| 371 | 435 | <legend><?php echo _("Route"); ?></legend> |
@@ -375,21 +439,30 @@ discard block |
||
| 375 | 439 | <option></option> |
| 376 | 440 | </select> |
| 377 | 441 | </div> |
| 378 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $_GET['departure_airport_route']; ?>');</script> |
|
| 442 | + <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) { |
|
| 443 | + print $_GET['departure_airport_route']; |
|
| 444 | +} |
|
| 445 | +?>');</script> |
|
| 379 | 446 | <div class="form-group"> |
| 380 | 447 | <label><?php echo _("Arrival Airport"); ?></label> |
| 381 | 448 | <select name="arrival_airport_route" id="arrivalairportnames" class="selectpicker" data-live-search="true"> |
| 382 | 449 | <option></option> |
| 383 | 450 | </select> |
| 384 | 451 | </div> |
| 385 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $_GET['arrival_airport_route']; ?>');</script> |
|
| 452 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) { |
|
| 453 | + print $_GET['arrival_airport_route']; |
|
| 454 | +} |
|
| 455 | +?>');</script> |
|
| 386 | 456 | </fieldset> |
| 387 | 457 | <fieldset> |
| 388 | 458 | <legend><?php echo _("Date"); ?></legend> |
| 389 | 459 | <div class="form-group"> |
| 390 | 460 | <label><?php echo _("Start Date"); ?></label> |
| 391 | 461 | <div class='input-group date' id='datetimepicker1'> |
| 392 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $_GET['start_date']; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 462 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) { |
|
| 463 | + print $_GET['start_date']; |
|
| 464 | +} |
|
| 465 | +?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 393 | 466 | <span class="input-group-addon"> |
| 394 | 467 | <span class="glyphicon glyphicon-calendar"></span> |
| 395 | 468 | </span> |
@@ -398,7 +471,10 @@ discard block |
||
| 398 | 471 | <div class="form-group"> |
| 399 | 472 | <label><?php echo _("End Date"); ?></label> |
| 400 | 473 | <div class='input-group date' id='datetimepicker2'> |
| 401 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $_GET['end_date']; ?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 474 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) { |
|
| 475 | + print $_GET['end_date']; |
|
| 476 | +} |
|
| 477 | +?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 402 | 478 | <span class="input-group-addon"> |
| 403 | 479 | <span class="glyphicon glyphicon-calendar"></span> |
| 404 | 480 | </span> |
@@ -474,7 +550,12 @@ discard block |
||
| 474 | 550 | <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" /> |
| 475 | 551 | </div> |
| 476 | 552 | <div class="form-group"> |
| 477 | - <label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label> |
|
| 553 | + <label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) { |
|
| 554 | + print $globalDistanceUnit; |
|
| 555 | +} else { |
|
| 556 | + print 'km'; |
|
| 557 | +} |
|
| 558 | +print ')'; ?></label> |
|
| 478 | 559 | <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" /> |
| 479 | 560 | </div> |
| 480 | 561 | </fieldset> |
@@ -9,7 +9,10 @@ |
||
| 9 | 9 | <?php |
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | - <span>Developed in Barrie by <a href="http://www.mariotrunz.com" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source & Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span> |
|
| 12 | + <span>Developed in Barrie by <a href="http://www.mariotrunz.com" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) { |
|
| 13 | + print $globalURL; |
|
| 14 | +} |
|
| 15 | +?>/about#source">Source & Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span> |
|
| 13 | 16 | </footer> |
| 14 | 17 | |
| 15 | 18 | <div class="notifications bottom-left"></div> |
@@ -34,7 +34,9 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 36 | 36 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 37 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 37 | + } else { |
|
| 38 | + $image = $spotter_item['image_thumbnail']; |
|
| 39 | + } |
|
| 38 | 40 | |
| 39 | 41 | } |
| 40 | 42 | /* else { |
@@ -46,7 +48,9 @@ discard block |
||
| 46 | 48 | print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image © '.$spotter_item['image_copyright'].'"/><br />Image © '.$spotter_item['image_copyright'].'</div>'; |
| 47 | 49 | } |
| 48 | 50 | print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
| 49 | -if (isset($spotter_item['airline_name'])) print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 51 | +if (isset($spotter_item['airline_name'])) { |
|
| 52 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 53 | +} |
|
| 50 | 54 | print '</div>'; |
| 51 | 55 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 52 | 56 | if (isset($spotter_item['departure_airport_time'])) { |
@@ -74,9 +78,14 @@ discard block |
||
| 74 | 78 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 75 | 79 | print '</div></div><div>'; |
| 76 | 80 | print '<span>'._("Aircraft").'</span>'; |
| 77 | -if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 78 | -if (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a>'; |
|
| 79 | -else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 81 | +if (isset($spotter_item['aircraft_wiki'])) { |
|
| 82 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 83 | +} |
|
| 84 | +if (isset($spotter_item['aircraft_type'])) { |
|
| 85 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a>'; |
|
| 86 | +} else { |
|
| 87 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 88 | +} |
|
| 80 | 89 | print '</div>'; |
| 81 | 90 | print '<div><span>'._("Altitude").'</span>'; |
| 82 | 91 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
@@ -85,7 +94,9 @@ discard block |
||
| 85 | 94 | print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
| 86 | 95 | } |
| 87 | 96 | print '</div>'; |
| 88 | -if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 97 | +if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
| 98 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 99 | +} |
|
| 89 | 100 | print '<div><span>'._("Speed").'</span>'; |
| 90 | 101 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
| 91 | 102 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -99,8 +110,11 @@ discard block |
||
| 99 | 110 | print '<div><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>'; |
| 100 | 111 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
| 101 | 112 | print '<div><span>'._("Pilot").'</span>'; |
| 102 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 103 | - else print $spotter_item['pilot_name']; |
|
| 113 | + if (isset($spotter_item['pilot_id'])) { |
|
| 114 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 115 | + } else { |
|
| 116 | + print $spotter_item['pilot_name']; |
|
| 117 | + } |
|
| 104 | 118 | print '</div>'; |
| 105 | 119 | } |
| 106 | 120 | |
@@ -121,10 +135,18 @@ discard block |
||
| 121 | 135 | } |
| 122 | 136 | print '</div>'; |
| 123 | 137 | |
| 124 | -if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 125 | -if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 126 | -if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 127 | -if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 138 | +if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
| 139 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 140 | +} |
|
| 141 | +if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
| 142 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 143 | +} |
|
| 144 | +if (isset($spotter_item['acars']['message'])) { |
|
| 145 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 146 | +} |
|
| 147 | +if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
| 148 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 149 | +} |
|
| 128 | 150 | print '</div>'; |
| 129 | 151 | ?> |
| 130 | 152 | </div> |