Completed
Push — master ( db2756...3d0574 )
by Yannick
29:36
created
atc-data.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,15 +40,15 @@
 block discarded – undo
40 40
 //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
41 41
 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
42 42
 if ($spotter_item['atc_range'] > 0) {
43
-    print '<div><span>'._("Range").'</span>';
44
-    print $spotter_item['atc_range'];
45
-    print '</div>';
43
+	print '<div><span>'._("Range").'</span>';
44
+	print $spotter_item['atc_range'];
45
+	print '</div>';
46 46
 }
47 47
 print '</div>';
48 48
 if ($spotter_item['info'] != '') {
49
-    print '<div class="notamtext"><span>'._("Info").'</span>';
50
-    print $spotter_item['info'];
51
-    print '</div>';
49
+	print '<div class="notamtext"><span>'._("Info").'</span>';
50
+	print $spotter_item['info'];
51
+	print '</div>';
52 52
 }
53 53
 print '</div>';
54 54
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 $ATC = new ATC();
6 6
 
7 7
 if (isset($_GET['atcid'])) {
8
-	$atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT);
9
-	$atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING);
8
+	$atcid = filter_input(INPUT_GET, 'atcid', FILTER_SANITIZE_NUMBER_INT);
9
+	$atcident = filter_input(INPUT_GET, 'atcident', FILTER_SANITIZE_STRING);
10 10
 	$atc_data = $ATC->getById($atcid);
11 11
 	if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident);
12 12
  ?>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 print '</div>';
39 39
 
40 40
 //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
41
-print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
41
+print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>';
42 42
 if ($spotter_item['atc_range'] > 0) {
43 43
     print '<div><span>'._("Range").'</span>';
44 44
     print $spotter_item['atc_range'];
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
 	$atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT);
9 9
 	$atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING);
10 10
 	$atc_data = $ATC->getById($atcid);
11
-	if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident);
11
+	if (!isset($atc_data[0])) {
12
+		$atc_data = $ATC->getByIdent($atcident);
13
+	}
12 14
  ?>
13 15
 <div class="alldetails">
14 16
 <button type="button" class="close">&times;</button>
Please login to merge, or discard this patch.
require/class.Elevation.php 3 patches
Doc Comments   +11 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,6 +52,10 @@  discard block
 block discarded – undo
52 52
 		$this->openedFiles = [];
53 53
 	}
54 54
 
