@@ -5,14 +5,14 @@ discard block |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | 7 | //for the date manipulation into the query |
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 9 | 9 | $start_date = $_GET['start_date'].":00"; |
| 10 | 10 | $end_date = $_GET['end_date'].":00"; |
| 11 | 11 | $sql_date = $start_date.",".$end_date; |
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 12 | + } else if ($_GET['start_date'] != "") { |
|
| 13 | 13 | $start_date = $_GET['start_date'].":00"; |
| 14 | 14 | $sql_date = $start_date; |
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | 18 | } else $sql_date = ''; |
@@ -20,38 +20,38 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | 22 | //for altitude manipulation |
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 25 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 24 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 25 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 28 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 29 | 29 | $sql_altitude = $end_altitude; |
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 31 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 32 | 32 | $sql_altitude = $start_altitude; |
| 33 | 33 | } else $sql_altitude = ''; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | -if(!isset($_GET['limit'])) |
|
| 37 | +if (!isset($_GET['limit'])) |
|
| 38 | 38 | { |
| 39 | 39 | if (!isset($_GET['number_results'])) { |
| 40 | 40 | $limit_start = 0; |
| 41 | 41 | $limit_end = 25; |
| 42 | 42 | $absolute_difference = 25; |
| 43 | 43 | } else { |
| 44 | - if ($_GET['number_results'] > 1000){ |
|
| 44 | + if ($_GET['number_results'] > 1000) { |
|
| 45 | 45 | $_GET['number_results'] = 1000; |
| 46 | 46 | } |
| 47 | 47 | $limit_start = 0; |
| 48 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 49 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 48 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 49 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | 50 | } |
| 51 | -} else { |
|
| 51 | +} else { |
|
| 52 | 52 | $limit_explode = explode(",", $_GET['limit']); |
| 53 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 53 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -68,34 +68,34 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 70 | 70 | else $sort = ''; |
| 71 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 72 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT); |
|
| 73 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 71 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 72 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); |
|
| 73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | 88 | if ($id != '') { |
| 89 | 89 | $spotter_array = $Spotter->getSpotterDataByID($id); |
| 90 | 90 | } else { |
| 91 | - $spotter_array = $Spotter->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,''); |
|
| 91 | + $spotter_array = $Spotter->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, ''); |
|
| 92 | 92 | } |
| 93 | 93 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 94 | 94 | $output .= '<gpx version="1.0">'; |
| 95 | 95 | $output .= '<name>FlightAirMap GPX Feed</name>'; |
| 96 | 96 | if (!empty($spotter_array)) |
| 97 | 97 | { |
| 98 | - foreach($spotter_array as $spotter_item) |
|
| 98 | + foreach ($spotter_array as $spotter_item) |
|
| 99 | 99 | { |
| 100 | 100 | $altitude = $spotter_item['altitude'].'00'; |
| 101 | 101 | //waypoint plotting |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | die(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -$ACARS=new ACARS(null,true); |
|
| 26 | +$ACARS = new ACARS(null, true); |
|
| 27 | 27 | date_default_timezone_set('UTC'); |
| 28 | 28 | // signal handler - playing nice with sockets and dump1090 |
| 29 | -pcntl_signal(SIGINT, function($signo) { |
|
| 29 | +pcntl_signal(SIGINT, function($signo) { |
|
| 30 | 30 | global $sock; |
| 31 | 31 | echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
| 32 | 32 | socket_shutdown($sock, 0); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n"); |
| 43 | 43 | |
| 44 | 44 | // Bind the source address |
| 45 | -if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
|
| 45 | +if (!socket_bind($sock, $globalACARSHost, $globalACARSPort)) |
|
| 46 | 46 | { |
| 47 | 47 | $errorcode = socket_last_error(); |
| 48 | 48 | $errormsg = socket_strerror($errorcode); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if ($globalDebug) echo "LISTEN UDP MODE \n\n"; |
| 54 | -while(1) { |
|
| 54 | +while (1) { |
|
| 55 | 55 | $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
| 56 | 56 | |
| 57 | 57 | // lets play nice and handle signals such as ctrl-c/kill properly |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
| 61 | 61 | if ($globalDebug) echo $buffer."\n"; |
| 62 | 62 | $ACARS->add(trim($buffer)); |
| 63 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
| 63 | + socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port); |
|
| 64 | 64 | $ACARS->deleteLiveAcarsData(); |
| 65 | 65 | } |
| 66 | -pcntl_exec($_,$argv); |
|
| 66 | +pcntl_exec($_, $argv); |
|
| 67 | 67 | ?> |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | } |
| 13 | 13 | // Check if script is not already running... (dirty) |
| 14 | 14 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN' && (!isset($globalDisableUpdateCheck) || $globalDisableUpdateCheck === FALSE)) { |
| 15 | - if(function_exists('exec')) { |
|
| 15 | + if (function_exists('exec')) { |
|
| 16 | 16 | exec("ps ux", $output, $result); |
| 17 | 17 | $j = 0; |
| 18 | - foreach ($output as $line) if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
| 18 | + foreach ($output as $line) if (strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
| 19 | 19 | if ($j > 1) { |
| 20 | 20 | echo "Script is already runnning..."; |
| 21 | 21 | die(); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | -setcookie("MapFormat",'2d'); |
|
| 4 | +setcookie("MapFormat", '2d'); |
|
| 5 | 5 | ?> |
| 6 | 6 | /** |
| 7 | 7 | * This javascript is part of FlightAirmap. |
@@ -108,16 +108,16 @@ discard block |
||
| 108 | 108 | <?php |
| 109 | 109 | } |
| 110 | 110 | if (isset($_GET['ident'])) { |
| 111 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 111 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 112 | 112 | } |
| 113 | 113 | if (isset($_GET['flightaware_id'])) { |
| 114 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 114 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 115 | 115 | } |
| 116 | 116 | if (isset($_GET['latitude'])) { |
| 117 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
| 117 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
| 118 | 118 | } |
| 119 | 119 | if (isset($_GET['longitude'])) { |
| 120 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
| 120 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
| 121 | 121 | } |
| 122 | 122 | ?> |
| 123 | 123 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } else { |
| 146 | 146 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
| 147 | 147 | if (isset($_COOKIE['lastcentercoord'])) { |
| 148 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
| 148 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
| 149 | 149 | $viewcenterlatitude = $lastcentercoord[0]; |
| 150 | 150 | $viewcenterlongitude = $lastcentercoord[1]; |
| 151 | 151 | $viewzoom = $lastcentercoord[2]; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | || navigator.userAgent.match(/BlackBerry/i) |
| 167 | 167 | || navigator.userAgent.match(/Windows Phone/i)) |
| 168 | 168 | { |
| 169 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
| 169 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom - 1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
| 170 | 170 | } else { |
| 171 | 171 | var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
| 172 | 172 | } |
@@ -310,19 +310,19 @@ discard block |
||
| 310 | 310 | map.addLayer(yandexLayer); |
| 311 | 311 | <?php |
| 312 | 312 | } elseif ($MapType == 'Bing-Aerial') { |
| 313 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 313 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 314 | 314 | ?> |
| 315 | 315 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 316 | 316 | map.addLayer(bingLayer); |
| 317 | 317 | <?php |
| 318 | 318 | } elseif ($MapType == 'Bing-Hybrid') { |
| 319 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 319 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 320 | 320 | ?> |
| 321 | 321 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 322 | 322 | map.addLayer(bingLayer); |
| 323 | 323 | <?php |
| 324 | 324 | } elseif ($MapType == 'Bing-Road') { |
| 325 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 325 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 326 | 326 | ?> |
| 327 | 327 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 328 | 328 | map.addLayer(bingLayer); |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | |
| 461 | 461 | function update_tsk() { |
| 462 | 462 | var bbox = map.getBounds().toBBoxString(); |
| 463 | - var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>",function (data) { |
|
| 463 | + var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>",function (data) { |
|
| 464 | 464 | tskLayer = L.geoJson(data,{ |
| 465 | 465 | onEachFeature: function (feature, layer) { |
| 466 | 466 | tskPopup(feature, layer); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | -setcookie("MapFormat",'2d'); |
|
| 4 | +setcookie("MapFormat", '2d'); |
|
| 5 | 5 | ?> |
| 6 | 6 | /** |
| 7 | 7 | * This javascript is part of FlightAirmap. |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | <?php |
| 29 | 29 | if (isset($_GET['famtrackid'])) { |
| 30 | - $famtrackid = filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING); |
|
| 30 | + $famtrackid = filter_input(INPUT_GET, 'famtrackid', FILTER_SANITIZE_STRING); |
|
| 31 | 31 | } |
| 32 | 32 | if (isset($_GET['ident'])) { |
| 33 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 33 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 34 | 34 | } |
| 35 | 35 | if (!isset($ident) && !isset($famtrackid)) { |
| 36 | 36 | ?> |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | <?php |
| 211 | 211 | } else { |
| 212 | 212 | ?> |
| 213 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 213 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 214 | 214 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 215 | 215 | <?php |
| 216 | 216 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /* |
| 227 | 227 | shadowUrl: iconURLShadowpath, |
| 228 | 228 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 229 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 229 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 230 | 230 | */ |
| 231 | 231 | }) |
| 232 | 232 | }) |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | <?php |
| 268 | 268 | } else { |
| 269 | 269 | ?> |
| 270 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 270 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 271 | 271 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 272 | 272 | <?php |
| 273 | 273 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | <?php |
| 324 | 324 | } else { |
| 325 | 325 | ?> |
| 326 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 326 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 327 | 327 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 328 | 328 | <?php |
| 329 | 329 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | -setcookie("MapFormat",'2d'); |
|
| 4 | +setcookie("MapFormat", '2d'); |
|
| 5 | 5 | ?> |
| 6 | 6 | /** |
| 7 | 7 | * This javascript is part of FlightAirmap. |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | <?php |
| 40 | 40 | if (isset($_GET['fammarine_id'])) { |
| 41 | - $fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING); |
|
| 41 | + $fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING); |
|
| 42 | 42 | } |
| 43 | 43 | if (isset($_GET['ident'])) { |
| 44 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 44 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 45 | 45 | } |
| 46 | 46 | if (!isset($ident) && !isset($fammarine_id)) { |
| 47 | 47 | ?> |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | <?php |
| 202 | 202 | } else { |
| 203 | 203 | ?> |
| 204 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 204 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 205 | 205 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 206 | 206 | <?php |
| 207 | 207 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | /* |
| 218 | 218 | shadowUrl: iconURLShadowpath, |
| 219 | 219 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 220 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 220 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 221 | 221 | */ |
| 222 | 222 | }) |
| 223 | 223 | }) |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | <?php |
| 259 | 259 | } else { |
| 260 | 260 | ?> |
| 261 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 261 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 262 | 262 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 263 | 263 | <?php |
| 264 | 264 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | <?php |
| 315 | 315 | } else { |
| 316 | 316 | ?> |
| 317 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 317 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 318 | 318 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 319 | 319 | <?php |
| 320 | 320 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | -setcookie("MapFormat",'2d'); |
|
| 4 | +setcookie("MapFormat", '2d'); |
|
| 5 | 5 | ?> |
| 6 | 6 | /** |
| 7 | 7 | * This javascript is part of FlightAirmap. |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | if (isset($_GET['famsatid'])) { |
| 29 | - $famsatid = filter_input(INPUT_GET,'famsatid',FILTER_SANITIZE_STRING); |
|
| 29 | + $famsatid = filter_input(INPUT_GET, 'famsatid', FILTER_SANITIZE_STRING); |
|
| 30 | 30 | } |
| 31 | 31 | if (isset($_GET['ident'])) { |
| 32 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 32 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 33 | 33 | } |
| 34 | 34 | if (!isset($ident) && !isset($famsatid)) { |
| 35 | 35 | ?> |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | <?php |
| 175 | 175 | } else { |
| 176 | 176 | ?> |
| 177 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 177 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 178 | 178 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 179 | 179 | <?php |
| 180 | 180 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | /* |
| 191 | 191 | shadowUrl: iconURLShadowpath, |
| 192 | 192 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 193 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 193 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 194 | 194 | */ |
| 195 | 195 | }) |
| 196 | 196 | }) |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | <?php |
| 232 | 232 | } else { |
| 233 | 233 | ?> |
| 234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 236 | 236 | <?php |
| 237 | 237 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | <?php |
| 288 | 288 | } else { |
| 289 | 289 | ?> |
| 290 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 290 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 291 | 291 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 292 | 292 | <?php |
| 293 | 293 | } |
@@ -6,14 +6,14 @@ discard block |
||
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | 8 | //for the date manipulation into the query |
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 10 | 10 | $start_date = $_GET['start_date'].":00"; |
| 11 | 11 | $end_date = $_GET['end_date'].":00"; |
| 12 | 12 | $sql_date = $start_date.",".$end_date; |
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | + } else if ($_GET['start_date'] != "") { |
|
| 14 | 14 | $start_date = $_GET['start_date'].":00"; |
| 15 | 15 | $sql_date = $start_date; |
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | 19 | } else $sql_date = ''; |
@@ -21,38 +21,38 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | 23 | //for altitude manipulation |
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 28 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 30 | 30 | $sql_altitude = $end_altitude; |
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 33 | 33 | $sql_altitude = $start_altitude; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | -if(!isset($_GET['limit'])) |
|
| 38 | +if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | if (!isset($_GET['number_results'])) { |
| 41 | 41 | $limit_start = 0; |
| 42 | 42 | $limit_end = 25; |
| 43 | 43 | $absolute_difference = 25; |
| 44 | 44 | } else { |
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 45 | + if ($_GET['number_results'] > 1000) { |
|
| 46 | 46 | $_GET['number_results'] = 1000; |
| 47 | 47 | } |
| 48 | 48 | $limit_start = 0; |
| 49 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 49 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | 51 | } |
| 52 | -} else { |
|
| 52 | +} else { |
|
| 53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -69,27 +69,27 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 71 | 71 | else $sort = ''; |
| 72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 73 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
| 74 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 75 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 76 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 77 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 82 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 83 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 84 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 86 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 87 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 88 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 73 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
| 74 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 75 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 76 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 77 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 82 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 83 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 84 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 86 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 87 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 89 | 89 | if ($id != '') { |
| 90 | 90 | $spotter_array = $Spotter->getSpotterDataByID($id); |
| 91 | 91 | } else { |
| 92 | - $spotter_array = $Spotter->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,''); |
|
| 92 | + $spotter_array = $Spotter->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, ''); |
|
| 93 | 93 | } |
| 94 | 94 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 95 | 95 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $output .= '</Style>'; |
| 118 | 118 | |
| 119 | 119 | if (!empty($spotter_array)) { |
| 120 | - foreach($spotter_array as $spotter_item) { |
|
| 120 | + foreach ($spotter_array as $spotter_item) { |
|
| 121 | 121 | $altitude = $spotter_item['altitude'].'00'; |
| 122 | 122 | $SpotterArchive = new SpotterArchive(); |
| 123 | 123 | $archive_data = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $output .= '<LineString>'; |
| 129 | 129 | $output .= '<coordinates>'; |
| 130 | 130 | foreach ($archive_data as $coord_data) { |
| 131 | - $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
| 131 | + $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
| 132 | 132 | } |
| 133 | 133 | $output .= '</coordinates>'; |
| 134 | 134 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $output .= ' ]]></description>'; |
| 192 | 192 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
| 193 | 193 | $output .= '<Point>'; |
| 194 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 194 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 195 | 195 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 196 | 196 | $output .= '</Point>'; |
| 197 | 197 | $output .= '</Placemark>'; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $output .= ' ]]></description>'; |
| 233 | 233 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
| 234 | 234 | $output .= '<Point>'; |
| 235 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 235 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 236 | 236 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 237 | 237 | $output .= '</Point>'; |
| 238 | 238 | $output .= '</Placemark>'; |
@@ -3,17 +3,17 @@ discard block |
||
| 3 | 3 | require_once('require/class.Language.php'); |
| 4 | 4 | require_once('require/class.Spotter.php'); |
| 5 | 5 | require_once('require/class.SpotterArchive.php'); |
| 6 | -$Spotter=new Spotter(); |
|
| 6 | +$Spotter = new Spotter(); |
|
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | 8 | //for the date manipulation into the query |
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 10 | 10 | $start_date = $_GET['start_date'].":00"; |
| 11 | 11 | $end_date = $_GET['end_date'].":00"; |
| 12 | 12 | $sql_date = $start_date.",".$end_date; |
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | + } else if ($_GET['start_date'] != "") { |
|
| 14 | 14 | $start_date = $_GET['start_date'].":00"; |
| 15 | 15 | $sql_date = $start_date; |
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | 19 | } else $sql_date = ''; |
@@ -21,21 +21,21 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | 23 | //for altitude manipulation |
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 28 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 30 | 30 | $sql_altitude = $end_altitude; |
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 33 | 33 | $sql_altitude = $start_altitude; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | -if(!isset($_GET['limit'])) |
|
| 38 | +if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | if (!isset($_GET['number_results'])) |
| 41 | 41 | { |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | $limit_end = 25; |
| 44 | 44 | $absolute_difference = 25; |
| 45 | 45 | } else { |
| 46 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | + if ($_GET['number_results'] > 1000) { |
|
| 47 | 47 | $_GET['number_results'] = 1000; |
| 48 | 48 | } |
| 49 | 49 | $limit_start = 0; |
| 50 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 52 | 52 | } |
| 53 | -} else { |
|
| 53 | +} else { |
|
| 54 | 54 | $limit_explode = explode(",", $_GET['limit']); |
| 55 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -70,34 +70,34 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 72 | 72 | else $sort = ''; |
| 73 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 74 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT); |
|
| 75 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 76 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 77 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 78 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 81 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 82 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 83 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 84 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 85 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 86 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 87 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 88 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 89 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 73 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 74 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); |
|
| 75 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 76 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 77 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 78 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 81 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 82 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 83 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 84 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 85 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 86 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 87 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 88 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 89 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 90 | 90 | if ($id != '') { |
| 91 | 91 | $spotter_array = $Spotter->getSpotterDataByID($id); |
| 92 | 92 | } else { |
| 93 | - $spotter_array = $Spotter->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,''); |
|
| 93 | + $spotter_array = $Spotter->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, ''); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $output = '{'; |
| 97 | 97 | $output .= '"type": "FeatureCollection",'; |
| 98 | 98 | $output .= '"features": ['; |
| 99 | 99 | if (!empty($spotter_array)) { |
| 100 | - foreach($spotter_array as $spotter_item) { |
|
| 100 | + foreach ($spotter_array as $spotter_item) { |
|
| 101 | 101 | //waypoint plotting |
| 102 | 102 | $output .= '{'; |
| 103 | 103 | $output .= '"type": "Feature",'; |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | $output .= '"coordinates": ['; |
| 165 | 165 | foreach ($archive_data as $coord_data) { |
| 166 | 166 | $output .= '['; |
| 167 | - $output .= $coord_data['longitude'].', '; |
|
| 168 | - $output .= $coord_data['latitude']; |
|
| 167 | + $output .= $coord_data['longitude'].', '; |
|
| 168 | + $output .= $coord_data['latitude']; |
|
| 169 | 169 | $output .= '],'; |
| 170 | 170 | } |
| 171 | 171 | $output = substr($output, 0, -1); |