@@ -91,6 +91,10 @@ |
||
91 | 91 | $this->rlatres = (($this->height - 1) / 180.0); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param integer $ix |
|
96 | + * @param integer $iy |
|
97 | + */ |
|
94 | 98 | private function _rawval($ix,$iy) { |
95 | 99 | if (($iy < 0)) { |
96 | 100 | $iy = -$iy; |
@@ -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 == '') { |
@@ -45,35 +45,35 @@ discard block |
||
45 | 45 | if (file_exists($name) === FALSE) { |
46 | 46 | throw new Exception($name." doesn't exist"); |
47 | 47 | } |
48 | - $f = @fopen($name,"r"); |
|
48 | + $f = @fopen($name, "r"); |
|
49 | 49 | if ($f === FALSE) { |
50 | 50 | throw new Exception("Can't open ".$name); |
51 | 51 | } |
52 | - $line = fgets($f,4096); |
|
52 | + $line = fgets($f, 4096); |
|
53 | 53 | if (trim($line) != 'P5') { |
54 | 54 | throw new Exception('No PGM header'); |
55 | 55 | } |
56 | 56 | $headerlen = strlen($line); |
57 | 57 | while (true) { |
58 | - $line = fgets($f,4096); |
|
58 | + $line = fgets($f, 4096); |
|
59 | 59 | if ((strlen($line) == 0)) { |
60 | 60 | throw new Exception('EOF before end of file header'); |
61 | 61 | } |
62 | 62 | $headerlen += strlen($line); |
63 | - if (strpos($line,'# Offset ') !== FALSE) { |
|
63 | + if (strpos($line, '# Offset ') !== FALSE) { |
|
64 | 64 | $this->offset = substr($line, 9); |
65 | - } else if (strpos($line,'# Scale ') !== FALSE) { |
|
65 | + } else if (strpos($line, '# Scale ') !== FALSE) { |
|
66 | 66 | $this->scale = substr($line, 8); |
67 | - } else if ((strpos($line,'#') === FALSE)) { |
|
68 | - list($this->width, $this->height) = preg_split('/\s+/',$line); |
|
67 | + } else if ((strpos($line, '#') === FALSE)) { |
|
68 | + list($this->width, $this->height) = preg_split('/\s+/', $line); |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | } |
72 | - $line = fgets($f,4096); |
|
72 | + $line = fgets($f, 4096); |
|
73 | 73 | $headerlen += strlen($line); |
74 | - $levels = (int)$line; |
|
75 | - $this->width = (int)$this->width; |
|
76 | - $this->height = (int)$this->height; |
|
74 | + $levels = (int) $line; |
|
75 | + $this->width = (int) $this->width; |
|
76 | + $this->height = (int) $this->height; |
|
77 | 77 | if (($levels != 65535)) { |
78 | 78 | throw new Exception('PGM file must have 65535 gray levels ('.$levels.')'); |
79 | 79 | } |
@@ -88,42 +88,42 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $fullsize = filesize($name); |
91 | - if ((($fullsize - $headerlen) != (($this->width * $this->height) * 2))) { |
|
91 | + if ((($fullsize - $headerlen) != (($this->width*$this->height)*2))) { |
|
92 | 92 | throw new Exception('File has the wrong length'); |
93 | 93 | } |
94 | 94 | |
95 | 95 | $this->headerlen = $headerlen; |
96 | - $this->raw= $f; |
|
97 | - $this->rlonres = ($this->width / 360.0); |
|
98 | - $this->rlatres = (($this->height - 1) / 180.0); |
|
96 | + $this->raw = $f; |
|
97 | + $this->rlonres = ($this->width/360.0); |
|
98 | + $this->rlatres = (($this->height - 1)/180.0); |
|
99 | 99 | } |
100 | 100 | |
101 | - private function _rawval($ix,$iy) { |
|
101 | + private function _rawval($ix, $iy) { |
|
102 | 102 | if (($iy < 0)) { |
103 | 103 | $iy = -$iy; |
104 | - $ix += ($this->width / 2); |
|
104 | + $ix += ($this->width/2); |
|
105 | 105 | } else if (($iy >= $this->height)) { |
106 | - $iy = ((2 * ($this->height - 1)) - $iy); |
|
107 | - $ix += ($this->width / 2); |
|
106 | + $iy = ((2*($this->height - 1)) - $iy); |
|
107 | + $ix += ($this->width/2); |
|
108 | 108 | } |
109 | 109 | if (($ix < 0)) { |
110 | 110 | $ix += $this->width; |
111 | 111 | } else if (($ix >= $this->width)) { |
112 | 112 | $ix -= $this->width; |
113 | 113 | } |
114 | - $k = ((($iy * $this->width) + $ix) * 2) + $this->headerlen; |
|
115 | - fseek($this->raw,$k); |
|
116 | - return unpack('n',fread($this->raw,2))[1]; |
|
114 | + $k = ((($iy*$this->width) + $ix)*2) + $this->headerlen; |
|
115 | + fseek($this->raw, $k); |
|
116 | + return unpack('n', fread($this->raw, 2))[1]; |
|
117 | 117 | } |
118 | 118 | |
119 | - public function get($lat,$lon,$cubic=true) { |
|
119 | + public function get($lat, $lon, $cubic = true) { |
|
120 | 120 | if (($lon < 0)) { |
121 | 121 | $lon += 360; |
122 | 122 | } |
123 | - $fy = ((90 - $lat) * $this->rlatres); |
|
124 | - $fx = ($lon * $this->rlonres); |
|
125 | - $iy = (int)$fy; |
|
126 | - $ix = (int)$fx; |
|
123 | + $fy = ((90 - $lat)*$this->rlatres); |
|
124 | + $fx = ($lon*$this->rlonres); |
|
125 | + $iy = (int) $fy; |
|
126 | + $ix = (int) $fx; |
|
127 | 127 | $fx -= $ix; |
128 | 128 | $fy -= $iy; |
129 | 129 | $t = array(); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $c3x = $this->c3; |
151 | 151 | $c0x = $this->c0; |
152 | 152 | } |
153 | - for ($i = 0; $i < 10;++$i) { |
|
153 | + for ($i = 0; $i < 10; ++$i) { |
|
154 | 154 | $t[$i] = 0; |
155 | 155 | for ($j = 0; $j < 12; ++$j) { |
156 | 156 | $t[$i] += $v[$j]*$c3x[$j][$i]; |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | $this->t = $t; |
162 | 162 | } else $t = $this->t; |
163 | 163 | if (!($cubic)) { |
164 | - $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
|
165 | - $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
|
166 | - $h = (((1 - $fy) * $a) + ($fy * $b)); |
|
164 | + $a = (((1 - $fx)*$this->v00) + ($fx*$this->v01)); |
|
165 | + $b = (((1 - $fx)*$this->v10) + ($fx*$this->v11)); |
|
166 | + $h = (((1 - $fy)*$a) + ($fy*$b)); |
|
167 | 167 | } else { |
168 | - $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])))))); |
|
168 | + $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])))))); |
|
169 | 169 | } |
170 | - return ((float)$this->offset + ((float)$this->scale * (float)$h)); |
|
170 | + return ((float) $this->offset + ((float) $this->scale*(float) $h)); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | /* |
@@ -38,8 +38,11 @@ discard block |
||
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
41 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
42 | - else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
41 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
42 | + $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
43 | + } else { |
|
44 | + $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
45 | + } |
|
43 | 46 | } |
44 | 47 | |
45 | 48 | if (file_exists($name) === FALSE) { |
@@ -159,7 +162,9 @@ discard block |
||
159 | 162 | } |
160 | 163 | } |
161 | 164 | $this->t = $t; |
162 | - } else $t = $this->t; |
|
165 | + } else { |
|
166 | + $t = $this->t; |
|
167 | + } |
|
163 | 168 | if (!($cubic)) { |
164 | 169 | $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
165 | 170 | $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
@@ -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; |
@@ -27,15 +27,21 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | -if ($authorize === false) die; |
|
30 | +if ($authorize === false) { |
|
31 | + die; |
|
32 | +} |
|
31 | 33 | |
32 | -if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
34 | +if (isset($globalTracker) && $globalTracker) { |
|
35 | + require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
36 | +} |
|
33 | 37 | if (isset($globalMarine) && $globalMarine) { |
34 | 38 | require_once(dirname(__FILE__).'/../require/class.AIS.php'); |
35 | 39 | require_once(dirname(__FILE__).'/../require/class.MarineImport.php'); |
36 | 40 | } |
37 | 41 | |
38 | -if (!isset($globalDebug)) $globalDebug = FALSE; |
|
42 | +if (!isset($globalDebug)) { |
|
43 | + $globalDebug = FALSE; |
|
44 | +} |
|
39 | 45 | |
40 | 46 | // Check if schema is at latest version |
41 | 47 | $Connection = new Connection(); |
@@ -45,10 +51,16 @@ discard block |
||
45 | 51 | } |
46 | 52 | |
47 | 53 | if (isset($globalServer) && $globalServer) { |
48 | - if ($globalDebug) echo "Using Server Mode\n"; |
|
54 | + if ($globalDebug) { |
|
55 | + echo "Using Server Mode\n"; |
|
56 | + } |
|
49 | 57 | $SI=new SpotterServer(); |
50 | -} else $SI=new SpotterImport($Connection->db); |
|
51 | -if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
|
58 | +} else { |
|
59 | + $SI=new SpotterImport($Connection->db); |
|
60 | +} |
|
61 | +if (isset($globalTracker) && $globalTracker) { |
|
62 | + $TI = new TrackerImport($Connection->db); |
|
63 | +} |
|
52 | 64 | if (isset($globalMarine) && $globalMarine) { |
53 | 65 | $AIS = new AIS(); |
54 | 66 | $MI = new MarineImport($Connection->db); |
@@ -57,7 +69,9 @@ discard block |
||
57 | 69 | date_default_timezone_set('UTC'); |
58 | 70 | |
59 | 71 | $buffer = ''; |
60 | -if (isset($_POST)) $buffer = $_POST; |
|
72 | +if (isset($_POST)) { |
|
73 | + $buffer = $_POST; |
|
74 | +} |
|
61 | 75 | $data = array(); |
62 | 76 | if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) { |
63 | 77 | $data['ident'] = $buffer['device_id']; |
@@ -68,15 +82,27 @@ discard block |
||
68 | 82 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | 83 | $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
70 | 84 | $data['comment'] = ''; |
71 | - if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
85 | + if (isset($buffer['battery']) && $buffer['battery'] != '') { |
|
86 | + $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
87 | + } |
|
72 | 88 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
73 | - if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
74 | - if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
89 | + if (isset($buffer['temp']) && $buffer['temp'] != '') { |
|
90 | + $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
91 | + } |
|
92 | + if (isset($buffer['press']) && $buffer['press'] != '') { |
|
93 | + $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
94 | + } |
|
75 | 95 | $TI->add($data); |
76 | 96 | unset($data); |
77 | 97 | } |
78 | -if (isset($SI)) $SI->checkAll(); |
|
79 | -if (isset($MI)) $MI->checkAll(); |
|
80 | -if (isset($TI)) $TI->checkAll(); |
|
98 | +if (isset($SI)) { |
|
99 | + $SI->checkAll(); |
|
100 | +} |
|
101 | +if (isset($MI)) { |
|
102 | + $MI->checkAll(); |
|
103 | +} |
|
104 | +if (isset($TI)) { |
|
105 | + $TI->checkAll(); |
|
106 | +} |
|
81 | 107 | |
82 | 108 | ?> |
@@ -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'].' '; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
@@ -10,10 +10,10 @@ |
||
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
13 | - * Get SQL query part for filter used |
|
14 | - * @param Array $filter the filter |
|
15 | - * @return Array the SQL part |
|
16 | - */ |
|
13 | + * Get SQL query part for filter used |
|
14 | + * @param Array $filter the filter |
|
15 | + * @return Array the SQL part |
|
16 | + */ |
|
17 | 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])) { |
@@ -7,7 +7,9 @@ discard block |
||
7 | 7 | public function __construct($dbc = null) { |
8 | 8 | $Connection = new Connection($dbc); |
9 | 9 | $this->db = $Connection->db; |
10 | - if ($this->db === null) die('Error: No DB connection. (ATC)'); |
|
10 | + if ($this->db === null) { |
|
11 | + die('Error: No DB connection. (ATC)'); |
|
12 | + } |
|
11 | 13 | } |
12 | 14 | |
13 | 15 | /** |
@@ -20,20 +22,27 @@ discard block |
||
20 | 22 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
21 | 23 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
22 | 24 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
23 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
25 | + if (isset($source['source'])) { |
|
26 | + $filter['source'][] = $source['source']; |
|
27 | + } |
|
24 | 28 | } |
25 | 29 | } else { |
26 | 30 | $filter = $globalStatsFilters[$globalFilterName]; |
27 | 31 | } |
28 | 32 | } |
29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
33 | + if (is_array($globalFilter)) { |
|
34 | + $filter = array_merge($filter,$globalFilter); |
|
35 | + } |
|
30 | 36 | $filter_query_join = ''; |
31 | 37 | $filter_query_where = ''; |
32 | 38 | if (isset($filter['source']) && !empty($filter['source'])) { |
33 | 39 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
34 | 40 | } |
35 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
36 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
41 | + if ($filter_query_where == '' && $where) { |
|
42 | + $filter_query_where = ' WHERE'; |
|
43 | + } elseif ($filter_query_where != '' && $and) { |
|
44 | + $filter_query_where .= ' AND'; |
|
45 | + } |
|
37 | 46 | $filter_query = $filter_query_join.$filter_query_where; |
38 | 47 | return $filter_query; |
39 | 48 | } |
@@ -90,7 +99,9 @@ discard block |
||
90 | 99 | $info = str_replace('^','<br />',$info); |
91 | 100 | $info = str_replace('&sect;','',$info); |
92 | 101 | $info = str_replace('"','',$info); |
93 | - if ($type == '') $type = NULL; |
|
102 | + if ($type == '') { |
|
103 | + $type = NULL; |
|
104 | + } |
|
94 | 105 | $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)"; |
95 | 106 | $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); |
96 | 107 | try { |
@@ -106,7 +117,9 @@ discard block |
||
106 | 117 | $info = str_replace('^','<br />',$info); |
107 | 118 | $info = str_replace('&sect;','',$info); |
108 | 119 | $info = str_replace('"','',$info); |
109 | - if ($type == '') $type = NULL; |
|
120 | + if ($type == '') { |
|
121 | + $type = NULL; |
|
122 | + } |
|
110 | 123 | $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"; |
111 | 124 | $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); |
112 | 125 | try { |
@@ -26,22 +26,22 @@ discard block |
||
26 | 26 | * @param Array $filter the filter |
27 | 27 | * @return Array the SQL part |
28 | 28 | */ |
29 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
29 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
30 | 30 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
31 | 31 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
32 | 32 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
33 | - foreach($globalStatsFilters[$globalFilterName] as $source) { |
|
33 | + foreach ($globalStatsFilters[$globalFilterName] as $source) { |
|
34 | 34 | if (isset($source['source'])) $filter['source'][] = $source['source']; |
35 | 35 | } |
36 | 36 | } else { |
37 | 37 | $filter = $globalStatsFilters[$globalFilterName]; |
38 | 38 | } |
39 | 39 | } |
40 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
40 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
41 | 41 | $filter_query_join = ''; |
42 | 42 | $filter_query_where = ''; |
43 | 43 | if (isset($filter['source']) && !empty($filter['source'])) { |
44 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
44 | + $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
45 | 45 | } |
46 | 46 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
47 | 47 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | try { |
61 | 61 | $sth = $this->db->prepare($query); |
62 | 62 | $sth->execute($query_values); |
63 | - } catch(PDOException $e) { |
|
63 | + } catch (PDOException $e) { |
|
64 | 64 | return "error : ".$e->getMessage(); |
65 | 65 | } |
66 | 66 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | * @return Array Return ATC |
74 | 74 | */ |
75 | 75 | public function getById($id) { |
76 | - $filter_query = $this->getFilter(array(),true,true); |
|
76 | + $filter_query = $this->getFilter(array(), true, true); |
|
77 | 77 | $query = "SELECT * FROM atc".$filter_query." atc_id = :id"; |
78 | 78 | $query_values = array(':id' => $id); |
79 | 79 | try { |
80 | 80 | $sth = $this->db->prepare($query); |
81 | 81 | $sth->execute($query_values); |
82 | - } catch(PDOException $e) { |
|
82 | + } catch (PDOException $e) { |
|
83 | 83 | return "error : ".$e->getMessage(); |
84 | 84 | } |
85 | 85 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -92,19 +92,19 @@ discard block |
||
92 | 92 | * @param String $format_source Format source |
93 | 93 | * @return Array Return ATC |
94 | 94 | */ |
95 | - public function getByIdent($ident,$format_source = '') { |
|
96 | - $filter_query = $this->getFilter(array(),true,true); |
|
95 | + public function getByIdent($ident, $format_source = '') { |
|
96 | + $filter_query = $this->getFilter(array(), true, true); |
|
97 | 97 | if ($format_source == '') { |
98 | 98 | $query = "SELECT * FROM atc".$filter_query." ident = :ident"; |
99 | 99 | $query_values = array(':ident' => $ident); |
100 | 100 | } else { |
101 | 101 | $query = "SELECT * FROM atc".$filter_query." ident = :ident AND format_source = :format_source"; |
102 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
102 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
103 | 103 | } |
104 | 104 | try { |
105 | 105 | $sth = $this->db->prepare($query); |
106 | 106 | $sth->execute($query_values); |
107 | - } catch(PDOException $e) { |
|
107 | + } catch (PDOException $e) { |
|
108 | 108 | return "error : ".$e->getMessage(); |
109 | 109 | } |
110 | 110 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | * @param String $format_source Format source |
127 | 127 | * @param String $source_name Source name |
128 | 128 | */ |
129 | - public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
130 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
131 | - $info = str_replace('^','<br />',$info); |
|
132 | - $info = str_replace('&sect;','',$info); |
|
133 | - $info = str_replace('"','',$info); |
|
129 | + public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
130 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
131 | + $info = str_replace('^', '<br />', $info); |
|
132 | + $info = str_replace('&sect;', '', $info); |
|
133 | + $info = str_replace('"', '', $info); |
|
134 | 134 | if ($type == '') $type = NULL; |
135 | 135 | $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)"; |
136 | - $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); |
|
136 | + $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); |
|
137 | 137 | try { |
138 | 138 | $sth = $this->db->prepare($query); |
139 | 139 | $sth->execute($query_values); |
140 | - } catch(PDOException $e) { |
|
140 | + } catch (PDOException $e) { |
|
141 | 141 | return "error : ".$e->getMessage(); |
142 | 142 | } |
143 | 143 | } |
@@ -157,18 +157,18 @@ discard block |
||
157 | 157 | * @param String $format_source Format source |
158 | 158 | * @param String $source_name Source name |
159 | 159 | */ |
160 | - public function update($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
161 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
162 | - $info = str_replace('^','<br />',$info); |
|
163 | - $info = str_replace('&sect;','',$info); |
|
164 | - $info = str_replace('"','',$info); |
|
160 | + public function update($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
161 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
162 | + $info = str_replace('^', '<br />', $info); |
|
163 | + $info = str_replace('&sect;', '', $info); |
|
164 | + $info = str_replace('"', '', $info); |
|
165 | 165 | if ($type == '') $type = NULL; |
166 | 166 | $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"; |
167 | - $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); |
|
167 | + $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); |
|
168 | 168 | try { |
169 | 169 | $sth = $this->db->prepare($query); |
170 | 170 | $sth->execute($query_values); |
171 | - } catch(PDOException $e) { |
|
171 | + } catch (PDOException $e) { |
|
172 | 172 | return "error : ".$e->getMessage(); |
173 | 173 | } |
174 | 174 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | try { |
184 | 184 | $sth = $this->db->prepare($query); |
185 | 185 | $sth->execute($query_values); |
186 | - } catch(PDOException $e) { |
|
186 | + } catch (PDOException $e) { |
|
187 | 187 | return "error : ".$e->getMessage(); |
188 | 188 | } |
189 | 189 | } |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | * @param String $ident Flight ident |
194 | 194 | * @param String $format_source Format source |
195 | 195 | */ |
196 | - public function deleteByIdent($ident,$format_source) { |
|
196 | + public function deleteByIdent($ident, $format_source) { |
|
197 | 197 | $query = "DELETE FROM atc WHERE ident = :ident AND format_source = :format_source"; |
198 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
198 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
199 | 199 | try { |
200 | 200 | $sth = $this->db->prepare($query); |
201 | 201 | $sth->execute($query_values); |
202 | - } catch(PDOException $e) { |
|
202 | + } catch (PDOException $e) { |
|
203 | 203 | return "error : ".$e->getMessage(); |
204 | 204 | } |
205 | 205 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | try { |
214 | 214 | $sth = $this->db->prepare($query); |
215 | 215 | $sth->execute($query_values); |
216 | - } catch(PDOException $e) { |
|
216 | + } catch (PDOException $e) { |
|
217 | 217 | return "error : ".$e->getMessage(); |
218 | 218 | } |
219 | 219 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | try { |
232 | 232 | $sth = $this->db->prepare($query); |
233 | 233 | $sth->execute(); |
234 | - } catch(PDOException $e) { |
|
234 | + } catch (PDOException $e) { |
|
235 | 235 | return "error"; |
236 | 236 | } |
237 | 237 | return "success"; |
@@ -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; |
@@ -11,7 +11,9 @@ discard block |
||
11 | 11 | print '<h1>'._("Geoid Height Calculator").'</h1>'; |
12 | 12 | print '</div>'; |
13 | 13 | print '<p>Not available</p>'; |
14 | - if (isset($globalDebug) && $globalDebug) echo '<p>'.$e.'</p>'; |
|
14 | + if (isset($globalDebug) && $globalDebug) { |
|
15 | + echo '<p>'.$e.'</p>'; |
|
16 | + } |
|
15 | 17 | require_once('footer.php'); |
16 | 18 | exit(); |
17 | 19 | } |
@@ -69,8 +71,11 @@ discard block |
||
69 | 71 | print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>'; |
70 | 72 | } |
71 | 73 | print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>'; |
72 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource; |
|
73 | - else $geoidsource = 'EGM96-15'; |
|
74 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
75 | + $geoidsource = $globalGeoidSource; |
|
76 | + } else { |
|
77 | + $geoidsource = 'EGM96-15'; |
|
78 | + } |
|
74 | 79 | print '<div class="col-sm-6">'.$geoidsource.'</div>'; |
75 | 80 | print '</div>'; |
76 | 81 | } |
@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
49 | 49 | if (isset($globalTimezone)) { |
50 | 50 | date_default_timezone_set($globalTimezone); |
51 | - } else date_default_timezone_set('UTC'); |
|
51 | + } else { |
|
52 | + date_default_timezone_set('UTC'); |
|
53 | + } |
|
52 | 54 | |
53 | 55 | if (is_array($all_data) && count($all_data) > 1) { |
54 | 56 | print '<br/>'; |
@@ -327,9 +329,13 @@ discard block |
||
327 | 329 | print '<div>'; |
328 | 330 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
329 | 331 | { |
330 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
331 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
332 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
332 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
333 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
334 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
335 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
336 | + } else { |
|
337 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
338 | + } |
|
333 | 339 | } else { |
334 | 340 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
335 | 341 | { |
@@ -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">'; |
@@ -547,19 +547,19 @@ discard block |
||
547 | 547 | if (count($departure_airport_info) > 0) { |
548 | 548 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
549 | 549 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
550 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
550 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
551 | 551 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
552 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
552 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
553 | 553 | } else { |
554 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
554 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
555 | 555 | } |
556 | 556 | } else { |
557 | 557 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
558 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
558 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
559 | 559 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
560 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
560 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
561 | 561 | } else { |
562 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
562 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 | } |
@@ -575,19 +575,19 @@ discard block |
||
575 | 575 | if (count($arrival_airport_info) > 0) { |
576 | 576 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
577 | 577 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
578 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
578 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
579 | 579 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
580 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
580 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
581 | 581 | } else { |
582 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
582 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
583 | 583 | } |
584 | 584 | } else { |
585 | 585 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
586 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
586 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
587 | 587 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
588 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
588 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
589 | 589 | } else { |
590 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
590 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
591 | 591 | } |
592 | 592 | } |
593 | 593 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | print '<div class="last-flights">'; |
607 | 607 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>'; |
608 | 608 | $hide_th_links = true; |
609 | - $spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", ""); |
|
609 | + $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,5", ""); |
|
610 | 610 | include('table-output.php'); |
611 | 611 | print '<div class="more">'; |
612 | 612 | print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
@@ -118,8 +118,12 @@ discard block |
||
118 | 118 | { |
119 | 119 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
120 | 120 | $ident = $spotter_array[0]['ident']; |
121 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
122 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
121 | + if (isset($spotter_array[0]['latitude'])) { |
|
122 | + $latitude = $spotter_array[0]['latitude']; |
|
123 | + } |
|
124 | + if (isset($spotter_array[0]['longitude'])) { |
|
125 | + $longitude = $spotter_array[0]['longitude']; |
|
126 | + } |
|
123 | 127 | require_once('header.php'); |
124 | 128 | if (isset($globalArchive) && $globalArchive && $type == 'aircraft') { |
125 | 129 | // Requirement for altitude graph |
@@ -127,7 +131,9 @@ discard block |
||
127 | 131 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
128 | 132 | if (isset($globalTimezone)) { |
129 | 133 | date_default_timezone_set($globalTimezone); |
130 | - } else date_default_timezone_set('UTC'); |
|
134 | + } else { |
|
135 | + date_default_timezone_set('UTC'); |
|
136 | + } |
|
131 | 137 | if (is_array($all_data) && count($all_data) > 1) { |
132 | 138 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
133 | 139 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -204,14 +210,22 @@ discard block |
||
204 | 210 | if (isset($spotter_array[0]['airline_icao'])) { |
205 | 211 | print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; |
206 | 212 | } |
207 | - if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
213 | + if ($type == 'aircraft') { |
|
214 | + print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
215 | + } |
|
208 | 216 | print '</div>'; |
209 | 217 | |
210 | - if ($type == 'aircraft') include('ident-sub-menu.php'); |
|
218 | + if ($type == 'aircraft') { |
|
219 | + include('ident-sub-menu.php'); |
|
220 | + } |
|
211 | 221 | 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>'; |
|
222 | + if ($type == 'aircraft') { |
|
223 | + 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>'; |
|
224 | + } elseif ($type == 'marine') { |
|
225 | + 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>'; |
|
226 | + } elseif ($type == 'tracker') { |
|
227 | + 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>'; |
|
228 | + } |
|
215 | 229 | |
216 | 230 | include('table-output.php'); |
217 | 231 | print '<div class="pagination">'; |
@@ -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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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) && isset($globalArchiveResults) && $globalArchiveResults) { |
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']; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $altitude_data = ''; |
136 | 136 | $hour_data = ''; |
137 | 137 | $speed_data = ''; |
138 | - foreach($all_data as $data) |
|
138 | + foreach ($all_data as $data) |
|
139 | 139 | { |
140 | 140 | $hour_data .= '"'.$data['date'].'",'; |
141 | 141 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $speed_data .= $speed.','; |
164 | 164 | } |
165 | 165 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
166 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
167 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
166 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
167 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
168 | 168 | print 'c3.generate({ |
169 | 169 | bindto: "#chart", |
170 | 170 | data: { |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | if ($type == 'aircraft') include('ident-sub-menu.php'); |
210 | 210 | print '<div class="table column">'; |
211 | - 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>'; |
|
212 | - 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>'; |
|
213 | - 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>'; |
|
211 | + 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>'; |
|
212 | + 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>'; |
|
213 | + 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>'; |
|
214 | 214 | |
215 | 215 | include('table-output.php'); |
216 | 216 | print '<div class="pagination">'; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $metar_info = $METAR->getMETAR($airport_icao); |
49 | 49 | //print_r($metar_info); |
50 | 50 | if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
51 | - //print_r($metar_parse); |
|
51 | + //print_r($metar_parse); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $airport = $airport_icao; |
33 | 33 | $page_url = $globalURL.'/airport/'.$airport_icao; |
34 | 34 | |
35 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
35 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
36 | 36 | if ($sort != '') { |
37 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort); |
|
38 | 38 | } else { |
39 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
39 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
40 | 40 | } |
41 | 41 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | //print_r($metar_parse); |
52 | 52 | } |
53 | 53 | |
54 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
54 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
55 | 55 | |
56 | 56 | require_once('header.php'); |
57 | 57 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | $airport_names = $Stats->getAllAirportNames(); |
64 | 64 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
65 | 65 | ksort($airport_names); |
66 | - foreach($airport_names as $airport_name) |
|
66 | + foreach ($airport_names as $airport_name) |
|
67 | 67 | { |
68 | - if($airport_icao == $airport_name['airport_icao']) |
|
68 | + if ($airport_icao == $airport_name['airport_icao']) |
|
69 | 69 | { |
70 | 70 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
71 | 71 | } else { |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | $date_data = ''; |
112 | 112 | $departure_data = ''; |
113 | 113 | $arrival_data = ''; |
114 | - foreach($all_data as $data) |
|
114 | + foreach ($all_data as $data) |
|
115 | 115 | { |
116 | 116 | $date_data .= '"'.$data['date'].'",'; |
117 | 117 | $departure_data .= $data['departure'].','; |
118 | 118 | $arrival_data .= $data['arrival'].','; |
119 | 119 | } |
120 | - $date_data = "['x',".substr($date_data,0,-1)."]"; |
|
121 | - $departure_data = "['departure',".substr($departure_data,0,-1)."]"; |
|
122 | - $arrival_data = "['arrival',".substr($arrival_data,0,-1)."]"; |
|
120 | + $date_data = "['x',".substr($date_data, 0, -1)."]"; |
|
121 | + $departure_data = "['departure',".substr($departure_data, 0, -1)."]"; |
|
122 | + $arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]"; |
|
123 | 123 | print 'c3.generate({ |
124 | 124 | bindto: "#chart", |
125 | 125 | data: { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
177 | 177 | } |
178 | 178 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
179 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
179 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
180 | 180 | print _("Humidity:").' '.$humidity.'%'." - "; |
181 | 181 | } |
182 | 182 | if (isset($metar_parse['QNH'])) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | print '<div class="table column">'; |
193 | 193 | if ($airport_array[0]['iata'] != "NA") |
194 | 194 | { |
195 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
195 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
196 | 196 | } |
197 | 197 | include('table-output.php'); |
198 | 198 | print '<div class="pagination">'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -47,7 +47,9 @@ discard block |
||
47 | 47 | $METAR = new METAR(); |
48 | 48 | $metar_info = $METAR->getMETAR($airport_icao); |
49 | 49 | //print_r($metar_info); |
50 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
50 | + if (isset($metar_info[0]['metar'])) { |
|
51 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
52 | + } |
|
51 | 53 | //print_r($metar_parse); |
52 | 54 | } |
53 | 55 | |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | print '<option></option>'; |
62 | 64 | $Stats = new Stats(); |
63 | 65 | $airport_names = $Stats->getAllAirportNames(); |
64 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
65 | 69 | ksort($airport_names); |
66 | 70 | foreach($airport_names as $airport_name) |
67 | 71 | { |
@@ -95,7 +99,9 @@ discard block |
||
95 | 99 | print '</div>'; |
96 | 100 | print '<div><span class="label">'._("Coordinates").'</span><a href="http://maps.google.ca/maps?z=10&t=k&q='.$airport_array[0]['latitude'].','.$airport_array[0]['longitude'].'" target="_blank">Google Map<i class="fa fa-angle-double-right"></i></a></div>'; |
97 | 101 | print '<div><span class="label">'._("Live Air Traffic").'</span><a href="http://www.liveatc.net/search/?icao='.$airport_array[0]['icao'].'" target="_blank">LiveATC.net<i class="fa fa-angle-double-right"></i></a></div>'; |
98 | - if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>'; |
|
102 | + if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') { |
|
103 | + print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>'; |
|
104 | + } |
|
99 | 105 | print '</div>'; |
100 | 106 | |
101 | 107 | $Stats = new Stats(); |
@@ -103,7 +109,9 @@ discard block |
||
103 | 109 | // Use spotter also |
104 | 110 | if (isset($globalTimezone)) { |
105 | 111 | date_default_timezone_set($globalTimezone); |
106 | - } else date_default_timezone_set('UTC'); |
|
112 | + } else { |
|
113 | + date_default_timezone_set('UTC'); |
|
114 | + } |
|
107 | 115 | if (count($all_data) > 0) { |
108 | 116 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
109 | 117 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
8 | 8 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
9 | 9 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
10 | 10 | |
11 | 11 | if (!empty($spotter_array)) |
12 | 12 | { |
13 | - $title = sprintf(_("Most Common Time of Day of aircraft with registration %s"),$registration); |
|
13 | + $title = sprintf(_("Most Common Time of Day of aircraft with registration %s"), $registration); |
|
14 | 14 | require_once('header.php'); |
15 | 15 | |
16 | 16 | print '<div class="info column">'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | include('registration-sub-menu.php'); |
24 | 24 | print '<div class="column">'; |
25 | 25 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
26 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."),$registration).'</p>'; |
|
26 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."), $registration).'</p>'; |
|
27 | 27 | |
28 | 28 | $hour_array = $Spotter->countAllHoursByRegistration($registration); |
29 | 29 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | $hour_data = ''; |
34 | 34 | $hour_cnt = ''; |
35 | 35 | $last = 0; |
36 | - foreach($hour_array as $hour_item) |
|
36 | + foreach ($hour_array as $hour_item) |
|
37 | 37 | { |
38 | - while($last != $hour_item['hour_name']) { |
|
38 | + while ($last != $hour_item['hour_name']) { |
|
39 | 39 | $hour_data .= '"'.$last.':00",'; |
40 | 40 | $hour_cnt .= '0,'; |
41 | 41 | $last++; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $hour_cnt .= $hour_item['hour_count'].','; |
46 | 46 | } |
47 | 47 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
48 | - $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
48 | + $hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
49 | 49 | print 'c3.generate({ |
50 | 50 | bindto: "#chartHour", |
51 | 51 | data: { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($hour_array as $hour_item) |
|
71 | + foreach ($hour_array as $hour_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td>'.$hour_item['hour_name'].':00</td>'; |