55
+	/**
56
+	 * @param double $row
57
+	 * @param double $column
58
+	 */
55 59
 	private function getElevationAtPosition($fileName, $row, $column) {
56 60
 		if (!array_key_exists($fileName, $this->openedFiles)) {
57 61
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
@@ -85,7 +89,7 @@  discard block
 block discarded – undo
85 89
 	 * @param float $lon
86 90
 	 * @param null  $fName
87 91
 	 *
88
-	 * @return mixed
92
+	 * @return double
89 93
 	 * @throws \Exception
90 94
 	 */
91 95
 	public function getElevation($lat, $lon, &$fName = null) {
@@ -142,6 +146,9 @@  discard block
 block discarded – undo
142 146
 		return $zN;
143 147
 	}
144 148
 
149
+	/**
150
+	 * @param integer $numPrefix
151
+	 */
145 152
 	private function getDeg($deg, $numPrefix) {
146 153
 		$deg = abs($deg);
147 154
 		$d   = floor($deg);     // round degrees
@@ -156,6 +163,9 @@  discard block
 block discarded – undo
156 163
 		return $d;
157 164
 	}
158 165
 
166
+	/**
167
+	 * @param double $deg
168
+	 */
159 169
 	private function getSec($deg) {
160 170
 		$deg = abs($deg);
161 171
 		$sec = round($deg * 3600, 4);
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 	private $openedFiles = [];
29 29
 
30 30
 	public function __construct($htgFilesDestination = '', $resolution = 3) {
31
-		if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/';
31
+		if ($htgFilesDestination == '') {
32
+			$htgFilesDestination = dirname(__FILE__).'/../data/';
33
+		}
32 34
 		$this->htgFilesDestination = $htgFilesDestination;
33 35
 		$this->resolution          = $resolution;
34 36
 		switch ($resolution) {
@@ -171,16 +173,26 @@  discard block
 block discarded – undo
171 173
 		$fileName  = "N{$N}E{$E}.hgt";
172 174
 		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
173 175
 			$Common = new Common();
174
-			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
176
+			if ($debug) {
177
+				echo 'Downloading '.$fileName.'.gz ...';
178
+			}
175 179
 			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176 180
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
177
-				if ($debug) echo "File '{$fileName}.gz' not exists.";
181
+				if ($debug) {
182
+					echo "File '{$fileName}.gz' not exists.";
183
+				}
178 184
 				return false;
179 185
 			}
180
-			if ($debug) echo 'Done'."\n";
181
-			if ($debug) echo 'Decompress '.$fileName.' ....';
186
+			if ($debug) {
187
+				echo 'Done'."\n";
188
+			}
189
+			if ($debug) {
190
+				echo 'Decompress '.$fileName.' ....';
191
+			}
182 192
 			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
183
-			if ($debug) echo 'Done'."\n";
193
+			if ($debug) {
194
+				echo 'Done'."\n";
195
+			}
184 196
 			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
185 197
 		}
186 198
 		return true;
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			default:
42 42
 				throw new \Exception("bad resolution can be only one of 1,3");
43 43
 		}
44
-		register_shutdown_function(function () {
44
+		register_shutdown_function(function() {
45 45
 			$this->closeAllFiles();
46 46
 		});
47 47
 	}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 
56 56
 	private function getElevationAtPosition($fileName, $row, $column) {
57 57
 		if (!array_key_exists($fileName, $this->openedFiles)) {
58
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
58
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
59 59
 				throw new \Exception("File '{$fileName}' not exists.");
60 60
 			}
61
-			$file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r");
61
+			$file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r");
62 62
 			if ($file === false) {
63 63
 				throw new \Exception("Cant open file '{$fileName}' for reading.");
64 64
 			}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			throw new \Exception("Not implemented yet");
73 73
 		}
74 74
 		$aRow     = $this->measPerDeg - $row;
75
-		$position = ($this->measPerDeg * ($aRow - 1)) + $column;
75
+		$position = ($this->measPerDeg*($aRow - 1)) + $column;
76 76
 		$position *= 2;
77 77
 		fseek($file, $position);
78 78
 		$short  = fread($file, 2);
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 		$latSec = $this->getSec($lat);
101 101
 		$lonSec = $this->getSec($lon);
102 102
 
103
-		$Xn = round($latSec / $this->resolution, 3);
104
-		$Yn = round($lonSec / $this->resolution, 3);
103
+		$Xn = round($latSec/$this->resolution, 3);
104
+		$Yn = round($lonSec/$this->resolution, 3);
105 105
 
106 106
 		$a1 = round($Xn);
107 107
 		$a2 = round($Yn);
@@ -133,55 +133,55 @@  discard block
 block discarded – undo
133 133
 		$b3 = $this->getElevationAtPosition($fName, $b1, $b2);
134 134
 		$c3 = $this->getElevationAtPosition($fName, $c1, $c2);
135 135
 
136
-		$n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2);
137
-		$n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3);
138
-		$n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1);
136
+		$n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2);
137
+		$n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3);
138
+		$n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1);
139 139
 
140
-		$d  = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3;
141
-		$zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3;
140
+		$d  = -$n1*$a1 - $n2*$a2 - $n3*$a3;
141
+		$zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3;
142 142
 
143 143
 		return $zN;
144 144
 	}
145 145
 
146 146
 	private function getDeg($deg, $numPrefix) {
147 147
 		$deg = abs($deg);
148
-		$d   = floor($deg);     // round degrees
148
+		$d   = floor($deg); // round degrees
149 149
 		if ($numPrefix >= 3) {
150 150
 			if ($d < 100) {
151
-				$d = '0' . $d;
151
+				$d = '0'.$d;
152 152
 			}
153 153
 		} // pad with leading zeros
154 154
 		if ($d < 10) {
155
-			$d = '0' . $d;
155
+			$d = '0'.$d;
156 156
 		}
157 157
 		return $d;
158 158
 	}
159 159
 
160 160
 	private function getSec($deg) {
161 161
 		$deg = abs($deg);
162
-		$sec = round($deg * 3600, 4);
163
-		$m   = fmod(floor($sec / 60), 60);
162
+		$sec = round($deg*3600, 4);
163
+		$m   = fmod(floor($sec/60), 60);
164 164
 		$s   = round(fmod($sec, 60), 4);
165
-		return ($m * 60) + $s;
165
+		return ($m*60) + $s;
166 166
 	}
167 167
 
