@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Translated to PHP of GeographicLib/src/Geoid.cpp |
12 | 12 | * by Ycarus <[email protected]> in 2017 |
13 | 13 | */ |
14 | -class GeoidHeight { |
|
14 | +class GeoidHeight { |
|
15 | 15 | private $c0 = 240; |
16 | 16 | private $c3 = [[9, -18, -88, 0, 96, 90, 0, 0, -60, -20], [-9, 18, 8, 0, -96, 30, 0, 0, 60, -20], [9, -88, -18, 90, 96, 0, -20, -60, 0, 0], [186, -42, -42, -150, -96, -150, 60, 60, 60, 60], [54, 162, -78, 30, -24, -90, -60, 60, -60, 60], [-9, -32, 18, 30, 24, 0, 20, -60, 0, 0], [-9, 8, 18, 30, -96, 0, -20, 60, 0, 0], [54, -78, 162, -90, -24, 30, 60, -60, 60, -60], [-54, 78, 78, 90, 144, 90, -60, -60, -60, -60], [9, -8, -18, -30, -24, 0, 20, 60, 0, 0], [-9, 18, -32, 0, 24, 30, 0, 0, -60, 20], [9, -18, -8, 0, -24, -30, 0, 0, 60, 20]]; |
17 | 17 | private $c0n = 372; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | private $v10 = null; |
35 | 35 | private $v11 = null; |
36 | 36 | |
37 | - public function __construct($name='') { |
|
37 | + public function __construct($name = '') { |
|
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
@@ -42,35 +42,35 @@ discard block |
||
42 | 42 | else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
43 | 43 | } |
44 | 44 | |
45 | - $f = @fopen($name,"r"); |
|
45 | + $f = @fopen($name, "r"); |
|
46 | 46 | if ($f === FALSE) { |
47 | 47 | throw new Exception("Can't open ".$name); |
48 | 48 | } |
49 | - $line = fgets($f,4096); |
|
49 | + $line = fgets($f, 4096); |
|
50 | 50 | if (trim($line) != 'P5') { |
51 | 51 | throw new Exception('No PGM header'); |
52 | 52 | } |
53 | 53 | $headerlen = strlen($line); |
54 | 54 | while (true) { |
55 | - $line = fgets($f,4096); |
|
55 | + $line = fgets($f, 4096); |
|
56 | 56 | if ((strlen($line) == 0)) { |
57 | 57 | throw new Exception('EOF before end of file header'); |
58 | 58 | } |
59 | 59 | $headerlen += strlen($line); |
60 | - if (strpos($line,'# Offset ') !== FALSE) { |
|
60 | + if (strpos($line, '# Offset ') !== FALSE) { |
|
61 | 61 | $this->offset = substr($line, 9); |
62 | - } else if (strpos($line,'# Scale ') !== FALSE) { |
|
62 | + } else if (strpos($line, '# Scale ') !== FALSE) { |
|
63 | 63 | $this->scale = substr($line, 8); |
64 | - } else if ((strpos($line,'#') === FALSE)) { |
|
65 | - list($this->width, $this->height) = preg_split('/\s+/',$line); |
|
64 | + } else if ((strpos($line, '#') === FALSE)) { |
|
65 | + list($this->width, $this->height) = preg_split('/\s+/', $line); |
|
66 | 66 | break; |
67 | 67 | } |
68 | 68 | } |
69 | - $line = fgets($f,4096); |
|
69 | + $line = fgets($f, 4096); |
|
70 | 70 | $headerlen += strlen($line); |
71 | - $levels = (int)$line; |
|
72 | - $this->width = (int)$this->width; |
|
73 | - $this->height = (int)$this->height; |
|
71 | + $levels = (int) $line; |
|
72 | + $this->width = (int) $this->width; |
|
73 | + $this->height = (int) $this->height; |
|
74 | 74 | if (($levels != 65535)) { |
75 | 75 | throw new Exception('PGM file must have 65535 gray levels ('.$levels.')'); |
76 | 76 | } |
@@ -85,42 +85,42 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $fullsize = filesize($name); |
88 | - if ((($fullsize - $headerlen) != (($this->width * $this->height) * 2))) { |
|
88 | + if ((($fullsize - $headerlen) != (($this->width*$this->height)*2))) { |
|
89 | 89 | throw new Exception('File has the wrong length'); |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->headerlen = $headerlen; |
93 | - $this->raw= $f; |
|
94 | - $this->rlonres = ($this->width / 360.0); |
|
95 | - $this->rlatres = (($this->height - 1) / 180.0); |
|
93 | + $this->raw = $f; |
|
94 | + $this->rlonres = ($this->width/360.0); |
|
95 | + $this->rlatres = (($this->height - 1)/180.0); |
|
96 | 96 | } |
97 | 97 | |
98 | - private function _rawval($ix,$iy) { |
|
98 | + private function _rawval($ix, $iy) { |
|
99 | 99 | if (($iy < 0)) { |
100 | 100 | $iy = -$iy; |
101 | - $ix += ($this->width / 2); |
|
101 | + $ix += ($this->width/2); |
|
102 | 102 | } else if (($iy >= $this->height)) { |
103 | - $iy = ((2 * ($this->height - 1)) - $iy); |
|
104 | - $ix += ($this->width / 2); |
|
103 | + $iy = ((2*($this->height - 1)) - $iy); |
|
104 | + $ix += ($this->width/2); |
|
105 | 105 | } |
106 | 106 | if (($ix < 0)) { |
107 | 107 | $ix += $this->width; |
108 | 108 | } else if (($ix >= $this->width)) { |
109 | 109 | $ix -= $this->width; |
110 | 110 | } |
111 | - $k = ((($iy * $this->width) + $ix) * 2) + $this->headerlen; |
|
112 | - fseek($this->raw,$k); |
|
113 | - return unpack('n',fread($this->raw,2))[1]; |
|
111 | + $k = ((($iy*$this->width) + $ix)*2) + $this->headerlen; |
|
112 | + fseek($this->raw, $k); |
|
113 | + return unpack('n', fread($this->raw, 2))[1]; |
|
114 | 114 | } |
115 | 115 | |
116 | - public function get($lat,$lon,$cubic=true) { |
|
116 | + public function get($lat, $lon, $cubic = true) { |
|
117 | 117 | if (($lon < 0)) { |
118 | 118 | $lon += 360; |
119 | 119 | } |
120 | - $fy = ((90 - $lat) * $this->rlatres); |
|
121 | - $fx = ($lon * $this->rlonres); |
|
122 | - $iy = (int)$fy; |
|
123 | - $ix = (int)$fx; |
|
120 | + $fy = ((90 - $lat)*$this->rlatres); |
|
121 | + $fx = ($lon*$this->rlonres); |
|
122 | + $iy = (int) $fy; |
|
123 | + $ix = (int) $fx; |
|
124 | 124 | $fx -= $ix; |
125 | 125 | $fy -= $iy; |
126 | 126 | $t = array(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $c3x = $this->c3; |
148 | 148 | $c0x = $this->c0; |
149 | 149 | } |
150 | - for ($i = 0; $i < 10;++$i) { |
|
150 | + for ($i = 0; $i < 10; ++$i) { |
|
151 | 151 | $t[$i] = 0; |
152 | 152 | for ($j = 0; $j < 12; ++$j) { |
153 | 153 | $t[$i] += $v[$j]*$c3x[$j][$i]; |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | $this->t = $t; |
159 | 159 | } else $t = $this->t; |
160 | 160 | if (!($cubic)) { |
161 | - $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
|
162 | - $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
|
163 | - $h = (((1 - $fy) * $a) + ($fy * $b)); |
|
161 | + $a = (((1 - $fx)*$this->v00) + ($fx*$this->v01)); |
|
162 | + $b = (((1 - $fx)*$this->v10) + ($fx*$this->v11)); |
|
163 | + $h = (((1 - $fy)*$a) + ($fy*$b)); |
|
164 | 164 | } else { |
165 | - $h = (($t[0] + ($fx * ($t[1] + ($fx * ($t[3] + ($fx * $t[6])))))) + ($fy * (($t[2] + ($fx * ($t[4] + ($fx * $t[7])))) + ($fy * (($t[5] + ($fx * $t[8])) + ($fy * $t[9])))))); |
|
165 | + $h = (($t[0] + ($fx*($t[1] + ($fx*($t[3] + ($fx*$t[6])))))) + ($fy*(($t[2] + ($fx*($t[4] + ($fx*$t[7])))) + ($fy*(($t[5] + ($fx*$t[8])) + ($fy*$t[9])))))); |
|
166 | 166 | } |
167 | - return ((float)$this->offset + ((float)$this->scale * (float)$h)); |
|
167 | + return ((float) $this->offset + ((float) $this->scale*(float) $h)); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | /* |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $globalLongitudeMin = '1.0'; //the minimum longitude (east) |
43 | 43 | |
44 | 44 | $globalCenterLatitude = '46.38'; //the latitude center of your coverage area |
45 | -$globalCenterLongitude = '5.29';//the longitude center of your coverage area |
|
45 | +$globalCenterLongitude = '5.29'; //the longitude center of your coverage area |
|
46 | 46 | |
47 | 47 | $globalLiveZoom = '9'; //default zoom on Live Map |
48 | 48 | $globalAirportZoom = '7'; //default zoom to begin to display airports icons |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $globalACARS = FALSE; |
152 | 152 | $globalACARSHost = '0.0.0.0'; // Local IP to listen |
153 | 153 | $globalACARSPort = '9999'; |
154 | -$globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive |
|
154 | +$globalACARSArchive = array('10', '80', '81', '82', '3F'); // labels of messages to archive |
|
155 | 155 | $globalACARSArchiveKeepMonths = '0'; |
156 | 156 | |
157 | 157 | //APRS configuration (for glidernet) |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | //Check by aircraft ICAO if image is not found by registration |
249 | 249 | $globalAircraftImageCheckICAO = TRUE; |
250 | 250 | //Sources for Aircraft image |
251 | -$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources'); |
|
251 | +$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters', 'customsources'); |
|
252 | 252 | // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic) |
253 | 253 | // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
254 | 254 | // ************************ |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | //Retrieve Image from externals sources |
258 | 258 | $globalMarineImageFetch = TRUE; |
259 | 259 | //Sources for Marine image |
260 | -$globalMarineImageSources = array('wikimedia','flickr','deviantart','bing','customsources'); |
|
260 | +$globalMarineImageSources = array('wikimedia', 'flickr', 'deviantart', 'bing', 'customsources'); |
|
261 | 261 | // Custom source configuration {mmsi} will be replaced by vessel mmsi, {name} by it's name (exif get copyright from exif data for each pic) |
262 | 262 | // example of config : $globalMarineImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{name}.jpg','original' => 'http://myurl/original/{name}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
263 | 263 | // ************************ |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | //Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE) |
266 | 266 | $globalSchedulesFetch = TRUE; |
267 | 267 | //Sources for airline schedule if not official airline site |
268 | -$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
268 | +$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
269 | 269 | |
270 | 270 | //Retrieve translation from external sources (set to FALSE for IVAO) |
271 | 271 | $globalTranslationFetch = TRUE; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | require_once(dirname(__FILE__).'/../require/class.Source.php'); |
10 | 10 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
11 | 11 | require_once(dirname(__FILE__).'/../require/class.Common.php'); |
12 | -$Common=new Common(); |
|
12 | +$Common = new Common(); |
|
13 | 13 | $authorize = false; |
14 | 14 | $params = array(); |
15 | 15 | $userip = $Common->getUserIP(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $authorize = true; |
21 | 21 | break; |
22 | 22 | } |
23 | - if ($userip != '' && isset($cb['host']) && in_array($userip,explode(',',$cb['host']))) { |
|
23 | + if ($userip != '' && isset($cb['host']) && in_array($userip, explode(',', $cb['host']))) { |
|
24 | 24 | $params = $globalSources[$key]; |
25 | 25 | $authorize = true; |
26 | 26 | break; |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | if (isset($globalServer) && $globalServer) { |
48 | 48 | if ($globalDebug) echo "Using Server Mode\n"; |
49 | - $SI=new SpotterServer(); |
|
50 | -} else $SI=new SpotterImport($Connection->db); |
|
49 | + $SI = new SpotterServer(); |
|
50 | +} else $SI = new SpotterImport($Connection->db); |
|
51 | 51 | if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
52 | 52 | if (isset($globalMarine) && $globalMarine) { |
53 | 53 | $AIS = new AIS(); |
54 | 54 | $MI = new MarineImport($Connection->db); |
55 | 55 | } |
56 | -$Source=new Source($Connection->db); |
|
56 | +$Source = new Source($Connection->db); |
|
57 | 57 | date_default_timezone_set('UTC'); |
58 | 58 | |
59 | 59 | $buffer = ''; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $data['altitude'] = round($buffer['altitude']*3.28084); |
67 | 67 | $data['speed'] = $buffer['speed']; |
68 | 68 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | - $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
|
69 | + $data['datetime'] = date('Y-m-d H:i:s', $buffer['timestamp']); |
|
70 | 70 | $data['comment'] = ''; |
71 | 71 | if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
72 | 72 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | $page_url = $globalURL.'/tools-geoid'; |
14 | 14 | |
15 | -$latitude = filter_input(INPUT_POST,'latitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
16 | -$longitude = filter_input(INPUT_POST,'longitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
17 | -$altitude = filter_input(INPUT_POST,'altitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
15 | +$latitude = filter_input(INPUT_POST, 'latitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
16 | +$longitude = filter_input(INPUT_POST, 'longitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
17 | +$altitude = filter_input(INPUT_POST, 'altitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
18 | 18 | |
19 | 19 | print '<div class="info column">'; |
20 | 20 | print '<h1>'._("Geoid Height Calculator").'</h1>'; |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($latitude != '' && $longitude != '') { |
53 | 53 | $globalDebug = FALSE; |
54 | - $geoid = $GeoidHeight->get($latitude,$longitude); |
|
54 | + $geoid = $GeoidHeight->get($latitude, $longitude); |
|
55 | 55 | print '<div class="row">'; |
56 | 56 | print '<div class="col-md-3 col-md-offset-5">'; |
57 | 57 | print '<div class="col-sm-6"><b>Geoid</b></div>'; |
58 | 58 | print '<div class="col-sm-6">'.$geoid.'</div>'; |
59 | 59 | if ($altitude != '') { |
60 | 60 | print '<div class="col-sm-6"><b>AMSL Elevation</b></div>'; |
61 | - print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>'; |
|
61 | + print '<div class="col-sm-6">'.round($altitude - $geoid, 3).'</div>'; |
|
62 | 62 | } |
63 | 63 | print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>'; |
64 | 64 | if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource; |
@@ -14,22 +14,22 @@ discard block |
||
14 | 14 | * @param Array $filter the filter |
15 | 15 | * @return Array the SQL part |
16 | 16 | */ |
17 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
17 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
19 | 19 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
20 | 20 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
21 | - foreach($globalStatsFilters[$globalFilterName] as $source) { |
|
21 | + foreach ($globalStatsFilters[$globalFilterName] as $source) { |
|
22 | 22 | if (isset($source['source'])) $filter['source'][] = $source['source']; |
23 | 23 | } |
24 | 24 | } else { |
25 | 25 | $filter = $globalStatsFilters[$globalFilterName]; |
26 | 26 | } |
27 | 27 | } |
28 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
28 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
29 | 29 | $filter_query_join = ''; |
30 | 30 | $filter_query_where = ''; |
31 | 31 | if (isset($filter['source']) && !empty($filter['source'])) { |
32 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
32 | + $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
33 | 33 | } |
34 | 34 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
35 | 35 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | try { |
45 | 45 | $sth = $this->db->prepare($query); |
46 | 46 | $sth->execute($query_values); |
47 | - } catch(PDOException $e) { |
|
47 | + } catch (PDOException $e) { |
|
48 | 48 | return "error : ".$e->getMessage(); |
49 | 49 | } |
50 | 50 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -52,66 +52,66 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | public function getById($id) { |
55 | - $filter_query = $this->getFilter(array(),true); |
|
55 | + $filter_query = $this->getFilter(array(), true); |
|
56 | 56 | $query = "SELECT * FROM atc".$filter_query." atc_id = :id"; |
57 | 57 | $query_values = array(':id' => $id); |
58 | 58 | try { |
59 | 59 | $sth = $this->db->prepare($query); |
60 | 60 | $sth->execute($query_values); |
61 | - } catch(PDOException $e) { |
|
61 | + } catch (PDOException $e) { |
|
62 | 62 | return "error : ".$e->getMessage(); |
63 | 63 | } |
64 | 64 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
65 | 65 | return $all; |
66 | 66 | } |
67 | 67 | |
68 | - public function getByIdent($ident,$format_source = '') { |
|
69 | - $filter_query = $this->getFilter(array(),true); |
|
68 | + public function getByIdent($ident, $format_source = '') { |
|
69 | + $filter_query = $this->getFilter(array(), true); |
|
70 | 70 | if ($format_source == '') { |
71 | 71 | $query = "SELECT * FROM atc".$filter_query." ident = :ident"; |
72 | 72 | $query_values = array(':ident' => $ident); |
73 | 73 | } else { |
74 | 74 | $query = "SELECT * FROM atc".$filter_query." ident = :ident AND format_source = :format_source"; |
75 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
75 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
76 | 76 | } |
77 | 77 | try { |
78 | 78 | $sth = $this->db->prepare($query); |
79 | 79 | $sth->execute($query_values); |
80 | - } catch(PDOException $e) { |
|
80 | + } catch (PDOException $e) { |
|
81 | 81 | return "error : ".$e->getMessage(); |
82 | 82 | } |
83 | 83 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
84 | 84 | return $all; |
85 | 85 | } |
86 | 86 | |
87 | - public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
88 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
89 | - $info = str_replace('^','<br />',$info); |
|
90 | - $info = str_replace('&sect;','',$info); |
|
91 | - $info = str_replace('"','',$info); |
|
87 | + public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
88 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
89 | + $info = str_replace('^', '<br />', $info); |
|
90 | + $info = str_replace('&sect;', '', $info); |
|
91 | + $info = str_replace('"', '', $info); |
|
92 | 92 | if ($type == '') $type = NULL; |
93 | 93 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
94 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
94 | + $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name); |
|
95 | 95 | try { |
96 | 96 | $sth = $this->db->prepare($query); |
97 | 97 | $sth->execute($query_values); |
98 | - } catch(PDOException $e) { |
|
98 | + } catch (PDOException $e) { |
|
99 | 99 | return "error : ".$e->getMessage(); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - public function update($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
104 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
105 | - $info = str_replace('^','<br />',$info); |
|
106 | - $info = str_replace('&sect;','',$info); |
|
107 | - $info = str_replace('"','',$info); |
|
103 | + public function update($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
104 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
105 | + $info = str_replace('^', '<br />', $info); |
|
106 | + $info = str_replace('&sect;', '', $info); |
|
107 | + $info = str_replace('"', '', $info); |
|
108 | 108 | if ($type == '') $type = NULL; |
109 | 109 | $query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name"; |
110 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
110 | + $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name); |
|
111 | 111 | try { |
112 | 112 | $sth = $this->db->prepare($query); |
113 | 113 | $sth->execute($query_values); |
114 | - } catch(PDOException $e) { |
|
114 | + } catch (PDOException $e) { |
|
115 | 115 | return "error : ".$e->getMessage(); |
116 | 116 | } |
117 | 117 | } |
@@ -122,18 +122,18 @@ discard block |
||
122 | 122 | try { |
123 | 123 | $sth = $this->db->prepare($query); |
124 | 124 | $sth->execute($query_values); |
125 | - } catch(PDOException $e) { |
|
125 | + } catch (PDOException $e) { |
|
126 | 126 | return "error : ".$e->getMessage(); |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | - public function deleteByIdent($ident,$format_source) { |
|
130 | + public function deleteByIdent($ident, $format_source) { |
|
131 | 131 | $query = "DELETE FROM atc WHERE ident = :ident AND format_source = :format_source"; |
132 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
132 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
133 | 133 | try { |
134 | 134 | $sth = $this->db->prepare($query); |
135 | 135 | $sth->execute($query_values); |
136 | - } catch(PDOException $e) { |
|
136 | + } catch (PDOException $e) { |
|
137 | 137 | return "error : ".$e->getMessage(); |
138 | 138 | } |
139 | 139 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | try { |
145 | 145 | $sth = $this->db->prepare($query); |
146 | 146 | $sth->execute($query_values); |
147 | - } catch(PDOException $e) { |
|
147 | + } catch (PDOException $e) { |
|
148 | 148 | return "error : ".$e->getMessage(); |
149 | 149 | } |
150 | 150 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | try { |
160 | 160 | $sth = $this->db->prepare($query); |
161 | 161 | $sth->execute(); |
162 | - } catch(PDOException $e) { |
|
162 | + } catch (PDOException $e) { |
|
163 | 163 | return "error"; |
164 | 164 | } |
165 | 165 | return "success"; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $Connection = new Connection(); |
55 | 55 | $sth = $Connection->db->prepare($query); |
56 | 56 | $sth->execute(); |
57 | - } catch(PDOException $e) { |
|
57 | + } catch (PDOException $e) { |
|
58 | 58 | return "error : ".$e->getMessage(); |
59 | 59 | } |
60 | 60 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $Connection = new Connection(); |
71 | 71 | $sth = $Connection->db->prepare($query); |
72 | 72 | $sth->execute(); |
73 | - } catch(PDOException $e) { |
|
73 | + } catch (PDOException $e) { |
|
74 | 74 | return "error : ".$e->getMessage(); |
75 | 75 | } |
76 | 76 | } |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | public function parse($data) { |
79 | 79 | //$data = str_replace(array('\n','\r','\r','\n'),'',$data); |
80 | 80 | $codes = implode('|', array_keys($this->texts)); |
81 | - $regWeather = '#^(\+|\-|VC)?(' . $codes . ')(' . $codes . ')?$#'; |
|
81 | + $regWeather = '#^(\+|\-|VC)?('.$codes.')('.$codes.')?$#'; |
|
82 | 82 | //$pieces = explode(' ',$data); |
83 | - $pieces = preg_split('/\s/',$data); |
|
83 | + $pieces = preg_split('/\s/', $data); |
|
84 | 84 | $pos = 0; |
85 | 85 | if ($pieces[0] == 'METAR') $pos++; |
86 | 86 | elseif ($pieces[0] == 'SPECI') $pos++; |
@@ -88,25 +88,25 @@ discard block |
||
88 | 88 | $result = array(); |
89 | 89 | $result['location'] = $pieces[$pos]; |
90 | 90 | $pos++; |
91 | - $result['dayofmonth'] = substr($pieces[$pos],0,2); |
|
92 | - $result['time'] = substr($pieces[$pos],2,4); |
|
91 | + $result['dayofmonth'] = substr($pieces[$pos], 0, 2); |
|
92 | + $result['time'] = substr($pieces[$pos], 2, 4); |
|
93 | 93 | $c = count($pieces); |
94 | - for($pos++; $pos < $c; $pos++) { |
|
94 | + for ($pos++; $pos < $c; $pos++) { |
|
95 | 95 | $piece = $pieces[$pos]; |
96 | 96 | if ($piece == 'RMK') break; |
97 | 97 | if ($piece == 'AUTO') $result['auto'] = true; |
98 | 98 | if ($piece == 'COR') $result['correction'] = true; |
99 | 99 | // Wind Speed |
100 | 100 | if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) { |
101 | - $result['wind']['direction'] = (float)$matches[1]; |
|
101 | + $result['wind']['direction'] = (float) $matches[1]; |
|
102 | 102 | $result['wind']['unit'] = $matches[4]; |
103 | - if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
104 | - elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
105 | - elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
106 | - $result['wind']['gust'] = (float)$matches[3]; |
|
103 | + if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float) $matches[2])*0.51444444444, 2); |
|
104 | + elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float) $matches[2])*1000, 2); |
|
105 | + elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float) $matches[2]), 2); |
|
106 | + $result['wind']['gust'] = (float) $matches[3]; |
|
107 | 107 | $result['wind']['unit'] = $matches[4]; |
108 | - $result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0; |
|
109 | - $result['wind']['max_variation'] = array_key_exists(6,$matches) ? $matches[6] : 0; |
|
108 | + $result['wind']['min_variation'] = array_key_exists(5, $matches) ? $matches[5] : 0; |
|
109 | + $result['wind']['max_variation'] = array_key_exists(6, $matches) ? $matches[6] : 0; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /* if (preg_match('#^([0-9]{3})([0-9]{2})(G([0-9]{2}))?(KT|MPS)$#', $piece, $matches)) { |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | |
128 | 128 | // Temperature |
129 | 129 | if (preg_match('#^(M?[0-9]{2,})/(M?[0-9]{2,})$#', $piece, $matches)) { |
130 | - $temp = (float)$matches[1]; |
|
130 | + $temp = (float) $matches[1]; |
|
131 | 131 | if ($matches[1]{0} == 'M') { |
132 | - $temp = ((float)substr($matches[1], 1)) * -1; |
|
132 | + $temp = ((float) substr($matches[1], 1))*-1; |
|
133 | 133 | } |
134 | 134 | $result['temperature'] = $temp; |
135 | - $dew = (float)$matches[2]; |
|
135 | + $dew = (float) $matches[2]; |
|
136 | 136 | if ($matches[2]{0} == 'M') { |
137 | - $dew = ((float)substr($matches[2], 1)) * -1; |
|
137 | + $dew = ((float) substr($matches[2], 1))*-1; |
|
138 | 138 | } |
139 | 139 | $result['dew'] = $dew; |
140 | 140 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $result['QNH'] = $matches[2]; |
147 | 147 | } else { |
148 | 148 | // inHg |
149 | - $result['QNH'] = round(($matches[2] / 100)*33.86389,2); |
|
149 | + $result['QNH'] = round(($matches[2]/100)*33.86389, 2); |
|
150 | 150 | } |
151 | 151 | /* |
152 | 152 | $result['QNH'] = $matches[1] == 'Q' ? $matches[2] : ($matches[2] / 100); |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | // Visibility |
168 | 168 | if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) { |
169 | 169 | if (isset($matches[3]) && strlen($matches[3]) > 0) { |
170 | - $result['visibility'] = (float)$matches[3] * 1609.34; |
|
170 | + $result['visibility'] = (float) $matches[3]*1609.34; |
|
171 | 171 | } else { |
172 | 172 | if ($matches[1] == '9999') { |
173 | 173 | $result['visibility'] = '> 10000'; |
174 | 174 | } else { |
175 | - $result['visibility'] = (float)$matches[1]; |
|
175 | + $result['visibility'] = (float) $matches[1]; |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | if (preg_match('#^CAVOK$#', $piece, $matches)) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage'; |
195 | 195 | elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility'; |
196 | 196 | $cloud['type_code'] = $type; |
197 | - $cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048); |
|
197 | + $cloud['level'] = round(((float) $matches[2])*100*0.3048); |
|
198 | 198 | $cloud['significant'] = isset($matches[3]) ? $matches[3] : ''; |
199 | 199 | $result['cloud'][] = $cloud; |
200 | 200 | } |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | $rvr['runway'] = $matches[1]; |
205 | 205 | $rvr['assessment'] = $matches[2]; |
206 | 206 | $rvr['rvr'] = $matches[3]; |
207 | - $rvr['rvr_max'] = array_key_exists(4,$matches) ? $matches[4] : 0; |
|
208 | - $rvr['unit'] = array_key_exists(5,$matches) ? $matches[5] : ''; |
|
207 | + $rvr['rvr_max'] = array_key_exists(4, $matches) ? $matches[4] : 0; |
|
208 | + $rvr['unit'] = array_key_exists(5, $matches) ? $matches[5] : ''; |
|
209 | 209 | $result['RVR'] = $rvr; |
210 | 210 | } |
211 | 211 | //if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | $result['RVR']['friction'] = $matches[5]; |
219 | 219 | } |
220 | 220 | if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
221 | - if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
222 | - else $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
221 | + if (isset($matches[5])) $range = array('exact' => (float) $matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
222 | + else $range = array('exact' => (float) $matches[2], 'unit' => 'M'); |
|
223 | 223 | if (isset($matches[3])) { |
224 | 224 | $range = Array( |
225 | - 'from' => (float)$matches[2], |
|
226 | - 'to' => (float)$matches[4], |
|
225 | + 'from' => (float) $matches[2], |
|
226 | + 'to' => (float) $matches[4], |
|
227 | 227 | 'unit' => $matches[5] ? 'FT' : 'M' |
228 | 228 | ); |
229 | 229 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | try { |
272 | 272 | $sth = $this->db->prepare($query); |
273 | 273 | $sth->execute($query_values); |
274 | - } catch(PDOException $e) { |
|
274 | + } catch (PDOException $e) { |
|
275 | 275 | return "error : ".$e->getMessage(); |
276 | 276 | } |
277 | 277 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -281,19 +281,19 @@ discard block |
||
281 | 281 | return $all; |
282 | 282 | } |
283 | 283 | |
284 | - public function addMETAR($location,$metar,$date) { |
|
284 | + public function addMETAR($location, $metar, $date) { |
|
285 | 285 | global $globalDBdriver; |
286 | - $date = date('Y-m-d H:i:s',strtotime($date)); |
|
286 | + $date = date('Y-m-d H:i:s', strtotime($date)); |
|
287 | 287 | if ($globalDBdriver == 'mysql') { |
288 | 288 | $query = "INSERT INTO metar (metar_location,metar_date,metar) VALUES (:location,:date,:metar) ON DUPLICATE KEY UPDATE metar_date = :date, metar = :metar"; |
289 | 289 | } else { |
290 | 290 | $query = "UPDATE metar SET metar_date = :date, metar = metar WHERE metar_location = :location;INSERT INTO metar (metar_location,metar_date,metar) SELECT :location,:date,:metar WHERE NOT EXISTS (SELECT 1 FROM metar WHERE metar_location = :location);"; |
291 | 291 | } |
292 | - $query_values = array(':location' => $location,':date' => $date,':metar' => utf8_encode($metar)); |
|
292 | + $query_values = array(':location' => $location, ':date' => $date, ':metar' => utf8_encode($metar)); |
|
293 | 293 | try { |
294 | 294 | $sth = $this->db->prepare($query); |
295 | 295 | $sth->execute($query_values); |
296 | - } catch(PDOException $e) { |
|
296 | + } catch (PDOException $e) { |
|
297 | 297 | return "error : ".$e->getMessage(); |
298 | 298 | } |
299 | 299 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | try { |
305 | 305 | $sth = $this->db->prepare($query); |
306 | 306 | $sth->execute($query_values); |
307 | - } catch(PDOException $e) { |
|
307 | + } catch (PDOException $e) { |
|
308 | 308 | return "error : ".$e->getMessage(); |
309 | 309 | } |
310 | 310 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | try { |
315 | 315 | $sth = $this->db->prepare($query); |
316 | 316 | $sth->execute(); |
317 | - } catch(PDOException $e) { |
|
317 | + } catch (PDOException $e) { |
|
318 | 318 | return "error : ".$e->getMessage(); |
319 | 319 | } |
320 | 320 | } |
@@ -325,27 +325,27 @@ discard block |
||
325 | 325 | date_default_timezone_set("UTC"); |
326 | 326 | $Common = new Common(); |
327 | 327 | if (isset($globalIVAO) && $globalIVAO) { |
328 | - $Common->download('http://wx.ivao.aero/metar.php',dirname(__FILE__).'/../install/tmp/ivaometar.txt'); |
|
329 | - $handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt',"r"); |
|
328 | + $Common->download('http://wx.ivao.aero/metar.php', dirname(__FILE__).'/../install/tmp/ivaometar.txt'); |
|
329 | + $handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt', "r"); |
|
330 | 330 | } else { |
331 | - $Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT',dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT'); |
|
332 | - $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r"); |
|
331 | + $Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT', dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT'); |
|
332 | + $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT', "r"); |
|
333 | 333 | } |
334 | 334 | if ($handle) { |
335 | 335 | if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB..."; |
336 | 336 | $date = ''; |
337 | 337 | if ($globalTransaction) $this->db->beginTransaction(); |
338 | - while(($line = fgets($handle,4096)) !== false) { |
|
339 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
338 | + while (($line = fgets($handle, 4096)) !== false) { |
|
339 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
340 | 340 | $date = $line; |
341 | 341 | } elseif ($line != '') { |
342 | 342 | if ($date == '') $date = date('Y/m/d H:m'); |
343 | 343 | $pos = 0; |
344 | - $pieces = preg_split('/\s/',$line); |
|
344 | + $pieces = preg_split('/\s/', $line); |
|
345 | 345 | if ($pieces[0] == 'METAR') $pos++; |
346 | 346 | if (strlen($pieces[$pos]) != 4) $pos++; |
347 | 347 | $location = $pieces[$pos]; |
348 | - echo $this->addMETAR($location,$line,$date); |
|
348 | + echo $this->addMETAR($location, $line, $date); |
|
349 | 349 | } |
350 | 350 | } |
351 | 351 | fclose($handle); |
@@ -359,22 +359,22 @@ discard block |
||
359 | 359 | if ($globalMETARurl == '') return array(); |
360 | 360 | date_default_timezone_set("UTC"); |
361 | 361 | $Common = new Common(); |
362 | - $url = str_replace('{icao}',$icao,$globalMETARurl); |
|
362 | + $url = str_replace('{icao}', $icao, $globalMETARurl); |
|
363 | 363 | $cycle = $Common->getData($url); |
364 | 364 | $date = ''; |
365 | - foreach(explode("\n",$cycle) as $line) { |
|
366 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
365 | + foreach (explode("\n", $cycle) as $line) { |
|
366 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
367 | 367 | $date = $line; |
368 | 368 | } |
369 | 369 | if ($line != '') { |
370 | 370 | if ($date == '') $date = date('Y/m/d H:m'); |
371 | 371 | $pos = 0; |
372 | - $pieces = preg_split('/\s/',$line); |
|
372 | + $pieces = preg_split('/\s/', $line); |
|
373 | 373 | if ($pieces[0] == 'METAR') $pos++; |
374 | 374 | if (strlen($pieces[$pos]) != 4) $pos++; |
375 | 375 | $location = $pieces[$pos]; |
376 | 376 | if (strlen($location == 4)) { |
377 | - $this->addMETAR($location,$line,$date); |
|
377 | + $this->addMETAR($location, $line, $date); |
|
378 | 378 | return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line)); |
379 | 379 | } else return array(); |
380 | 380 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
3 | 3 | if ($id == "") |
4 | 4 | { |
5 | 5 | header('Location: /'); |
@@ -16,30 +16,30 @@ discard block |
||
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - if(isset($spotter_array[0]['flightaware_id'])) { |
|
19 | + if (isset($spotter_array[0]['flightaware_id'])) { |
|
20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
21 | 21 | } |
22 | - if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
22 | + if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
23 | 23 | $latitude = $spotter_array[0]['last_latitude']; |
24 | - } elseif(isset($spotter_array[0]['latitude'])) { |
|
24 | + } elseif (isset($spotter_array[0]['latitude'])) { |
|
25 | 25 | $latitude = $spotter_array[0]['latitude']; |
26 | 26 | } |
27 | - if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
27 | + if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
28 | 28 | $longitude = $spotter_array[0]['last_longitude']; |
29 | - } elseif(isset($spotter_array[0]['longitude'])) { |
|
29 | + } elseif (isset($spotter_array[0]['longitude'])) { |
|
30 | 30 | $longitude = $spotter_array[0]['longitude']; |
31 | 31 | } |
32 | 32 | $title = ''; |
33 | - if(isset($spotter_array[0]['ident'])) { |
|
33 | + if (isset($spotter_array[0]['ident'])) { |
|
34 | 34 | $title .= $spotter_array[0]['ident']; |
35 | 35 | } |
36 | - if(isset($spotter_array[0]['airline_name'])) { |
|
36 | + if (isset($spotter_array[0]['airline_name'])) { |
|
37 | 37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
38 | 38 | } |
39 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
39 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
40 | 40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
41 | 41 | } |
42 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
42 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
43 | 43 | $title .= ' - '.$spotter_array[0]['registration']; |
44 | 44 | } |
45 | 45 | //$facebook_meta_image = $spotter_array[0]['image']; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $altitude_data = ''; |
60 | 60 | $hour_data = ''; |
61 | 61 | $speed_data = ''; |
62 | - foreach($all_data as $data) |
|
62 | + foreach ($all_data as $data) |
|
63 | 63 | { |
64 | 64 | $hour_data .= '"'.$data['date'].'",'; |
65 | 65 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $speed_data .= $speed.','; |
88 | 88 | } |
89 | 89 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
90 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
91 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
90 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
91 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
92 | 92 | print 'c3.generate({ |
93 | 93 | bindto: "#chart", |
94 | 94 | data: { |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
135 | 135 | } |
136 | 136 | } |
137 | - if(isset($spotter_array[0]['ident'])) { |
|
137 | + if (isset($spotter_array[0]['ident'])) { |
|
138 | 138 | print $spotter_array[0]['ident']; |
139 | 139 | } |
140 | - if(isset($spotter_array[0]['airline_name'])) { |
|
140 | + if (isset($spotter_array[0]['airline_name'])) { |
|
141 | 141 | print ' - '.$spotter_array[0]['airline_name']; |
142 | 142 | } |
143 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
143 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
144 | 144 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
145 | 145 | } |
146 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
146 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
147 | 147 | print ' - '.$spotter_array[0]['registration']; |
148 | 148 | } |
149 | 149 | print '</h1>'; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | print '</div>'; |
298 | 298 | */ |
299 | 299 | |
300 | - foreach($spotter_array as $spotter_item) |
|
300 | + foreach ($spotter_array as $spotter_item) |
|
301 | 301 | { |
302 | 302 | print '<div class="details">'; |
303 | 303 | print '<h3>'._("Flight Information").'</h3>'; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
398 | 398 | if ($spotter_item['departure_airport_time'] > 2460) { |
399 | 399 | print '<div class="time">'; |
400 | - print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
|
400 | + print 'at '.date('H:m', $spotter_item['departure_airport_time']); |
|
401 | 401 | print '</div>'; |
402 | 402 | } else { |
403 | 403 | print '<div class="time">'; |
@@ -546,19 +546,19 @@ discard block |
||
546 | 546 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
547 | 547 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
548 | 548 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
549 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
549 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
550 | 550 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
551 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
551 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
552 | 552 | } else { |
553 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
553 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
554 | 554 | } |
555 | 555 | } else { |
556 | 556 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
557 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
557 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
558 | 558 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
559 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
559 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
560 | 560 | } else { |
561 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
561 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
562 | 562 | } |
563 | 563 | } |
564 | 564 | print '</div>'; |
@@ -572,19 +572,19 @@ discard block |
||
572 | 572 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
573 | 573 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
574 | 574 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
575 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
575 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
576 | 576 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
577 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
577 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
578 | 578 | } else { |
579 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
579 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
580 | 580 | } |
581 | 581 | } else { |
582 | 582 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
583 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
583 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
584 | 584 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
585 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
585 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
586 | 586 | } else { |
587 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
587 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
588 | 588 | } |
589 | 589 | } |
590 | 590 | print '</div>'; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | print '<div class="last-flights">'; |
604 | 604 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$spotter_array[0]['registration'].')</h3>'; |
605 | 605 | $hide_th_links = true; |
606 | - $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'],"0,5", ""); |
|
606 | + $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'], "0,5", ""); |
|
607 | 607 | include('table-output.php'); |
608 | 608 | print '<div class="more">'; |
609 | 609 | print '<a href="'.$globalURL.'/registration/'.$spotter_array[0]['registration'].'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | require_once('require/class.Language.php'); |
4 | 4 | require_once('require/class.Translation.php'); |
5 | 5 | $type = ''; |
6 | -$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
6 | +$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
7 | 7 | if (isset($_GET['marine'])) { |
8 | 8 | require_once('require/class.Marine.php'); |
9 | 9 | require_once('require/class.MarineLive.php'); |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | $page_url = $globalURL.'/ident/'.$_GET['ident']; |
31 | 31 | } |
32 | 32 | |
33 | -if (!isset($_GET['ident'])){ |
|
33 | +if (!isset($_GET['ident'])) { |
|
34 | 34 | header('Location: '.$globalURL.''); |
35 | 35 | } else { |
36 | 36 | $Translation = new Translation(); |
37 | 37 | //calculuation for the pagination |
38 | - if(!isset($_GET['limit'])) |
|
38 | + if (!isset($_GET['limit'])) |
|
39 | 39 | { |
40 | 40 | $limit_start = 0; |
41 | 41 | $limit_end = 25; |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | $limit_previous_1 = $limit_start - $absolute_difference; |
55 | 55 | $limit_previous_2 = $limit_end - $absolute_difference; |
56 | 56 | |
57 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
57 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
58 | 58 | if ($type == 'aircraft') { |
59 | 59 | if ($sort != '') |
60 | 60 | { |
61 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
61 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
62 | 62 | if (empty($spotter_array)) { |
63 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
63 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
64 | 64 | } |
65 | 65 | } else { |
66 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
66 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
67 | 67 | if (empty($spotter_array)) { |
68 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
68 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | if (empty($spotter_array)) { |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | $ident = $new_ident; |
75 | 75 | if ($sort != '') |
76 | 76 | { |
77 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
77 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
78 | 78 | if (empty($spotter_array)) { |
79 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
79 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
80 | 80 | } |
81 | 81 | } else { |
82 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
82 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
83 | 83 | if (empty($spotter_array)) { |
84 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
84 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
@@ -89,34 +89,34 @@ discard block |
||
89 | 89 | } elseif ($type == 'marine') { |
90 | 90 | if ($sort != '') |
91 | 91 | { |
92 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
92 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
93 | 93 | if (empty($spotter_array)) { |
94 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
94 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
95 | 95 | } |
96 | 96 | } else { |
97 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
97 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
98 | 98 | if (empty($spotter_array)) { |
99 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
99 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } elseif ($type == 'tracker') { |
103 | 103 | if ($sort != '') |
104 | 104 | { |
105 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
105 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
106 | 106 | if (empty($spotter_array)) { |
107 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
107 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
108 | 108 | } |
109 | 109 | } else { |
110 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
110 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
111 | 111 | if (empty($spotter_array)) { |
112 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
112 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | 117 | if (!empty($spotter_array)) |
118 | 118 | { |
119 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
|
119 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']); |
|
120 | 120 | $ident = $spotter_array[0]['ident']; |
121 | 121 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
122 | 122 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $altitude_data = ''; |
137 | 137 | $hour_data = ''; |
138 | 138 | $speed_data = ''; |
139 | - foreach($all_data as $data) |
|
139 | + foreach ($all_data as $data) |
|
140 | 140 | { |
141 | 141 | $hour_data .= '"'.$data['date'].'",'; |
142 | 142 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | $speed_data .= $speed.','; |
165 | 165 | } |
166 | 166 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
167 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
168 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
167 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
168 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
169 | 169 | print 'c3.generate({ |
170 | 170 | bindto: "#chart", |
171 | 171 | data: { |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | |
210 | 210 | if ($type == 'aircraft') include('ident-sub-menu.php'); |
211 | 211 | print '<div class="table column">'; |
212 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
213 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
214 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
212 | + if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
213 | + elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
214 | + elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
215 | 215 | |
216 | 216 | include('table-output.php'); |
217 | 217 | print '<div class="pagination">'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Arrival Airports from %s"),$country); |
|
17 | + $title = sprintf(_("Most Common Arrival Airports from %s"), $country); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
23 | 23 | print '<option></option>'; |
24 | 24 | $all_countries = $Spotter->getAllCountries(); |
25 | - foreach($all_countries as $all_country) |
|
25 | + foreach ($all_countries as $all_country) |
|
26 | 26 | { |
27 | - if($country == $all_country['country']) |
|
27 | + if ($country == $all_country['country']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
30 | 30 | } else { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ($_GET['country'] != "NA") |
40 | 40 | { |
41 | 41 | print '<div class="info column">'; |
42 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
42 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
43 | 43 | print '</div>'; |
44 | 44 | } else { |
45 | 45 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | include('country-sub-menu.php'); |
49 | 49 | print '<div class="column">'; |
50 | 50 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
51 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
51 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
52 | 52 | $airport_airport_array = $Spotter->countAllArrivalAirportsByCountry($country); |
53 | 53 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
54 | 54 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | print '<script>'; |
58 | 58 | print 'var series = ['; |
59 | 59 | $airport_data = ''; |
60 | - foreach($airport_airport_array as $airport_item) |
|
60 | + foreach ($airport_airport_array as $airport_item) |
|
61 | 61 | { |
62 | 62 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_name'].' ('.$airport_item['airport_arrival_icao'].')",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
63 | 63 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | print '</thead>'; |
112 | 112 | print '<tbody>'; |
113 | 113 | $i = 1; |
114 | - foreach($airport_airport_array as $airport_item) |
|
114 | + foreach ($airport_airport_array as $airport_item) |
|
115 | 115 | { |
116 | 116 | print '<tr>'; |
117 | 117 | print '<td><strong>'.$i.'</strong></td>'; |