168
-	public function download($lat,$lon, $debug = false) {
168
+	public function download($lat, $lon, $debug = false) {
169 169
 		$N      = $this->getDeg($lat, 2);
170 170
 		$E      = $this->getDeg($lon, 3);
171
-		$fileName  = "N{$N}E{$E}.hgt";
172
-		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
171
+		$fileName = "N{$N}E{$E}.hgt";
172
+		if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
173 173
 			$Common = new Common();
174 174
 			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
175
-			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
175
+			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
176
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) {
177 177
 				if ($debug) echo "File '{$fileName}.gz' not exists.";
178 178
 				return false;
179 179
 			}
180 180
 			if ($debug) echo 'Done'."\n";
181 181
 			if ($debug) echo 'Decompress '.$fileName.' ....';
182
-			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
182
+			$Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName);
183 183
 			if ($debug) echo 'Done'."\n";
184
-			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
184
+			unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
185 185
 		}
186 186
 		return true;
187 187
 	}
@@ -194,22 +194,22 @@  discard block
 block discarded – undo
194 194
 		try {
195 195
 			$sth = $db->prepare($query);
196 196
 			$sth->execute($query_values);
197
-		} catch(PDOException $e) {
197
+		} catch (PDOException $e) {
198 198
 			return "error : ".$e->getMessage();
199 199
 		}
200 200
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
201
-			$this->download($data['latitude'],$data['longitude'],true);
201
+			$this->download($data['latitude'], $data['longitude'], true);
202 202
 		}
203 203
 		$query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10';
204 204
 		$query_values = array();
205 205
 		try {
206 206
 			$sth = $db->prepare($query);
207 207
 			$sth->execute($query_values);
208
-		} catch(PDOException $e) {
208
+		} catch (PDOException $e) {
209 209
 			return "error : ".$e->getMessage();
210 210
 		}
211 211
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
212
-			$this->download($data['latitude'],$data['longitude'],true);
212
+			$this->download($data['latitude'], $data['longitude'], true);
213 213
 		}
214 214
 	}
215 215
 }
Please login to merge, or discard this patch.
require/class.GeoidHeight.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -91,6 +91,10 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 /*
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,8 +38,11 @@  discard block
 block discarded – undo
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
 		$f = @fopen($name,"r");
@@ -156,7 +159,9 @@  discard block
 block discarded – undo
156 159
 				}
157 160
 			}
158 161
 			$this->t = $t;
159
-		} else $t = $this->t;
162
+		} else {
163
+			$t = $this->t;
164
+		}
160 165
 		if (!($cubic)) {
161 166
 			$a = (((1 - $fx) * $this->v00) + ($fx * $this->v01));
162 167
 			$b = (((1 - $fx) * $this->v10) + ($fx * $this->v11));
Please login to merge, or discard this patch.
require/settings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
import/callback.php 2 patches
Braces   +39 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,15 +27,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'].' ';
Please login to merge, or discard this patch.
require/class.ATC.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
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])) {
Please login to merge, or discard this patch.
Braces   +20 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
90 99
 		$info = str_replace('^','<br />',$info);
91 100
 		$info = str_replace('&amp;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
 block discarded – undo
106 117
 		$info = str_replace('^','<br />',$info);
107 118
 		$info = str_replace('&amp;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 {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -26,22 +26,22 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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('&amp;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('&amp;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
 block discarded – undo
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('&amp;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('&amp;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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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";
Please login to merge, or discard this patch.
tools-geoid.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 try {
6 6
 $GeoidHeight = new GeoidHeight();
7 7
 } catch (Exception $e) {
8
-    echo $e;
8
+	echo $e;
9 9
 }
10 10
 $title = _("Geoid Height Calculator");
11 11
 require_once('header.php');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,11 @@
 block discarded – undo
61 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
-	if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource;
65
-	else $geoidsource = 'EGM96-15';
64
+	if (isset($globalGeoidSource) && $globalGeoidSource != '') {
65
+		$geoidsource = $globalGeoidSource;
66
+	} else {
67
+		$geoidsource = 'EGM96-15';
68
+	}
66 69
 	print '<div class="col-sm-6">'.$geoidsource.'</div>';
67 70
 	print '</div>';
68 71
 }
Please login to merge, or discard this patch.
flightid-overview.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 				{
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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&raquo;</a>';
Please login to merge, or discard this patch.
ident-detailed.php 2 patches
Braces   +22 added lines, -8 removed lines patch added patch discarded remove patch
@@ -118,8 +118,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">';
Please login to merge, or discard this patch.