Completed
Push — master ( 8e51f6...557b77 )
by Yannick
12:09 queued 04:29
created
airport-data.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -47,79 +47,79 @@
 block discarded – undo
47 47
 print '</div>';
48 48
 print '<div><span>'._("Altitude").'</span>';
49 49
 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
50
-        print $spotter_item['altitude'].' feet';
50
+		print $spotter_item['altitude'].' feet';
51 51
 } else {
52
-        print round($spotter_item['altitude']*0.3048).' m';
52
+		print round($spotter_item['altitude']*0.3048).' m';
53 53
 }
54 54
 print '</div>';
55 55
 print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
56 56
 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
57 57
 if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
58
-    print '<div><span>'._("Links").'</span>';
59
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
60
-    print ' - ';
61
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
62
-    print '</div>';
58
+	print '<div><span>'._("Links").'</span>';
59
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
60
+	print ' - ';
61
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
62
+	print '</div>';
63 63
 } elseif (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '') {
64
-    print '<div><span>'._("Links").'</span>';
65
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
66
-    print '</div>';
64
+	print '<div><span>'._("Links").'</span>';
65
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
66
+	print '</div>';
67 67
 } elseif (isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
68
-    print '<div><span>'._("Links").'</span>';
69
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
70
-    print '</div>';
68
+	print '<div><span>'._("Links").'</span>';
69
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
70
+	print '</div>';
71 71
 }
72 72
 if ($spotter_item['type'] == 'medium_airport' || $spotter_item['type'] == 'large_airport') {
73
-    print '<div><span>'._("Live Air Traffic").'</span>';
74
-    print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>';
75
-    print '</div>';
73
+	print '<div><span>'._("Live Air Traffic").'</span>';
74
+	print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>';
75
+	print '</div>';
76 76
 }
77 77
 
78 78
 print '</div>';
79 79
 
80 80
 if (isset($metar_parse)) {
81
-    print '<div class="waypoints">';
82
-    print '<div><span>METAR</span>';
83
-    print '<i>'.$metar_info[0]['metar'].'</i><br />';
84
-    print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
81
+	print '<div class="waypoints">';
82
+	print '<div><span>METAR</span>';
83
+	print '<i>'.$metar_info[0]['metar'].'</i><br />';
84
+	print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
85 85
 //    print_r($metar_parse);
86
-    if (isset($metar_parse['wind'])) {
87
-        print _("Wind:").' ';
86
+	if (isset($metar_parse['wind'])) {
87
+		print _("Wind:").' ';
88 88
 	if (isset($metar_parse['wind']['direction'])) {
89
-	    $direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
90
-	    print $direction[0]['direction_fullname'];
91
-	    print ' ('.$metar_parse['wind']['direction'].'°) ';
92
-        }
93
-        if (isset($metar_parse['wind']['speed'])) {
94
-	    print $metar_parse['wind']['speed'].' m/s';
95
-        }
89
+		$direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
90
+		print $direction[0]['direction_fullname'];
91
+		print ' ('.$metar_parse['wind']['direction'].'°) ';
92
+		}
93
+		if (isset($metar_parse['wind']['speed'])) {
94
+		print $metar_parse['wind']['speed'].' m/s';
95
+		}
96 96
 	print '<br/>';
97
-    }
98
-    if (isset($metar_parse['visibility'])) {
99
-        print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
100
-    }
101
-    if (isset($metar_parse['weather'])) {
102
-        print _("Weather:").' '.$metar_parse['weather']."<br/>";
103
-    }
104
-    if (isset($metar_parse['temperature'])) {
105
-        print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
106
-    }
107
-    if (isset($metar_parse['dew'])) {
108
-        print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
109
-    }
110
-    if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
97
+	}
98
+	if (isset($metar_parse['visibility'])) {
99
+		print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
100
+	}
101
+	if (isset($metar_parse['weather'])) {
102
+		print _("Weather:").' '.$metar_parse['weather']."<br/>";
103
+	}
104
+	if (isset($metar_parse['temperature'])) {
105
+		print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
106
+	}
107
+	if (isset($metar_parse['dew'])) {
108
+		print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
109
+	}
110
+	if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
111 111
 	$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
112 112
 	print _("Humidity:").' '.$humidity.'%'."<br/>";
113
-    }
114
-    if (isset($metar_parse['QNH'])) {
115
-        print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
116
-    }
113
+	}
114
+	if (isset($metar_parse['QNH'])) {
115
+		print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
116
+	}
117 117
 /*
118 118
 if (isset($metar_parse['QNH'])) {
119 119
     print 'Pressure : '.$metar_parse['QNH'].' hPa'."<br/>";
120 120
 }
121 121
 */
122
-    print '</div>';
122
+	print '</div>';
123 123
 /*
124 124
 Wind: from the NNE (020 degrees) at 5 MPH (4 KT) (direction variable):0
125 125
 Visibility: greater than 7 mile(s):0
Please login to merge, or discard this patch.
require/class.APRS.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 class aprs {
3
-    private function urshift($n, $s) {
3
+	private function urshift($n, $s) {
4 4
 	return ($n >= 0) ? ($n >> $s) :
5
-    	    (($n & 0x7fffffff) >> $s) | 
6
-        	(0x40000000 >> ($s - 1));
7
-    }
5
+			(($n & 0x7fffffff) >> $s) | 
6
+			(0x40000000 >> ($s - 1));
7
+	}
8 8
 
9
-    public function parse($input) {
9
+	public function parse($input) {
10 10
 	global $globalDebug;
11 11
 	$debug = false;
12 12
 	$result = array();
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	
19 19
 	/* Check that end was found and body has at least one byte. */
20 20
 	if ($splitpos == 0 || $splitpos + 1 == $input_len || $splitpos === FALSE) {
21
-	    if ($globalDebug) echo '!!! APRS invalid : '.$input."\n";
22
-	    return false;
21
+		if ($globalDebug) echo '!!! APRS invalid : '.$input."\n";
22
+		return false;
23 23
 	}
24 24
 	
25 25
 	/* Save header and body. */
@@ -32,22 +32,22 @@  discard block
 block discarded – undo
32 32
 	/* Parse source, target and path. */
33 33
 	//FLRDF0A52>APRS,qAS,LSTB
34 34
 	if (preg_match('/^([A-Z0-9\\-]{1,9})>(.*)$/',$header,$matches)) {
35
-	    $ident = $matches[1];
36
-	    $all_elements = $matches[2];
37
-	    if ($debug) echo 'ident : '.$ident."\n";
38
-	    $result['ident'] = $ident;
35
+		$ident = $matches[1];
36
+		$all_elements = $matches[2];
37
+		if ($debug) echo 'ident : '.$ident."\n";
38
+		$result['ident'] = $ident;
39 39
 	} else return false;
40 40
 	$elements = explode(',',$all_elements);
41 41
 	$source = end($elements);
42 42
 	$result['source'] = $source;
43 43
 	foreach ($elements as $element) {
44
-	    if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) {
45
-	        //echo "ok";
46
-	        if ($element == 'TCPIP*') return false;
47
-	    } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) {
44
+		if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) {
45
+			//echo "ok";
46
+			if ($element == 'TCPIP*') return false;
47
+		} elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) {
48 48
 		return false;
49
-	    }
50
-	    /*
49
+		}
50
+		/*
51 51
 	    } elseif (preg_match('/^([0-9A-F]{32})$/',$element)) {
52 52
 		//echo "ok";
53 53
 	    } else {
@@ -58,23 +58,23 @@  discard block
 block discarded – undo
58 58
 	// Check for Timestamp
59 59
 	$body_parse = substr($body,1);
60 60
 	if (preg_match('/^([0-9]{2})([0-9]{2})([0-9]{2})([zh\\/])/',$body_parse,$matches)) {
61
-	    $timestamp = $matches[0];
62
-	    if ($matches[4] == 'h') {
61
+		$timestamp = $matches[0];
62
+		if ($matches[4] == 'h') {
63 63
 		$timestamp = strtotime($matches[1].':'.$matches[2].':'.$matches[3]);
64 64
 		//echo 'timestamp : '.$timestamp.' - now : '.time()."\n";
65 65
 		/*
66 66
 		if (time() + 3900 < $timestamp) $timestamp -= 86400;
67 67
 		elseif (time() - 82500 > $timestamp) $timestamp += 86400;
68 68
 		*/
69
-	    } elseif ($matches[4] == 'z' || $matches[4] == '/') {
69
+		} elseif ($matches[4] == 'z' || $matches[4] == '/') {
70 70
 		// This work or not ?
71 71
 		$timestamp = strtotime($matches[1].' '.$matches[2].':'.$matches[3]);
72
-	    }
73
-	    $body_parse = substr($body_parse,7);
74
-	    $result['timestamp'] = $timestamp;
72
+		}
73
+		$body_parse = substr($body_parse,7);
74
+		$result['timestamp'] = $timestamp;
75 75
 	}
76 76
 	if (strlen($body_parse) > 19) {
77
-	    if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) {
77
+		if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) {
78 78
 		// 4658.70N/00707.78Ez
79 79
 		//print_r(str_split($body_parse));
80 80
 		
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$lon = intval($lon_deg);
92 92
 		if ($lat > 89 || $lon > 179) return false;
93 93
 	    
94
-	    /*
94
+		/*
95 95
 	    $tmp_5b = str_replace('.','',$lat_min);
96 96
 	    if (preg_match('/^([0-9]{0,4})( {0,4})$/',$tmp_5b,$matches)) {
97 97
 	        print_r($matches);
@@ -103,64 +103,64 @@  discard block
 block discarded – undo
103 103
 		if ($wind == 'W') $longitude = 0-$longitude;
104 104
 		$result['latitude'] = $latitude;
105 105
 		$result['longitude'] = $longitude;
106
-	    }
107
-	    if ($body_len > 19) {
106
+		}
107
+		if ($body_len > 19) {
108 108
 		$body_split = str_split($body_parse);
109 109
 		$symbol_code = $body_split[18];
110 110
 		if ($symbol_code != '_') {
111
-		    $body_parse = substr($body_parse,19);
112
-		    $body_parse_len = strlen($body_parse);
113
-		    if ($body_parse_len >= 7) {
111
+			$body_parse = substr($body_parse,19);
112
+			$body_parse_len = strlen($body_parse);
113
+			if ($body_parse_len >= 7) {
114 114
 			
115
-		        if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) {
116
-		    	    $course = substr($body_parse,0,3);
117
-		    	    $tmp_s = intval($course);
118
-		    	    if ($tmp_s >= 1 && $tmp_s <= 360) $result['course'] = intval($course);
119
-		    	    $speed = substr($body_parse,4,3);
120
-		    	    $result['speed'] = round($speed*1.852);
121
-		    	    $body_parse = substr($body_parse,7);
122
-		        }
123
-		        // Check PHGR, PHG, RNG
124
-		    } 
125
-		    /*
115
+				if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) {
116
+					$course = substr($body_parse,0,3);
117
+					$tmp_s = intval($course);
118
+					if ($tmp_s >= 1 && $tmp_s <= 360) $result['course'] = intval($course);
119
+					$speed = substr($body_parse,4,3);
120
+					$result['speed'] = round($speed*1.852);
121
+					$body_parse = substr($body_parse,7);
122
+				}
123
+				// Check PHGR, PHG, RNG
124
+			} 
125
+			/*
126 126
 		    else if ($body_parse_len > 0) {
127 127
 			$rest = $body_parse;
128 128
 		    }
129 129
 		    */
130
-		    if (strlen($body_parse) > 0) {
131
-		        if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) {
132
-		            $altitude = intval($matches[1]);
133
-		            //$result['altitude'] = round($altitude*0.3048);
134
-		            $result['altitude'] = $altitude;
135
-		            $body_parse = substr($body_parse,strlen($matches[0])+1);
136
-		        }
137
-		    }
130
+			if (strlen($body_parse) > 0) {
131
+				if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) {
132
+					$altitude = intval($matches[1]);
133
+					//$result['altitude'] = round($altitude*0.3048);
134
+					$result['altitude'] = $altitude;
135
+					$body_parse = substr($body_parse,strlen($matches[0])+1);
136
+				}
137
+			}
138 138
 		    
139
-		    // Telemetry
140
-		    /*
139
+			// Telemetry
140
+			/*
141 141
 		    if (preg_match('/^([0-9]+),(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,([01]{0,8})/',$body_parse,$matches)) {
142 142
 		        // Nothing yet...
143 143
 		    }
144 144
 		    */
145
-		    // DAO
146
-		    if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) {
147
-			    $dao = $matches[1];
148
-			    if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) {
145
+			// DAO
146
+			if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) {
147
+				$dao = $matches[1];
148
+				if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) {
149 149
 				$dao_split = str_split($dao);
150
-			        $lat_off = (($dao_split[1])-48.0)*0.001/60.0;
151
-			        $lon_off = (($dao_split[2])-48.0)*0.001/60.0;
150
+					$lat_off = (($dao_split[1])-48.0)*0.001/60.0;
151
+					$lon_off = (($dao_split[2])-48.0)*0.001/60.0;
152 152
 			    
153 153
 				if ($result['latitude'] < 0) $result['latitude'] -= $lat_off;
154 154
 				else $result['latitude'] += $lat_off;
155 155
 				if ($result['longitude'] < 0) $result['longitude'] -= $lon_off;
156 156
 				else $result['longitude'] += $lon_off;
157
-			    }
158
-		            $body_parse = substr($body_parse,6);
159
-		    }
157
+				}
158
+					$body_parse = substr($body_parse,6);
159
+			}
160 160
 		    
161
-		    // OGN comment
161
+			// OGN comment
162 162
 		   // echo "Before OGN : ".$body_parse."\n";
163
-		    if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) {
163
+			if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) {
164 164
 			$id = $matches[1];
165 165
 			//$mode = substr($id,0,2);
166 166
 			$address = substr($id,2);
@@ -190,49 +190,49 @@  discard block
 block discarded – undo
190 190
 			$stealth = (intval(substr($id,0,2), 16) & 0b10000000) != 0;
191 191
 			$result['stealth'] = $stealth;
192 192
 			$result['address'] = $address;
193
-		    }
193
+			}
194 194
 		    
195
-		    //Comment
196
-		    $result['comment'] = $body_parse;
195
+			//Comment
196
+			$result['comment'] = $body_parse;
197 197
 		} else {
198
-		    // parse weather
199
-		    $body_parse = substr($body_parse,19);
200
-		    //$body_parse_len = strlen($body_parse);
198
+			// parse weather
199
+			$body_parse = substr($body_parse,19);
200
+			//$body_parse_len = strlen($body_parse);
201 201
 
202
-		    if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
202
+			if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
203 203
 			$result['wind_dir'] = $matches[1];
204 204
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
205 205
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
206 206
 			$result['temp'] = round(5/9*(($matches[4])-32),1);
207
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
208
-		    } elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
207
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
208
+			} elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
209 209
 			$result['wind_dir'] = $matches[1];
210 210
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
211 211
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
212 212
 			$result['temp'] = round(5/9*(($matches[4])-32),1);
213
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
214
-		    } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
213
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
214
+			} elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
215 215
 			$result['wind_dir'] = $matches[1];
216 216
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
217 217
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
218
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
219
-		    } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) {
218
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
219
+			} elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) {
220 220
 			$result['wind_dir'] = $matches[1];
221 221
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
222 222
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
223
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
224
-		    }
225
-		    if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) {
223
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
224
+			}
225
+			if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) {
226 226
 			$result['temp'] = round(5/9*(($matches[1])-32),1);
227
-		    }
227
+			}
228
+		}
228 229
 		}
229
-	    }
230 230
 	}
231 231
 	if (isset($result['latitude'])) $result['latitude'] = round($result['latitude'],4);
232 232
 	if (isset($result['longitude'])) $result['longitude'] = round($result['longitude'],4);
233 233
 	//print_r($result);
234 234
 	return $result;
235
-    }
235
+	}
236 236
 }
237 237
 /*
238 238
 $aprs = new aprs();
Please login to merge, or discard this patch.
require/class.SpotterArchive.php 1 patch
Indentation   +502 added lines, -502 removed lines patch added patch discarded remove patch
@@ -57,44 +57,44 @@  discard block
 block discarded – undo
57 57
 	}
58 58
 
59 59
 
60
-        /**
61
-        * Gets all the spotter information based on a particular callsign
62
-        *
63
-        * @return Array the spotter information
64
-        *
65
-        */
66
-        public function getLastArchiveSpotterDataByIdent($ident)
67
-        {
60
+		/**
61
+		 * Gets all the spotter information based on a particular callsign
62
+		 *
63
+		 * @return Array the spotter information
64
+		 *
65
+		 */
66
+		public function getLastArchiveSpotterDataByIdent($ident)
67
+		{
68 68
 		$Spotter = new Spotter($this->db);
69
-                date_default_timezone_set('UTC');
69
+				date_default_timezone_set('UTC');
70 70
 
71
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
72
-                //$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
73
-                $query  = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1";
71
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
72
+				//$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
73
+				$query  = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1";
74 74
 
75
-                $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident));
75
+				$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident));
76 76
 
77
-                return $spotter_array;
78
-        }
77
+				return $spotter_array;
78
+		}
79 79
 
80 80
 
81
-        /**
82
-        * Gets last the spotter information based on a particular id
83
-        *
84
-        * @return Array the spotter information
85
-        *
86
-        */
87
-        public function getLastArchiveSpotterDataById($id)
88
-        {
89
-    		$Spotter = new Spotter($this->db);
90
-                date_default_timezone_set('UTC');
91
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
92
-                //$query  = SpotterArchive->$global_query." WHERE spotter_archive.flightaware_id = :id";
93
-                //$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
94
-                $query  = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1";
81
+		/**
82
+		 * Gets last the spotter information based on a particular id
83
+		 *
84
+		 * @return Array the spotter information
85
+		 *
86
+		 */
87
+		public function getLastArchiveSpotterDataById($id)
88
+		{
89
+			$Spotter = new Spotter($this->db);
90
+				date_default_timezone_set('UTC');
91
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
92
+				//$query  = SpotterArchive->$global_query." WHERE spotter_archive.flightaware_id = :id";
93
+				//$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
94
+				$query  = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1";
95 95
 
96 96
 //              $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id));
97
-                  /*
97
+				  /*
98 98
                 try {
99 99
                         $Connection = new Connection();
100 100
                         $sth = Connection->$db->prepare($query);
@@ -104,232 +104,232 @@  discard block
 block discarded – undo
104 104
                 }
105 105
                 $spotter_array = $sth->fetchAll(PDO->FETCH_ASSOC);
106 106
                 */
107
-                $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id));
108
-
109
-                return $spotter_array;
110
-        }
111
-
112
-        /**
113
-        * Gets all the spotter information based on a particular id
114
-        *
115
-        * @return Array the spotter information
116
-        *
117
-        */
118
-        public function getAllArchiveSpotterDataById($id)
119
-        {
120
-                date_default_timezone_set('UTC');
121
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
122
-                $query  = $this->global_query." WHERE spotter_archive.flightaware_id = :id";
107
+				$spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id));
108
+
109
+				return $spotter_array;
110
+		}
111
+
112
+		/**
113
+		 * Gets all the spotter information based on a particular id
114
+		 *
115
+		 * @return Array the spotter information
116
+		 *
117
+		 */
118
+		public function getAllArchiveSpotterDataById($id)
119
+		{
120
+				date_default_timezone_set('UTC');
121
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
122
+				$query  = $this->global_query." WHERE spotter_archive.flightaware_id = :id";
123 123
 
124 124
 //              $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id));
125 125
 
126
-                try {
127
-                        $sth = $this->db->prepare($query);
128
-                        $sth->execute(array(':id' => $id));
129
-                } catch(PDOException $e) {
130
-                        echo $e->getMessage();
131
-                        die;
132
-                }
133
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
134
-
135
-                return $spotter_array;
136
-        }
137
-
138
-        /**
139
-        * Gets coordinate & time spotter information based on a particular id
140
-        *
141
-        * @return Array the spotter information
142
-        *
143
-        */
144
-        public function getCoordArchiveSpotterDataById($id)
145
-        {
146
-                date_default_timezone_set('UTC');
147
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
148
-                $query  = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id";
126
+				try {
127
+						$sth = $this->db->prepare($query);
128
+						$sth->execute(array(':id' => $id));
129
+				} catch(PDOException $e) {
130
+						echo $e->getMessage();
131
+						die;
132
+				}
133
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
134
+
135
+				return $spotter_array;
136
+		}
137
+
138
+		/**
139
+		 * Gets coordinate & time spotter information based on a particular id
140
+		 *
141
+		 * @return Array the spotter information
142
+		 *
143
+		 */
144
+		public function getCoordArchiveSpotterDataById($id)
145
+		{
146
+				date_default_timezone_set('UTC');
147
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
148
+				$query  = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id";
149 149
 
150 150
 //              $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id));
151 151
 
152
-                try {
153
-                        $sth = $this->db->prepare($query);
154
-                        $sth->execute(array(':id' => $id));
155
-                } catch(PDOException $e) {
156
-                        echo $e->getMessage();
157
-                        die;
158
-                }
159
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
152
+				try {
153
+						$sth = $this->db->prepare($query);
154
+						$sth->execute(array(':id' => $id));
155
+				} catch(PDOException $e) {
156
+						echo $e->getMessage();
157
+						die;
158
+				}
159
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
160 160
 
161
-                return $spotter_array;
162
-        }
161
+				return $spotter_array;
162
+		}
163 163
 
164 164
 
165
-        /**
166
-        * Gets altitude information based on a particular callsign
167
-        *
168
-        * @return Array the spotter information
169
-        *
170
-        */
171
-        public function getAltitudeArchiveSpotterDataByIdent($ident)
172
-        {
165
+		/**
166
+		 * Gets altitude information based on a particular callsign
167
+		 *
168
+		 * @return Array the spotter information
169
+		 *
170
+		 */
171
+		public function getAltitudeArchiveSpotterDataByIdent($ident)
172
+		{
173 173
 
174
-                date_default_timezone_set('UTC');
174
+				date_default_timezone_set('UTC');
175 175
 
176
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
177
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident";
176
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
177
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident";
178 178
 
179
-                try {
180
-                        $sth = $this->db->prepare($query);
181
-                        $sth->execute(array(':ident' => $ident));
182
-                } catch(PDOException $e) {
183
-                        echo $e->getMessage();
184
-                        die;
185
-                }
186
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
179
+				try {
180
+						$sth = $this->db->prepare($query);
181
+						$sth->execute(array(':ident' => $ident));
182
+				} catch(PDOException $e) {
183
+						echo $e->getMessage();
184
+						die;
185
+				}
186
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
187 187
 
188
-                return $spotter_array;
189
-        }
188
+				return $spotter_array;
189
+		}
190 190
 
191
-        /**
192
-        * Gets altitude information based on a particular id
193
-        *
194
-        * @return Array the spotter information
195
-        *
196
-        */
197
-        public function getAltitudeArchiveSpotterDataById($id)
198
-        {
191
+		/**
192
+		 * Gets altitude information based on a particular id
193
+		 *
194
+		 * @return Array the spotter information
195
+		 *
196
+		 */
197
+		public function getAltitudeArchiveSpotterDataById($id)
198
+		{
199 199
 
200
-                date_default_timezone_set('UTC');
200
+				date_default_timezone_set('UTC');
201 201
 
202
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
203
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date";
202
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
203
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date";
204 204
 
205
-                try {
206
-                        $sth = $this->db->prepare($query);
207
-                        $sth->execute(array(':id' => $id));
208
-                } catch(PDOException $e) {
209
-                        echo $e->getMessage();
210
-                        die;
211
-                }
212
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
205
+				try {
206
+						$sth = $this->db->prepare($query);
207
+						$sth->execute(array(':id' => $id));
208
+				} catch(PDOException $e) {
209
+						echo $e->getMessage();
210
+						die;
211
+				}
212
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
213 213
 
214
-                return $spotter_array;
215
-        }
214
+				return $spotter_array;
215
+		}
216 216
 
217
-        /**
218
-        * Gets altitude & speed information based on a particular id
219
-        *
220
-        * @return Array the spotter information
221
-        *
222
-        */
223
-        public function getAltitudeSpeedArchiveSpotterDataById($id)
224
-        {
217
+		/**
218
+		 * Gets altitude & speed information based on a particular id
219
+		 *
220
+		 * @return Array the spotter information
221
+		 *
222
+		 */
223
+		public function getAltitudeSpeedArchiveSpotterDataById($id)
224
+		{
225 225
 
226
-                date_default_timezone_set('UTC');
226
+				date_default_timezone_set('UTC');
227 227
 
228
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
229
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.ground_speed, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date";
228
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
229
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.ground_speed, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date";
230 230
 
231
-                try {
232
-                        $sth = $this->db->prepare($query);
233
-                        $sth->execute(array(':id' => $id));
234
-                } catch(PDOException $e) {
235
-                        echo $e->getMessage();
236
-                        die;
237
-                }
238
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
231
+				try {
232
+						$sth = $this->db->prepare($query);
233
+						$sth->execute(array(':id' => $id));
234
+				} catch(PDOException $e) {
235
+						echo $e->getMessage();
236
+						die;
237
+				}
238
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
239 239
 
240
-                return $spotter_array;
241
-        }
240
+				return $spotter_array;
241
+		}
242 242
 
243 243
 
244
-        /**
245
-        * Gets altitude information based on a particular callsign
246
-        *
247
-        * @return Array the spotter information
248
-        *
249
-        */
250
-        public function getLastAltitudeArchiveSpotterDataByIdent($ident)
251
-        {
244
+		/**
245
+		 * Gets altitude information based on a particular callsign
246
+		 *
247
+		 * @return Array the spotter information
248
+		 *
249
+		 */
250
+		public function getLastAltitudeArchiveSpotterDataByIdent($ident)
251
+		{
252 252
 
253
-                date_default_timezone_set('UTC');
253
+				date_default_timezone_set('UTC');
254 254
 
255
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
256
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
255
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
256
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
257 257
 //                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident";
258 258
 
259
-                try {
260
-                        $sth = $this->db->prepare($query);
261
-                        $sth->execute(array(':ident' => $ident));
262
-                } catch(PDOException $e) {
263
-                        echo $e->getMessage();
264
-                        die;
265
-                }
266
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
259
+				try {
260
+						$sth = $this->db->prepare($query);
261
+						$sth->execute(array(':ident' => $ident));
262
+				} catch(PDOException $e) {
263
+						echo $e->getMessage();
264
+						die;
265
+				}
266
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
267 267
 
268
-                return $spotter_array;
269
-        }
268
+				return $spotter_array;
269
+		}
270 270
 
271 271
 
272 272
 
273
-       /**
274
-        * Gets all the archive spotter information
275
-        *
276
-        * @return Array the spotter information
277
-        *
278
-        */
279
-        public function getSpotterArchiveData($ident,$flightaware_id,$date)
280
-        {
281
-    		$Spotter = new Spotter($this->db);
282
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
283
-                $query  = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.flightaware_id = :flightaware_id AND l.date LIKE :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate";
273
+	   /**
274
+	    * Gets all the archive spotter information
275
+	    *
276
+	    * @return Array the spotter information
277
+	    *
278
+	    */
279
+		public function getSpotterArchiveData($ident,$flightaware_id,$date)
280
+		{
281
+			$Spotter = new Spotter($this->db);
282
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
283
+				$query  = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.flightaware_id = :flightaware_id AND l.date LIKE :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate";
284 284
 
285
-                $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':flightaware_id' => $flightaware_id,':date' => $date.'%'));
285
+				$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':flightaware_id' => $flightaware_id,':date' => $date.'%'));
286 286
 
287
-                return $spotter_array;
288
-        }
287
+				return $spotter_array;
288
+		}
289 289
         
290
-        public function deleteSpotterArchiveTrackData()
291
-        {
290
+		public function deleteSpotterArchiveTrackData()
291
+		{
292 292
 		global $globalArchiveKeepTrackMonths;
293
-                date_default_timezone_set('UTC');
293
+				date_default_timezone_set('UTC');
294 294
 		$query = 'DELETE FROM spotter_archive WHERE spotter_archive.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$globalArchiveKeepTrackMonths.' MONTH)';
295
-                try {
296
-                        $sth = $this->db->prepare($query);
297
-                        $sth->execute();
298
-                } catch(PDOException $e) {
299
-                        echo $e->getMessage();
300
-                        die;
301
-                }
295
+				try {
296
+						$sth = $this->db->prepare($query);
297
+						$sth->execute();
298
+				} catch(PDOException $e) {
299
+						echo $e->getMessage();
300
+						die;
301
+				}
302 302
 	}
303 303
 
304 304
 	/**
305
-        * Gets Minimal Live Spotter data
306
-        *
307
-        * @return Array the spotter information
308
-        *
309
-        */
310
-        public function getMinLiveSpotterData($begindate,$enddate,$filter = array())
311
-        {
312
-                global $globalDBdriver, $globalLiveInterval;
313
-                date_default_timezone_set('UTC');
314
-
315
-                $filter_query = '';
316
-                if (isset($filter['source']) && !empty($filter['source'])) {
317
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
318
-                }
319
-                // Use spotter_output also ?
320
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
321
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
322
-                }
323
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
324
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
325
-                }
326
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
327
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
328
-                }
329
-
330
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
331
-                if ($globalDBdriver == 'mysql') {
332
-                        /*
305
+	 * Gets Minimal Live Spotter data
306
+	 *
307
+	 * @return Array the spotter information
308
+	 *
309
+	 */
310
+		public function getMinLiveSpotterData($begindate,$enddate,$filter = array())
311
+		{
312
+				global $globalDBdriver, $globalLiveInterval;
313
+				date_default_timezone_set('UTC');
314
+
315
+				$filter_query = '';
316
+				if (isset($filter['source']) && !empty($filter['source'])) {
317
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
318
+				}
319
+				// Use spotter_output also ?
320
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
321
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
322
+				}
323
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
324
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
325
+				}
326
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
327
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
328
+				}
329
+
330
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
331
+				if ($globalDBdriver == 'mysql') {
332
+						/*
333 333
                         $query  = 'SELECT a.aircraft_shadow, spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk 
334 334
                     		    FROM spotter_archive 
335 335
                     		    INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao';
@@ -341,51 +341,51 @@  discard block
 block discarded – undo
341 341
 						WHERE (l.date BETWEEN DATE_SUB('."'".$begindate."'".',INTERVAL '.$globalLiveInterval.' SECOND) AND '."'".$begindate."'".') 
342 342
 						GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id 
343 343
 				    AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao';
344
-                } else {
345
-                        $query  = 'SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao';
346
-                }
347
-                //echo $query;
348
-                try {
349
-                        $sth = $this->db->prepare($query);
350
-                        $sth->execute();
351
-                } catch(PDOException $e) {
352
-                        echo $e->getMessage();
353
-                        die;
354
-                }
355
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
356
-
357
-                return $spotter_array;
358
-        }
344
+				} else {
345
+						$query  = 'SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao';
346
+				}
347
+				//echo $query;
348
+				try {
349
+						$sth = $this->db->prepare($query);
350
+						$sth->execute();
351
+				} catch(PDOException $e) {
352
+						echo $e->getMessage();
353
+						die;
354
+				}
355
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
356
+
357
+				return $spotter_array;
358
+		}
359 359
 
360 360
 	/**
361
-        * Gets Minimal Live Spotter data
362
-        *
363
-        * @return Array the spotter information
364
-        *
365
-        */
366
-        public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array())
367
-        {
368
-                global $globalDBdriver, $globalLiveInterval;
369
-                date_default_timezone_set('UTC');
370
-
371
-                $filter_query = '';
372
-                if (isset($filter['source']) && !empty($filter['source'])) {
373
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
374
-                }
375
-                // Should use spotter_output also ?
376
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
377
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
378
-                }
379
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
380
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
381
-                }
382
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
383
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
384
-                }
385
-
386
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
387
-                if ($globalDBdriver == 'mysql') {
388
-                        /*
361
+	 * Gets Minimal Live Spotter data
362
+	 *
363
+	 * @return Array the spotter information
364
+	 *
365
+	 */
366
+		public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array())
367
+		{
368
+				global $globalDBdriver, $globalLiveInterval;
369
+				date_default_timezone_set('UTC');
370
+
371
+				$filter_query = '';
372
+				if (isset($filter['source']) && !empty($filter['source'])) {
373
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
374
+				}
375
+				// Should use spotter_output also ?
376
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
377
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
378
+				}
379
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
380
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
381
+				}
382
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
383
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
384
+				}
385
+
386
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
387
+				if ($globalDBdriver == 'mysql') {
388
+						/*
389 389
                         $query  = 'SELECT a.aircraft_shadow, spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk 
390 390
                     		    FROM spotter_archive 
391 391
                     		    INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao';
@@ -396,94 +396,94 @@  discard block
 block discarded – undo
396 396
 				    WHERE (spotter_archive_output.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') 
397 397
                         	    '.$filter_query.' GROUP BY spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao, spotter_archive_output.arrival_airport_icao, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow';
398 398
 
399
-                } else {
400
-                        //$query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow FROM spotter_archive_output INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive_output.flightaware_id = s.flightaware_id AND spotter_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao';
401
-                       /*
399
+				} else {
400
+						//$query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow FROM spotter_archive_output INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive_output.flightaware_id = s.flightaware_id AND spotter_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao';
401
+					   /*
402 402
                         $query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow
403 403
                         	    FROM spotter_archive_output 
404 404
                         	    INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao
405 405
                         	    WHERE spotter_archive_output.date >= '."'".$begindate."'".' AND spotter_archive_output.date <= '."'".$enddate."'".'
406 406
                         	    '.$filter_query.' GROUP BY spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao, spotter_archive_output.arrival_airport_icao, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow';
407 407
                         */
408
-                        $query  = 'SELECT DISTINCT spotter_output.flightaware_id, spotter_output.ident, spotter_output.aircraft_icao, spotter_output.departure_airport_icao as departure_airport, spotter_output.arrival_airport_icao as arrival_airport, spotter_output.latitude, spotter_output.longitude, spotter_output.altitude, spotter_output.heading, spotter_output.ground_speed, spotter_output.squawk, a.aircraft_shadow
408
+						$query  = 'SELECT DISTINCT spotter_output.flightaware_id, spotter_output.ident, spotter_output.aircraft_icao, spotter_output.departure_airport_icao as departure_airport, spotter_output.arrival_airport_icao as arrival_airport, spotter_output.latitude, spotter_output.longitude, spotter_output.altitude, spotter_output.heading, spotter_output.ground_speed, spotter_output.squawk, a.aircraft_shadow
409 409
                         	    FROM spotter_output 
410 410
                         	    INNER JOIN (SELECT * FROM aircraft) a on spotter_output.aircraft_icao = a.icao
411 411
                         	    WHERE spotter_output.date >= '."'".$begindate."'".' AND spotter_output.date <= '."'".$enddate."'".'
412 412
                         	    '.$filter_query.' LIMIT 200 OFFSET 0';
413 413
 //                        	    .' GROUP BY spotter_output.flightaware_id, spotter_output.ident, spotter_output.aircraft_icao, spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao, spotter_output.latitude, spotter_output.longitude, spotter_output.altitude, spotter_output.heading, spotter_output.ground_speed, spotter_output.squawk, a.aircraft_shadow';
414 414
                         	    
415
-                }
416
-                //echo $query;
417
-                try {
418
-                        $sth = $this->db->prepare($query);
419
-                        $sth->execute();
420
-                } catch(PDOException $e) {
421
-                        echo $e->getMessage();
422
-                        die;
423
-                }
424
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
425
-
426
-                return $spotter_array;
427
-        }
415
+				}
416
+				//echo $query;
417
+				try {
418
+						$sth = $this->db->prepare($query);
419
+						$sth->execute();
420
+				} catch(PDOException $e) {
421
+						echo $e->getMessage();
422
+						die;
423
+				}
424
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
425
+
426
+				return $spotter_array;
427
+		}
428 428
 
429 429
 	 /**
430
-        * Gets count Live Spotter data
431
-        *
432
-        * @return Array the spotter information
433
-        *
434
-        */
435
-        public function getLiveSpotterCount($begindate,$enddate,$filter = array())
436
-        {
437
-                global $globalDBdriver, $globalLiveInterval;
438
-                date_default_timezone_set('UTC');
439
-
440
-                $filter_query = '';
441
-                if (isset($filter['source']) && !empty($filter['source'])) {
442
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
443
-                }
444
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
445
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
446
-                }
447
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
448
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
449
-                }
450
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
451
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
452
-                }
453
-
454
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
455
-                if ($globalDBdriver == 'mysql') {
430
+	  * Gets count Live Spotter data
431
+	  *
432
+	  * @return Array the spotter information
433
+	  *
434
+	  */
435
+		public function getLiveSpotterCount($begindate,$enddate,$filter = array())
436
+		{
437
+				global $globalDBdriver, $globalLiveInterval;
438
+				date_default_timezone_set('UTC');
439
+
440
+				$filter_query = '';
441
+				if (isset($filter['source']) && !empty($filter['source'])) {
442
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
443
+				}
444
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
445
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
446
+				}
447
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
448
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
449
+				}
450
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
451
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
452
+				}
453
+
454
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
455
+				if ($globalDBdriver == 'mysql') {
456 456
 			$query = 'SELECT COUNT(DISTINCT flightaware_id) as nb 
457 457
 			FROM spotter_archive l 
458 458
 			WHERE (l.date BETWEEN DATE_SUB('."'".$begindate."'".',INTERVAL '.$globalLiveInterval.' SECOND) AND '."'".$begindate."'".')'.$filter_query;
459
-                } else {
459
+				} else {
460 460
 			$query = 'SELECT COUNT(DISTINCT flightaware_id) as nb FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."' - INTERVAL '".$globalLiveInterval." SECONDS' AND "."'".$enddate."'".')'.$filter_query;
461
-                }
462
-                //echo $query;
463
-                try {
464
-                        $sth = $this->db->prepare($query);
465
-                        $sth->execute();
466
-                } catch(PDOException $e) {
467
-                        echo $e->getMessage();
468
-                        die;
469
-                }
461
+				}
462
+				//echo $query;
463
+				try {
464
+						$sth = $this->db->prepare($query);
465
+						$sth->execute();
466
+				} catch(PDOException $e) {
467
+						echo $e->getMessage();
468
+						die;
469
+				}
470 470
 		$result = $sth->fetch(PDO::FETCH_ASSOC);
471
-                return $result['nb'];
471
+				return $result['nb'];
472 472
 
473
-        }
473
+		}
474 474
 
475 475
 
476 476
 
477 477
 	// Spotter_Archive_output
478 478
 	
479
-    /**
480
-    * Gets all the spotter information
481
-    *
482
-    * @return Array the spotter information
483
-    *
484
-    */
485
-    public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filter=array())
486
-    {
479
+	/**
480
+	 * Gets all the spotter information
481
+	 *
482
+	 * @return Array the spotter information
483
+	 *
484
+	 */
485
+	public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filter=array())
486
+	{
487 487
 	global $globalTimezone, $globalDBdriver;
488 488
 	require_once(dirname(__FILE__).'/class.Translation.php');
489 489
 	$Translation = new Translation();
@@ -497,159 +497,159 @@  discard block
 block discarded – undo
497 497
 	$filter_query = $this->getFilter($filter);
498 498
 	if ($q != "")
499 499
 	{
500
-	    if (!is_string($q))
501
-	    {
500
+		if (!is_string($q))
501
+		{
502 502
 		return false;
503
-	    } else {
503
+		} else {
504 504
 	        
505 505
 		$q_array = explode(" ", $q);
506 506
 		
507 507
 		foreach ($q_array as $q_item){
508
-		    $additional_query .= " AND (";
509
-		    $additional_query .= "(spotter_archive_output.spotter_id like '%".$q_item."%') OR ";
510
-		    $additional_query .= "(spotter_archive_output.aircraft_icao like '%".$q_item."%') OR ";
511
-		    $additional_query .= "(spotter_archive_output.aircraft_name like '%".$q_item."%') OR ";
512
-		    $additional_query .= "(spotter_archive_output.aircraft_manufacturer like '%".$q_item."%') OR ";
513
-		    $additional_query .= "(spotter_archive_output.airline_icao like '%".$q_item."%') OR ";
514
-		    $additional_query .= "(spotter_archive_output.airline_name like '%".$q_item."%') OR ";
515
-		    $additional_query .= "(spotter_archive_output.airline_country like '%".$q_item."%') OR ";
516
-		    $additional_query .= "(spotter_archive_output.departure_airport_icao like '%".$q_item."%') OR ";
517
-		    $additional_query .= "(spotter_archive_output.departure_airport_name like '%".$q_item."%') OR ";
518
-		    $additional_query .= "(spotter_archive_output.departure_airport_city like '%".$q_item."%') OR ";
519
-		    $additional_query .= "(spotter_archive_output.departure_airport_country like '%".$q_item."%') OR ";
520
-		    $additional_query .= "(spotter_archive_output.arrival_airport_icao like '%".$q_item."%') OR ";
521
-		    $additional_query .= "(spotter_archive_output.arrival_airport_name like '%".$q_item."%') OR ";
522
-		    $additional_query .= "(spotter_archive_output.arrival_airport_city like '%".$q_item."%') OR ";
523
-		    $additional_query .= "(spotter_archive_output.arrival_airport_country like '%".$q_item."%') OR ";
524
-		    $additional_query .= "(spotter_archive_output.registration like '%".$q_item."%') OR ";
525
-		    $additional_query .= "(spotter_archive_output.owner_name like '%".$q_item."%') OR ";
526
-		    $additional_query .= "(spotter_archive_output.pilot_id like '%".$q_item."%') OR ";
527
-		    $additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR ";
528
-		    $additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR ";
529
-		    $translate = $Translation->ident2icao($q_item);
530
-		    if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
531
-		    $additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')";
532
-		    $additional_query .= ")";
533
-		}
534
-	    }
508
+			$additional_query .= " AND (";
509
+			$additional_query .= "(spotter_archive_output.spotter_id like '%".$q_item."%') OR ";
510
+			$additional_query .= "(spotter_archive_output.aircraft_icao like '%".$q_item."%') OR ";
511
+			$additional_query .= "(spotter_archive_output.aircraft_name like '%".$q_item."%') OR ";
512
+			$additional_query .= "(spotter_archive_output.aircraft_manufacturer like '%".$q_item."%') OR ";
513
+			$additional_query .= "(spotter_archive_output.airline_icao like '%".$q_item."%') OR ";
514
+			$additional_query .= "(spotter_archive_output.airline_name like '%".$q_item."%') OR ";
515
+			$additional_query .= "(spotter_archive_output.airline_country like '%".$q_item."%') OR ";
516
+			$additional_query .= "(spotter_archive_output.departure_airport_icao like '%".$q_item."%') OR ";
517
+			$additional_query .= "(spotter_archive_output.departure_airport_name like '%".$q_item."%') OR ";
518
+			$additional_query .= "(spotter_archive_output.departure_airport_city like '%".$q_item."%') OR ";
519
+			$additional_query .= "(spotter_archive_output.departure_airport_country like '%".$q_item."%') OR ";
520
+			$additional_query .= "(spotter_archive_output.arrival_airport_icao like '%".$q_item."%') OR ";
521
+			$additional_query .= "(spotter_archive_output.arrival_airport_name like '%".$q_item."%') OR ";
522
+			$additional_query .= "(spotter_archive_output.arrival_airport_city like '%".$q_item."%') OR ";
523
+			$additional_query .= "(spotter_archive_output.arrival_airport_country like '%".$q_item."%') OR ";
524
+			$additional_query .= "(spotter_archive_output.registration like '%".$q_item."%') OR ";
525
+			$additional_query .= "(spotter_archive_output.owner_name like '%".$q_item."%') OR ";
526
+			$additional_query .= "(spotter_archive_output.pilot_id like '%".$q_item."%') OR ";
527
+			$additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR ";
528
+			$additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR ";
529
+			$translate = $Translation->ident2icao($q_item);
530
+			if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
531
+			$additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')";
532
+			$additional_query .= ")";
533
+		}
534
+		}
535 535
 	}
536 536
 	
537 537
 	if ($registration != "")
538 538
 	{
539
-	    $registration = filter_var($registration,FILTER_SANITIZE_STRING);
540
-	    if (!is_string($registration))
541
-	    {
539
+		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
540
+		if (!is_string($registration))
541
+		{
542 542
 		return false;
543
-	    } else {
543
+		} else {
544 544
 		$additional_query .= " AND (spotter_archive_output.registration = '".$registration."')";
545
-	    }
545
+		}
546 546
 	}
547 547
 	
548 548
 	if ($aircraft_icao != "")
549 549
 	{
550
-	    $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
551
-	    if (!is_string($aircraft_icao))
552
-	    {
550
+		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
551
+		if (!is_string($aircraft_icao))
552
+		{
553 553
 		return false;
554
-	    } else {
554
+		} else {
555 555
 		$additional_query .= " AND (spotter_archive_output.aircraft_icao = '".$aircraft_icao."')";
556
-	    }
556
+		}
557 557
 	}
558 558
 	
559 559
 	if ($aircraft_manufacturer != "")
560 560
 	{
561
-	    $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
562
-	    if (!is_string($aircraft_manufacturer))
563
-	    {
561
+		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
562
+		if (!is_string($aircraft_manufacturer))
563
+		{
564 564
 		return false;
565
-	    } else {
565
+		} else {
566 566
 		$additional_query .= " AND (spotter_archive_output.aircraft_manufacturer = '".$aircraft_manufacturer."')";
567
-	    }
567
+		}
568 568
 	}
569 569
 	
570 570
 	if ($highlights == "true")
571 571
 	{
572
-	    if (!is_string($highlights))
573
-	    {
572
+		if (!is_string($highlights))
573
+		{
574 574
 		return false;
575
-	    } else {
575
+		} else {
576 576
 		$additional_query .= " AND (spotter_archive_output.highlight <> '')";
577
-	    }
577
+		}
578 578
 	}
579 579
 	
580 580
 	if ($airline_icao != "")
581 581
 	{
582
-	    $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
583
-	    if (!is_string($airline_icao))
584
-	    {
582
+		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
583
+		if (!is_string($airline_icao))
584
+		{
585 585
 		return false;
586
-	    } else {
586
+		} else {
587 587
 		$additional_query .= " AND (spotter_archive_output.airline_icao = '".$airline_icao."')";
588
-	    }
588
+		}
589 589
 	}
590 590
 	
591 591
 	if ($airline_country != "")
592 592
 	{
593
-	    $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING);
594
-	    if (!is_string($airline_country))
595
-	    {
593
+		$airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING);
594
+		if (!is_string($airline_country))
595
+		{
596 596
 		return false;
597
-	    } else {
597
+		} else {
598 598
 		$additional_query .= " AND (spotter_archive_output.airline_country = '".$airline_country."')";
599
-	    }
599
+		}
600 600
 	}
601 601
 	
602 602
 	if ($airline_type != "")
603 603
 	{
604
-	    $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING);
605
-	    if (!is_string($airline_type))
606
-	    {
604
+		$airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING);
605
+		if (!is_string($airline_type))
606
+		{
607 607
 		return false;
608
-	    } else {
608
+		} else {
609 609
 		if ($airline_type == "passenger")
610 610
 		{
611
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'passenger')";
611
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'passenger')";
612 612
 		}
613 613
 		if ($airline_type == "cargo")
614 614
 		{
615
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'cargo')";
615
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'cargo')";
616 616
 		}
617 617
 		if ($airline_type == "military")
618 618
 		{
619
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'military')";
619
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'military')";
620
+		}
620 621
 		}
621
-	    }
622 622
 	}
623 623
 	
624 624
 	if ($airport != "")
625 625
 	{
626
-	    $airport = filter_var($airport,FILTER_SANITIZE_STRING);
627
-	    if (!is_string($airport))
628
-	    {
626
+		$airport = filter_var($airport,FILTER_SANITIZE_STRING);
627
+		if (!is_string($airport))
628
+		{
629 629
 		return false;
630
-	    } else {
630
+		} else {
631 631
 		$additional_query .= " AND ((spotter_archive_output.departure_airport_icao = '".$airport."') OR (spotter_archive_output.arrival_airport_icao = '".$airport."'))";
632
-	    }
632
+		}
633 633
 	}
634 634
 	
635 635
 	if ($airport_country != "")
636 636
 	{
637
-	    $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING);
638
-	    if (!is_string($airport_country))
639
-	    {
637
+		$airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING);
638
+		if (!is_string($airport_country))
639
+		{
640 640
 		return false;
641
-	    } else {
641
+		} else {
642 642
 		$additional_query .= " AND ((spotter_archive_output.departure_airport_country = '".$airport_country."') OR (spotter_archive_output.arrival_airport_country = '".$airport_country."'))";
643
-	    }
643
+		}
644 644
 	}
645 645
     
646 646
 	if ($callsign != "")
647 647
 	{
648
-	    $callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
649
-	    if (!is_string($callsign))
650
-	    {
648
+		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
649
+		if (!is_string($callsign))
650
+		{
651 651
 		return false;
652
-	    } else {
652
+		} else {
653 653
 		$translate = $Translation->ident2icao($callsign);
654 654
 		if ($translate != $callsign) {
655 655
 			$additional_query .= " AND (spotter_archive_output.ident = :callsign OR spotter_archive_output.ident = :translate)";
@@ -657,99 +657,99 @@  discard block
 block discarded – undo
657 657
 		} else {
658 658
 			$additional_query .= " AND (spotter_archive_output.ident = '".$callsign."')";
659 659
 		}
660
-	    }
660
+		}
661 661
 	}
662 662
 
663 663
 	if ($owner != "")
664 664
 	{
665
-	    $owner = filter_var($owner,FILTER_SANITIZE_STRING);
666
-	    if (!is_string($owner))
667
-	    {
665
+		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
666
+		if (!is_string($owner))
667
+		{
668 668
 		return false;
669
-	    } else {
669
+		} else {
670 670
 		$additional_query .= " AND (spotter_archive_output.owner_name = '".$owner."')";
671
-	    }
671
+		}
672 672
 	}
673 673
 
674 674
 	if ($pilot_name != "")
675 675
 	{
676
-	    $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING);
677
-	    if (!is_string($pilot_name))
678
-	    {
676
+		$pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING);
677
+		if (!is_string($pilot_name))
678
+		{
679 679
 		return false;
680
-	    } else {
680
+		} else {
681 681
 		$additional_query .= " AND (spotter_archive_output.pilot_name = '".$pilot_name."')";
682
-	    }
682
+		}
683 683
 	}
684 684
 	
685 685
 	if ($pilot_id != "")
686 686
 	{
687
-	    $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT);
688
-	    if (!is_string($pilot_id))
689
-	    {
687
+		$pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT);
688
+		if (!is_string($pilot_id))
689
+		{
690 690
 		return false;
691
-	    } else {
691
+		} else {
692 692
 		$additional_query .= " AND (spotter_archive_output.pilot_id = '".$pilot_id."')";
693
-	    }
693
+		}
694 694
 	}
695 695
 	
696 696
 	if ($departure_airport_route != "")
697 697
 	{
698
-	    $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING);
699
-	    if (!is_string($departure_airport_route))
700
-	    {
698
+		$departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING);
699
+		if (!is_string($departure_airport_route))
700
+		{
701 701
 		return false;
702
-	    } else {
702
+		} else {
703 703
 		$additional_query .= " AND (spotter_archive_output.departure_airport_icao = '".$departure_airport_route."')";
704
-	    }
704
+		}
705 705
 	}
706 706
 	
707 707
 	if ($arrival_airport_route != "")
708 708
 	{
709
-	    $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING);
710
-	    if (!is_string($arrival_airport_route))
711
-	    {
709
+		$arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING);
710
+		if (!is_string($arrival_airport_route))
711
+		{
712 712
 		return false;
713
-	    } else {
713
+		} else {
714 714
 		$additional_query .= " AND (spotter_archive_output.arrival_airport_icao = '".$arrival_airport_route."')";
715
-	    }
715
+		}
716 716
 	}
717 717
 	
718 718
 	if ($altitude != "")
719 719
 	{
720
-	    $altitude_array = explode(",", $altitude);
720
+		$altitude_array = explode(",", $altitude);
721 721
 	    
722
-	    $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
723
-	    $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
722
+		$altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
723
+		$altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
724 724
 	    
725 725
 
726
-	    if ($altitude_array[1] != "")
727
-	    {                
726
+		if ($altitude_array[1] != "")
727
+		{                
728 728
 		$altitude_array[0] = substr($altitude_array[0], 0, -2);
729 729
 		$altitude_array[1] = substr($altitude_array[1], 0, -2);
730 730
 		$additional_query .= " AND altitude BETWEEN '".$altitude_array[0]."' AND '".$altitude_array[1]."' ";
731
-	    } else {
731
+		} else {
732 732
 		$altitude_array[0] = substr($altitude_array[0], 0, -2);
733 733
 		$additional_query .= " AND altitude <= '".$altitude_array[0]."' ";
734
-	    }
734
+		}
735 735
 	}
736 736
 	
737 737
 	if ($date_posted != "")
738 738
 	{
739
-	    $date_array = explode(",", $date_posted);
739
+		$date_array = explode(",", $date_posted);
740 740
 	    
741
-	    $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING);
742
-	    $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING);
741
+		$date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING);
742
+		$date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING);
743 743
 	    
744
-	    if ($globalTimezone != '') {
744
+		if ($globalTimezone != '') {
745 745
 		date_default_timezone_set($globalTimezone);
746 746
 		$datetime = new DateTime();
747 747
 		$offset = $datetime->format('P');
748
-	    } else $offset = '+00:00';
748
+		} else $offset = '+00:00';
749 749
 
750 750
 
751
-	    if ($date_array[1] != "")
752
-	    {                
751
+		if ($date_array[1] != "")
752
+		{                
753 753
 		$date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0]));
754 754
 		$date_array[1] = date("Y-m-d H:i:s", strtotime($date_array[1]));
755 755
 		if ($globalDBdriver == 'mysql') {
@@ -757,28 +757,28 @@  discard block
 block discarded – undo
757 757
 		} else {
758 758
 			$additional_query .= " AND spotter_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." >= CAST('".$date_array[0]."' AS TIMESTAMP) AND spotter_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." <= CAST('".$date_array[1]."' AS TIMESTAMP) ";
759 759
 		}
760
-	    } else {
760
+		} else {
761 761
 		$date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0]));
762
-                if ($globalDBdriver == 'mysql') {
762
+				if ($globalDBdriver == 'mysql') {
763 763
 			$additional_query .= " AND TIMESTAMP(CONVERT_TZ(spotter_archive_output.date,'+00:00', '".$offset."')) >= '".$date_array[0]."' ";
764 764
 		} else {
765 765
 			$additional_query .= " AND spotter_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." >= CAST('".$date_array[0]."' AS TIMESTAMP) ";
766 766
 		}
767
-	    }
767
+		}
768 768
 	}
769 769
 	
770 770
 	if ($limit != "")
771 771
 	{
772
-	    $limit_array = explode(",", $limit);
772
+		$limit_array = explode(",", $limit);
773 773
 	    
774
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
775
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
774
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
775
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
776 776
 	    
777
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
778
-	    {
777
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
778
+		{
779 779
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
780 780
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
781
-	    }
781
+		}
782 782
 	}
783 783
 	
784 784
 
@@ -809,33 +809,33 @@  discard block
 block discarded – undo
809 809
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values,$limit_query);
810 810
 
811 811
 	return $spotter_array;
812
-    }
812
+	}
813 813
 
814
-    public function deleteSpotterArchiveData()
815
-    {
814
+	public function deleteSpotterArchiveData()
815
+	{
816 816
 		global $globalArchiveKeepMonths, $globalDBdriver;
817
-                date_default_timezone_set('UTC');
818
-                if ($globalDBdriver == 'mysql') {
817
+				date_default_timezone_set('UTC');
818
+				if ($globalDBdriver == 'mysql') {
819 819
 			$query = 'DELETE FROM spotter_archive_output WHERE spotter_archive_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$globalArchiveKeepMonths.' MONTH)';
820 820
 		} else {
821 821
 			$query = "DELETE FROM spotter_archive_output WHERE spotter_archive_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalArchiveKeepMonths." MONTH'";
822 822
 		}
823
-                try {
824
-                        $sth = $this->db->prepare($query);
825
-                        $sth->execute();
826
-                } catch(PDOException $e) {
827
-                        return "error";
828
-                }
823
+				try {
824
+						$sth = $this->db->prepare($query);
825
+						$sth->execute();
826
+				} catch(PDOException $e) {
827
+						return "error";
828
+				}
829 829
 	}
830 830
 
831
-    /**
832
-    * Gets all the spotter information based on the callsign
833
-    *
834
-    * @return Array the spotter information
835
-    *
836
-    */
837
-    public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
838
-    {
831
+	/**
832
+	 * Gets all the spotter information based on the callsign
833
+	 *
834
+	 * @return Array the spotter information
835
+	 *
836
+	 */
837
+	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
838
+	{
839 839
 	$global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output";
840 840
 	
841 841
 	date_default_timezone_set('UTC');
@@ -847,35 +847,35 @@  discard block
 block discarded – undo
847 847
 	
848 848
 	if ($ident != "")
849 849
 	{
850
-	    if (!is_string($ident))
851
-	    {
850
+		if (!is_string($ident))
851
+		{
852 852
 		return false;
853
-	    } else {
853
+		} else {
854 854
 		$additional_query = " AND (spotter_archive_output.ident = :ident)";
855 855
 		$query_values = array(':ident' => $ident);
856
-	    }
856
+		}
857 857
 	}
858 858
 	
859 859
 	if ($limit != "")
860 860
 	{
861
-	    $limit_array = explode(",", $limit);
861
+		$limit_array = explode(",", $limit);
862 862
 	    
863
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
864
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
863
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
864
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
865 865
 	    
866
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
867
-	    {
866
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
867
+		{
868 868
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
869 869
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
870
-	    }
870
+		}
871 871
 	}
872 872
 
873 873
 	if ($sort != "")
874 874
 	{
875
-	    $search_orderby_array = $Spotter->getOrderBy();
876
-	    $orderby_query = $search_orderby_array[$sort]['sql'];
875
+		$search_orderby_array = $Spotter->getOrderBy();
876
+		$orderby_query = $search_orderby_array[$sort]['sql'];
877 877
 	} else {
878
-	    $orderby_query = " ORDER BY spotter_archive_output.date DESC";
878
+		$orderby_query = " ORDER BY spotter_archive_output.date DESC";
879 879
 	}
880 880
 
881 881
 	$query = $global_query." WHERE spotter_archive_output.ident <> '' ".$additional_query." ".$orderby_query;
@@ -883,16 +883,16 @@  discard block
 block discarded – undo
883 883
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query);
884 884
 
885 885
 	return $spotter_array;
886
-    }
887
-
888
-    /**
889
-    * Gets all number of flight over countries
890
-    *
891
-    * @return Array the airline country list
892
-    *
893
-    */
894
-    public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
895
-    {
886
+	}
887
+
888
+	/**
889
+	 * Gets all number of flight over countries
890
+	 *
891
+	 * @return Array the airline country list
892
+	 *
893
+	 */
894
+	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
895
+	{
896 896
 	global $globalDBdriver;
897 897
 	/*
898 898
 	$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
@@ -902,14 +902,14 @@  discard block
 block discarded – undo
902 902
 	$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb
903 903
 		    FROM countries c, spotter_archive s
904 904
 		    WHERE c.iso2 = s.over_country ";
905
-                if ($olderthanmonths > 0) {
906
-            		if ($globalDBdriver == 'mysql') {
905
+				if ($olderthanmonths > 0) {
906
+					if ($globalDBdriver == 'mysql') {
907 907
 				$query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
908 908
 			} else {
909 909
 				$query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
910 910
 			}
911 911
 		}
912
-                if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
912
+				if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
913 913
 	$query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC";
914 914
 	if ($limit) $query .= " LIMIT 0,10";
915 915
       
@@ -922,14 +922,14 @@  discard block
 block discarded – undo
922 922
         
923 923
 	while($row = $sth->fetch(PDO::FETCH_ASSOC))
924 924
 	{
925
-	    $temp_array['flight_count'] = $row['nb'];
926
-	    $temp_array['flight_country'] = $row['name'];
927
-	    $temp_array['flight_country_iso3'] = $row['iso3'];
928
-	    $temp_array['flight_country_iso2'] = $row['iso2'];
929
-	    $flight_array[] = $temp_array;
925
+		$temp_array['flight_count'] = $row['nb'];
926
+		$temp_array['flight_country'] = $row['name'];
927
+		$temp_array['flight_country_iso3'] = $row['iso3'];
928
+		$temp_array['flight_country_iso2'] = $row['iso2'];
929
+		$flight_array[] = $temp_array;
930 930
 	}
931 931
 	return $flight_array;
932
-    }
932
+	}
933 933
 
934 934
 }
935 935
 ?>
936 936
\ No newline at end of file
Please login to merge, or discard this patch.
require/class.SpotterLive.php 1 patch
Indentation   +203 added lines, -203 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 
13 13
 
14 14
 	/**
15
-	* Get SQL query part for filter used
16
-	* @param Array $filter the filter
17
-	* @return Array the SQL part
18
-	*/
15
+	 * Get SQL query part for filter used
16
+	 * @param Array $filter the filter
17
+	 * @return Array the SQL part
18
+	 */
19 19
 	public function getFilter($filter = array(),$where = false,$and = false) {
20 20
 		global $globalFilter;
21 21
 		if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter);
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 
52 52
 	/**
53
-	* Gets all the spotter information based on the latest data entry
54
-	*
55
-	* @return Array the spotter information
56
-	*
57
-	*/
53
+	 * Gets all the spotter information based on the latest data entry
54
+	 *
55
+	 * @return Array the spotter information
56
+	 *
57
+	 */
58 58
 	public function getLiveSpotterData($limit = '', $sort = '', $filter = array())
59 59
 	{
60 60
 		global $globalDBdriver, $globalLiveInterval;
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	/**
96
-	* Gets Minimal Live Spotter data
97
-	*
98
-	* @return Array the spotter information
99
-	*
100
-	*/
96
+	 * Gets Minimal Live Spotter data
97
+	 *
98
+	 * @return Array the spotter information
99
+	 *
100
+	 */
101 101
 	public function getMinLiveSpotterData($filter = array())
102 102
 	{
103 103
 		global $globalDBdriver, $globalLiveInterval;
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 
144 144
 	/**
145
-	* Gets Minimal Live Spotter data since xx seconds
146
-	*
147
-	* @return Array the spotter information
148
-	*
149
-	*/
145
+	 * Gets Minimal Live Spotter data since xx seconds
146
+	 *
147
+	 * @return Array the spotter information
148
+	 *
149
+	 */
150 150
 	public function getMinLastLiveSpotterData($filter = array())
151 151
 	{
152 152
 		global $globalDBdriver, $globalLiveInterval;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			$query  = 'SELECT a.aircraft_shadow, a.engine_type, a.engine_count, a.wake_category, spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source 
161 161
 			FROM spotter_live LEFT JOIN (SELECT aircraft_shadow,engine_type, engine_count, wake_category,icao FROM aircraft) a ON spotter_live.aircraft_icao = a.icao'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= spotter_live.date 
162 162
 			ORDER BY spotter_live.flightaware_id, spotter_live.date';
163
-                } else {
163
+				} else {
164 164
 /*
165 165
 			$query  = "SELECT a.aircraft_shadow, spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source 
166 166
 			FROM spotter_live WHERE CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 //			echo $query;
173 173
 		}
174 174
 
175
-    		try {
175
+			try {
176 176
 			$sth = $this->db->prepare($query);
177 177
 			$sth->execute();
178 178
 		} catch(PDOException $e) {
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 
186 186
 	/**
187
-	* Gets number of latest data entry
188
-	*
189
-	* @return String number of entry
190
-	*
191
-	*/
187
+	 * Gets number of latest data entry
188
+	 *
189
+	 * @return String number of entry
190
+	 *
191
+	 */
192 192
 	public function getLiveSpotterCount($filter = array())
193 193
 	{
194 194
 		global $globalDBdriver, $globalLiveInterval;
@@ -214,11 +214,11 @@  discard block
 block discarded – undo
214 214
 	}
215 215
 
216 216
 	/**
217
-	* Gets all the spotter information based on the latest data entry and coord
218
-	*
219
-	* @return Array the spotter information
220
-	*
221
-	*/
217
+	 * Gets all the spotter information based on the latest data entry and coord
218
+	 *
219
+	 * @return Array the spotter information
220
+	 *
221
+	 */
222 222
 	public function getLiveSpotterDatabyCoord($coord, $filter = array())
223 223
 	{
224 224
 		global $globalDBdriver, $globalLiveInterval;
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
 	}
244 244
 
245 245
 	/**
246
-	* Gets all the spotter information based on a user's latitude and longitude
247
-	*
248
-	* @return Array the spotter information
249
-	*
250
-	*/
246
+	 * Gets all the spotter information based on a user's latitude and longitude
247
+	 *
248
+	 * @return Array the spotter information
249
+	 *
250
+	 */
251 251
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
252 252
 	{
253 253
 		$Spotter = new Spotter($this->db);
@@ -257,145 +257,145 @@  discard block
 block discarded – undo
257 257
 				return false;
258 258
 			}
259 259
 		}
260
-        if ($lng != '')
261
-                {
262
-                        if (!is_numeric($lng))
263
-                        {
264
-                                return false;
265
-                        }
266
-                }
267
-
268
-                if ($radius != '')
269
-                {
270
-                        if (!is_numeric($radius))
271
-                        {
272
-                                return false;
273
-                        }
274
-                }
260
+		if ($lng != '')
261
+				{
262
+						if (!is_numeric($lng))
263
+						{
264
+								return false;
265
+						}
266
+				}
267
+
268
+				if ($radius != '')
269
+				{
270
+						if (!is_numeric($radius))
271
+						{
272
+								return false;
273
+						}
274
+				}
275 275
 		$additional_query = '';
276
-        if ($interval != '')
277
-                {
278
-                        if (!is_string($interval))
279
-                        {
280
-                                //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
281
-			        return false;
282
-                        } else {
283
-                if ($interval == '1m')
284
-                {
285
-                    $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
286
-                } else if ($interval == '15m'){
287
-                    $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date ';
288
-                } 
289
-            }
290
-                } else {
291
-         $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';   
292
-        }
293
-
294
-                $query  = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live 
276
+		if ($interval != '')
277
+				{
278
+						if (!is_string($interval))
279
+						{
280
+								//$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
281
+					return false;
282
+						} else {
283
+				if ($interval == '1m')
284
+				{
285
+					$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
286
+				} else if ($interval == '15m'){
287
+					$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date ';
288
+				} 
289
+			}
290
+				} else {
291
+		 $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';   
292
+		}
293
+
294
+				$query  = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live 
295 295
                    WHERE spotter_live.latitude <> '' 
296 296
                                    AND spotter_live.longitude <> '' 
297 297
                    ".$additional_query."
298 298
                    HAVING distance < :radius  
299 299
                                    ORDER BY distance";
300 300
 
301
-                $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius));
301
+				$spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius));
302 302
 
303
-                return $spotter_array;
304
-        }
303
+				return $spotter_array;
304
+		}
305 305
 
306 306
     
307
-        /**
308
-	* Gets all the spotter information based on a particular callsign
309
-	*
310
-	* @return Array the spotter information
311
-	*
312
-	*/
307
+		/**
308
+		 * Gets all the spotter information based on a particular callsign
309
+		 *
310
+		 * @return Array the spotter information
311
+		 *
312
+		 */
313 313
 	public function getLastLiveSpotterDataByIdent($ident)
314 314
 	{
315 315
 		$Spotter = new Spotter($this->db);
316 316
 		date_default_timezone_set('UTC');
317 317
 
318 318
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
319
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
319
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
320 320
 
321 321
 		$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident));
322 322
 
323 323
 		return $spotter_array;
324 324
 	}
325 325
 
326
-        /**
327
-	* Gets all the spotter information based on a particular callsign
328
-	*
329
-	* @return Array the spotter information
330
-	*
331
-	*/
326
+		/**
327
+		 * Gets all the spotter information based on a particular callsign
328
+		 *
329
+		 * @return Array the spotter information
330
+		 *
331
+		 */
332 332
 	public function getDateLiveSpotterDataByIdent($ident,$date)
333 333
 	{
334 334
 		$Spotter = new Spotter($this->db);
335 335
 		date_default_timezone_set('UTC');
336 336
 
337 337
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
338
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
338
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
339 339
 
340
-                $date = date('c',$date);
340
+				$date = date('c',$date);
341 341
 		$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date));
342 342
 
343 343
 		return $spotter_array;
344 344
 	}
345 345
 
346
-        /**
347
-	* Gets last spotter information based on a particular callsign
348
-	*
349
-	* @return Array the spotter information
350
-	*
351
-	*/
346
+		/**
347
+		 * Gets last spotter information based on a particular callsign
348
+		 *
349
+		 * @return Array the spotter information
350
+		 *
351
+		 */
352 352
 	public function getLastLiveSpotterDataById($id)
353 353
 	{
354 354
 		$Spotter = new Spotter($this->db);
355 355
 		date_default_timezone_set('UTC');
356 356
 
357 357
 		$id = filter_var($id, FILTER_SANITIZE_STRING);
358
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
358
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
359 359
 
360 360
 		$spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id));
361 361
 
362 362
 		return $spotter_array;
363 363
 	}
364 364
 
365
-        /**
366
-	* Gets last spotter information based on a particular callsign
367
-	*
368
-	* @return Array the spotter information
369
-	*
370
-	*/
365
+		/**
366
+		 * Gets last spotter information based on a particular callsign
367
+		 *
368
+		 * @return Array the spotter information
369
+		 *
370
+		 */
371 371
 	public function getDateLiveSpotterDataById($id,$date)
372 372
 	{
373 373
 		$Spotter = new Spotter($this->db);
374 374
 		date_default_timezone_set('UTC');
375 375
 
376 376
 		$id = filter_var($id, FILTER_SANITIZE_STRING);
377
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
378
-                $date = date('c',$date);
377
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
378
+				$date = date('c',$date);
379 379
 		$spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date));
380 380
 
381 381
 		return $spotter_array;
382 382
 	}
383 383
 
384
-        /**
385
-	* Gets altitude information based on a particular callsign
386
-	*
387
-	* @return Array the spotter information
388
-	*
389
-	*/
384
+		/**
385
+		 * Gets altitude information based on a particular callsign
386
+		 *
387
+		 * @return Array the spotter information
388
+		 *
389
+		 */
390 390
 	public function getAltitudeLiveSpotterDataByIdent($ident)
391 391
 	{
392 392
 
393 393
 		date_default_timezone_set('UTC');
394 394
 
395 395
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
396
-                $query  = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident';
396
+				$query  = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident';
397 397
 
398
-    		try {
398
+			try {
399 399
 			
400 400
 			$sth = $this->db->prepare($query);
401 401
 			$sth->execute(array(':ident' => $ident));
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		return $spotter_array;
409 409
 	}
410 410
 
411
-        /**
412
-	* Gets all the spotter information based on a particular id
413
-	*
414
-	* @return Array the spotter information
415
-	*
416
-	*/
411
+		/**
412
+		 * Gets all the spotter information based on a particular id
413
+		 *
414
+		 * @return Array the spotter information
415
+		 *
416
+		 */
417 417
 	public function getAllLiveSpotterDataById($id,$liveinterval = false)
418 418
 	{
419 419
 		global $globalDBdriver, $globalLiveInterval;
@@ -441,18 +441,18 @@  discard block
 block discarded – undo
441 441
 		return $spotter_array;
442 442
 	}
443 443
 
444
-        /**
445
-	* Gets all the spotter information based on a particular ident
446
-	*
447
-	* @return Array the spotter information
448
-	*
449
-	*/
444
+		/**
445
+		 * Gets all the spotter information based on a particular ident
446
+		 *
447
+		 * @return Array the spotter information
448
+		 *
449
+		 */
450 450
 	public function getAllLiveSpotterDataByIdent($ident)
451 451
 	{
452 452
 		date_default_timezone_set('UTC');
453 453
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
454 454
 		$query  = self::$global_query.' WHERE spotter_live.ident = :ident';
455
-    		try {
455
+			try {
456 456
 			
457 457
 			$sth = $this->db->prepare($query);
458 458
 			$sth->execute(array(':ident' => $ident));
@@ -466,23 +466,23 @@  discard block
 block discarded – undo
466 466
 
467 467
 
468 468
 	/**
469
-	* Deletes all info in the table
470
-	*
471
-	* @return String success or false
472
-	*
473
-	*/
469
+	 * Deletes all info in the table
470
+	 *
471
+	 * @return String success or false
472
+	 *
473
+	 */
474 474
 	public function deleteLiveSpotterData()
475 475
 	{
476 476
 		global $globalDBdriver;
477 477
 		if ($globalDBdriver == 'mysql') {
478 478
 			//$query  = "DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) >= spotter_live.date";
479 479
 			$query  = 'DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 9 HOUR) >= spotter_live.date';
480
-            		//$query  = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)";
480
+					//$query  = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)";
481 481
 		} else {
482 482
 			$query  = "DELETE FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date";
483 483
 		}
484 484
         
485
-    		try {
485
+			try {
486 486
 			
487 487
 			$sth = $this->db->prepare($query);
488 488
 			$sth->execute();
@@ -494,18 +494,18 @@  discard block
 block discarded – undo
494 494
 	}
495 495
 
496 496
 	/**
497
-	* Deletes all info in the table for aircraft not seen since 2 HOUR
498
-	*
499
-	* @return String success or false
500
-	*
501
-	*/
497
+	 * Deletes all info in the table for aircraft not seen since 2 HOUR
498
+	 *
499
+	 * @return String success or false
500
+	 *
501
+	 */
502 502
 	public function deleteLiveSpotterDataNotUpdated()
503 503
 	{
504 504
 		global $globalDBdriver, $globalDebug;
505 505
 		if ($globalDBdriver == 'mysql') {
506 506
 			//$query = 'SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) < spotter_live.date) LIMIT 800 OFFSET 0';
507
-    			$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 1200 OFFSET 0";
508
-    			try {
507
+				$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 1200 OFFSET 0";
508
+				try {
509 509
 				
510 510
 				$sth = $this->db->prepare($query);
511 511
 				$sth->execute();
@@ -513,8 +513,8 @@  discard block
 block discarded – undo
513 513
 				return "error";
514 514
 			}
515 515
 			$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
516
-                        $i = 0;
517
-                        $j =0;
516
+						$i = 0;
517
+						$j =0;
518 518
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
519 519
 			foreach($all as $row)
520 520
 			{
@@ -522,20 +522,20 @@  discard block
 block discarded – undo
522 522
 				$j++;
523 523
 				if ($j == 30) {
524 524
 					if ($globalDebug) echo ".";
525
-				    	try {
525
+						try {
526 526
 						
527 527
 						$sth = $this->db->prepare(substr($query_delete,0,-1).")");
528 528
 						$sth->execute();
529 529
 					} catch(PDOException $e) {
530 530
 						return "error";
531 531
 					}
532
-                                	$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
533
-                                	$j = 0;
532
+									$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
533
+									$j = 0;
534 534
 				}
535 535
 				$query_delete .= "'".$row['flightaware_id']."',";
536 536
 			}
537 537
 			if ($i > 0) {
538
-    				try {
538
+					try {
539 539
 					
540 540
 					$sth = $this->db->prepare(substr($query_delete,0,-1).")");
541 541
 					$sth->execute();
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
 			return "success";
547 547
 		} elseif ($globalDBdriver == 'pgsql') {
548 548
 			//$query = "SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' < spotter_live.date) LIMIT 800 OFFSET 0";
549
-    			//$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0";
550
-    			$query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0)";
551
-    			try {
549
+				//$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0";
550
+				$query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0)";
551
+				try {
552 552
 				
553 553
 				$sth = $this->db->prepare($query);
554 554
 				$sth->execute();
@@ -592,17 +592,17 @@  discard block
 block discarded – undo
592 592
 	}
593 593
 
594 594
 	/**
595
-	* Deletes all info in the table for an ident
596
-	*
597
-	* @return String success or false
598
-	*
599
-	*/
595
+	 * Deletes all info in the table for an ident
596
+	 *
597
+	 * @return String success or false
598
+	 *
599
+	 */
600 600
 	public function deleteLiveSpotterDataByIdent($ident)
601 601
 	{
602 602
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
603 603
 		$query  = 'DELETE FROM spotter_live WHERE ident = :ident';
604 604
         
605
-    		try {
605
+			try {
606 606
 			
607 607
 			$sth = $this->db->prepare($query);
608 608
 			$sth->execute(array(':ident' => $ident));
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 	}
615 615
 
616 616
 	/**
617
-	* Deletes all info in the table for an id
618
-	*
619
-	* @return String success or false
620
-	*
621
-	*/
617
+	 * Deletes all info in the table for an id
618
+	 *
619
+	 * @return String success or false
620
+	 *
621
+	 */
622 622
 	public function deleteLiveSpotterDataById($id)
623 623
 	{
624 624
 		$id = filter_var($id, FILTER_SANITIZE_STRING);
625 625
 		$query  = 'DELETE FROM spotter_live WHERE flightaware_id = :id';
626 626
         
627
-    		try {
627
+			try {
628 628
 			
629 629
 			$sth = $this->db->prepare($query);
630 630
 			$sth->execute(array(':id' => $id));
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
 
638 638
 
639 639
 	/**
640
-	* Gets the aircraft ident within the last hour
641
-	*
642
-	* @return String the ident
643
-	*
644
-	*/
640
+	 * Gets the aircraft ident within the last hour
641
+	 *
642
+	 * @return String the ident
643
+	 *
644
+	 */
645 645
 	public function getIdentFromLastHour($ident)
646 646
 	{
647 647
 		global $globalDBdriver, $globalTimezone;
@@ -667,14 +667,14 @@  discard block
 block discarded – undo
667 667
 			$ident_result = $row['ident'];
668 668
 		}
669 669
 		return $ident_result;
670
-        }
670
+		}
671 671
 
672 672
 	/**
673
-	* Check recent aircraft
674
-	*
675
-	* @return String the ident
676
-	*
677
-	*/
673
+	 * Check recent aircraft
674
+	 *
675
+	 * @return String the ident
676
+	 *
677
+	 */
678 678
 	public function checkIdentRecent($ident)
679 679
 	{
680 680
 		global $globalDBdriver, $globalTimezone;
@@ -700,14 +700,14 @@  discard block
 block discarded – undo
700 700
 			$ident_result = $row['flightaware_id'];
701 701
 		}
702 702
 		return $ident_result;
703
-        }
703
+		}
704 704
 
705 705
 	/**
706
-	* Check recent aircraft by id
707
-	*
708
-	* @return String the ident
709
-	*
710
-	*/
706
+	 * Check recent aircraft by id
707
+	 *
708
+	 * @return String the ident
709
+	 *
710
+	 */
711 711
 	public function checkIdRecent($id)
712 712
 	{
713 713
 		global $globalDBdriver, $globalTimezone;
@@ -733,14 +733,14 @@  discard block
 block discarded – undo
733 733
 			$ident_result = $row['flightaware_id'];
734 734
 		}
735 735
 		return $ident_result;
736
-        }
736
+		}
737 737
 
738 738
 	/**
739
-	* Check recent aircraft by ModeS
740
-	*
741
-	* @return String the ModeS
742
-	*
743
-	*/
739
+	 * Check recent aircraft by ModeS
740
+	 *
741
+	 * @return String the ModeS
742
+	 *
743
+	 */
744 744
 	public function checkModeSRecent($modes)
745 745
 	{
746 746
 		global $globalDBdriver, $globalTimezone;
@@ -767,19 +767,19 @@  discard block
 block discarded – undo
767 767
 			$ident_result = $row['flightaware_id'];
768 768
 		}
769 769
 		return $ident_result;
770
-        }
770
+		}
771 771
 
772 772
 	/**
773
-	* Adds a new spotter data
774
-	*
775
-	* @param String $flightaware_id the ID from flightaware
776
-	* @param String $ident the flight ident
777
-	* @param String $aircraft_icao the aircraft type
778
-	* @param String $departure_airport_icao the departure airport
779
-	* @param String $arrival_airport_icao the arrival airport
780
-	* @return String success or false
781
-	*
782
-	*/
773
+	 * Adds a new spotter data
774
+	 *
775
+	 * @param String $flightaware_id the ID from flightaware
776
+	 * @param String $ident the flight ident
777
+	 * @param String $aircraft_icao the aircraft type
778
+	 * @param String $departure_airport_icao the departure airport
779
+	 * @param String $arrival_airport_icao the arrival airport
780
+	 * @return String success or false
781
+	 *
782
+	 */
783 783
 	public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '')
784 784
 	{
785 785
 		global $globalURL, $globalArchive, $globalDebug;
@@ -915,10 +915,10 @@  discard block
 block discarded – undo
915 915
 		$arrival_airport_country = '';
916 916
 		
917 917
             	
918
-            	if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL;
919
-            	if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL;
920
-            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
921
-            	if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
918
+				if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL;
919
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL;
920
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
921
+				if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
922 922
             	
923 923
 		$query  = 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country) 
924 924
 		VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name, :departure_airport_city, :departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date,:departure_airport_time,:arrival_airport_time,:squawk,:route_stop,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country)';
@@ -929,13 +929,13 @@  discard block
 block discarded – undo
929 929
 			
930 930
 			$sth = $this->db->prepare($query);
931 931
 			$sth->execute($query_values);
932
-                } catch(PDOException $e) {
933
-                	return "error : ".$e->getMessage();
934
-                }
932
+				} catch(PDOException $e) {
933
+					return "error : ".$e->getMessage();
934
+				}
935 935
 		if (isset($globalArchive) && $globalArchive && $putinarchive && !$noarchive) {
936
-		    if ($globalDebug) echo '(Add to SBS archive : ';
937
-		    $result =  $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country);
938
-		    if ($globalDebug) echo $result.')';
936
+			if ($globalDebug) echo '(Add to SBS archive : ';
937
+			$result =  $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country);
938
+			if ($globalDebug) echo $result.')';
939 939
 		}
940 940
 		return "success";
941 941
 
Please login to merge, or discard this patch.
require/class.Spotter.php 1 patch
Indentation   +1265 added lines, -1265 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	}
14 14
 
15 15
 	/**
16
-	* Get SQL query part for filter used
17
-	* @param Array $filter the filter
18
-	* @return Array the SQL part
19
-	*/
16
+	 * Get SQL query part for filter used
17
+	 * @param Array $filter the filter
18
+	 * @return Array the SQL part
19
+	 */
20 20
 	public function getFilter($filter = array(),$where = false,$and = false) {
21 21
 		global $globalFilter;
22 22
 		if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter);
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 
53 53
 	/**
54
-	* Executes the SQL statements to get the spotter information
55
-	*
56
-	* @param String $query the SQL query
57
-	* @param Array $params parameter of the query
58
-	* @param String $limitQuery the limit query
59
-	* @return Array the spotter information
60
-	*
61
-	*/
54
+	 * Executes the SQL statements to get the spotter information
55
+	 *
56
+	 * @param String $query the SQL query
57
+	 * @param Array $params parameter of the query
58
+	 * @param String $limitQuery the limit query
59
+	 * @return Array the spotter information
60
+	 *
61
+	 */
62 62
 	public function getDataFromDB($query, $params = array(), $limitQuery = '')
63 63
 	{
64 64
 		global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS;
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 					if ($aircraft_array[0]['aircraft_shadow'] != NULL) {
222 222
 						$temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow'];
223 223
 					} else $temp_array['aircraft_shadow'] = 'default.png';
224
-                                } else {
225
-                            		$temp_array['aircraft_shadow'] = 'default.png';
224
+								} else {
225
+									$temp_array['aircraft_shadow'] = 'default.png';
226 226
 					$temp_array['aircraft_name'] = 'N/A';
227 227
 					$temp_array['aircraft_manufacturer'] = 'N/A';
228
-                            	}
228
+								}
229 229
 			}
230 230
 			$fromsource = NULL;
231 231
 			if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim';
@@ -407,11 +407,11 @@  discard block
 block discarded – undo
407 407
 	
408 408
 	
409 409
 	/**
410
-	* Gets all the spotter information
411
-	*
412
-	* @return Array the spotter information
413
-	*
414
-	*/
410
+	 * Gets all the spotter information
411
+	 *
412
+	 * @return Array the spotter information
413
+	 *
414
+	 */
415 415
 	public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filter = array())
416 416
 	{
417 417
 		global $globalTimezone, $globalDBdriver;
@@ -758,11 +758,11 @@  discard block
 block discarded – undo
758 758
 	
759 759
 	
760 760
 	/**
761
-	* Gets all the spotter information based on the latest data entry
762
-	*
763
-	* @return Array the spotter information
764
-	*
765
-	*/
761
+	 * Gets all the spotter information based on the latest data entry
762
+	 *
763
+	 * @return Array the spotter information
764
+	 *
765
+	 */
766 766
 	public function getLatestSpotterData($limit = '', $sort = '', $filter = array())
767 767
 	{
768 768
 		global $global_query;
@@ -801,12 +801,12 @@  discard block
 block discarded – undo
801 801
 	}
802 802
     
803 803
     
804
-    /**
805
-	* Gets all the spotter information based on a user's latitude and longitude
806
-	*
807
-	* @return Array the spotter information
808
-	*
809
-	*/
804
+	/**
805
+	 * Gets all the spotter information based on a user's latitude and longitude
806
+	 *
807
+	 * @return Array the spotter information
808
+	 *
809
+	 */
810 810
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
811 811
 	{
812 812
 		date_default_timezone_set('UTC');
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 				return false;
835 835
 			}
836 836
 		}
837
-    		$additional_query = '';
837
+			$additional_query = '';
838 838
 		if ($interval != "")
839 839
 		{
840 840
 			if (!is_string($interval))
@@ -874,12 +874,12 @@  discard block
 block discarded – undo
874 874
 	}
875 875
     
876 876
     
877
-    /**
878
-	* Gets all the spotter information sorted by the newest aircraft type
879
-	*
880
-	* @return Array the spotter information
881
-	*
882
-	*/
877
+	/**
878
+	 * Gets all the spotter information sorted by the newest aircraft type
879
+	 *
880
+	 * @return Array the spotter information
881
+	 *
882
+	 */
883 883
 	public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array())
884 884
 	{
885 885
 		global $global_query;
@@ -920,11 +920,11 @@  discard block
 block discarded – undo
920 920
     
921 921
     
922 922
 	/**
923
-	* Gets all the spotter information sorted by the newest aircraft registration
924
-	*
925
-	* @return Array the spotter information
926
-	*
927
-	*/
923
+	 * Gets all the spotter information sorted by the newest aircraft registration
924
+	 *
925
+	 * @return Array the spotter information
926
+	 *
927
+	 */
928 928
 	public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array())
929 929
 	{
930 930
 		global $global_query;
@@ -964,11 +964,11 @@  discard block
 block discarded – undo
964 964
 
965 965
 
966 966
 	/**
967
-	* Gets all the spotter information sorted by the newest airline
968
-	*
969
-	* @return Array the spotter information
970
-	*
971
-	*/
967
+	 * Gets all the spotter information sorted by the newest airline
968
+	 *
969
+	 * @return Array the spotter information
970
+	 *
971
+	 */
972 972
 	public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array())
973 973
 	{
974 974
 		global $global_query;
@@ -1007,12 +1007,12 @@  discard block
 block discarded – undo
1007 1007
 	}
1008 1008
     
1009 1009
     
1010
-    /**
1011
-	* Gets all the spotter information sorted by the newest departure airport
1012
-	*
1013
-	* @return Array the spotter information
1014
-	*
1015
-	*/
1010
+	/**
1011
+	 * Gets all the spotter information sorted by the newest departure airport
1012
+	 *
1013
+	 * @return Array the spotter information
1014
+	 *
1015
+	 */
1016 1016
 	public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array())
1017 1017
 	{
1018 1018
 		global $global_query;
@@ -1054,11 +1054,11 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
 
1056 1056
 	/**
1057
-	* Gets all the spotter information sorted by the newest arrival airport
1058
-	*
1059
-	* @return Array the spotter information
1060
-	*
1061
-	*/
1057
+	 * Gets all the spotter information sorted by the newest arrival airport
1058
+	 *
1059
+	 * @return Array the spotter information
1060
+	 *
1061
+	 */
1062 1062
 	public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array())
1063 1063
 	{
1064 1064
 		global $global_query;
@@ -1097,11 +1097,11 @@  discard block
 block discarded – undo
1097 1097
 	
1098 1098
 
1099 1099
 	/**
1100
-	* Gets all the spotter information based on the spotter id
1101
-	*
1102
-	* @return Array the spotter information
1103
-	*
1104
-	*/
1100
+	 * Gets all the spotter information based on the spotter id
1101
+	 *
1102
+	 * @return Array the spotter information
1103
+	 *
1104
+	 */
1105 1105
 	public function getSpotterDataByID($id = '')
1106 1106
 	{
1107 1107
 		global $global_query;
@@ -1123,11 +1123,11 @@  discard block
 block discarded – undo
1123 1123
 	
1124 1124
 	
1125 1125
 	/**
1126
-	* Gets all the spotter information based on the callsign
1127
-	*
1128
-	* @return Array the spotter information
1129
-	*
1130
-	*/
1126
+	 * Gets all the spotter information based on the callsign
1127
+	 *
1128
+	 * @return Array the spotter information
1129
+	 *
1130
+	 */
1131 1131
 	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
1132 1132
 	{
1133 1133
 		global $global_query;
@@ -1180,11 +1180,11 @@  discard block
 block discarded – undo
1180 1180
 	
1181 1181
 	
1182 1182
 	/**
1183
-	* Gets all the spotter information based on the aircraft type
1184
-	*
1185
-	* @return Array the spotter information
1186
-	*
1187
-	*/
1183
+	 * Gets all the spotter information based on the aircraft type
1184
+	 *
1185
+	 * @return Array the spotter information
1186
+	 *
1187
+	 */
1188 1188
 	public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array())
1189 1189
 	{
1190 1190
 		global $global_query;
@@ -1238,11 +1238,11 @@  discard block
 block discarded – undo
1238 1238
 	
1239 1239
 	
1240 1240
 	/**
1241
-	* Gets all the spotter information based on the aircraft registration
1242
-	*
1243
-	* @return Array the spotter information
1244
-	*
1245
-	*/
1241
+	 * Gets all the spotter information based on the aircraft registration
1242
+	 *
1243
+	 * @return Array the spotter information
1244
+	 *
1245
+	 */
1246 1246
 	public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array())
1247 1247
 	{
1248 1248
 		global $global_query;
@@ -1298,11 +1298,11 @@  discard block
 block discarded – undo
1298 1298
 	
1299 1299
 	
1300 1300
 	/**
1301
-	* Gets all the spotter information based on the airline
1302
-	*
1303
-	* @return Array the spotter information
1304
-	*
1305
-	*/
1301
+	 * Gets all the spotter information based on the airline
1302
+	 *
1303
+	 * @return Array the spotter information
1304
+	 *
1305
+	 */
1306 1306
 	public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '')
1307 1307
 	{
1308 1308
 		global $global_query;
@@ -1354,11 +1354,11 @@  discard block
 block discarded – undo
1354 1354
 	
1355 1355
 	
1356 1356
 	/**
1357
-	* Gets all the spotter information based on the airport
1358
-	*
1359
-	* @return Array the spotter information
1360
-	*
1361
-	*/
1357
+	 * Gets all the spotter information based on the airport
1358
+	 *
1359
+	 * @return Array the spotter information
1360
+	 *
1361
+	 */
1362 1362
 	public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '')
1363 1363
 	{
1364 1364
 		global $global_query;
@@ -1411,11 +1411,11 @@  discard block
 block discarded – undo
1411 1411
 
1412 1412
 
1413 1413
 	/**
1414
-	* Gets all the spotter information based on the date
1415
-	*
1416
-	* @return Array the spotter information
1417
-	*
1418
-	*/
1414
+	 * Gets all the spotter information based on the date
1415
+	 *
1416
+	 * @return Array the spotter information
1417
+	 *
1418
+	 */
1419 1419
 	public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array())
1420 1420
 	{
1421 1421
 		global $global_query, $globalTimezone, $globalDBdriver;
@@ -1492,11 +1492,11 @@  discard block
 block discarded – undo
1492 1492
 
1493 1493
 
1494 1494
 	/**
1495
-	* Gets all the spotter information based on the country name
1496
-	*
1497
-	* @return Array the spotter information
1498
-	*
1499
-	*/
1495
+	 * Gets all the spotter information based on the country name
1496
+	 *
1497
+	 * @return Array the spotter information
1498
+	 *
1499
+	 */
1500 1500
 	public function getSpotterDataByCountry($country = '', $limit = '', $sort = '')
1501 1501
 	{
1502 1502
 		global $global_query;
@@ -1549,11 +1549,11 @@  discard block
 block discarded – undo
1549 1549
 	
1550 1550
 	
1551 1551
 	/**
1552
-	* Gets all the spotter information based on the manufacturer name
1553
-	*
1554
-	* @return Array the spotter information
1555
-	*
1556
-	*/
1552
+	 * Gets all the spotter information based on the manufacturer name
1553
+	 *
1554
+	 * @return Array the spotter information
1555
+	 *
1556
+	 */
1557 1557
 	public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '')
1558 1558
 	{
1559 1559
 		global $global_query;
@@ -1608,13 +1608,13 @@  discard block
 block discarded – undo
1608 1608
   
1609 1609
   
1610 1610
 	/**
1611
-	* Gets a list of all aircraft that take a route
1612
-	*
1613
-	* @param String $departure_airport_icao ICAO code of departure airport
1614
-	* @param String $arrival_airport_icao ICAO code of arrival airport
1615
-	* @return Array the spotter information
1616
-	*
1617
-	*/
1611
+	 * Gets a list of all aircraft that take a route
1612
+	 *
1613
+	 * @param String $departure_airport_icao ICAO code of departure airport
1614
+	 * @param String $arrival_airport_icao ICAO code of arrival airport
1615
+	 * @return Array the spotter information
1616
+	 *
1617
+	 */
1618 1618
 	public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '')
1619 1619
 	{
1620 1620
 		global $global_query;
@@ -1680,11 +1680,11 @@  discard block
 block discarded – undo
1680 1680
 	
1681 1681
 	
1682 1682
 	/**
1683
-	* Gets all the spotter information based on the special column in the table
1684
-	*
1685
-	* @return Array the spotter information
1686
-	*
1687
-	*/
1683
+	 * Gets all the spotter information based on the special column in the table
1684
+	 *
1685
+	 * @return Array the spotter information
1686
+	 *
1687
+	 */
1688 1688
 	public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array())
1689 1689
 	{
1690 1690
 		global $global_query;
@@ -1723,11 +1723,11 @@  discard block
 block discarded – undo
1723 1723
 	}
1724 1724
 
1725 1725
 	/**
1726
-	* Gets all the highlight based on a aircraft registration
1727
-	*
1728
-	* @return String the highlight text
1729
-	*
1730
-	*/
1726
+	 * Gets all the highlight based on a aircraft registration
1727
+	 *
1728
+	 * @return String the highlight text
1729
+	 *
1730
+	 */
1731 1731
 	public function getHighlightByRegistration($registration,$filter = array())
1732 1732
 	{
1733 1733
 		global $global_query;
@@ -1749,13 +1749,13 @@  discard block
 block discarded – undo
1749 1749
 
1750 1750
 	
1751 1751
 	/**
1752
-	* Gets the squawk usage from squawk code
1753
-	*
1754
-	* @param String $squawk squawk code
1755
-	* @param String $country country
1756
-	* @return String usage
1757
-	*
1758
-	*/
1752
+	 * Gets the squawk usage from squawk code
1753
+	 *
1754
+	 * @param String $squawk squawk code
1755
+	 * @param String $country country
1756
+	 * @return String usage
1757
+	 *
1758
+	 */
1759 1759
 	public function getSquawkUsage($squawk = '',$country = 'FR')
1760 1760
 	{
1761 1761
 		
@@ -1775,12 +1775,12 @@  discard block
 block discarded – undo
1775 1775
 	}
1776 1776
 
1777 1777
 	/**
1778
-	* Gets the airport icao from the iata
1779
-	*
1780
-	* @param String $airport_iata the iata code of the airport
1781
-	* @return String airport iata
1782
-	*
1783
-	*/
1778
+	 * Gets the airport icao from the iata
1779
+	 *
1780
+	 * @param String $airport_iata the iata code of the airport
1781
+	 * @return String airport iata
1782
+	 *
1783
+	 */
1784 1784
 	public function getAirportIcao($airport_iata = '')
1785 1785
 	{
1786 1786
 		
@@ -1799,14 +1799,14 @@  discard block
 block discarded – undo
1799 1799
 	}
1800 1800
 
1801 1801
 	/**
1802
-	* Gets the airport distance
1803
-	*
1804
-	* @param String $airport_icao the icao code of the airport
1805
-	* @param Float $latitude the latitude
1806
-	* @param Float $longitude the longitude
1807
-	* @return Float distance to the airport
1808
-	*
1809
-	*/
1802
+	 * Gets the airport distance
1803
+	 *
1804
+	 * @param String $airport_icao the icao code of the airport
1805
+	 * @param Float $latitude the latitude
1806
+	 * @param Float $longitude the longitude
1807
+	 * @return Float distance to the airport
1808
+	 *
1809
+	 */
1810 1810
 	public function getAirportDistance($airport_icao,$latitude,$longitude)
1811 1811
 	{
1812 1812
 		
@@ -1826,12 +1826,12 @@  discard block
 block discarded – undo
1826 1826
 	}
1827 1827
 	
1828 1828
 	/**
1829
-	* Gets the airport info based on the icao
1830
-	*
1831
-	* @param String $airport the icao code of the airport
1832
-	* @return Array airport information
1833
-	*
1834
-	*/
1829
+	 * Gets the airport info based on the icao
1830
+	 *
1831
+	 * @param String $airport the icao code of the airport
1832
+	 * @return Array airport information
1833
+	 *
1834
+	 */
1835 1835
 	public function getAllAirportInfo($airport = '')
1836 1836
 	{
1837 1837
 		
@@ -1877,12 +1877,12 @@  discard block
 block discarded – undo
1877 1877
 	}
1878 1878
 	
1879 1879
 	/**
1880
-	* Gets the airport info based on the country
1881
-	*
1882
-	* @param Array $countries Airports countries
1883
-	* @return Array airport information
1884
-	*
1885
-	*/
1880
+	 * Gets the airport info based on the country
1881
+	 *
1882
+	 * @param Array $countries Airports countries
1883
+	 * @return Array airport information
1884
+	 *
1885
+	 */
1886 1886
 	public function getAllAirportInfobyCountry($countries)
1887 1887
 	{
1888 1888
 		$lst_countries = '';
@@ -1920,12 +1920,12 @@  discard block
 block discarded – undo
1920 1920
 	}
1921 1921
 	
1922 1922
 	/**
1923
-	* Gets airports info based on the coord
1924
-	*
1925
-	* @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
1926
-	* @return Array airport information
1927
-	*
1928
-	*/
1923
+	 * Gets airports info based on the coord
1924
+	 *
1925
+	 * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
1926
+	 * @return Array airport information
1927
+	 *
1928
+	 */
1929 1929
 	public function getAllAirportInfobyCoord($coord)
1930 1930
 	{
1931 1931
 		global $globalDBdriver;
@@ -1956,12 +1956,12 @@  discard block
 block discarded – undo
1956 1956
 	}
1957 1957
 
1958 1958
 	/**
1959
-	* Gets waypoints info based on the coord
1960
-	*
1961
-	* @param Array $coord waypoints coord
1962
-	* @return Array airport information
1963
-	*
1964
-	*/
1959
+	 * Gets waypoints info based on the coord
1960
+	 *
1961
+	 * @param Array $coord waypoints coord
1962
+	 * @return Array airport information
1963
+	 *
1964
+	 */
1965 1965
 	public function getAllWaypointsInfobyCoord($coord)
1966 1966
 	{
1967 1967
 		if (is_array($coord)) {
@@ -1995,12 +1995,12 @@  discard block
 block discarded – undo
1995 1995
 	
1996 1996
 	
1997 1997
 	/**
1998
-	* Gets the airline info based on the icao code or iata code
1999
-	*
2000
-	* @param String $airline_icao the iata code of the airport
2001
-	* @return Array airport information
2002
-	*
2003
-	*/
1998
+	 * Gets the airline info based on the icao code or iata code
1999
+	 *
2000
+	 * @param String $airline_icao the iata code of the airport
2001
+	 * @return Array airport information
2002
+	 *
2003
+	 */
2004 2004
 	public function getAllAirlineInfo($airline_icao, $fromsource = NULL)
2005 2005
 	{
2006 2006
 		$airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING));
@@ -2029,7 +2029,7 @@  discard block
 block discarded – undo
2029 2029
 			} else {
2030 2030
 				$sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource));
2031 2031
 			}
2032
-                        /*
2032
+						/*
2033 2033
 			$airline_array = array();
2034 2034
 			$temp_array = array();
2035 2035
 		
@@ -2052,12 +2052,12 @@  discard block
 block discarded – undo
2052 2052
 	
2053 2053
 	
2054 2054
 	/**
2055
-	* Gets the aircraft info based on the aircraft type
2056
-	*
2057
-	* @param String $aircraft_type the aircraft type
2058
-	* @return Array aircraft information
2059
-	*
2060
-	*/
2055
+	 * Gets the aircraft info based on the aircraft type
2056
+	 *
2057
+	 * @param String $aircraft_type the aircraft type
2058
+	 * @return Array aircraft information
2059
+	 *
2060
+	 */
2061 2061
 	public function getAllAircraftInfo($aircraft_type)
2062 2062
 	{
2063 2063
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2089,12 +2089,12 @@  discard block
 block discarded – undo
2089 2089
 	}
2090 2090
 
2091 2091
 	/**
2092
-	* Gets the aircraft icao based on the aircraft name/type
2093
-	*
2094
-	* @param String $aircraft_type the aircraft type
2095
-	* @return String aircraft information
2096
-	*
2097
-	*/
2092
+	 * Gets the aircraft icao based on the aircraft name/type
2093
+	 *
2094
+	 * @param String $aircraft_type the aircraft type
2095
+	 * @return String aircraft information
2096
+	 *
2097
+	 */
2098 2098
 	public function getAircraftIcao($aircraft_type)
2099 2099
 	{
2100 2100
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2119,12 +2119,12 @@  discard block
 block discarded – undo
2119 2119
 	}
2120 2120
 	
2121 2121
 	/**
2122
-	* Gets the aircraft info based on the aircraft ident
2123
-	*
2124
-	* @param String $aircraft_modes the aircraft ident (hex)
2125
-	* @return String aircraft type
2126
-	*
2127
-	*/
2122
+	 * Gets the aircraft info based on the aircraft ident
2123
+	 *
2124
+	 * @param String $aircraft_modes the aircraft ident (hex)
2125
+	 * @return String aircraft type
2126
+	 *
2127
+	 */
2128 2128
 	public function getAllAircraftType($aircraft_modes)
2129 2129
 	{
2130 2130
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -2141,12 +2141,12 @@  discard block
 block discarded – undo
2141 2141
 	}
2142 2142
 
2143 2143
 	/**
2144
-	* Gets correct aircraft operator corde
2145
-	*
2146
-	* @param String $operator the aircraft operator code (callsign)
2147
-	* @return String aircraft operator code
2148
-	*
2149
-	*/
2144
+	 * Gets correct aircraft operator corde
2145
+	 *
2146
+	 * @param String $operator the aircraft operator code (callsign)
2147
+	 * @return String aircraft operator code
2148
+	 *
2149
+	 */
2150 2150
 	public function getOperator($operator)
2151 2151
 	{
2152 2152
 		$operator = filter_var($operator,FILTER_SANITIZE_STRING);
@@ -2162,16 +2162,16 @@  discard block
 block discarded – undo
2162 2162
 	}
2163 2163
 
2164 2164
 	/**
2165
-	* Gets the aircraft route based on the aircraft callsign
2166
-	*
2167
-	* @param String $callsign the aircraft callsign
2168
-	* @return Array aircraft type
2169
-	*
2170
-	*/
2165
+	 * Gets the aircraft route based on the aircraft callsign
2166
+	 *
2167
+	 * @param String $callsign the aircraft callsign
2168
+	 * @return Array aircraft type
2169
+	 *
2170
+	 */
2171 2171
 	public function getRouteInfo($callsign)
2172 2172
 	{
2173 2173
 		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
2174
-                if ($callsign == '') return array();
2174
+				if ($callsign == '') return array();
2175 2175
 		$query  = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1";
2176 2176
 		
2177 2177
 		$sth = $this->db->prepare($query);
@@ -2184,12 +2184,12 @@  discard block
 block discarded – undo
2184 2184
 	}
2185 2185
 	
2186 2186
 	/**
2187
-	* Gets the aircraft info based on the aircraft registration
2188
-	*
2189
-	* @param String $registration the aircraft registration
2190
-	* @return Array aircraft information
2191
-	*
2192
-	*/
2187
+	 * Gets the aircraft info based on the aircraft registration
2188
+	 *
2189
+	 * @param String $registration the aircraft registration
2190
+	 * @return Array aircraft information
2191
+	 *
2192
+	 */
2193 2193
 	public function getAircraftInfoByRegistration($registration)
2194 2194
 	{
2195 2195
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2216,12 +2216,12 @@  discard block
 block discarded – undo
2216 2216
 	}
2217 2217
 	
2218 2218
 	/**
2219
-	* Gets the aircraft owner & base based on the aircraft registration
2220
-	*
2221
-	* @param String $registration the aircraft registration
2222
-	* @return Array aircraft information
2223
-	*
2224
-	*/
2219
+	 * Gets the aircraft owner & base based on the aircraft registration
2220
+	 *
2221
+	 * @param String $registration the aircraft registration
2222
+	 * @return Array aircraft information
2223
+	 *
2224
+	 */
2225 2225
 	public function getAircraftOwnerByRegistration($registration)
2226 2226
 	{
2227 2227
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2237,11 +2237,11 @@  discard block
 block discarded – undo
2237 2237
 	
2238 2238
   
2239 2239
   /**
2240
-	* Gets all flights (but with only little info)
2241
-	*
2242
-	* @return Array basic flight information
2243
-	*
2244
-	*/
2240
+   * Gets all flights (but with only little info)
2241
+   *
2242
+   * @return Array basic flight information
2243
+   *
2244
+   */
2245 2245
 	public function getAllFlightsforSitemap()
2246 2246
 	{
2247 2247
 		//$query  = "SELECT spotter_output.spotter_id, spotter_output.ident, spotter_output.airline_name, spotter_output.aircraft_name, spotter_output.aircraft_icao FROM spotter_output ORDER BY LIMIT ";
@@ -2249,7 +2249,7 @@  discard block
 block discarded – undo
2249 2249
 		
2250 2250
 		$sth = $this->db->prepare($query);
2251 2251
 		$sth->execute();
2252
-                  /*
2252
+				  /*
2253 2253
 		$flight_array = array();
2254 2254
 		$temp_array = array();
2255 2255
 		
@@ -2271,11 +2271,11 @@  discard block
 block discarded – undo
2271 2271
 	}
2272 2272
   
2273 2273
 	/**
2274
-	* Gets a list of all aircraft manufacturers
2275
-	*
2276
-	* @return Array list of aircraft types
2277
-	*
2278
-	*/
2274
+	 * Gets a list of all aircraft manufacturers
2275
+	 *
2276
+	 * @return Array list of aircraft types
2277
+	 *
2278
+	 */
2279 2279
 	public function getAllManufacturers()
2280 2280
 	{
2281 2281
 		/*
@@ -2304,11 +2304,11 @@  discard block
 block discarded – undo
2304 2304
   
2305 2305
   
2306 2306
   /**
2307
-	* Gets a list of all aircraft types
2308
-	*
2309
-	* @return Array list of aircraft types
2310
-	*
2311
-	*/
2307
+   * Gets a list of all aircraft types
2308
+   *
2309
+   * @return Array list of aircraft types
2310
+   *
2311
+   */
2312 2312
 	public function getAllAircraftTypes()
2313 2313
 	{
2314 2314
 		/*
@@ -2340,11 +2340,11 @@  discard block
 block discarded – undo
2340 2340
 	
2341 2341
 	
2342 2342
 	/**
2343
-	* Gets a list of all aircraft registrations
2344
-	*
2345
-	* @return Array list of aircraft registrations
2346
-	*
2347
-	*/
2343
+	 * Gets a list of all aircraft registrations
2344
+	 *
2345
+	 * @return Array list of aircraft registrations
2346
+	 *
2347
+	 */
2348 2348
 	public function getAllAircraftRegistrations()
2349 2349
 	{
2350 2350
 		$query  = "SELECT DISTINCT spotter_output.registration 
@@ -2369,12 +2369,12 @@  discard block
 block discarded – undo
2369 2369
 	}
2370 2370
 
2371 2371
 	/**
2372
-	* Gets all source name
2373
-	*
2374
-	* @param String type format of source
2375
-	* @return Array list of source name
2376
-	*
2377
-	*/
2372
+	 * Gets all source name
2373
+	 *
2374
+	 * @param String type format of source
2375
+	 * @return Array list of source name
2376
+	 *
2377
+	 */
2378 2378
 	public function getAllSourceName($type = '')
2379 2379
 	{
2380 2380
 		$query_values = array();
@@ -2405,11 +2405,11 @@  discard block
 block discarded – undo
2405 2405
 
2406 2406
 
2407 2407
 	/**
2408
-	* Gets a list of all airline names
2409
-	*
2410
-	* @return Array list of airline names
2411
-	*
2412
-	*/
2408
+	 * Gets a list of all airline names
2409
+	 *
2410
+	 * @return Array list of airline names
2411
+	 *
2412
+	 */
2413 2413
 	public function getAllAirlineNames($airline_type = '')
2414 2414
 	{
2415 2415
 		$airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING);
@@ -2452,11 +2452,11 @@  discard block
 block discarded – undo
2452 2452
 	
2453 2453
 	
2454 2454
 	/**
2455
-	* Gets a list of all airline countries
2456
-	*
2457
-	* @return Array list of airline countries
2458
-	*
2459
-	*/
2455
+	 * Gets a list of all airline countries
2456
+	 *
2457
+	 * @return Array list of airline countries
2458
+	 *
2459
+	 */
2460 2460
 	public function getAllAirlineCountries()
2461 2461
 	{
2462 2462
 		
@@ -2485,11 +2485,11 @@  discard block
 block discarded – undo
2485 2485
 	
2486 2486
 	
2487 2487
 	/**
2488
-	* Gets a list of all departure & arrival names
2489
-	*
2490
-	* @return Array list of airport names
2491
-	*
2492
-	*/
2488
+	 * Gets a list of all departure & arrival names
2489
+	 *
2490
+	 * @return Array list of airport names
2491
+	 *
2492
+	 */
2493 2493
 	public function getAllAirportNames()
2494 2494
 	{
2495 2495
 		$airport_array = array();
@@ -2540,11 +2540,11 @@  discard block
 block discarded – undo
2540 2540
 	
2541 2541
 	
2542 2542
 	/**
2543
-	* Gets a list of all departure & arrival airport countries
2544
-	*
2545
-	* @return Array list of airport countries
2546
-	*
2547
-	*/
2543
+	 * Gets a list of all departure & arrival airport countries
2544
+	 *
2545
+	 * @return Array list of airport countries
2546
+	 *
2547
+	 */
2548 2548
 	public function getAllAirportCountries()
2549 2549
 	{
2550 2550
 		$airport_array = array();
@@ -2593,11 +2593,11 @@  discard block
 block discarded – undo
2593 2593
 	
2594 2594
 	
2595 2595
 	/**
2596
-	* Gets a list of all countries (airline, departure airport & arrival airport)
2597
-	*
2598
-	* @return Array list of countries
2599
-	*
2600
-	*/
2596
+	 * Gets a list of all countries (airline, departure airport & arrival airport)
2597
+	 *
2598
+	 * @return Array list of countries
2599
+	 *
2600
+	 */
2601 2601
 	public function getAllCountries()
2602 2602
 	{
2603 2603
 		$Connection= new Connection($this->db);
@@ -2676,11 +2676,11 @@  discard block
 block discarded – undo
2676 2676
 	
2677 2677
 	
2678 2678
 	/**
2679
-	* Gets a list of all idents/callsigns
2680
-	*
2681
-	* @return Array list of ident/callsign names
2682
-	*
2683
-	*/
2679
+	 * Gets a list of all idents/callsigns
2680
+	 *
2681
+	 * @return Array list of ident/callsign names
2682
+	 *
2683
+	 */
2684 2684
 	public function getAllIdents()
2685 2685
 	{
2686 2686
 		$query  = "SELECT DISTINCT spotter_output.ident
@@ -2704,9 +2704,9 @@  discard block
 block discarded – undo
2704 2704
 	}
2705 2705
 
2706 2706
 	/**
2707
-	* Get a list of flights from airport since 7 days
2708
-	* @return Array number, icao, name and city of airports
2709
-	*/
2707
+	 * Get a list of flights from airport since 7 days
2708
+	 * @return Array number, icao, name and city of airports
2709
+	 */
2710 2710
 
2711 2711
 	public function getLast7DaysAirportsDeparture($airport_icao = '') {
2712 2712
 		global $globalTimezone, $globalDBdriver;
@@ -2736,9 +2736,9 @@  discard block
 block discarded – undo
2736 2736
 	}
2737 2737
 
2738 2738
 	/**
2739
-	* Get a list of flights from airport since 7 days
2740
-	* @return Array number, icao, name and city of airports
2741
-	*/
2739
+	 * Get a list of flights from airport since 7 days
2740
+	 * @return Array number, icao, name and city of airports
2741
+	 */
2742 2742
 
2743 2743
 	public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') {
2744 2744
 		global $globalTimezone, $globalDBdriver;
@@ -2768,9 +2768,9 @@  discard block
 block discarded – undo
2768 2768
 	}
2769 2769
 
2770 2770
 	/**
2771
-	* Get a list of flights from detected airport since 7 days
2772
-	* @return Array number, icao, name and city of airports
2773
-	*/
2771
+	 * Get a list of flights from detected airport since 7 days
2772
+	 * @return Array number, icao, name and city of airports
2773
+	 */
2774 2774
 
2775 2775
 	public function getLast7DaysDetectedAirportsDeparture($airport_icao = '') {
2776 2776
 		global $globalTimezone, $globalDBdriver;
@@ -2811,9 +2811,9 @@  discard block
 block discarded – undo
2811 2811
 	}
2812 2812
 
2813 2813
 	/**
2814
-	* Get a list of flights from detected airport since 7 days
2815
-	* @return Array number, icao, name and city of airports
2816
-	*/
2814
+	 * Get a list of flights from detected airport since 7 days
2815
+	 * @return Array number, icao, name and city of airports
2816
+	 */
2817 2817
 
2818 2818
 	public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') {
2819 2819
 		global $globalTimezone, $globalDBdriver;
@@ -2855,9 +2855,9 @@  discard block
 block discarded – undo
2855 2855
 
2856 2856
 
2857 2857
 	/**
2858
-	* Get a list of flights to airport since 7 days
2859
-	* @return Array number, icao, name and city of airports
2860
-	*/
2858
+	 * Get a list of flights to airport since 7 days
2859
+	 * @return Array number, icao, name and city of airports
2860
+	 */
2861 2861
 
2862 2862
 	public function getLast7DaysAirportsArrival($airport_icao = '') {
2863 2863
 		global $globalTimezone, $globalDBdriver;
@@ -2889,9 +2889,9 @@  discard block
 block discarded – undo
2889 2889
 
2890 2890
 
2891 2891
 	/**
2892
-	* Get a list of flights detected to airport since 7 days
2893
-	* @return Array number, icao, name and city of airports
2894
-	*/
2892
+	 * Get a list of flights detected to airport since 7 days
2893
+	 * @return Array number, icao, name and city of airports
2894
+	 */
2895 2895
 
2896 2896
 	public function getLast7DaysDetectedAirportsArrival($airport_icao = '') {
2897 2897
 		global $globalTimezone, $globalDBdriver;
@@ -2935,9 +2935,9 @@  discard block
 block discarded – undo
2935 2935
 
2936 2936
 
2937 2937
 	/**
2938
-	* Get a list of flights to airport since 7 days
2939
-	* @return Array number, icao, name and city of airports
2940
-	*/
2938
+	 * Get a list of flights to airport since 7 days
2939
+	 * @return Array number, icao, name and city of airports
2940
+	 */
2941 2941
 
2942 2942
 	public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') {
2943 2943
 		global $globalTimezone, $globalDBdriver;
@@ -2969,9 +2969,9 @@  discard block
 block discarded – undo
2969 2969
 
2970 2970
 
2971 2971
 	/**
2972
-	* Get a list of flights detected to airport since 7 days
2973
-	* @return Array number, icao, name and city of airports
2974
-	*/
2972
+	 * Get a list of flights detected to airport since 7 days
2973
+	 * @return Array number, icao, name and city of airports
2974
+	 */
2975 2975
 
2976 2976
 	public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') {
2977 2977
 		global $globalTimezone, $globalDBdriver;
@@ -3015,11 +3015,11 @@  discard block
 block discarded – undo
3015 3015
 
3016 3016
 
3017 3017
 	/**
3018
-	* Gets a list of all dates
3019
-	*
3020
-	* @return Array list of date names
3021
-	*
3022
-	*/
3018
+	 * Gets a list of all dates
3019
+	 *
3020
+	 * @return Array list of date names
3021
+	 *
3022
+	 */
3023 3023
 	public function getAllDates()
3024 3024
 	{
3025 3025
 		global $globalTimezone, $globalDBdriver;
@@ -3060,11 +3060,11 @@  discard block
 block discarded – undo
3060 3060
 	
3061 3061
 	
3062 3062
 	/**
3063
-	* Gets all route combinations
3064
-	*
3065
-	* @return Array the route list
3066
-	*
3067
-	*/
3063
+	 * Gets all route combinations
3064
+	 *
3065
+	 * @return Array the route list
3066
+	 *
3067
+	 */
3068 3068
 	public function getAllRoutes()
3069 3069
 	{
3070 3070
 		$query  = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ',  spotter_output.arrival_airport_icao) AS route,  spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao 
@@ -3090,13 +3090,13 @@  discard block
 block discarded – undo
3090 3090
 	}
3091 3091
 
3092 3092
 	/**
3093
-	* Update ident spotter data
3094
-	*
3095
-	* @param String $flightaware_id the ID from flightaware
3096
-	* @param String $ident the flight ident
3097
-	* @return String success or false
3098
-	*
3099
-	*/	
3093
+	 * Update ident spotter data
3094
+	 *
3095
+	 * @param String $flightaware_id the ID from flightaware
3096
+	 * @param String $ident the flight ident
3097
+	 * @return String success or false
3098
+	 *
3099
+	 */	
3100 3100
 	public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL)
3101 3101
 	{
3102 3102
 		if (!is_numeric(substr($ident, 0, 3)))
@@ -3117,14 +3117,14 @@  discard block
 block discarded – undo
3117 3117
 		} else {
3118 3118
 			$airline_array = $this->getAllAirlineInfo("NA");
3119 3119
 		}
3120
-                $airline_name = $airline_array[0]['name'];
3121
-                $airline_icao = $airline_array[0]['icao'];
3122
-                $airline_country = $airline_array[0]['country'];
3123
-                $airline_type = $airline_array[0]['type'];
3120
+				$airline_name = $airline_array[0]['name'];
3121
+				$airline_icao = $airline_array[0]['icao'];
3122
+				$airline_country = $airline_array[0]['country'];
3123
+				$airline_type = $airline_array[0]['type'];
3124 3124
 
3125 3125
 
3126 3126
 		$query = 'UPDATE spotter_output SET ident = :ident, airline_name = :airline_name, airline_icao = :airline_icao, airline_country = :airline_country, airline_type = :airline_type WHERE flightaware_id = :flightaware_id';
3127
-                $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type);
3127
+				$query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type);
3128 3128
 
3129 3129
 		try {
3130 3130
 			$sth = $this->db->prepare($query);
@@ -3137,19 +3137,19 @@  discard block
 block discarded – undo
3137 3137
 
3138 3138
 	}
3139 3139
 	/**
3140
-	* Update latest spotter data
3141
-	*
3142
-	* @param String $flightaware_id the ID from flightaware
3143
-	* @param String $ident the flight ident
3144
-	* @param String $arrival_airport_icao the arrival airport
3145
-	* @return String success or false
3146
-	*
3147
-	*/	
3140
+	 * Update latest spotter data
3141
+	 *
3142
+	 * @param String $flightaware_id the ID from flightaware
3143
+	 * @param String $ident the flight ident
3144
+	 * @param String $arrival_airport_icao the arrival airport
3145
+	 * @return String success or false
3146
+	 *
3147
+	 */	
3148 3148
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3149 3149
 	{
3150 3150
 		if ($groundspeed == '') $groundspeed = NULL;
3151 3151
 		$query = 'UPDATE spotter_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_ground = :last_ground, last_seen = :last_seen, real_arrival_airport_icao = :real_arrival_airport_icao, real_arrival_airport_time = :real_arrival_airport_time, last_ground_speed = :last_ground_speed WHERE flightaware_id = :flightaware_id';
3152
-                $query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident);
3152
+				$query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident);
3153 3153
 
3154 3154
 		try {
3155 3155
 			$sth = $this->db->prepare($query);
@@ -3163,32 +3163,32 @@  discard block
 block discarded – undo
3163 3163
 	}
3164 3164
 
3165 3165
 	/**
3166
-	* Adds a new spotter data
3167
-	*
3168
-	* @param String $flightaware_id the ID from flightaware
3169
-	* @param String $ident the flight ident
3170
-	* @param String $aircraft_icao the aircraft type
3171
-	* @param String $departure_airport_icao the departure airport
3172
-	* @param String $arrival_airport_icao the arrival airport
3173
-	* @param String $latitude latitude of flight
3174
-	* @param String $longitude latitude of flight
3175
-	* @param String $waypoints waypoints of flight
3176
-	* @param String $altitude altitude of flight
3177
-	* @param String $heading heading of flight
3178
-	* @param String $groundspeed speed of flight
3179
-	* @param String $date date of flight
3180
-	* @param String $departure_airport_time departure time of flight
3181
-	* @param String $arrival_airport_time arrival time of flight
3182
-	* @param String $squawk squawk code of flight
3183
-	* @param String $route_stop route stop of flight
3184
-	* @param String $highlight highlight or not
3185
-	* @param String $ModeS ModesS code of flight
3186
-	* @param String $registration registration code of flight
3187
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
3188
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
3189
-	* @param String $verticalrate vertival rate of flight
3190
-	* @return String success or false
3191
-	*/
3166
+	 * Adds a new spotter data
3167
+	 *
3168
+	 * @param String $flightaware_id the ID from flightaware
3169
+	 * @param String $ident the flight ident
3170
+	 * @param String $aircraft_icao the aircraft type
3171
+	 * @param String $departure_airport_icao the departure airport
3172
+	 * @param String $arrival_airport_icao the arrival airport
3173
+	 * @param String $latitude latitude of flight
3174
+	 * @param String $longitude latitude of flight
3175
+	 * @param String $waypoints waypoints of flight
3176
+	 * @param String $altitude altitude of flight
3177
+	 * @param String $heading heading of flight
3178
+	 * @param String $groundspeed speed of flight
3179
+	 * @param String $date date of flight
3180
+	 * @param String $departure_airport_time departure time of flight
3181
+	 * @param String $arrival_airport_time arrival time of flight
3182
+	 * @param String $squawk squawk code of flight
3183
+	 * @param String $route_stop route stop of flight
3184
+	 * @param String $highlight highlight or not
3185
+	 * @param String $ModeS ModesS code of flight
3186
+	 * @param String $registration registration code of flight
3187
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
3188
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
3189
+	 * @param String $verticalrate vertival rate of flight
3190
+	 * @return String success or false
3191
+	 */
3192 3192
 	public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '',$squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false,$format_source = '', $source_name = '')
3193 3193
 	{
3194 3194
 		global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed;
@@ -3400,8 +3400,8 @@  discard block
 block discarded – undo
3400 3400
     
3401 3401
 		if ($globalIVAO && $aircraft_icao != '')
3402 3402
 		{
3403
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3404
-            		else $airline_icao = '';
3403
+					if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3404
+					else $airline_icao = '';
3405 3405
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3406 3406
 			if (!isset($image_array[0]['registration']))
3407 3407
 			{
@@ -3432,48 +3432,48 @@  discard block
 block discarded – undo
3432 3432
 	
3433 3433
 		if (count($airline_array) == 0) 
3434 3434
 		{
3435
-                        $airline_array = $this->getAllAirlineInfo('NA');
3436
-                }
3437
-                if (count($aircraft_array) == 0) 
3438
-                {
3439
-                        $aircraft_array = $this->getAllAircraftInfo('NA');
3440
-                }
3441
-                if (count($departure_airport_array) == 0) 
3442
-                {
3443
-                        $departure_airport_array = $this->getAllAirportInfo('NA');
3444
-                }
3445
-                if (count($arrival_airport_array) == 0) 
3446
-                {
3447
-                        $arrival_airport_array = $this->getAllAirportInfo('NA');
3448
-                }
3449
-                if ($registration == '') $registration = 'NA';
3450
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3451
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3452
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3453
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3454
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3455
-                $query  = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) 
3435
+						$airline_array = $this->getAllAirlineInfo('NA');
3436
+				}
3437
+				if (count($aircraft_array) == 0) 
3438
+				{
3439
+						$aircraft_array = $this->getAllAircraftInfo('NA');
3440
+				}
3441
+				if (count($departure_airport_array) == 0) 
3442
+				{
3443
+						$departure_airport_array = $this->getAllAirportInfo('NA');
3444
+				}
3445
+				if (count($arrival_airport_array) == 0) 
3446
+				{
3447
+						$arrival_airport_array = $this->getAllAirportInfo('NA');
3448
+				}
3449
+				if ($registration == '') $registration = 'NA';
3450
+				if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3451
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3452
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3453
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3454
+				if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3455
+				$query  = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) 
3456 3456
                 VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name,:departure_airport_city,:departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date, :departure_airport_time, :arrival_airport_time, :squawk, :route_stop, :highlight, :ModeS, :pilot_id, :pilot_name, :verticalrate, :owner_name,:ground, :format_source, :source_name)";
3457 3457
 
3458
-                $airline_name = $airline_array[0]['name'];
3459
-                $airline_icao = $airline_array[0]['icao'];
3460
-                $airline_country = $airline_array[0]['country'];
3461
-                $airline_type = $airline_array[0]['type'];
3458
+				$airline_name = $airline_array[0]['name'];
3459
+				$airline_icao = $airline_array[0]['icao'];
3460
+				$airline_country = $airline_array[0]['country'];
3461
+				$airline_type = $airline_array[0]['type'];
3462 3462
 		if ($airline_type == '') {
3463 3463
 			$timeelapsed = microtime(true);
3464 3464
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3465 3465
 			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3466 3466
 		}
3467 3467
 		if ($airline_type == null) $airline_type = '';
3468
-                $aircraft_type = $aircraft_array[0]['type'];
3469
-                $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3470
-                $departure_airport_name = $departure_airport_array[0]['name'];
3471
-                $departure_airport_city = $departure_airport_array[0]['city'];
3472
-                $departure_airport_country = $departure_airport_array[0]['country'];
3473
-                $arrival_airport_name = $arrival_airport_array[0]['name'];
3474
-                $arrival_airport_city = $arrival_airport_array[0]['city'];
3475
-                $arrival_airport_country = $arrival_airport_array[0]['country'];
3476
-                $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date,':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name);
3468
+				$aircraft_type = $aircraft_array[0]['type'];
3469
+				$aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3470
+				$departure_airport_name = $departure_airport_array[0]['name'];
3471
+				$departure_airport_city = $departure_airport_array[0]['city'];
3472
+				$departure_airport_country = $departure_airport_array[0]['country'];
3473
+				$arrival_airport_name = $arrival_airport_array[0]['name'];
3474
+				$arrival_airport_city = $arrival_airport_array[0]['city'];
3475
+				$arrival_airport_country = $arrival_airport_array[0]['country'];
3476
+				$query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date,':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name);
3477 3477
 
3478 3478
 		try {
3479 3479
 		        
@@ -3481,7 +3481,7 @@  discard block
 block discarded – undo
3481 3481
 			$sth->execute($query_values);
3482 3482
 			$this->db = null;
3483 3483
 		} catch (PDOException $e) {
3484
-		    return "error : ".$e->getMessage();
3484
+			return "error : ".$e->getMessage();
3485 3485
 		}
3486 3486
 		
3487 3487
 		return "success";
@@ -3490,11 +3490,11 @@  discard block
 block discarded – undo
3490 3490
 	
3491 3491
   
3492 3492
 	/**
3493
-	* Gets the aircraft ident within the last hour
3494
-	*
3495
-	* @return String the ident
3496
-	*
3497
-	*/
3493
+	 * Gets the aircraft ident within the last hour
3494
+	 *
3495
+	 * @return String the ident
3496
+	 *
3497
+	 */
3498 3498
 	public function getIdentFromLastHour($ident)
3499 3499
 	{
3500 3500
 		global $globalDBdriver, $globalTimezone;
@@ -3510,11 +3510,11 @@  discard block
 block discarded – undo
3510 3510
 								AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
3511 3511
 								AND spotter_output.date < now() AT TIME ZONE 'UTC'";
3512 3512
 			$query_data = array(':ident' => $ident);
3513
-    		}
3513
+			}
3514 3514
 		
3515 3515
 		$sth = $this->db->prepare($query);
3516 3516
 		$sth->execute($query_data);
3517
-    		$ident_result='';
3517
+			$ident_result='';
3518 3518
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
3519 3519
 		{
3520 3520
 			$ident_result = $row['ident'];
@@ -3525,11 +3525,11 @@  discard block
 block discarded – undo
3525 3525
 	
3526 3526
 	
3527 3527
 	/**
3528
-	* Gets the aircraft data from the last 20 seconds
3529
-	*
3530
-	* @return Array the spotter data
3531
-	*
3532
-	*/
3528
+	 * Gets the aircraft data from the last 20 seconds
3529
+	 *
3530
+	 * @return Array the spotter data
3531
+	 *
3532
+	 */
3533 3533
 	public function getRealTimeData($q = '')
3534 3534
 	{
3535 3535
 		global $globalDBdriver;
@@ -3573,11 +3573,11 @@  discard block
 block discarded – undo
3573 3573
 	
3574 3574
 	
3575 3575
 	 /**
3576
-	* Gets all airlines that have flown over
3577
-	*
3578
-	* @return Array the airline list
3579
-	*
3580
-	*/
3576
+	  * Gets all airlines that have flown over
3577
+	  *
3578
+	  * @return Array the airline list
3579
+	  *
3580
+	  */
3581 3581
 	public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
3582 3582
 	{
3583 3583
 		global $globalDBdriver;
@@ -3591,7 +3591,7 @@  discard block
 block discarded – undo
3591 3591
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3592 3592
 			}
3593 3593
 		}
3594
-                if ($sincedate != '') {
3594
+				if ($sincedate != '') {
3595 3595
 			if ($globalDBdriver == 'mysql') {
3596 3596
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3597 3597
 			} else {
@@ -3618,26 +3618,26 @@  discard block
 block discarded – undo
3618 3618
 	}
3619 3619
 
3620 3620
 	 /**
3621
-	* Gets all pilots that have flown over
3622
-	*
3623
-	* @return Array the pilots list
3624
-	*
3625
-	*/
3621
+	  * Gets all pilots that have flown over
3622
+	  *
3623
+	  * @return Array the pilots list
3624
+	  *
3625
+	  */
3626 3626
 	public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3627 3627
 	{
3628 3628
 		global $globalDBdriver;
3629 3629
 		$filter_query = $this->getFilter($filters,true,true);
3630 3630
 		$query  = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count
3631 3631
 		 			FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' ";
3632
-                if ($olderthanmonths > 0) {
3633
-            		if ($globalDBdriver == 'mysql') {
3632
+				if ($olderthanmonths > 0) {
3633
+					if ($globalDBdriver == 'mysql') {
3634 3634
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3635 3635
 			} else {
3636 3636
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3637 3637
 			}
3638 3638
 		}
3639
-                if ($sincedate != '') {
3640
-            		if ($globalDBdriver == 'mysql') {
3639
+				if ($sincedate != '') {
3640
+					if ($globalDBdriver == 'mysql') {
3641 3641
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3642 3642
 			} else {
3643 3643
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3664,25 +3664,25 @@  discard block
 block discarded – undo
3664 3664
 	}
3665 3665
 	
3666 3666
 		 /**
3667
-	* Gets all pilots that have flown over
3668
-	*
3669
-	* @return Array the pilots list
3670
-	*
3671
-	*/
3667
+		  * Gets all pilots that have flown over
3668
+		  *
3669
+		  * @return Array the pilots list
3670
+		  *
3671
+		  */
3672 3672
 	public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
3673 3673
 	{
3674 3674
 		global $globalDBdriver;
3675 3675
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count
3676 3676
 		 			FROM spotter_output WHERE spotter_output.pilot_id <> '' ";
3677
-                if ($olderthanmonths > 0) {
3678
-            		if ($globalDBdriver == 'mysql') {
3677
+				if ($olderthanmonths > 0) {
3678
+					if ($globalDBdriver == 'mysql') {
3679 3679
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3680 3680
 			} else {
3681 3681
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3682 3682
 			}
3683 3683
 		}
3684
-                if ($sincedate != '') {
3685
-            		if ($globalDBdriver == 'mysql') {
3684
+				if ($sincedate != '') {
3685
+					if ($globalDBdriver == 'mysql') {
3686 3686
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3687 3687
 			} else {
3688 3688
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3710,26 +3710,26 @@  discard block
 block discarded – undo
3710 3710
 	}
3711 3711
 	
3712 3712
 	 /**
3713
-	* Gets all owner that have flown over
3714
-	*
3715
-	* @return Array the pilots list
3716
-	*
3717
-	*/
3713
+	  * Gets all owner that have flown over
3714
+	  *
3715
+	  * @return Array the pilots list
3716
+	  *
3717
+	  */
3718 3718
 	public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3719 3719
 	{
3720 3720
 		global $globalDBdriver;
3721 3721
 		$filter_query = $this->getFilter($filters,true,true);
3722 3722
 		$query  = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
3723 3723
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
3724
-                if ($olderthanmonths > 0) {
3725
-            		if ($globalDBdriver == 'mysql') {
3724
+				if ($olderthanmonths > 0) {
3725
+					if ($globalDBdriver == 'mysql') {
3726 3726
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3727 3727
 			} else {
3728 3728
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3729 3729
 			}
3730 3730
 		}
3731
-                if ($sincedate != '') {
3732
-            		if ($globalDBdriver == 'mysql') {
3731
+				if ($sincedate != '') {
3732
+					if ($globalDBdriver == 'mysql') {
3733 3733
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3734 3734
 			} else {
3735 3735
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3755,25 +3755,25 @@  discard block
 block discarded – undo
3755 3755
 	}
3756 3756
 	
3757 3757
 	 /**
3758
-	* Gets all owner that have flown over
3759
-	*
3760
-	* @return Array the pilots list
3761
-	*
3762
-	*/
3758
+	  * Gets all owner that have flown over
3759
+	  *
3760
+	  * @return Array the pilots list
3761
+	  *
3762
+	  */
3763 3763
 	public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
3764 3764
 	{
3765 3765
 		global $globalDBdriver;
3766 3766
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
3767 3767
 		 			FROM spotter_output WHERE spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
3768
-                if ($olderthanmonths > 0) {
3769
-            		if ($globalDBdriver == 'mysql') {
3768
+				if ($olderthanmonths > 0) {
3769
+					if ($globalDBdriver == 'mysql') {
3770 3770
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3771 3771
 			} else {
3772 3772
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3773 3773
 			}
3774 3774
 		}
3775
-                if ($sincedate != '') {
3776
-            		if ($globalDBdriver == 'mysql') {
3775
+				if ($sincedate != '') {
3776
+					if ($globalDBdriver == 'mysql') {
3777 3777
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3778 3778
 			} else {
3779 3779
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3800,11 +3800,11 @@  discard block
 block discarded – undo
3800 3800
 	}
3801 3801
 
3802 3802
 	/**
3803
-	* Gets all airlines that have flown over by aircraft
3804
-	*
3805
-	* @return Array the airline list
3806
-	*
3807
-	*/
3803
+	 * Gets all airlines that have flown over by aircraft
3804
+	 *
3805
+	 * @return Array the airline list
3806
+	 *
3807
+	 */
3808 3808
 	public function countAllAirlinesByAircraft($aircraft_icao)
3809 3809
 	{
3810 3810
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -3837,11 +3837,11 @@  discard block
 block discarded – undo
3837 3837
 
3838 3838
 
3839 3839
 	/**
3840
-	* Gets all airline countries that have flown over by aircraft
3841
-	*
3842
-	* @return Array the airline country list
3843
-	*
3844
-	*/
3840
+	 * Gets all airline countries that have flown over by aircraft
3841
+	 *
3842
+	 * @return Array the airline country list
3843
+	 *
3844
+	 */
3845 3845
 	public function countAllAirlineCountriesByAircraft($aircraft_icao)
3846 3846
 	{
3847 3847
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -3874,11 +3874,11 @@  discard block
 block discarded – undo
3874 3874
 	
3875 3875
 	
3876 3876
 	/**
3877
-	* Gets all airlines that have flown over by airport
3878
-	*
3879
-	* @return Array the airline list
3880
-	*
3881
-	*/
3877
+	 * Gets all airlines that have flown over by airport
3878
+	 *
3879
+	 * @return Array the airline list
3880
+	 *
3881
+	 */
3882 3882
 	public function countAllAirlinesByAirport($airport_icao)
3883 3883
 	{
3884 3884
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -3910,11 +3910,11 @@  discard block
 block discarded – undo
3910 3910
 
3911 3911
 
3912 3912
 	/**
3913
-	* Gets all airline countries that have flown over by airport icao
3914
-	*
3915
-	* @return Array the airline country list
3916
-	*
3917
-	*/
3913
+	 * Gets all airline countries that have flown over by airport icao
3914
+	 *
3915
+	 * @return Array the airline country list
3916
+	 *
3917
+	 */
3918 3918
 	public function countAllAirlineCountriesByAirport($airport_icao)
3919 3919
 	{
3920 3920
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -3945,11 +3945,11 @@  discard block
 block discarded – undo
3945 3945
 
3946 3946
 
3947 3947
 	/**
3948
-	* Gets all airlines that have flown over by aircraft manufacturer
3949
-	*
3950
-	* @return Array the airline list
3951
-	*
3952
-	*/
3948
+	 * Gets all airlines that have flown over by aircraft manufacturer
3949
+	 *
3950
+	 * @return Array the airline list
3951
+	 *
3952
+	 */
3953 3953
 	public function countAllAirlinesByManufacturer($aircraft_manufacturer)
3954 3954
 	{
3955 3955
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -3981,11 +3981,11 @@  discard block
 block discarded – undo
3981 3981
 
3982 3982
 
3983 3983
 	/**
3984
-	* Gets all airline countries that have flown over by aircraft manufacturer
3985
-	*
3986
-	* @return Array the airline country list
3987
-	*
3988
-	*/
3984
+	 * Gets all airline countries that have flown over by aircraft manufacturer
3985
+	 *
3986
+	 * @return Array the airline country list
3987
+	 *
3988
+	 */
3989 3989
 	public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer)
3990 3990
 	{
3991 3991
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4015,11 +4015,11 @@  discard block
 block discarded – undo
4015 4015
 
4016 4016
 
4017 4017
 	/**
4018
-	* Gets all airlines that have flown over by date
4019
-	*
4020
-	* @return Array the airline list
4021
-	*
4022
-	*/
4018
+	 * Gets all airlines that have flown over by date
4019
+	 *
4020
+	 * @return Array the airline list
4021
+	 *
4022
+	 */
4023 4023
 	public function countAllAirlinesByDate($date)
4024 4024
 	{
4025 4025
 		global $globalTimezone, $globalDBdriver;
@@ -4065,11 +4065,11 @@  discard block
 block discarded – undo
4065 4065
 	
4066 4066
 	
4067 4067
 	/**
4068
-	* Gets all airline countries that have flown over by date
4069
-	*
4070
-	* @return Array the airline country list
4071
-	*
4072
-	*/
4068
+	 * Gets all airline countries that have flown over by date
4069
+	 *
4070
+	 * @return Array the airline country list
4071
+	 *
4072
+	 */
4073 4073
 	public function countAllAirlineCountriesByDate($date)
4074 4074
 	{
4075 4075
 		global $globalTimezone, $globalDBdriver;
@@ -4113,11 +4113,11 @@  discard block
 block discarded – undo
4113 4113
 
4114 4114
 
4115 4115
 	/**
4116
-	* Gets all airlines that have flown over by ident/callsign
4117
-	*
4118
-	* @return Array the airline list
4119
-	*
4120
-	*/
4116
+	 * Gets all airlines that have flown over by ident/callsign
4117
+	 *
4118
+	 * @return Array the airline list
4119
+	 *
4120
+	 */
4121 4121
 	public function countAllAirlinesByIdent($ident)
4122 4122
 	{
4123 4123
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4148,11 +4148,11 @@  discard block
 block discarded – undo
4148 4148
 	}
4149 4149
 
4150 4150
 	/**
4151
-	* Gets all airlines that have flown over by route
4152
-	*
4153
-	* @return Array the airline list
4154
-	*
4155
-	*/
4151
+	 * Gets all airlines that have flown over by route
4152
+	 *
4153
+	 * @return Array the airline list
4154
+	 *
4155
+	 */
4156 4156
 	public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao)
4157 4157
 	{
4158 4158
 		$departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING);
@@ -4184,11 +4184,11 @@  discard block
 block discarded – undo
4184 4184
 	}
4185 4185
 
4186 4186
 	/**
4187
-	* Gets all airline countries that have flown over by route
4188
-	*
4189
-	* @return Array the airline country list
4190
-	*
4191
-	*/
4187
+	 * Gets all airline countries that have flown over by route
4188
+	 *
4189
+	 * @return Array the airline country list
4190
+	 *
4191
+	 */
4192 4192
 	public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao)
4193 4193
 	{
4194 4194
 		$departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING);
@@ -4220,11 +4220,11 @@  discard block
 block discarded – undo
4220 4220
 
4221 4221
 
4222 4222
 	/**
4223
-	* Gets all airlines that have flown over by country
4224
-	*
4225
-	* @return Array the airline list
4226
-	*
4227
-	*/
4223
+	 * Gets all airlines that have flown over by country
4224
+	 *
4225
+	 * @return Array the airline list
4226
+	 *
4227
+	 */
4228 4228
 	public function countAllAirlinesByCountry($country)
4229 4229
 	{
4230 4230
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4255,11 +4255,11 @@  discard block
 block discarded – undo
4255 4255
 
4256 4256
 
4257 4257
 	/**
4258
-	* Gets all airline countries that have flown over by country
4259
-	*
4260
-	* @return Array the airline country list
4261
-	*
4262
-	*/
4258
+	 * Gets all airline countries that have flown over by country
4259
+	 *
4260
+	 * @return Array the airline country list
4261
+	 *
4262
+	 */
4263 4263
 	public function countAllAirlineCountriesByCountry($country)
4264 4264
 	{
4265 4265
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4289,11 +4289,11 @@  discard block
 block discarded – undo
4289 4289
 
4290 4290
 
4291 4291
 	/**
4292
-	* Gets all airlines countries
4293
-	*
4294
-	* @return Array the airline country list
4295
-	*
4296
-	*/
4292
+	 * Gets all airlines countries
4293
+	 *
4294
+	 * @return Array the airline country list
4295
+	 *
4296
+	 */
4297 4297
 	public function countAllAirlineCountries($limit = true)
4298 4298
 	{
4299 4299
 		$query  = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count
@@ -4319,11 +4319,11 @@  discard block
 block discarded – undo
4319 4319
 	}
4320 4320
 
4321 4321
 	/**
4322
-	* Gets all number of flight over countries
4323
-	*
4324
-	* @return Array the airline country list
4325
-	*
4326
-	*/
4322
+	 * Gets all number of flight over countries
4323
+	 *
4324
+	 * @return Array the airline country list
4325
+	 *
4326
+	 */
4327 4327
 	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
4328 4328
 	{
4329 4329
 		global $globalDBdriver;
@@ -4335,15 +4335,15 @@  discard block
 block discarded – undo
4335 4335
 		$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
4336 4336
 					FROM countries c, spotter_live s
4337 4337
 					WHERE c.iso2 = s.over_country ";
4338
-                if ($olderthanmonths > 0) {
4338
+				if ($olderthanmonths > 0) {
4339 4339
 			if ($globalDBdriver == 'mysql') {
4340 4340
 				$query .= 'AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
4341 4341
 			} else {
4342 4342
 				$query .= "AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4343 4343
 			}
4344 4344
 		}
4345
-                if ($sincedate != '') {
4346
-            		if ($globalDBdriver == 'mysql') {
4345
+				if ($sincedate != '') {
4346
+					if ($globalDBdriver == 'mysql') {
4347 4347
 				$query .= "AND spotter_live.date > '".$sincedate."' ";
4348 4348
 			} else {
4349 4349
 				$query .= "AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4373,11 +4373,11 @@  discard block
 block discarded – undo
4373 4373
 	
4374 4374
 	
4375 4375
 	/**
4376
-	* Gets all aircraft types that have flown over
4377
-	*
4378
-	* @return Array the aircraft list
4379
-	*
4380
-	*/
4376
+	 * Gets all aircraft types that have flown over
4377
+	 *
4378
+	 * @return Array the aircraft list
4379
+	 *
4380
+	 */
4381 4381
 	public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4382 4382
 	{
4383 4383
 		global $globalDBdriver;
@@ -4420,11 +4420,11 @@  discard block
 block discarded – undo
4420 4420
 	}
4421 4421
 
4422 4422
 	/**
4423
-	* Gets all aircraft types that have flown over by airline
4424
-	*
4425
-	* @return Array the aircraft list
4426
-	*
4427
-	*/
4423
+	 * Gets all aircraft types that have flown over by airline
4424
+	 *
4425
+	 * @return Array the aircraft list
4426
+	 *
4427
+	 */
4428 4428
 	public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '')
4429 4429
 	{
4430 4430
 		global $globalDBdriver;
@@ -4468,11 +4468,11 @@  discard block
 block discarded – undo
4468 4468
 
4469 4469
 
4470 4470
 	/**
4471
-	* Gets all aircraft registration that have flown over by aircaft icao
4472
-	*
4473
-	* @return Array the aircraft list
4474
-	*
4475
-	*/
4471
+	 * Gets all aircraft registration that have flown over by aircaft icao
4472
+	 *
4473
+	 * @return Array the aircraft list
4474
+	 *
4475
+	 */
4476 4476
 	public function countAllAircraftRegistrationByAircraft($aircraft_icao)
4477 4477
 	{
4478 4478
 		$Image = new Image($this->db);
@@ -4511,11 +4511,11 @@  discard block
 block discarded – undo
4511 4511
 
4512 4512
 
4513 4513
 	/**
4514
-	* Gets all aircraft types that have flown over by airline icao
4515
-	*
4516
-	* @return Array the aircraft list
4517
-	*
4518
-	*/
4514
+	 * Gets all aircraft types that have flown over by airline icao
4515
+	 *
4516
+	 * @return Array the aircraft list
4517
+	 *
4518
+	 */
4519 4519
 	public function countAllAircraftTypesByAirline($airline_icao)
4520 4520
 	{
4521 4521
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -4545,11 +4545,11 @@  discard block
 block discarded – undo
4545 4545
 
4546 4546
 
4547 4547
 	/**
4548
-	* Gets all aircraft registration that have flown over by airline icao
4549
-	*
4550
-	* @return Array the aircraft list
4551
-	*
4552
-	*/
4548
+	 * Gets all aircraft registration that have flown over by airline icao
4549
+	 *
4550
+	 * @return Array the aircraft list
4551
+	 *
4552
+	 */
4553 4553
 	public function countAllAircraftRegistrationByAirline($airline_icao)
4554 4554
 	{
4555 4555
 		$Image = new Image($this->db);
@@ -4587,11 +4587,11 @@  discard block
 block discarded – undo
4587 4587
 
4588 4588
 
4589 4589
 	/**
4590
-	* Gets all aircraft manufacturer that have flown over by airline icao
4591
-	*
4592
-	* @return Array the aircraft list
4593
-	*
4594
-	*/
4590
+	 * Gets all aircraft manufacturer that have flown over by airline icao
4591
+	 *
4592
+	 * @return Array the aircraft list
4593
+	 *
4594
+	 */
4595 4595
 	public function countAllAircraftManufacturerByAirline($airline_icao)
4596 4596
 	{
4597 4597
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -4620,11 +4620,11 @@  discard block
 block discarded – undo
4620 4620
 
4621 4621
 
4622 4622
 	/**
4623
-	* Gets all aircraft types that have flown over by airline icao
4624
-	*
4625
-	* @return Array the aircraft list
4626
-	*
4627
-	*/
4623
+	 * Gets all aircraft types that have flown over by airline icao
4624
+	 *
4625
+	 * @return Array the aircraft list
4626
+	 *
4627
+	 */
4628 4628
 	public function countAllAircraftTypesByAirport($airport_icao)
4629 4629
 	{
4630 4630
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4653,11 +4653,11 @@  discard block
 block discarded – undo
4653 4653
 
4654 4654
 
4655 4655
 	/**
4656
-	* Gets all aircraft registration that have flown over by airport icao
4657
-	*
4658
-	* @return Array the aircraft list
4659
-	*
4660
-	*/
4656
+	 * Gets all aircraft registration that have flown over by airport icao
4657
+	 *
4658
+	 * @return Array the aircraft list
4659
+	 *
4660
+	 */
4661 4661
 	public function countAllAircraftRegistrationByAirport($airport_icao)
4662 4662
 	{
4663 4663
 		$Image = new Image($this->db);
@@ -4695,11 +4695,11 @@  discard block
 block discarded – undo
4695 4695
 	
4696 4696
 	
4697 4697
 	/**
4698
-	* Gets all aircraft manufacturer that have flown over by airport icao
4699
-	*
4700
-	* @return Array the aircraft list
4701
-	*
4702
-	*/
4698
+	 * Gets all aircraft manufacturer that have flown over by airport icao
4699
+	 *
4700
+	 * @return Array the aircraft list
4701
+	 *
4702
+	 */
4703 4703
 	public function countAllAircraftManufacturerByAirport($airport_icao)
4704 4704
 	{
4705 4705
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4726,11 +4726,11 @@  discard block
 block discarded – undo
4726 4726
 	}
4727 4727
 
4728 4728
 	/**
4729
-	* Gets all aircraft types that have flown over by aircraft manufacturer
4730
-	*
4731
-	* @return Array the aircraft list
4732
-	*
4733
-	*/
4729
+	 * Gets all aircraft types that have flown over by aircraft manufacturer
4730
+	 *
4731
+	 * @return Array the aircraft list
4732
+	 *
4733
+	 */
4734 4734
 	public function countAllAircraftTypesByManufacturer($aircraft_manufacturer)
4735 4735
 	{
4736 4736
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4757,11 +4757,11 @@  discard block
 block discarded – undo
4757 4757
 
4758 4758
 
4759 4759
 	/**
4760
-	* Gets all aircraft registration that have flown over by aircaft manufacturer
4761
-	*
4762
-	* @return Array the aircraft list
4763
-	*
4764
-	*/
4760
+	 * Gets all aircraft registration that have flown over by aircaft manufacturer
4761
+	 *
4762
+	 * @return Array the aircraft list
4763
+	 *
4764
+	 */
4765 4765
 	public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer)
4766 4766
 	{
4767 4767
 		$Image = new Image($this->db);
@@ -4797,11 +4797,11 @@  discard block
 block discarded – undo
4797 4797
 	}
4798 4798
 
4799 4799
 	/**
4800
-	* Gets all aircraft types that have flown over by date
4801
-	*
4802
-	* @return Array the aircraft list
4803
-	*
4804
-	*/
4800
+	 * Gets all aircraft types that have flown over by date
4801
+	 *
4802
+	 * @return Array the aircraft list
4803
+	 *
4804
+	 */
4805 4805
 	public function countAllAircraftTypesByDate($date)
4806 4806
 	{
4807 4807
 		global $globalTimezone, $globalDBdriver;
@@ -4844,11 +4844,11 @@  discard block
 block discarded – undo
4844 4844
 
4845 4845
 
4846 4846
 	/**
4847
-	* Gets all aircraft registration that have flown over by date
4848
-	*
4849
-	* @return Array the aircraft list
4850
-	*
4851
-	*/
4847
+	 * Gets all aircraft registration that have flown over by date
4848
+	 *
4849
+	 * @return Array the aircraft list
4850
+	 *
4851
+	 */
4852 4852
 	public function countAllAircraftRegistrationByDate($date)
4853 4853
 	{
4854 4854
 		global $globalTimezone, $globalDBdriver;
@@ -4900,11 +4900,11 @@  discard block
 block discarded – undo
4900 4900
 
4901 4901
 
4902 4902
 	/**
4903
-	* Gets all aircraft manufacturer that have flown over by date
4904
-	*
4905
-	* @return Array the aircraft manufacturer list
4906
-	*
4907
-	*/
4903
+	 * Gets all aircraft manufacturer that have flown over by date
4904
+	 *
4905
+	 * @return Array the aircraft manufacturer list
4906
+	 *
4907
+	 */
4908 4908
 	public function countAllAircraftManufacturerByDate($date)
4909 4909
 	{
4910 4910
 		global $globalTimezone, $globalDBdriver;
@@ -4947,11 +4947,11 @@  discard block
 block discarded – undo
4947 4947
 
4948 4948
 
4949 4949
 	/**
4950
-	* Gets all aircraft types that have flown over by ident/callsign
4951
-	*
4952
-	* @return Array the aircraft list
4953
-	*
4954
-	*/
4950
+	 * Gets all aircraft types that have flown over by ident/callsign
4951
+	 *
4952
+	 * @return Array the aircraft list
4953
+	 *
4954
+	 */
4955 4955
 	public function countAllAircraftTypesByIdent($ident)
4956 4956
 	{
4957 4957
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4981,11 +4981,11 @@  discard block
 block discarded – undo
4981 4981
 
4982 4982
 
4983 4983
 	/**
4984
-	* Gets all aircraft registration that have flown over by ident/callsign
4985
-	*
4986
-	* @return Array the aircraft list
4987
-	*
4988
-	*/
4984
+	 * Gets all aircraft registration that have flown over by ident/callsign
4985
+	 *
4986
+	 * @return Array the aircraft list
4987
+	 *
4988
+	 */
4989 4989
 	public function countAllAircraftRegistrationByIdent($ident)
4990 4990
 	{
4991 4991
 		$Image = new Image($this->db);
@@ -5025,11 +5025,11 @@  discard block
 block discarded – undo
5025 5025
 
5026 5026
 
5027 5027
 	/**
5028
-	* Gets all aircraft manufacturer that have flown over by ident/callsign
5029
-	*
5030
-	* @return Array the aircraft manufacturer list
5031
-	*
5032
-	*/
5028
+	 * Gets all aircraft manufacturer that have flown over by ident/callsign
5029
+	 *
5030
+	 * @return Array the aircraft manufacturer list
5031
+	 *
5032
+	 */
5033 5033
 	public function countAllAircraftManufacturerByIdent($ident)
5034 5034
 	{
5035 5035
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -5056,11 +5056,11 @@  discard block
 block discarded – undo
5056 5056
 
5057 5057
 
5058 5058
 	/**
5059
-	* Gets all aircraft types that have flown over by route
5060
-	*
5061
-	* @return Array the aircraft list
5062
-	*
5063
-	*/
5059
+	 * Gets all aircraft types that have flown over by route
5060
+	 *
5061
+	 * @return Array the aircraft list
5062
+	 *
5063
+	 */
5064 5064
 	public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao)
5065 5065
 	{
5066 5066
 		$departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING);
@@ -5089,11 +5089,11 @@  discard block
 block discarded – undo
5089 5089
 	}
5090 5090
 
5091 5091
 	/**
5092
-	* Gets all aircraft registration that have flown over by route
5093
-	*
5094
-	* @return Array the aircraft list
5095
-	*
5096
-	*/
5092
+	 * Gets all aircraft registration that have flown over by route
5093
+	 *
5094
+	 * @return Array the aircraft list
5095
+	 *
5096
+	 */
5097 5097
 	public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao)
5098 5098
 	{
5099 5099
 		$Image = new Image($this->db);
@@ -5135,11 +5135,11 @@  discard block
 block discarded – undo
5135 5135
 	
5136 5136
 	
5137 5137
 	/**
5138
-	* Gets all aircraft manufacturer that have flown over by route
5139
-	*
5140
-	* @return Array the aircraft manufacturer list
5141
-	*
5142
-	*/
5138
+	 * Gets all aircraft manufacturer that have flown over by route
5139
+	 *
5140
+	 * @return Array the aircraft manufacturer list
5141
+	 *
5142
+	 */
5143 5143
 	public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao)
5144 5144
 	{
5145 5145
 		$departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING);
@@ -5173,11 +5173,11 @@  discard block
 block discarded – undo
5173 5173
 	
5174 5174
 	
5175 5175
 	/**
5176
-	* Gets all aircraft types that have flown over by country
5177
-	*
5178
-	* @return Array the aircraft list
5179
-	*
5180
-	*/
5176
+	 * Gets all aircraft types that have flown over by country
5177
+	 *
5178
+	 * @return Array the aircraft list
5179
+	 *
5180
+	 */
5181 5181
 	public function countAllAircraftTypesByCountry($country)
5182 5182
 	{
5183 5183
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -5209,11 +5209,11 @@  discard block
 block discarded – undo
5209 5209
 
5210 5210
 
5211 5211
 	/**
5212
-	* Gets all aircraft registration that have flown over by country
5213
-	*
5214
-	* @return Array the aircraft list
5215
-	*
5216
-	*/
5212
+	 * Gets all aircraft registration that have flown over by country
5213
+	 *
5214
+	 * @return Array the aircraft list
5215
+	 *
5216
+	 */
5217 5217
 	public function countAllAircraftRegistrationByCountry($country)
5218 5218
 	{
5219 5219
 		$Image = new Image($this->db);
@@ -5254,11 +5254,11 @@  discard block
 block discarded – undo
5254 5254
 	
5255 5255
 	
5256 5256
 	/**
5257
-	* Gets all aircraft manufacturer that have flown over by country
5258
-	*
5259
-	* @return Array the aircraft manufacturer list
5260
-	*
5261
-	*/
5257
+	 * Gets all aircraft manufacturer that have flown over by country
5258
+	 *
5259
+	 * @return Array the aircraft manufacturer list
5260
+	 *
5261
+	 */
5262 5262
 	public function countAllAircraftManufacturerByCountry($country)
5263 5263
 	{
5264 5264
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -5290,17 +5290,17 @@  discard block
 block discarded – undo
5290 5290
 	
5291 5291
 	
5292 5292
 	/**
5293
-	* Gets all aircraft manufacturers that have flown over
5294
-	*
5295
-	* @return Array the aircraft list
5296
-	*
5297
-	*/
5293
+	 * Gets all aircraft manufacturers that have flown over
5294
+	 *
5295
+	 * @return Array the aircraft list
5296
+	 *
5297
+	 */
5298 5298
 	public function countAllAircraftManufacturers($filter = array())
5299 5299
 	{
5300 5300
 		$filter_query = $this->getFilter($filter,true,true);
5301 5301
 		$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
5302 5302
                     FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'";
5303
-                $query .= " GROUP BY spotter_output.aircraft_manufacturer
5303
+				$query .= " GROUP BY spotter_output.aircraft_manufacturer
5304 5304
 					ORDER BY aircraft_manufacturer_count DESC
5305 5305
 					LIMIT 10";
5306 5306
       
@@ -5325,11 +5325,11 @@  discard block
 block discarded – undo
5325 5325
 	
5326 5326
 	
5327 5327
 	/**
5328
-	* Gets all aircraft registrations that have flown over
5329
-	*
5330
-	* @return Array the aircraft list
5331
-	*
5332
-	*/
5328
+	 * Gets all aircraft registrations that have flown over
5329
+	 *
5330
+	 * @return Array the aircraft list
5331
+	 *
5332
+	 */
5333 5333
 	public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5334 5334
 	{
5335 5335
 		global $globalDBdriver;
@@ -5337,15 +5337,15 @@  discard block
 block discarded – undo
5337 5337
 		$filter_query = $this->getFilter($filters,true,true);
5338 5338
 		$query  = "SELECT DISTINCT spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao,  spotter_output.aircraft_name, spotter_output.airline_name    
5339 5339
                     FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'";
5340
-                if ($olderthanmonths > 0) {
5341
-            		if ($globalDBdriver == 'mysql') {
5340
+				if ($olderthanmonths > 0) {
5341
+					if ($globalDBdriver == 'mysql') {
5342 5342
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5343 5343
 			} else {
5344 5344
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5345 5345
 			}
5346 5346
 		}
5347
-                if ($sincedate != '') {
5348
-            		if ($globalDBdriver == 'mysql') {
5347
+				if ($sincedate != '') {
5348
+					if ($globalDBdriver == 'mysql') {
5349 5349
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5350 5350
 			} else {
5351 5351
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -5354,7 +5354,7 @@  discard block
 block discarded – undo
5354 5354
 
5355 5355
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5356 5356
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5357
-                $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5357
+				$query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5358 5358
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5359 5359
 		
5360 5360
 		$sth = $this->db->prepare($query);
@@ -5385,11 +5385,11 @@  discard block
 block discarded – undo
5385 5385
 
5386 5386
 
5387 5387
 	/**
5388
-	* Gets all aircraft registrations that have flown over
5389
-	*
5390
-	* @return Array the aircraft list
5391
-	*
5392
-	*/
5388
+	 * Gets all aircraft registrations that have flown over
5389
+	 *
5390
+	 * @return Array the aircraft list
5391
+	 *
5392
+	 */
5393 5393
 	public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '')
5394 5394
 	{
5395 5395
 		global $globalDBdriver;
@@ -5397,15 +5397,15 @@  discard block
 block discarded – undo
5397 5397
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao,  spotter_output.aircraft_name, spotter_output.airline_name    
5398 5398
                     FROM spotter_output 
5399 5399
                     WHERE spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' ";
5400
-                if ($olderthanmonths > 0) {
5401
-            		if ($globalDBdriver == 'mysql') {
5400
+				if ($olderthanmonths > 0) {
5401
+					if ($globalDBdriver == 'mysql') {
5402 5402
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5403 5403
 			} else {
5404 5404
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5405 5405
 			}
5406 5406
 		}
5407
-                if ($sincedate != '') {
5408
-            		if ($globalDBdriver == 'mysql') {
5407
+				if ($sincedate != '') {
5408
+					if ($globalDBdriver == 'mysql') {
5409 5409
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5410 5410
 			} else {
5411 5411
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -5414,7 +5414,7 @@  discard block
 block discarded – undo
5414 5414
 
5415 5415
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5416 5416
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5417
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5417
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5418 5418
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5419 5419
 		
5420 5420
 		$sth = $this->db->prepare($query);
@@ -5446,35 +5446,35 @@  discard block
 block discarded – undo
5446 5446
 	
5447 5447
 	
5448 5448
 	/**
5449
-	* Gets all departure airports of the airplanes that have flown over
5450
-	*
5451
-	* @return Array the airport list
5452
-	*
5453
-	*/
5449
+	 * Gets all departure airports of the airplanes that have flown over
5450
+	 *
5451
+	 * @return Array the airport list
5452
+	 *
5453
+	 */
5454 5454
 	public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5455 5455
 	{
5456 5456
 		global $globalDBdriver;
5457 5457
 		$filter_query = $this->getFilter($filters,true,true);
5458 5458
 		$query  = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country 
5459 5459
 				FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA'";
5460
-                if ($olderthanmonths > 0) {
5461
-            		if ($globalDBdriver == 'mysql') {
5460
+				if ($olderthanmonths > 0) {
5461
+					if ($globalDBdriver == 'mysql') {
5462 5462
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5463 5463
 			} else {
5464 5464
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5465 5465
 			}
5466
-                }
5467
-                if ($sincedate != '') {
5468
-            		if ($globalDBdriver == 'mysql') {
5466
+				}
5467
+				if ($sincedate != '') {
5468
+					if ($globalDBdriver == 'mysql') {
5469 5469
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5470 5470
 			} else {
5471 5471
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5472 5472
 			}
5473 5473
 		}
5474 5474
 
5475
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5476
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5477
-                $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5475
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5476
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5477
+				$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5478 5478
 				ORDER BY airport_departure_icao_count DESC";
5479 5479
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5480 5480
       
@@ -5498,35 +5498,35 @@  discard block
 block discarded – undo
5498 5498
 	}
5499 5499
 
5500 5500
 	/**
5501
-	* Gets all departure airports of the airplanes that have flown over
5502
-	*
5503
-	* @return Array the airport list
5504
-	*
5505
-	*/
5501
+	 * Gets all departure airports of the airplanes that have flown over
5502
+	 *
5503
+	 * @return Array the airport list
5504
+	 *
5505
+	 */
5506 5506
 	public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
5507 5507
 	{
5508 5508
 		global $globalDBdriver;
5509 5509
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country 
5510 5510
 								FROM spotter_output
5511 5511
                     WHERE spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' ";
5512
-                if ($olderthanmonths > 0) {
5513
-            		if ($globalDBdriver == 'mysql') {
5512
+				if ($olderthanmonths > 0) {
5513
+					if ($globalDBdriver == 'mysql') {
5514 5514
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5515 5515
 			} else {
5516 5516
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5517 5517
 			}
5518
-                }
5519
-                if ($sincedate != '') {
5520
-            		if ($globalDBdriver == 'mysql') {
5518
+				}
5519
+				if ($sincedate != '') {
5520
+					if ($globalDBdriver == 'mysql') {
5521 5521
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5522 5522
 			} else {
5523 5523
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5524 5524
 			}
5525 5525
 		}
5526 5526
 
5527
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5528
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5529
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5527
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5528
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5529
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5530 5530
 				ORDER BY airport_departure_icao_count DESC";
5531 5531
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5532 5532
       
@@ -5551,34 +5551,34 @@  discard block
 block discarded – undo
5551 5551
 	}
5552 5552
 
5553 5553
 	/**
5554
-	* Gets all detected departure airports of the airplanes that have flown over
5555
-	*
5556
-	* @return Array the airport list
5557
-	*
5558
-	*/
5554
+	 * Gets all detected departure airports of the airplanes that have flown over
5555
+	 *
5556
+	 * @return Array the airport list
5557
+	 *
5558
+	 */
5559 5559
 	public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5560 5560
 	{
5561 5561
 		global $globalDBdriver;
5562 5562
 		$filter_query = $this->getFilter($filters,true,true);
5563 5563
 		$query  = "SELECT DISTINCT spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country
5564 5564
 				FROM spotter_output, airport".$filter_query." spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao";
5565
-                if ($olderthanmonths > 0) {
5566
-            		if ($globalDBdriver == 'mysql') {
5565
+				if ($olderthanmonths > 0) {
5566
+					if ($globalDBdriver == 'mysql') {
5567 5567
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5568 5568
 			} else {
5569 5569
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5570 5570
 			}
5571
-                }
5572
-                if ($sincedate != '') {
5573
-            		if ($globalDBdriver == 'mysql') {
5571
+				}
5572
+				if ($sincedate != '') {
5573
+					if ($globalDBdriver == 'mysql') {
5574 5574
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5575 5575
 			} else {
5576 5576
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5577 5577
 			}
5578 5578
 		}
5579
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5580
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5581
-                $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5579
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5580
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5581
+				$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5582 5582
 				ORDER BY airport_departure_icao_count DESC";
5583 5583
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5584 5584
       
@@ -5602,35 +5602,35 @@  discard block
 block discarded – undo
5602 5602
 	}
5603 5603
 	
5604 5604
 	/**
5605
-	* Gets all detected departure airports of the airplanes that have flown over
5606
-	*
5607
-	* @return Array the airport list
5608
-	*
5609
-	*/
5605
+	 * Gets all detected departure airports of the airplanes that have flown over
5606
+	 *
5607
+	 * @return Array the airport list
5608
+	 *
5609
+	 */
5610 5610
 	public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
5611 5611
 	{
5612 5612
 		global $globalDBdriver;
5613 5613
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country
5614 5614
 				FROM spotter_output, airport
5615 5615
                     WHERE spotter_output.airline_icao <> '' AND spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao ";
5616
-                if ($olderthanmonths > 0) {
5617
-            		if ($globalDBdriver == 'mysql') {
5616
+				if ($olderthanmonths > 0) {
5617
+					if ($globalDBdriver == 'mysql') {
5618 5618
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5619 5619
 			} else {
5620 5620
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5621 5621
 			}
5622
-                }
5623
-                if ($sincedate != '') {
5624
-            		if ($globalDBdriver == 'mysql') {
5622
+				}
5623
+				if ($sincedate != '') {
5624
+					if ($globalDBdriver == 'mysql') {
5625 5625
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5626 5626
 			} else {
5627 5627
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
5628 5628
 			}
5629 5629
 		}
5630 5630
 
5631
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5632
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5633
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5631
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5632
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5633
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5634 5634
 				ORDER BY airport_departure_icao_count DESC";
5635 5635
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5636 5636
       
@@ -5655,11 +5655,11 @@  discard block
 block discarded – undo
5655 5655
 	}	
5656 5656
 	
5657 5657
 	/**
5658
-	* Gets all departure airports of the airplanes that have flown over based on an airline icao
5659
-	*
5660
-	* @return Array the airport list
5661
-	*
5662
-	*/
5658
+	 * Gets all departure airports of the airplanes that have flown over based on an airline icao
5659
+	 *
5660
+	 * @return Array the airport list
5661
+	 *
5662
+	 */
5663 5663
 	public function countAllDepartureAirportsByAirline($airline_icao)
5664 5664
 	{
5665 5665
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -5694,11 +5694,11 @@  discard block
 block discarded – undo
5694 5694
 	
5695 5695
 	
5696 5696
 	/**
5697
-	* Gets all departure airports by country of the airplanes that have flown over based on an airline icao
5698
-	*
5699
-	* @return Array the airport list
5700
-	*
5701
-	*/
5697
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airline icao
5698
+	 *
5699
+	 * @return Array the airport list
5700
+	 *
5701
+	 */
5702 5702
 	public function countAllDepartureAirportCountriesByAirline($airline_icao)
5703 5703
 	{
5704 5704
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -5730,11 +5730,11 @@  discard block
 block discarded – undo
5730 5730
 	
5731 5731
 	
5732 5732
 	/**
5733
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft icao
5734
-	*
5735
-	* @return Array the airport list
5736
-	*
5737
-	*/
5733
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft icao
5734
+	 *
5735
+	 * @return Array the airport list
5736
+	 *
5737
+	 */
5738 5738
 	public function countAllDepartureAirportsByAircraft($aircraft_icao)
5739 5739
 	{
5740 5740
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -5768,11 +5768,11 @@  discard block
 block discarded – undo
5768 5768
 	
5769 5769
 	
5770 5770
 	/**
5771
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
5772
-	*
5773
-	* @return Array the airport list
5774
-	*
5775
-	*/
5771
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
5772
+	 *
5773
+	 * @return Array the airport list
5774
+	 *
5775
+	 */
5776 5776
 	public function countAllDepartureAirportCountriesByAircraft($aircraft_icao)
5777 5777
 	{
5778 5778
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -5803,11 +5803,11 @@  discard block
 block discarded – undo
5803 5803
 	
5804 5804
 	
5805 5805
 	/**
5806
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft registration
5807
-	*
5808
-	* @return Array the airport list
5809
-	*
5810
-	*/
5806
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft registration
5807
+	 *
5808
+	 * @return Array the airport list
5809
+	 *
5810
+	 */
5811 5811
 	public function countAllDepartureAirportsByRegistration($registration)
5812 5812
 	{
5813 5813
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -5841,11 +5841,11 @@  discard block
 block discarded – undo
5841 5841
 	
5842 5842
 	
5843 5843
 	/**
5844
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
5845
-	*
5846
-	* @return Array the airport list
5847
-	*
5848
-	*/
5844
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
5845
+	 *
5846
+	 * @return Array the airport list
5847
+	 *
5848
+	 */
5849 5849
 	public function countAllDepartureAirportCountriesByRegistration($registration)
5850 5850
 	{
5851 5851
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -5876,11 +5876,11 @@  discard block
 block discarded – undo
5876 5876
 	
5877 5877
 	
5878 5878
 	/**
5879
-	* Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
5880
-	*
5881
-	* @return Array the airport list
5882
-	*
5883
-	*/
5879
+	 * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
5880
+	 *
5881
+	 * @return Array the airport list
5882
+	 *
5883
+	 */
5884 5884
 	public function countAllDepartureAirportsByAirport($airport_icao)
5885 5885
 	{
5886 5886
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -5914,11 +5914,11 @@  discard block
 block discarded – undo
5914 5914
 	
5915 5915
 	
5916 5916
 	/**
5917
-	* Gets all departure airports by country of the airplanes that have flown over based on an airport icao
5918
-	*
5919
-	* @return Array the airport list
5920
-	*
5921
-	*/
5917
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airport icao
5918
+	 *
5919
+	 * @return Array the airport list
5920
+	 *
5921
+	 */
5922 5922
 	public function countAllDepartureAirportCountriesByAirport($airport_icao)
5923 5923
 	{
5924 5924
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -5950,11 +5950,11 @@  discard block
 block discarded – undo
5950 5950
 	
5951 5951
 	
5952 5952
 	/**
5953
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
5954
-	*
5955
-	* @return Array the airport list
5956
-	*
5957
-	*/
5953
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
5954
+	 *
5955
+	 * @return Array the airport list
5956
+	 *
5957
+	 */
5958 5958
 	public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer)
5959 5959
 	{
5960 5960
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -5988,11 +5988,11 @@  discard block
 block discarded – undo
5988 5988
 	
5989 5989
 	
5990 5990
 	/**
5991
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
5992
-	*
5993
-	* @return Array the airport list
5994
-	*
5995
-	*/
5991
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
5992
+	 *
5993
+	 * @return Array the airport list
5994
+	 *
5995
+	 */
5996 5996
 	public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer)
5997 5997
 	{
5998 5998
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -6023,11 +6023,11 @@  discard block
 block discarded – undo
6023 6023
 	
6024 6024
 	
6025 6025
 	/**
6026
-	* Gets all departure airports of the airplanes that have flown over based on a date
6027
-	*
6028
-	* @return Array the airport list
6029
-	*
6030
-	*/
6026
+	 * Gets all departure airports of the airplanes that have flown over based on a date
6027
+	 *
6028
+	 * @return Array the airport list
6029
+	 *
6030
+	 */
6031 6031
 	public function countAllDepartureAirportsByDate($date)
6032 6032
 	{
6033 6033
 		global $globalTimezone, $globalDBdriver;
@@ -6075,11 +6075,11 @@  discard block
 block discarded – undo
6075 6075
 	
6076 6076
 	
6077 6077
 	/**
6078
-	* Gets all departure airports by country of the airplanes that have flown over based on a date
6079
-	*
6080
-	* @return Array the airport list
6081
-	*
6082
-	*/
6078
+	 * Gets all departure airports by country of the airplanes that have flown over based on a date
6079
+	 *
6080
+	 * @return Array the airport list
6081
+	 *
6082
+	 */
6083 6083
 	public function countAllDepartureAirportCountriesByDate($date)
6084 6084
 	{
6085 6085
 		global $globalTimezone, $globalDBdriver;
@@ -6123,11 +6123,11 @@  discard block
 block discarded – undo
6123 6123
 	
6124 6124
 	
6125 6125
 	/**
6126
-	* Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6127
-	*
6128
-	* @return Array the airport list
6129
-	*
6130
-	*/
6126
+	 * Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6127
+	 *
6128
+	 * @return Array the airport list
6129
+	 *
6130
+	 */
6131 6131
 	public function countAllDepartureAirportsByIdent($ident)
6132 6132
 	{
6133 6133
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -6162,11 +6162,11 @@  discard block
 block discarded – undo
6162 6162
 	
6163 6163
 	
6164 6164
 	/**
6165
-	* Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
6166
-	*
6167
-	* @return Array the airport list
6168
-	*
6169
-	*/
6165
+	 * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
6166
+	 *
6167
+	 * @return Array the airport list
6168
+	 *
6169
+	 */
6170 6170
 	public function countAllDepartureAirportCountriesByIdent($ident)
6171 6171
 	{
6172 6172
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -6198,11 +6198,11 @@  discard block
 block discarded – undo
6198 6198
 	
6199 6199
 	
6200 6200
 	/**
6201
-	* Gets all departure airports of the airplanes that have flown over based on a country
6202
-	*
6203
-	* @return Array the airport list
6204
-	*
6205
-	*/
6201
+	 * Gets all departure airports of the airplanes that have flown over based on a country
6202
+	 *
6203
+	 * @return Array the airport list
6204
+	 *
6205
+	 */
6206 6206
 	public function countAllDepartureAirportsByCountry($country)
6207 6207
 	{
6208 6208
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -6236,11 +6236,11 @@  discard block
 block discarded – undo
6236 6236
 
6237 6237
 
6238 6238
 	/**
6239
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6240
-	*
6241
-	* @return Array the airport list
6242
-	*
6243
-	*/
6239
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6240
+	 *
6241
+	 * @return Array the airport list
6242
+	 *
6243
+	 */
6244 6244
 	public function countAllDepartureAirportCountriesByCountry($country)
6245 6245
 	{
6246 6246
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -6271,40 +6271,40 @@  discard block
 block discarded – undo
6271 6271
 	
6272 6272
 
6273 6273
 	/**
6274
-	* Gets all arrival airports of the airplanes that have flown over
6275
-	*
6276
-	* @return Array the airport list
6277
-	*
6278
-	*/
6274
+	 * Gets all arrival airports of the airplanes that have flown over
6275
+	 *
6276
+	 * @return Array the airport list
6277
+	 *
6278
+	 */
6279 6279
 	public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
6280 6280
 	{
6281 6281
 		global $globalDBdriver;
6282 6282
 		$filter_query = $this->getFilter($filters,true,true);
6283 6283
 		$query  = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country 
6284 6284
 				FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA'";
6285
-                if ($olderthanmonths > 0) {
6286
-            		if ($globalDBdriver == 'mysql') {
6285
+				if ($olderthanmonths > 0) {
6286
+					if ($globalDBdriver == 'mysql') {
6287 6287
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6288 6288
 			} else {
6289 6289
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6290 6290
 			}
6291
-                if ($sincedate != '') {
6292
-            		if ($globalDBdriver == 'mysql') {
6291
+				if ($sincedate != '') {
6292
+					if ($globalDBdriver == 'mysql') {
6293 6293
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6294 6294
 			} else {
6295 6295
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6296 6296
 			}
6297 6297
 		}
6298
-            		if ($globalDBdriver == 'mysql') {
6298
+					if ($globalDBdriver == 'mysql') {
6299 6299
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6300 6300
 			} else {
6301 6301
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6302 6302
 			}
6303 6303
 		}
6304 6304
 
6305
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6306
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6307
-                $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6305
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6306
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6307
+				$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6308 6308
 					ORDER BY airport_arrival_icao_count DESC";
6309 6309
 		if ($limit) $query .= " LIMIT 10";
6310 6310
       
@@ -6333,40 +6333,40 @@  discard block
 block discarded – undo
6333 6333
 	}
6334 6334
 
6335 6335
 	/**
6336
-	* Gets all arrival airports of the airplanes that have flown over
6337
-	*
6338
-	* @return Array the airport list
6339
-	*
6340
-	*/
6336
+	 * Gets all arrival airports of the airplanes that have flown over
6337
+	 *
6338
+	 * @return Array the airport list
6339
+	 *
6340
+	 */
6341 6341
 	public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false)
6342 6342
 	{
6343 6343
 		global $globalDBdriver;
6344 6344
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country 
6345 6345
 								FROM spotter_output 
6346 6346
                     WHERE spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' ";
6347
-                if ($olderthanmonths > 0) {
6348
-            		if ($globalDBdriver == 'mysql') {
6347
+				if ($olderthanmonths > 0) {
6348
+					if ($globalDBdriver == 'mysql') {
6349 6349
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6350 6350
 			} else {
6351 6351
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6352 6352
 			}
6353
-                if ($sincedate != '') {
6354
-            		if ($globalDBdriver == 'mysql') {
6353
+				if ($sincedate != '') {
6354
+					if ($globalDBdriver == 'mysql') {
6355 6355
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6356 6356
 			} else {
6357 6357
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6358 6358
 			}
6359 6359
 		}
6360
-            		if ($globalDBdriver == 'mysql') {
6360
+					if ($globalDBdriver == 'mysql') {
6361 6361
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6362 6362
 			} else {
6363 6363
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6364 6364
 			}
6365 6365
 		}
6366 6366
 
6367
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6368
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6369
-                $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6367
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6368
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6369
+				$query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6370 6370
 					ORDER BY airport_arrival_icao_count DESC";
6371 6371
 		if ($limit) $query .= " LIMIT 10";
6372 6372
       
@@ -6397,39 +6397,39 @@  discard block
 block discarded – undo
6397 6397
 
6398 6398
 
6399 6399
 	/**
6400
-	* Gets all detected arrival airports of the airplanes that have flown over
6401
-	*
6402
-	* @return Array the airport list
6403
-	*
6404
-	*/
6400
+	 * Gets all detected arrival airports of the airplanes that have flown over
6401
+	 *
6402
+	 * @return Array the airport list
6403
+	 *
6404
+	 */
6405 6405
 	public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
6406 6406
 	{
6407 6407
 		global $globalDBdriver;
6408 6408
 		$filter_query = $this->getFilter($filters,true,true);
6409 6409
 		$query  = "SELECT DISTINCT spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country 
6410 6410
 			FROM spotter_output, airport".$filter_query." spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao";
6411
-                if ($olderthanmonths > 0) {
6412
-            		if ($globalDBdriver == 'mysql') {
6411
+				if ($olderthanmonths > 0) {
6412
+					if ($globalDBdriver == 'mysql') {
6413 6413
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6414 6414
 			} else {
6415 6415
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6416 6416
 			}
6417
-                if ($sincedate != '') {
6418
-            		if ($globalDBdriver == 'mysql') {
6417
+				if ($sincedate != '') {
6418
+					if ($globalDBdriver == 'mysql') {
6419 6419
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6420 6420
 			} else {
6421 6421
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6422 6422
 			}
6423 6423
 		}
6424
-            		if ($globalDBdriver == 'mysql') {
6424
+					if ($globalDBdriver == 'mysql') {
6425 6425
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6426 6426
 			} else {
6427 6427
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6428 6428
 			}
6429 6429
 		}
6430
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6431
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6432
-                $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6430
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6431
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6432
+				$query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6433 6433
 					ORDER BY airport_arrival_icao_count DESC";
6434 6434
 		if ($limit) $query .= " LIMIT 10";
6435 6435
       
@@ -6458,40 +6458,40 @@  discard block
 block discarded – undo
6458 6458
 	}
6459 6459
 	
6460 6460
 	/**
6461
-	* Gets all detected arrival airports of the airplanes that have flown over
6462
-	*
6463
-	* @return Array the airport list
6464
-	*
6465
-	*/
6461
+	 * Gets all detected arrival airports of the airplanes that have flown over
6462
+	 *
6463
+	 * @return Array the airport list
6464
+	 *
6465
+	 */
6466 6466
 	public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false)
6467 6467
 	{
6468 6468
 		global $globalDBdriver;
6469 6469
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country 
6470 6470
 			FROM spotter_output, airport 
6471 6471
                     WHERE spotter_output.airline_icao <> '' AND spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao ";
6472
-                if ($olderthanmonths > 0) {
6473
-            		if ($globalDBdriver == 'mysql') {
6472
+				if ($olderthanmonths > 0) {
6473
+					if ($globalDBdriver == 'mysql') {
6474 6474
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6475 6475
 			} else {
6476 6476
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6477 6477
 			}
6478
-                if ($sincedate != '') {
6479
-            		if ($globalDBdriver == 'mysql') {
6478
+				if ($sincedate != '') {
6479
+					if ($globalDBdriver == 'mysql') {
6480 6480
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6481 6481
 			} else {
6482 6482
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6483 6483
 			}
6484 6484
 		}
6485
-            		if ($globalDBdriver == 'mysql') {
6485
+					if ($globalDBdriver == 'mysql') {
6486 6486
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6487 6487
 			} else {
6488 6488
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6489 6489
 			}
6490 6490
 		}
6491 6491
 
6492
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6493
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6494
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6492
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6493
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6494
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6495 6495
 					ORDER BY airport_arrival_icao_count DESC";
6496 6496
 		if ($limit) $query .= " LIMIT 10";
6497 6497
       
@@ -6521,11 +6521,11 @@  discard block
 block discarded – undo
6521 6521
 	}	
6522 6522
 	
6523 6523
 	/**
6524
-	* Gets all arrival airports of the airplanes that have flown over based on an airline icao
6525
-	*
6526
-	* @return Array the airport list
6527
-	*
6528
-	*/
6524
+	 * Gets all arrival airports of the airplanes that have flown over based on an airline icao
6525
+	 *
6526
+	 * @return Array the airport list
6527
+	 *
6528
+	 */
6529 6529
 	public function countAllArrivalAirportsByAirline($airline_icao)
6530 6530
 	{
6531 6531
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -6559,11 +6559,11 @@  discard block
 block discarded – undo
6559 6559
 	
6560 6560
 	
6561 6561
 	/**
6562
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
6563
-	*
6564
-	* @return Array the airport list
6565
-	*
6566
-	*/
6562
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
6563
+	 *
6564
+	 * @return Array the airport list
6565
+	 *
6566
+	 */
6567 6567
 	public function countAllArrivalAirportCountriesByAirline($airline_icao)
6568 6568
 	{
6569 6569
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -6594,11 +6594,11 @@  discard block
 block discarded – undo
6594 6594
 	
6595 6595
 	
6596 6596
 	/**
6597
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
6598
-	*
6599
-	* @return Array the airport list
6600
-	*
6601
-	*/
6597
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
6598
+	 *
6599
+	 * @return Array the airport list
6600
+	 *
6601
+	 */
6602 6602
 	public function countAllArrivalAirportsByAircraft($aircraft_icao)
6603 6603
 	{
6604 6604
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -6633,11 +6633,11 @@  discard block
 block discarded – undo
6633 6633
 	
6634 6634
 	
6635 6635
 	/**
6636
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
6637
-	*
6638
-	* @return Array the airport list
6639
-	*
6640
-	*/
6636
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
6637
+	 *
6638
+	 * @return Array the airport list
6639
+	 *
6640
+	 */
6641 6641
 	public function countAllArrivalAirportCountriesByAircraft($aircraft_icao)
6642 6642
 	{
6643 6643
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -6668,11 +6668,11 @@  discard block
 block discarded – undo
6668 6668
 	
6669 6669
 	
6670 6670
 	/**
6671
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
6672
-	*
6673
-	* @return Array the airport list
6674
-	*
6675
-	*/
6671
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
6672
+	 *
6673
+	 * @return Array the airport list
6674
+	 *
6675
+	 */
6676 6676
 	public function countAllArrivalAirportsByRegistration($registration)
6677 6677
 	{
6678 6678
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -6706,11 +6706,11 @@  discard block
 block discarded – undo
6706 6706
 	
6707 6707
 	
6708 6708
 	/**
6709
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
6710
-	*
6711
-	* @return Array the airport list
6712
-	*
6713
-	*/
6709
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
6710
+	 *
6711
+	 * @return Array the airport list
6712
+	 *
6713
+	 */
6714 6714
 	public function countAllArrivalAirportCountriesByRegistration($registration)
6715 6715
 	{
6716 6716
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -6742,11 +6742,11 @@  discard block
 block discarded – undo
6742 6742
 	
6743 6743
 	
6744 6744
 	/**
6745
-	* Gets all arrival airports of the airplanes that have flown over based on an departure airport
6746
-	*
6747
-	* @return Array the airport list
6748
-	*
6749
-	*/
6745
+	 * Gets all arrival airports of the airplanes that have flown over based on an departure airport
6746
+	 *
6747
+	 * @return Array the airport list
6748
+	 *
6749
+	 */
6750 6750
 	public function countAllArrivalAirportsByAirport($airport_icao)
6751 6751
 	{
6752 6752
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -6780,11 +6780,11 @@  discard block
 block discarded – undo
6780 6780
 	
6781 6781
 	
6782 6782
 	/**
6783
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
6784
-	*
6785
-	* @return Array the airport list
6786
-	*
6787
-	*/
6783
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
6784
+	 *
6785
+	 * @return Array the airport list
6786
+	 *
6787
+	 */
6788 6788
 	public function countAllArrivalAirportCountriesByAirport($airport_icao)
6789 6789
 	{
6790 6790
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -6815,11 +6815,11 @@  discard block
 block discarded – undo
6815 6815
 	
6816 6816
 	
6817 6817
 	/**
6818
-	* Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
6819
-	*
6820
-	* @return Array the airport list
6821
-	*
6822
-	*/
6818
+	 * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
6819
+	 *
6820
+	 * @return Array the airport list
6821
+	 *
6822
+	 */
6823 6823
 	public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer)
6824 6824
 	{
6825 6825
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -6854,11 +6854,11 @@  discard block
 block discarded – undo
6854 6854
 	
6855 6855
 	
6856 6856
 	/**
6857
-	* Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
6858
-	*
6859
-	* @return Array the airport list
6860
-	*
6861
-	*/
6857
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
6858
+	 *
6859
+	 * @return Array the airport list
6860
+	 *
6861
+	 */
6862 6862
 	public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer)
6863 6863
 	{
6864 6864
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -6890,11 +6890,11 @@  discard block
 block discarded – undo
6890 6890
 	
6891 6891
 	
6892 6892
 	/**
6893
-	* Gets all arrival airports of the airplanes that have flown over based on a date
6894
-	*
6895
-	* @return Array the airport list
6896
-	*
6897
-	*/
6893
+	 * Gets all arrival airports of the airplanes that have flown over based on a date
6894
+	 *
6895
+	 * @return Array the airport list
6896
+	 *
6897
+	 */
6898 6898
 	public function countAllArrivalAirportsByDate($date)
6899 6899
 	{
6900 6900
 		global $globalTimezone, $globalDBdriver;
@@ -6941,11 +6941,11 @@  discard block
 block discarded – undo
6941 6941
 	
6942 6942
 	
6943 6943
 	/**
6944
-	* Gets all arrival airports by country of the airplanes that have flown over based on a date
6945
-	*
6946
-	* @return Array the airport list
6947
-	*
6948
-	*/
6944
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a date
6945
+	 *
6946
+	 * @return Array the airport list
6947
+	 *
6948
+	 */
6949 6949
 	public function countAllArrivalAirportCountriesByDate($date)
6950 6950
 	{
6951 6951
 		global $globalTimezone, $globalDBdriver;
@@ -6989,11 +6989,11 @@  discard block
 block discarded – undo
6989 6989
 	
6990 6990
 	
6991 6991
 	/**
6992
-	* Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
6993
-	*
6994
-	* @return Array the airport list
6995
-	*
6996
-	*/
6992
+	 * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
6993
+	 *
6994
+	 * @return Array the airport list
6995
+	 *
6996
+	 */
6997 6997
 	public function countAllArrivalAirportsByIdent($ident)
6998 6998
 	{
6999 6999
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -7027,11 +7027,11 @@  discard block
 block discarded – undo
7027 7027
 	
7028 7028
 	
7029 7029
 	/**
7030
-	* Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
7031
-	*
7032
-	* @return Array the airport list
7033
-	*
7034
-	*/
7030
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
7031
+	 *
7032
+	 * @return Array the airport list
7033
+	 *
7034
+	 */
7035 7035
 	public function countAllArrivalAirportCountriesByIdent($ident)
7036 7036
 	{
7037 7037
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -7063,11 +7063,11 @@  discard block
 block discarded – undo
7063 7063
 	
7064 7064
 	
7065 7065
 	/**
7066
-	* Gets all arrival airports of the airplanes that have flown over based on a country
7067
-	*
7068
-	* @return Array the airport list
7069
-	*
7070
-	*/
7066
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
7067
+	 *
7068
+	 * @return Array the airport list
7069
+	 *
7070
+	 */
7071 7071
 	public function countAllArrivalAirportsByCountry($country)
7072 7072
 	{
7073 7073
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -7101,11 +7101,11 @@  discard block
 block discarded – undo
7101 7101
 	
7102 7102
 	
7103 7103
 	/**
7104
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
7105
-	*
7106
-	* @return Array the airport list
7107
-	*
7108
-	*/
7104
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
7105
+	 *
7106
+	 * @return Array the airport list
7107
+	 *
7108
+	 */
7109 7109
 	public function countAllArrivalAirportCountriesByCountry($country)
7110 7110
 	{
7111 7111
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -7137,11 +7137,11 @@  discard block
 block discarded – undo
7137 7137
 
7138 7138
 
7139 7139
 	/**
7140
-	* Counts all airport departure countries
7141
-	*
7142
-	* @return Array the airport departure list
7143
-	*
7144
-	*/
7140
+	 * Counts all airport departure countries
7141
+	 *
7142
+	 * @return Array the airport departure list
7143
+	 *
7144
+	 */
7145 7145
 	public function countAllDepartureCountries($filters = array())
7146 7146
 	{
7147 7147
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7171,11 +7171,11 @@  discard block
 block discarded – undo
7171 7171
 	
7172 7172
 	
7173 7173
 	/**
7174
-	* Counts all airport arrival countries
7175
-	*
7176
-	* @return Array the airport arrival list
7177
-	*
7178
-	*/
7174
+	 * Counts all airport arrival countries
7175
+	 *
7176
+	 * @return Array the airport arrival list
7177
+	 *
7178
+	 */
7179 7179
 	public function countAllArrivalCountries($limit = true,$filters = array())
7180 7180
 	{
7181 7181
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7208,11 +7208,11 @@  discard block
 block discarded – undo
7208 7208
 
7209 7209
 
7210 7210
 	/**
7211
-	* Gets all route combinations
7212
-	*
7213
-	* @return Array the route list
7214
-	*
7215
-	*/
7211
+	 * Gets all route combinations
7212
+	 *
7213
+	 * @return Array the route list
7214
+	 *
7215
+	 */
7216 7216
 	public function countAllRoutes()
7217 7217
 	{
7218 7218
 		
@@ -7252,11 +7252,11 @@  discard block
 block discarded – undo
7252 7252
 	
7253 7253
 	
7254 7254
 	/**
7255
-	* Gets all route combinations based on an aircraft
7256
-	*
7257
-	* @return Array the route list
7258
-	*
7259
-	*/
7255
+	 * Gets all route combinations based on an aircraft
7256
+	 *
7257
+	 * @return Array the route list
7258
+	 *
7259
+	 */
7260 7260
 	public function countAllRoutesByAircraft($aircraft_icao)
7261 7261
 	{
7262 7262
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -7294,11 +7294,11 @@  discard block
 block discarded – undo
7294 7294
 	
7295 7295
 	
7296 7296
 	/**
7297
-	* Gets all route combinations based on an aircraft registration
7298
-	*
7299
-	* @return Array the route list
7300
-	*
7301
-	*/
7297
+	 * Gets all route combinations based on an aircraft registration
7298
+	 *
7299
+	 * @return Array the route list
7300
+	 *
7301
+	 */
7302 7302
 	public function countAllRoutesByRegistration($registration)
7303 7303
 	{
7304 7304
 		$registration = filter_var($registration, FILTER_SANITIZE_STRING);
@@ -7337,11 +7337,11 @@  discard block
 block discarded – undo
7337 7337
 	
7338 7338
 	
7339 7339
 	/**
7340
-	* Gets all route combinations based on an airline
7341
-	*
7342
-	* @return Array the route list
7343
-	*
7344
-	*/
7340
+	 * Gets all route combinations based on an airline
7341
+	 *
7342
+	 * @return Array the route list
7343
+	 *
7344
+	 */
7345 7345
 	public function countAllRoutesByAirline($airline_icao)
7346 7346
 	{
7347 7347
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
@@ -7380,11 +7380,11 @@  discard block
 block discarded – undo
7380 7380
 	
7381 7381
 	
7382 7382
 	/**
7383
-	* Gets all route combinations based on an airport
7384
-	*
7385
-	* @return Array the route list
7386
-	*
7387
-	*/
7383
+	 * Gets all route combinations based on an airport
7384
+	 *
7385
+	 * @return Array the route list
7386
+	 *
7387
+	 */
7388 7388
 	public function countAllRoutesByAirport($airport_icao)
7389 7389
 	{
7390 7390
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -7423,11 +7423,11 @@  discard block
 block discarded – undo
7423 7423
 	
7424 7424
 	
7425 7425
 	/**
7426
-	* Gets all route combinations based on an country
7427
-	*
7428
-	* @return Array the route list
7429
-	*
7430
-	*/
7426
+	 * Gets all route combinations based on an country
7427
+	 *
7428
+	 * @return Array the route list
7429
+	 *
7430
+	 */
7431 7431
 	public function countAllRoutesByCountry($country)
7432 7432
 	{
7433 7433
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -7465,11 +7465,11 @@  discard block
 block discarded – undo
7465 7465
 
7466 7466
 
7467 7467
 	/**
7468
-	* Gets all route combinations based on an date
7469
-	*
7470
-	* @return Array the route list
7471
-	*
7472
-	*/
7468
+	 * Gets all route combinations based on an date
7469
+	 *
7470
+	 * @return Array the route list
7471
+	 *
7472
+	 */
7473 7473
 	public function countAllRoutesByDate($date)
7474 7474
 	{
7475 7475
 		global $globalTimezone, $globalDBdriver;
@@ -7520,11 +7520,11 @@  discard block
 block discarded – undo
7520 7520
 	
7521 7521
 	
7522 7522
 	/**
7523
-	* Gets all route combinations based on an ident/callsign
7524
-	*
7525
-	* @return Array the route list
7526
-	*
7527
-	*/
7523
+	 * Gets all route combinations based on an ident/callsign
7524
+	 *
7525
+	 * @return Array the route list
7526
+	 *
7527
+	 */
7528 7528
 	public function countAllRoutesByIdent($ident)
7529 7529
 	{
7530 7530
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -7562,11 +7562,11 @@  discard block
 block discarded – undo
7562 7562
 	
7563 7563
 	
7564 7564
 	/**
7565
-	* Gets all route combinations based on an manufacturer
7566
-	*
7567
-	* @return Array the route list
7568
-	*
7569
-	*/
7565
+	 * Gets all route combinations based on an manufacturer
7566
+	 *
7567
+	 * @return Array the route list
7568
+	 *
7569
+	 */
7570 7570
 	public function countAllRoutesByManufacturer($aircraft_manufacturer)
7571 7571
 	{
7572 7572
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -7605,11 +7605,11 @@  discard block
 block discarded – undo
7605 7605
 	
7606 7606
 	
7607 7607
 	/**
7608
-	* Gets all route combinations with waypoints
7609
-	*
7610
-	* @return Array the route list
7611
-	*
7612
-	*/
7608
+	 * Gets all route combinations with waypoints
7609
+	 *
7610
+	 * @return Array the route list
7611
+	 *
7612
+	 */
7613 7613
 	public function countAllRoutesWithWaypoints()
7614 7614
 	{
7615 7615
 		$query  = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country
@@ -7649,11 +7649,11 @@  discard block
 block discarded – undo
7649 7649
 	
7650 7650
 	
7651 7651
 	/**
7652
-	* Gets all callsigns that have flown over
7653
-	*
7654
-	* @return Array the callsign list
7655
-	*
7656
-	*/
7652
+	 * Gets all callsigns that have flown over
7653
+	 *
7654
+	 * @return Array the callsign list
7655
+	 *
7656
+	 */
7657 7657
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
7658 7658
 	{
7659 7659
 		global $globalDBdriver;
@@ -7691,11 +7691,11 @@  discard block
 block discarded – undo
7691 7691
 	}
7692 7692
 
7693 7693
 	/**
7694
-	* Gets all callsigns that have flown over
7695
-	*
7696
-	* @return Array the callsign list
7697
-	*
7698
-	*/
7694
+	 * Gets all callsigns that have flown over
7695
+	 *
7696
+	 * @return Array the callsign list
7697
+	 *
7698
+	 */
7699 7699
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
7700 7700
 	{
7701 7701
 		global $globalDBdriver;
@@ -7736,11 +7736,11 @@  discard block
 block discarded – undo
7736 7736
 
7737 7737
 
7738 7738
 	/**
7739
-	* Counts all dates
7740
-	*
7741
-	* @return Array the date list
7742
-	*
7743
-	*/
7739
+	 * Counts all dates
7740
+	 *
7741
+	 * @return Array the date list
7742
+	 *
7743
+	 */
7744 7744
 	public function countAllDates($filters = array())
7745 7745
 	{
7746 7746
 		global $globalTimezone, $globalDBdriver;
@@ -7785,11 +7785,11 @@  discard block
 block discarded – undo
7785 7785
 	}
7786 7786
 	
7787 7787
 	/**
7788
-	* Counts all dates
7789
-	*
7790
-	* @return Array the date list
7791
-	*
7792
-	*/
7788
+	 * Counts all dates
7789
+	 *
7790
+	 * @return Array the date list
7791
+	 *
7792
+	 */
7793 7793
 	public function countAllDatesByAirlines()
7794 7794
 	{
7795 7795
 		global $globalTimezone, $globalDBdriver;
@@ -7835,11 +7835,11 @@  discard block
 block discarded – undo
7835 7835
 	}	
7836 7836
 	
7837 7837
 	/**
7838
-	* Counts all dates during the last 7 days
7839
-	*
7840
-	* @return Array the date list
7841
-	*
7842
-	*/
7838
+	 * Counts all dates during the last 7 days
7839
+	 *
7840
+	 * @return Array the date list
7841
+	 *
7842
+	 */
7843 7843
 	public function countAllDatesLast7Days($filters = array())
7844 7844
 	{
7845 7845
 		global $globalTimezone, $globalDBdriver;
@@ -7861,7 +7861,7 @@  discard block
 block discarded – undo
7861 7861
 			$query .= " GROUP BY date_name 
7862 7862
 								ORDER BY date_name ASC";
7863 7863
 			$query_data = array(':offset' => $offset);
7864
-    		}
7864
+			}
7865 7865
 		
7866 7866
 		$sth = $this->db->prepare($query);
7867 7867
 		$sth->execute($query_data);
@@ -7881,11 +7881,11 @@  discard block
 block discarded – undo
7881 7881
 	}
7882 7882
 
7883 7883
 	/**
7884
-	* Counts all dates during the last month
7885
-	*
7886
-	* @return Array the date list
7887
-	*
7888
-	*/
7884
+	 * Counts all dates during the last month
7885
+	 *
7886
+	 * @return Array the date list
7887
+	 *
7888
+	 */
7889 7889
 	public function countAllDatesLastMonth($filters = array())
7890 7890
 	{
7891 7891
 		global $globalTimezone, $globalDBdriver;
@@ -7907,7 +7907,7 @@  discard block
 block discarded – undo
7907 7907
 			$query .= " GROUP BY date_name 
7908 7908
 								ORDER BY date_name ASC";
7909 7909
 			$query_data = array(':offset' => $offset);
7910
-    		}
7910
+			}
7911 7911
 		
7912 7912
 		$sth = $this->db->prepare($query);
7913 7913
 		$sth->execute($query_data);
@@ -7928,11 +7928,11 @@  discard block
 block discarded – undo
7928 7928
 
7929 7929
 
7930 7930
 	/**
7931
-	* Counts all dates during the last month
7932
-	*
7933
-	* @return Array the date list
7934
-	*
7935
-	*/
7931
+	 * Counts all dates during the last month
7932
+	 *
7933
+	 * @return Array the date list
7934
+	 *
7935
+	 */
7936 7936
 	public function countAllDatesLastMonthByAirlines()
7937 7937
 	{
7938 7938
 		global $globalTimezone, $globalDBdriver;
@@ -7956,7 +7956,7 @@  discard block
 block discarded – undo
7956 7956
 								GROUP BY spotter_output.airline_icao, date_name 
7957 7957
 								ORDER BY date_name ASC";
7958 7958
 			$query_data = array(':offset' => $offset);
7959
-    		}
7959
+			}
7960 7960
 		
7961 7961
 		$sth = $this->db->prepare($query);
7962 7962
 		$sth->execute($query_data);
@@ -7978,11 +7978,11 @@  discard block
 block discarded – undo
7978 7978
 	
7979 7979
 
7980 7980
 	/**
7981
-	* Counts all month
7982
-	*
7983
-	* @return Array the month list
7984
-	*
7985
-	*/
7981
+	 * Counts all month
7982
+	 *
7983
+	 * @return Array the month list
7984
+	 *
7985
+	 */
7986 7986
 	public function countAllMonths($filters = array())
7987 7987
 	{
7988 7988
 		global $globalTimezone, $globalDBdriver;
@@ -8026,11 +8026,11 @@  discard block
 block discarded – undo
8026 8026
 	}
8027 8027
 
8028 8028
 	/**
8029
-	* Counts all month
8030
-	*
8031
-	* @return Array the month list
8032
-	*
8033
-	*/
8029
+	 * Counts all month
8030
+	 *
8031
+	 * @return Array the month list
8032
+	 *
8033
+	 */
8034 8034
 	public function countAllMonthsByAirlines()
8035 8035
 	{
8036 8036
 		global $globalTimezone, $globalDBdriver;
@@ -8075,11 +8075,11 @@  discard block
 block discarded – undo
8075 8075
 	}
8076 8076
 
8077 8077
 	/**
8078
-	* Counts all military month
8079
-	*
8080
-	* @return Array the month list
8081
-	*
8082
-	*/
8078
+	 * Counts all military month
8079
+	 *
8080
+	 * @return Array the month list
8081
+	 *
8082
+	 */
8083 8083
 	public function countAllMilitaryMonths()
8084 8084
 	{
8085 8085
 		global $globalTimezone, $globalDBdriver;
@@ -8122,11 +8122,11 @@  discard block
 block discarded – undo
8122 8122
 	}
8123 8123
 	
8124 8124
 	/**
8125
-	* Counts all month owners
8126
-	*
8127
-	* @return Array the month list
8128
-	*
8129
-	*/
8125
+	 * Counts all month owners
8126
+	 *
8127
+	 * @return Array the month list
8128
+	 *
8129
+	 */
8130 8130
 	public function countAllMonthsOwners()
8131 8131
 	{
8132 8132
 		global $globalTimezone, $globalDBdriver;
@@ -8169,11 +8169,11 @@  discard block
 block discarded – undo
8169 8169
 	}
8170 8170
 	
8171 8171
 	/**
8172
-	* Counts all month owners
8173
-	*
8174
-	* @return Array the month list
8175
-	*
8176
-	*/
8172
+	 * Counts all month owners
8173
+	 *
8174
+	 * @return Array the month list
8175
+	 *
8176
+	 */
8177 8177
 	public function countAllMonthsOwnersByAirlines()
8178 8178
 	{
8179 8179
 		global $globalTimezone, $globalDBdriver;
@@ -8217,11 +8217,11 @@  discard block
 block discarded – undo
8217 8217
 	}
8218 8218
 
8219 8219
 	/**
8220
-	* Counts all month pilot
8221
-	*
8222
-	* @return Array the month list
8223
-	*
8224
-	*/
8220
+	 * Counts all month pilot
8221
+	 *
8222
+	 * @return Array the month list
8223
+	 *
8224
+	 */
8225 8225
 	public function countAllMonthsPilots()
8226 8226
 	{
8227 8227
 		global $globalTimezone, $globalDBdriver;
@@ -8264,11 +8264,11 @@  discard block
 block discarded – undo
8264 8264
 	}
8265 8265
 	
8266 8266
 	/**
8267
-	* Counts all month pilot
8268
-	*
8269
-	* @return Array the month list
8270
-	*
8271
-	*/
8267
+	 * Counts all month pilot
8268
+	 *
8269
+	 * @return Array the month list
8270
+	 *
8271
+	 */
8272 8272
 	public function countAllMonthsPilotsByAirlines()
8273 8273
 	{
8274 8274
 		global $globalTimezone, $globalDBdriver;
@@ -8312,11 +8312,11 @@  discard block
 block discarded – undo
8312 8312
 	}
8313 8313
 
8314 8314
 	/**
8315
-	* Counts all month airline
8316
-	*
8317
-	* @return Array the month list
8318
-	*
8319
-	*/
8315
+	 * Counts all month airline
8316
+	 *
8317
+	 * @return Array the month list
8318
+	 *
8319
+	 */
8320 8320
 	public function countAllMonthsAirlines()
8321 8321
 	{
8322 8322
 		global $globalTimezone, $globalDBdriver;
@@ -8359,11 +8359,11 @@  discard block
 block discarded – undo
8359 8359
 	}
8360 8360
 	
8361 8361
 	/**
8362
-	* Counts all month aircraft
8363
-	*
8364
-	* @return Array the month list
8365
-	*
8366
-	*/
8362
+	 * Counts all month aircraft
8363
+	 *
8364
+	 * @return Array the month list
8365
+	 *
8366
+	 */
8367 8367
 	public function countAllMonthsAircrafts()
8368 8368
 	{
8369 8369
 		global $globalTimezone, $globalDBdriver;
@@ -8407,11 +8407,11 @@  discard block
 block discarded – undo
8407 8407
 	
8408 8408
 
8409 8409
 	/**
8410
-	* Counts all month aircraft
8411
-	*
8412
-	* @return Array the month list
8413
-	*
8414
-	*/
8410
+	 * Counts all month aircraft
8411
+	 *
8412
+	 * @return Array the month list
8413
+	 *
8414
+	 */
8415 8415
 	public function countAllMonthsAircraftsByAirlines()
8416 8416
 	{
8417 8417
 		global $globalTimezone, $globalDBdriver;
@@ -8455,11 +8455,11 @@  discard block
 block discarded – undo
8455 8455
 	}
8456 8456
 
8457 8457
 	/**
8458
-	* Counts all month real arrival
8459
-	*
8460
-	* @return Array the month list
8461
-	*
8462
-	*/
8458
+	 * Counts all month real arrival
8459
+	 *
8460
+	 * @return Array the month list
8461
+	 *
8462
+	 */
8463 8463
 	public function countAllMonthsRealArrivals()
8464 8464
 	{
8465 8465
 		global $globalTimezone, $globalDBdriver;
@@ -8503,11 +8503,11 @@  discard block
 block discarded – undo
8503 8503
 	
8504 8504
 
8505 8505
 	/**
8506
-	* Counts all month real arrival
8507
-	*
8508
-	* @return Array the month list
8509
-	*
8510
-	*/
8506
+	 * Counts all month real arrival
8507
+	 *
8508
+	 * @return Array the month list
8509
+	 *
8510
+	 */
8511 8511
 	public function countAllMonthsRealArrivalsByAirlines()
8512 8512
 	{
8513 8513
 		global $globalTimezone, $globalDBdriver;
@@ -8552,11 +8552,11 @@  discard block
 block discarded – undo
8552 8552
 	
8553 8553
 
8554 8554
 	/**
8555
-	* Counts all dates during the last year
8556
-	*
8557
-	* @return Array the date list
8558
-	*
8559
-	*/
8555
+	 * Counts all dates during the last year
8556
+	 *
8557
+	 * @return Array the date list
8558
+	 *
8559
+	 */
8560 8560
 	public function countAllMonthsLastYear($filters)
8561 8561
 	{
8562 8562
 		global $globalTimezone, $globalDBdriver;
@@ -8578,7 +8578,7 @@  discard block
 block discarded – undo
8578 8578
 			$query .= " GROUP BY year_name, month_name
8579 8579
 								ORDER BY year_name, month_name ASC";
8580 8580
 			$query_data = array(':offset' => $offset);
8581
-    		}
8581
+			}
8582 8582
 		
8583 8583
 		$sth = $this->db->prepare($query);
8584 8584
 		$sth->execute($query_data);
@@ -8601,11 +8601,11 @@  discard block
 block discarded – undo
8601 8601
 	
8602 8602
 	
8603 8603
 	/**
8604
-	* Counts all hours
8605
-	*
8606
-	* @return Array the hour list
8607
-	*
8608
-	*/
8604
+	 * Counts all hours
8605
+	 *
8606
+	 * @return Array the hour list
8607
+	 *
8608
+	 */
8609 8609
 	public function countAllHours($orderby,$filters = array())
8610 8610
 	{
8611 8611
 		global $globalTimezone, $globalDBdriver;
@@ -8666,11 +8666,11 @@  discard block
 block discarded – undo
8666 8666
 	}
8667 8667
 	
8668 8668
 	/**
8669
-	* Counts all hours
8670
-	*
8671
-	* @return Array the hour list
8672
-	*
8673
-	*/
8669
+	 * Counts all hours
8670
+	 *
8671
+	 * @return Array the hour list
8672
+	 *
8673
+	 */
8674 8674
 	public function countAllHoursByAirlines($orderby)
8675 8675
 	{
8676 8676
 		global $globalTimezone, $globalDBdriver;
@@ -8734,11 +8734,11 @@  discard block
 block discarded – undo
8734 8734
 
8735 8735
 
8736 8736
 	/**
8737
-	* Counts all hours by airline
8738
-	*
8739
-	* @return Array the hour list
8740
-	*
8741
-	*/
8737
+	 * Counts all hours by airline
8738
+	 *
8739
+	 * @return Array the hour list
8740
+	 *
8741
+	 */
8742 8742
 	public function countAllHoursByAirline($airline_icao)
8743 8743
 	{
8744 8744
 		global $globalTimezone, $globalDBdriver;
@@ -8785,11 +8785,11 @@  discard block
 block discarded – undo
8785 8785
 	
8786 8786
 	
8787 8787
 	/**
8788
-	* Counts all hours by aircraft
8789
-	*
8790
-	* @return Array the hour list
8791
-	*
8792
-	*/
8788
+	 * Counts all hours by aircraft
8789
+	 *
8790
+	 * @return Array the hour list
8791
+	 *
8792
+	 */
8793 8793
 	public function countAllHoursByAircraft($aircraft_icao)
8794 8794
 	{
8795 8795
 		global $globalTimezone, $globalDBdriver;
@@ -8833,11 +8833,11 @@  discard block
 block discarded – undo
8833 8833
 	
8834 8834
 	
8835 8835
 	/**
8836
-	* Counts all hours by aircraft registration
8837
-	*
8838
-	* @return Array the hour list
8839
-	*
8840
-	*/
8836
+	 * Counts all hours by aircraft registration
8837
+	 *
8838
+	 * @return Array the hour list
8839
+	 *
8840
+	 */
8841 8841
 	public function countAllHoursByRegistration($registration)
8842 8842
 	{
8843 8843
 		global $globalTimezone, $globalDBdriver;
@@ -8881,11 +8881,11 @@  discard block
 block discarded – undo
8881 8881
 	
8882 8882
 	
8883 8883
 	/**
8884
-	* Counts all hours by airport
8885
-	*
8886
-	* @return Array the hour list
8887
-	*
8888
-	*/
8884
+	 * Counts all hours by airport
8885
+	 *
8886
+	 * @return Array the hour list
8887
+	 *
8888
+	 */
8889 8889
 	public function countAllHoursByAirport($airport_icao)
8890 8890
 	{
8891 8891
 		global $globalTimezone, $globalDBdriver;
@@ -8930,11 +8930,11 @@  discard block
 block discarded – undo
8930 8930
 	
8931 8931
 	
8932 8932
 	/**
8933
-	* Counts all hours by manufacturer
8934
-	*
8935
-	* @return Array the hour list
8936
-	*
8937
-	*/
8933
+	 * Counts all hours by manufacturer
8934
+	 *
8935
+	 * @return Array the hour list
8936
+	 *
8937
+	 */
8938 8938
 	public function countAllHoursByManufacturer($aircraft_manufacturer)
8939 8939
 	{
8940 8940
 		global $globalTimezone, $globalDBdriver;
@@ -8979,11 +8979,11 @@  discard block
 block discarded – undo
8979 8979
 	
8980 8980
 	
8981 8981
 	/**
8982
-	* Counts all hours by date
8983
-	*
8984
-	* @return Array the hour list
8985
-	*
8986
-	*/
8982
+	 * Counts all hours by date
8983
+	 *
8984
+	 * @return Array the hour list
8985
+	 *
8986
+	 */
8987 8987
 	public function countAllHoursByDate($date)
8988 8988
 	{
8989 8989
 		global $globalTimezone, $globalDBdriver;
@@ -9028,11 +9028,11 @@  discard block
 block discarded – undo
9028 9028
 	
9029 9029
 	
9030 9030
 	/**
9031
-	* Counts all hours by a ident/callsign
9032
-	*
9033
-	* @return Array the hour list
9034
-	*
9035
-	*/
9031
+	 * Counts all hours by a ident/callsign
9032
+	 *
9033
+	 * @return Array the hour list
9034
+	 *
9035
+	 */
9036 9036
 	public function countAllHoursByIdent($ident)
9037 9037
 	{
9038 9038
 		global $globalTimezone, $globalDBdriver;
@@ -9078,11 +9078,11 @@  discard block
 block discarded – undo
9078 9078
 	
9079 9079
 	
9080 9080
 	/**
9081
-	* Counts all hours by route
9082
-	*
9083
-	* @return Array the hour list
9084
-	*
9085
-	*/
9081
+	 * Counts all hours by route
9082
+	 *
9083
+	 * @return Array the hour list
9084
+	 *
9085
+	 */
9086 9086
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao)
9087 9087
 	{
9088 9088
 		global $globalTimezone, $globalDBdriver;
@@ -9127,11 +9127,11 @@  discard block
 block discarded – undo
9127 9127
 	
9128 9128
 	
9129 9129
 	/**
9130
-	* Counts all hours by country
9131
-	*
9132
-	* @return Array the hour list
9133
-	*
9134
-	*/
9130
+	 * Counts all hours by country
9131
+	 *
9132
+	 * @return Array the hour list
9133
+	 *
9134
+	 */
9135 9135
 	public function countAllHoursByCountry($country)
9136 9136
 	{
9137 9137
 		global $globalTimezone, $globalDBdriver;
@@ -9177,11 +9177,11 @@  discard block
 block discarded – undo
9177 9177
 
9178 9178
 
9179 9179
 	/**
9180
-	* Counts all aircraft that have flown over
9181
-	*
9182
-	* @return Integer the number of aircrafts
9183
-	*
9184
-	*/
9180
+	 * Counts all aircraft that have flown over
9181
+	 *
9182
+	 * @return Integer the number of aircrafts
9183
+	 *
9184
+	 */
9185 9185
 	public function countOverallAircrafts($filters = array())
9186 9186
 	{
9187 9187
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9193,11 +9193,11 @@  discard block
 block discarded – undo
9193 9193
 	}
9194 9194
 
9195 9195
 	/**
9196
-	* Counts all flight that really arrival
9197
-	*
9198
-	* @return Integer the number of aircrafts
9199
-	*
9200
-	*/
9196
+	 * Counts all flight that really arrival
9197
+	 *
9198
+	 * @return Integer the number of aircrafts
9199
+	 *
9200
+	 */
9201 9201
 	public function countOverallArrival($filters = array())
9202 9202
 	{
9203 9203
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9210,11 +9210,11 @@  discard block
 block discarded – undo
9210 9210
 	}
9211 9211
 
9212 9212
 	/**
9213
-	* Counts all pilots that have flown over
9214
-	*
9215
-	* @return Integer the number of pilots
9216
-	*
9217
-	*/
9213
+	 * Counts all pilots that have flown over
9214
+	 *
9215
+	 * @return Integer the number of pilots
9216
+	 *
9217
+	 */
9218 9218
 	public function countOverallPilots($filters = array())
9219 9219
 	{
9220 9220
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9226,11 +9226,11 @@  discard block
 block discarded – undo
9226 9226
 	}
9227 9227
 
9228 9228
 	/**
9229
-	* Counts all owners that have flown over
9230
-	*
9231
-	* @return Integer the number of owners
9232
-	*
9233
-	*/
9229
+	 * Counts all owners that have flown over
9230
+	 *
9231
+	 * @return Integer the number of owners
9232
+	 *
9233
+	 */
9234 9234
 	public function countOverallOwners($filters = array())
9235 9235
 	{
9236 9236
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9243,11 +9243,11 @@  discard block
 block discarded – undo
9243 9243
 	
9244 9244
 	
9245 9245
 	/**
9246
-	* Counts all flights that have flown over
9247
-	*
9248
-	* @return Integer the number of flights
9249
-	*
9250
-	*/
9246
+	 * Counts all flights that have flown over
9247
+	 *
9248
+	 * @return Integer the number of flights
9249
+	 *
9250
+	 */
9251 9251
 	public function countOverallFlights($filters = array())
9252 9252
 	{
9253 9253
 		$query  = "SELECT COUNT(spotter_output.spotter_id) AS flight_count  
@@ -9260,11 +9260,11 @@  discard block
 block discarded – undo
9260 9260
 	}
9261 9261
 	
9262 9262
 	/**
9263
-	* Counts all military flights that have flown over
9264
-	*
9265
-	* @return Integer the number of flights
9266
-	*
9267
-	*/
9263
+	 * Counts all military flights that have flown over
9264
+	 *
9265
+	 * @return Integer the number of flights
9266
+	 *
9267
+	 */
9268 9268
 	public function countOverallMilitaryFlights($filters = array())
9269 9269
 	{
9270 9270
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9279,11 +9279,11 @@  discard block
 block discarded – undo
9279 9279
 	
9280 9280
 	
9281 9281
 	/**
9282
-	* Counts all airlines that have flown over
9283
-	*
9284
-	* @return Integer the number of airlines
9285
-	*
9286
-	*/
9282
+	 * Counts all airlines that have flown over
9283
+	 *
9284
+	 * @return Integer the number of airlines
9285
+	 *
9286
+	 */
9287 9287
 	public function countOverallAirlines($filters = array())
9288 9288
 	{
9289 9289
 		$query  = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count 
@@ -9297,11 +9297,11 @@  discard block
 block discarded – undo
9297 9297
 
9298 9298
   
9299 9299
 	/**
9300
-	* Counts all hours of today
9301
-	*
9302
-	* @return Array the hour list
9303
-	*
9304
-	*/
9300
+	 * Counts all hours of today
9301
+	 *
9302
+	 * @return Array the hour list
9303
+	 *
9304
+	 */
9305 9305
 	public function countAllHoursFromToday()
9306 9306
 	{
9307 9307
 		global $globalTimezone, $globalDBdriver;
@@ -9342,11 +9342,11 @@  discard block
 block discarded – undo
9342 9342
 	}
9343 9343
     
9344 9344
 	/**
9345
-	* Gets all the spotter information based on calculated upcoming flights
9346
-	*
9347
-	* @return Array the spotter information
9348
-	*
9349
-	*/
9345
+	 * Gets all the spotter information based on calculated upcoming flights
9346
+	 *
9347
+	 * @return Array the spotter information
9348
+	 *
9349
+	 */
9350 9350
 	public function getUpcomingFlights($limit = '', $sort = '')
9351 9351
 	{
9352 9352
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -9422,12 +9422,12 @@  discard block
 block discarded – undo
9422 9422
 	}
9423 9423
     
9424 9424
     
9425
-     /**
9426
-	* Gets the Barrie Spotter ID based on the FlightAware ID
9427
-	*
9428
-	* @return Integer the Barrie Spotter ID
9425
+	 /**
9426
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
9427
+	  *
9428
+	  * @return Integer the Barrie Spotter ID
9429 9429
 q	*
9430
-	*/
9430
+	  */
9431 9431
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
9432 9432
 	{
9433 9433
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -9448,13 +9448,13 @@  discard block
 block discarded – undo
9448 9448
   
9449 9449
  
9450 9450
 	/**
9451
-	* Parses a date string
9452
-	*
9453
-	* @param String $dateString the date string
9454
-	* @param String $timezone the timezone of a user
9455
-	* @return Array the time information
9456
-	*
9457
-	*/
9451
+	 * Parses a date string
9452
+	 *
9453
+	 * @param String $dateString the date string
9454
+	 * @param String $timezone the timezone of a user
9455
+	 * @return Array the time information
9456
+	 *
9457
+	 */
9458 9458
 	public function parseDateString($dateString, $timezone = '')
9459 9459
 	{
9460 9460
 		$time_array = array();
@@ -9490,12 +9490,12 @@  discard block
 block discarded – undo
9490 9490
 	
9491 9491
 	
9492 9492
 	/**
9493
-	* Parses the direction degrees to working
9494
-	*
9495
-	* @param Float $direction the direction in degrees
9496
-	* @return Array the direction information
9497
-	*
9498
-	*/
9493
+	 * Parses the direction degrees to working
9494
+	 *
9495
+	 * @param Float $direction the direction in degrees
9496
+	 * @return Array the direction information
9497
+	 *
9498
+	 */
9499 9499
 	public function parseDirection($direction = 0)
9500 9500
 	{
9501 9501
 		if ($direction == '') $direction = 0;
@@ -9574,12 +9574,12 @@  discard block
 block discarded – undo
9574 9574
 	
9575 9575
 	
9576 9576
 	/**
9577
-	* Gets the aircraft registration
9578
-	*
9579
-	* @param String $flightaware_id the flight aware id
9580
-	* @return String the aircraft registration
9581
-	*
9582
-	*/
9577
+	 * Gets the aircraft registration
9578
+	 *
9579
+	 * @param String $flightaware_id the flight aware id
9580
+	 * @return String the aircraft registration
9581
+	 *
9582
+	 */
9583 9583
 	
9584 9584
 	public function getAircraftRegistration($flightaware_id)
9585 9585
 	{
@@ -9608,12 +9608,12 @@  discard block
 block discarded – undo
9608 9608
 
9609 9609
 
9610 9610
 	/**
9611
-	* Gets the aircraft registration from ModeS
9612
-	*
9613
-	* @param String $aircraft_modes the flight ModeS in hex
9614
-	* @return String the aircraft registration
9615
-	*
9616
-	*/
9611
+	 * Gets the aircraft registration from ModeS
9612
+	 *
9613
+	 * @param String $aircraft_modes the flight ModeS in hex
9614
+	 * @return String the aircraft registration
9615
+	 *
9616
+	 */
9617 9617
 	public function getAircraftRegistrationBymodeS($aircraft_modes)
9618 9618
 	{
9619 9619
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -9625,19 +9625,19 @@  discard block
 block discarded – undo
9625 9625
     
9626 9626
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
9627 9627
 		if (count($row) > 0) {
9628
-		    //return $row['Registration'];
9629
-		    return $row['registration'];
9628
+			//return $row['Registration'];
9629
+			return $row['registration'];
9630 9630
 		} else return '';
9631 9631
 	
9632 9632
 	}
9633 9633
 
9634 9634
 	/**
9635
-	* Gets the aircraft type from ModeS
9636
-	*
9637
-	* @param String $aircraft_modes the flight ModeS in hex
9638
-	* @return String the aircraft type
9639
-	*
9640
-	*/
9635
+	 * Gets the aircraft type from ModeS
9636
+	 *
9637
+	 * @param String $aircraft_modes the flight ModeS in hex
9638
+	 * @return String the aircraft type
9639
+	 *
9640
+	 */
9641 9641
 	public function getAircraftTypeBymodeS($aircraft_modes)
9642 9642
 	{
9643 9643
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -9649,19 +9649,19 @@  discard block
 block discarded – undo
9649 9649
     
9650 9650
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
9651 9651
 		if (count($row) > 0) {
9652
-		    if ($row['type_flight'] == null) return '';
9653
-		    else return $row['type_flight'];
9652
+			if ($row['type_flight'] == null) return '';
9653
+			else return $row['type_flight'];
9654 9654
 		} else return '';
9655 9655
 	
9656 9656
 	}
9657 9657
 
9658 9658
 	/**
9659
-	* Gets Countrie from latitude/longitude
9660
-	*
9661
-	* @param Float $latitude latitute of the flight
9662
-	* @param Float $longitude longitute of the flight
9663
-	* @return String the countrie
9664
-	*/
9659
+	 * Gets Countrie from latitude/longitude
9660
+	 *
9661
+	 * @param Float $latitude latitute of the flight
9662
+	 * @param Float $longitude longitute of the flight
9663
+	 * @return String the countrie
9664
+	 */
9665 9665
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
9666 9666
 	{
9667 9667
 		global $globalDBdriver, $globalDebug;
@@ -9694,12 +9694,12 @@  discard block
 block discarded – undo
9694 9694
 	}
9695 9695
 
9696 9696
 	/**
9697
-	* converts the registration code using the country prefix
9698
-	*
9699
-	* @param String $registration the aircraft registration
9700
-	* @return String the aircraft registration
9701
-	*
9702
-	*/
9697
+	 * converts the registration code using the country prefix
9698
+	 *
9699
+	 * @param String $registration the aircraft registration
9700
+	 * @return String the aircraft registration
9701
+	 *
9702
+	 */
9703 9703
 	public function convertAircraftRegistration($registration)
9704 9704
 	{
9705 9705
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -9751,12 +9751,12 @@  discard block
 block discarded – undo
9751 9751
 	}
9752 9752
 
9753 9753
 	/**
9754
-	* Country from the registration code
9755
-	*
9756
-	* @param String $registration the aircraft registration
9757
-	* @return String the country
9758
-	*
9759
-	*/
9754
+	 * Country from the registration code
9755
+	 *
9756
+	 * @param String $registration the aircraft registration
9757
+	 * @return String the country
9758
+	 *
9759
+	 */
9760 9760
 	public function countryFromAircraftRegistration($registration)
9761 9761
 	{
9762 9762
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -9775,8 +9775,8 @@  discard block
 block discarded – undo
9775 9775
 				$country = $row['country'];
9776 9776
 			}
9777 9777
 		} else {
9778
-    			$registration_1 = substr($registration, 0, 1);
9779
-		        $registration_2 = substr($registration, 0, 2);
9778
+				$registration_1 = substr($registration, 0, 1);
9779
+				$registration_2 = substr($registration, 0, 2);
9780 9780
 
9781 9781
 			$country = '';
9782 9782
 			//first get the prefix based on two characters
@@ -9812,11 +9812,11 @@  discard block
 block discarded – undo
9812 9812
 	}
9813 9813
 	
9814 9814
 	/**
9815
-	* Set a new highlight value for a flight
9816
-	*
9817
-	* @param String $flightaware_id flightaware_id from spotter_output table
9818
-	* @param String $highlight New highlight value
9819
-	*/
9815
+	 * Set a new highlight value for a flight
9816
+	 *
9817
+	 * @param String $flightaware_id flightaware_id from spotter_output table
9818
+	 * @param String $highlight New highlight value
9819
+	 */
9820 9820
 	public function setHighlightFlight($flightaware_id,$highlight) {
9821 9821
 		
9822 9822
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -9825,12 +9825,12 @@  discard block
 block discarded – undo
9825 9825
 	}
9826 9826
 	
9827 9827
 	/**
9828
-	* Gets the short url from bit.ly
9829
-	*
9830
-	* @param String $url the full url
9831
-	* @return String the bit.ly url
9832
-	*
9833
-	*/
9828
+	 * Gets the short url from bit.ly
9829
+	 *
9830
+	 * @param String $url the full url
9831
+	 * @return String the bit.ly url
9832
+	 *
9833
+	 */
9834 9834
 	public function getBitlyURL($url)
9835 9835
 	{
9836 9836
 		global $globalBitlyAccessToken;
@@ -10119,11 +10119,11 @@  discard block
 block discarded – undo
10119 10119
 			$query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance 
10120 10120
 	                      FROM airport WHERE longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) 
10121 10121
 	                      AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;";
10122
-                } else {
10122
+				} else {
10123 10123
 			$query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2))) as distance 
10124 10124
 	                      FROM airport WHERE CAST(longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) 
10125 10125
 	                      AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;";
10126
-    		}
10126
+			}
10127 10127
 		$sth = $this->db->prepare($query);
10128 10128
 		$sth->execute();
10129 10129
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
 <div id="showdetails" class="showdetails"></div>
35 35
 <div id="infobox" class="infobox"></div>
36 36
 <?php
37
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
37
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
38 38
 
39 39
 ?>
40 40
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script>
41 41
 <?php
42
-    }
42
+	}
43 43
 ?>
44 44
 <div id="dialog" title="<?php echo _("Session has timed-out"); ?>">
45 45
   <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p>
@@ -53,31 +53,31 @@  discard block
 block discarded – undo
53 53
 	<li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
54 54
 	<li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
55 55
 <?php
56
-    if (isset($globalArchive) && $globalArchive == TRUE && (isset($globalBeta) && $globalBeta == TRUE)) {
56
+	if (isset($globalArchive) && $globalArchive == TRUE && (isset($globalBeta) && $globalBeta == TRUE)) {
57 57
 ?>
58 58
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
59 59
 <?php
60
-    }
60
+	}
61 61
 ?>
62 62
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
63 63
 	<li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li>
64 64
 <?php
65
-    if (isset($globalMap3D) && $globalMap3D) {
65
+	if (isset($globalMap3D) && $globalMap3D) {
66 66
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
67 67
 ?>
68 68
 	<li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
69 69
 <?php
70
-        } else {
71
-    	    if (isset($globalMapSatellites) && $globalMapSatellites) {
70
+		} else {
71
+			if (isset($globalMapSatellites) && $globalMapSatellites) {
72 72
 ?>
73 73
 	<li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li>
74 74
 <?php
75
-	    }
75
+		}
76 76
 ?>
77 77
 	<li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
78 78
 <?php
79 79
 	}
80
-    }
80
+	}
81 81
 ?>
82 82
     </ul>
83 83
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 ?>
110 110
         </div>
111 111
 <?php
112
-    if (isset($globalArchive) && $globalArchive == TRUE) {
112
+	if (isset($globalArchive) && $globalArchive == TRUE) {
113 113
 ?>
114 114
         <div class="sidebar-pane" id="archive">
115 115
 	    <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	    </form>
166 166
 	</div>
167 167
 <?php
168
-    }
168
+	}
169 169
 ?>
170 170
         <div class="sidebar-pane" id="settings">
171 171
 	    <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -176,56 +176,56 @@  discard block
 block discarded – undo
176 176
 			    <?php
177 177
 				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
178 178
 				else $MapType = $_COOKIE['MapType'];
179
-			    ?>
179
+				?>
180 180
 			    <?php
181 181
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
182
-			    ?>
182
+				?>
183 183
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
184 184
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
185 185
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
186 186
 			    <?php
187 187
 				}
188
-			    ?>
188
+				?>
189 189
 			    <?php
190
-			        if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
191
-			    ?>
190
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
191
+				?>
192 192
 			    <?php
193
-				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
194
-			    ?>
193
+					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
194
+				?>
195 195
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
196 196
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
197 197
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
198 198
 			    <?php
199
-				    }
200
-			    ?>
199
+					}
200
+				?>
201 201
 			    <?php
202
-				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
203
-			    ?>
202
+					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
203
+				?>
204 204
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
205 205
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
206 206
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
207 207
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
208 208
 			    <?php
209
-				    }
210
-			    ?>
209
+					}
210
+				?>
211 211
 			    <?php
212
-				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
213
-			    ?>
212
+					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
213
+				?>
214 214
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
215 215
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
216 216
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
217 217
 			    <?php
218
-				    }
219
-			    ?>
218
+					}
219
+				?>
220 220
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
221 221
 			    <?php
222 222
 				}
223
-			    ?>
223
+				?>
224 224
 			    <?php
225
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
225
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
226 226
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
227 227
 					else $MapBoxId = $_COOKIE['MapTypeId'];
228
-			    ?>
228
+				?>
229 229
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
230 230
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
231 231
 			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
240 240
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
241 241
 			    <?php
242
-				    }
243
-			    ?>
242
+					}
243
+				?>
244 244
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
245 245
 			</select>
246 246
 		    </li>
247 247
 <?php
248
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
248
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
249 249
 ?>
250 250
 		    <li><?php echo _("Type of Terrain:"); ?>
251 251
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 			</select>
256 256
 		    </li>
257 257
 <?php
258
-    }
258
+	}
259 259
 ?>
260 260
 <?php
261
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
261
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
262 262
 ?>
263 263
 		    
264 264
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
@@ -266,54 +266,54 @@  discard block
 block discarded – undo
266 266
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
267 267
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
268 268
 <?php
269
-    }
269
+	}
270 270
 ?>
271 271
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
272 272
 <?php
273
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
273
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
274 274
 ?>
275 275
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
276 276
 <?php
277
-    }
277
+	}
278 278
 ?>
279 279
 
280 280
 		    <?php
281 281
 			if (function_exists('array_column')) {
282
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
283
-		    ?>
282
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
283
+			?>
284 284
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
285 285
 		    <?php
286
-			    }
286
+				}
287 287
 			} elseif (isset($globalSources)) {
288
-			    $dispolar = false;
289
-			    foreach ($globalSources as $testsource) {
290
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
291
-			    }
292
-			    if ($dispolar) {
293
-		    ?>
288
+				$dispolar = false;
289
+				foreach ($globalSources as $testsource) {
290
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
291
+				}
292
+				if ($dispolar) {
293
+			?>
294 294
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
295 295
 		    <?php
296
-			    }
297
-		        }
298
-		    ?>
296
+				}
297
+				}
298
+			?>
299 299
 <?php
300
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
300
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
301 301
 ?>
302 302
 
303 303
 		    <?php
304
-		        if (extension_loaded('gd') && function_exists('gd_info')) {
305
-		    ?>
304
+				if (extension_loaded('gd') && function_exists('gd_info')) {
305
+			?>
306 306
 		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
307 307
 		    <?php 
308 308
 			if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
309
-		    ?>
309
+			?>
310 310
 		    <li><?php echo _("Aircraft icon color:"); ?>
311 311
 			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
312 312
 		    </li>
313 313
 		    <?php
314
-			    }
315
-		        }
316
-		    ?>
314
+				}
315
+				}
316
+			?>
317 317
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
318 318
 			<div class="range">
319 319
 			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
@@ -321,20 +321,20 @@  discard block
 block discarded – undo
321 321
 			</div>
322 322
 		    </li>
323 323
 <?php
324
-    }
324
+	}
325 325
 ?>
326 326
 		    <?php
327 327
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
328
-		    ?>
328
+			?>
329 329
 			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
330 330
 			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
331 331
 			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
332 332
 		    <?php
333 333
 			}
334
-		    ?>
334
+			?>
335 335
 		    <?php
336 336
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
337
-		    ?>
337
+			?>
338 338
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
339 339
 			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
340 340
 			<?php } ?>
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			<?php } ?>
344 344
 		    <?php
345 345
 			}
346
-		    ?>
346
+			?>
347 347
 		    <li><?php echo _("Display airlines:"); ?>
348 348
 			<select class="selectpicker" multiple onchange="airlines(this);">
349 349
 			    <?php
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
358 358
 					}
359 359
 				}
360
-			    ?>
360
+				?>
361 361
 			</select>
362 362
 		    </li>
363 363
 		    <?php
364 364
 			if (isset($globalAPRS) && $globalAPRS) {
365
-		    ?>
365
+			?>
366 366
 		    <li><?php echo _("Display APRS sources name:"); ?>
367 367
 			<select class="selectpicker" multiple onchange="sources(this);">
368 368
 			    <?php
@@ -374,15 +374,15 @@  discard block
 block discarded – undo
374 374
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
375 375
 					}
376 376
 				}
377
-			    ?>
377
+				?>
378 378
 			</select>
379 379
 		    </li>
380 380
 		    <?php
381 381
 			}
382
-		    ?>
382
+			?>
383 383
 		    <?php
384 384
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
385
-		    ?>
385
+			?>
386 386
 		    <li><?php echo _("Display airlines of type:"); ?>
387 387
 			<select class="selectpicker" onchange="airlinestype(this);">
388 388
 			    <option value="all"<?php if (!isset($_COOKIE['airlinestype']) || $_COOKIE['airlinestype'] == 'all' || $_COOKIE['airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		    </li>
394 394
 		    <?php
395 395
 			}
396
-		    ?>
396
+			?>
397 397
 		    <li><?php echo _("Distance unit:"); ?>
398 398
 			<select class="selectpicker" onchange="unitdistance(this);">
399 399
 			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	    <p><?php echo _("Any change in settings reload page"); ?></p>
420 420
     	</div>
421 421
 <?php
422
-    if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
422
+	if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
423 423
 ?>
424 424
         <div class="sidebar-pane" id="satellites">
425 425
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -459,14 +459,14 @@  discard block
 block discarded – undo
459 459
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
460 460
 					}
461 461
 				}
462
-			    ?>
462
+				?>
463 463
 			</select>
464 464
 		    </li>
465 465
 		</ul>
466 466
 	    </form>
467 467
 	</div>
468 468
 <?php
469
-    }
469
+	}
470 470
 ?>
471 471
     </div>
472 472
 </div>
Please login to merge, or discard this patch.
require/class.NOTAM.php 1 patch
Indentation   +942 added lines, -942 removed lines patch added patch discarded remove patch
@@ -7,964 +7,964 @@
 block discarded – undo
7 7
 class NOTAM {
8 8
 	public $db;
9 9
 	private $abbr = array(
10
-	                    'A/A' => 'Air-to-air',
11
-	                    'A/G' => 'Air-to-ground',
12
-	                    'AAL' => 'Above Aerodrome Level',
13
-	                    'ABM' => 'Abeam',
14
-	                    'ABN' => 'Aerodrome Beacon',
15
-	                    'ABT' => 'About',
16
-	                    'ABV' => 'Above',
17
-	                    'ACC' => 'Area Control',
18
-	                    'ACFT' => 'Aircraft',
19
-	                    'ACK' => 'Acknowledge',
20
-	                    'ACL' => 'Altimeter Check Location',
21
-	                    'ACN' => 'Aircraft Classification Number',
22
-	                    'ACPT' => 'Accepted',
23
-	                    'ACT' => 'Active',
24
-	                    'AD' => 'Aerodrome',
25
-	                    'ADA' => 'Advisory Area',
26
-	                    'ADC' => 'Aerodrome Chart',
27
-	                    'ADDN' => 'Additional',
28
-	                    'ADIZ' => 'Air defense identification zone',
29
-	                    'ADJ' => 'Adjacent',
30
-	                    'ADR' => 'Advisory Route',
31
-	                    'ADS' => 'Automatic Dependent Surveillance',
32
-	                    'ADVS' => 'Advisory Service',
33
-	                    'ADZ' => 'Advised',
34
-	                    'AFIL' => 'Flight Plan Filed In The Air',
35
-	                    'AFIS' => 'Airport flight information service',
36
-	                    'AFM' => 'Affirm',
37
-	                    'AFT' => 'After',
38
-	                    'AGA' => 'Aerodromes, Air Routes and Ground Aids',
39
-	                    'AGN' => 'Again',
40
-	                    'AIS' => 'Aeronautical information service',
41
-	                    'ALERFA' => 'Alert Phase',
42
-	                    'ALRS' => 'Alerting Service',
43
-	                    'ALS' => 'Approach Lighting System',
44
-	                    'ALT' => 'Altitude',
45
-	                    'ALTN' => 'Alternate',
46
-	                    'AMA' => 'Area Minimum Altitude',
47
-	                    'ANC' => 'Aeronautical Chart',
48
-	                    'ANCS' => 'Aeronautical Navigation Chart',
49
-	                    'ANS' => 'Answer',
50
-	                    'AOC' => 'Aerodrome Obstacle Chart',
51
-	                    'AP' => 'Airport',
52
-	                    'APCH' => 'Approach',
53
-	                    'APDC' => 'Aircraft Parking/docking Chart',
54
-	                    'APN' => 'Apron',
55
-	                    'APNS' => 'Aprons',
56
-	                    'APP' => 'Approach Control',
57
-	                    'APR' => 'April',
58
-	                    'APRX' => 'Approximately',
59
-	                    'APSG' => 'After Passing',
60
-	                    'APV' => 'Approved',
61
-	                    'ARC' => 'Area Chart',
62
-	                    'ARNG' => 'Arrange',
63
-	                    'ARO' => 'Air Traffic Services Reporting Office',
64
-	                    'ARP' => 'Aerodrome Reference Point',
65
-	                    'ARR' => 'Arriving',
66
-	                    'ARST' => 'Arresting',
67
-	                    'ASC' => 'Ascend To',
68
-	                    'ASDA' => 'Accelerate-Stop Distance Available',
69
-	                    'ASPEEDG' => 'Airspeed Gain',
70
-	                    'ASPEEDL' => 'Airspeed Loss',
71
-	                    'ASPH' => 'Asphalt',
72
-	                    'ATA' => 'Actual Time of Arrival',
73
-	                    'ATD' => 'Actual Time of Departure',
74
-	                    'ATFM' => 'Air Traffic Flow Management',
75
-	                    'ATIS' => 'Automatic terminal information service',
76
-	                    'ATM' => 'Air Traffic Management',
77
-	                    'ATP' => 'At',
78
-	                    'ATTN' => 'Attention',
79
-	                    'ATZ' => 'Aerodrome Traffic Zone',
80
-	                    'AUG' => 'August',
81
-	                    'AUTH' => 'Authorization',
82
-	                    'AUW' => 'All Up Weight',
83
-	                    'AUX' => 'Auxiliary',
84
-	                    'AVBL' => 'Available',
85
-	                    'AVG' => 'Average',
86
-	                    'AVGAS' => 'Aviation Gasoline',
87
-	                    'AWTA' => 'Advise At What Time Able',
88
-	                    'AWY' => 'Airway',
89
-	                    'AWYS' => 'Airways',
90
-	                    'AZM' => 'Azimuth',
91
-	                    'BA' => 'Braking Action',
92
-	                    'BCN' => 'Beacon',
93
-	                    'BCST' => 'Broadcast',
94
-	                    'BDRY' => 'Boundary',
95
-	                    'BFR' => 'Before',
96
-	                    'BLDG' => 'Building',
97
-	                    'BLO' => 'Below Clouds',
98
-	                    'BLW' => 'Below',
99
-	                    'BRF' => 'Short',
100
-	                    'BRG' => 'Bearing',
101
-	                    'BRKG' => 'Breaking',
102
-	                    'BTL' => 'Between Layers',
103
-	                    'BTN' => 'Between',
104
-	                    'CD' => 'Candela',
105
-	                    'CDN' => 'Coordination',
106
-	                    'CF' => 'Change Frequency To',
107
-	                    'CFM' => 'Confirm',
108
-	                    'CGL' => 'Circling Guidance Light(s)',
109
-	                    'CH' => 'Channel',
110
-	                    'CHG' => 'Changed',
111
-	                    'CIT' => 'Near or Over Large Towns',
112
-	                    'CIV' => 'Civil',
113
-	                    'CK' => 'Check',
114
-	                    'CL' => 'Centre Line',
115
-	                    'CLBR' => 'Calibration',
116
-	                    'CLD' => 'Cloud',
117
-	                    'CLG' => 'Calling',
118
-	                    'CLIMB-OUT' => 'Climb-out Area',
119
-	                    'CLR' => 'Clearance',
120
-	                    'CLRD' => 'Cleared',
121
-	                    'CLSD' => 'Closed',
122
-	                    'CMB' => 'Climb',
123
-	                    'CMPL' => 'Complete',
124
-	                    'CNL' => 'Cancel',
125
-	                    'CNS' => 'Communications, Navigation And Surveillance',
126
-	                    'COM' => 'Communications',
127
-	                    'CONC' => 'Concrete',
128
-	                    'COND' => 'Condition',
129
-	                    'CONS' => 'Continuous',
130
-	                    'CONST' => 'Construction',
131
-	                    'CONT' => 'Continued',
132
-	                    'COOR' => 'Coordination',
133
-	                    'COORD' => 'Coordinates',
134
-	                    'COP' => 'Change-over Point',
135
-	                    'COR' => 'Correction',
136
-	                    'COT' => 'At The Coast',
137
-	                    'COV' => 'Covered',
138
-	                    'CPDLC' => 'Controller-pilot Data Link Communications',
139
-	                    'CPL' => 'Current Flight Plan',
140
-	                    'CRC' => 'Cyclic Redundancy Check',
141
-	                    'CRZ' => 'Cruise',
142
-	                    'CTA' => 'Control area',
143
-	                    'CTAM' => 'Climb To And Maintain',
144
-	                    'CTC' => 'Contact',
145
-	                    'CTL' => 'Control',
146
-	                    'CTN' => 'Caution',
147
-	                    'CTR' => 'Control Zone',
148
-	                    'CVR' => 'Cockpit Voice Recorder',
149
-	                    'CW' => 'Continuous Wave',
150
-	                    'CWY' => 'Clearway',
151
-	                    'DA' => 'Decision Altitude',
152
-	                    'DCKG' => 'Docking',
153
-	                    'DCP' => 'Datum Crossing Point',
154
-	                    'DCPC' => 'Direct Controller-pilot Communications',
155
-	                    'DCT' => 'Direct',
156
-	                    'DEC' => 'December',
157
-	                    'DEG' => 'Degrees',
158
-	                    'DEP' => 'Departing',
159
-	                    'DES' => 'Descend',
160
-	                    'DEST' => 'Destination',
161
-	                    'DETRESFA' => 'Distress Phase',
162
-	                    'DEV' => 'Deviating',
163
-	                    'DFDR' => 'Digital Flight Data Recorder',
164
-	                    'DFTI' => 'Distance From Touchdown Indicator',
165
-	                    'DH' => 'Decision Height',
166
-	                    'DIP' => 'Diffuse',
167
-	                    'DIST' => 'Distance',
168
-	                    'DIV' => 'Divert',
169
-	                    'DLA' => 'Delay',
170
-	                    'DLY' => 'Daily',
171
-	                    'DME' => 'Distance measuring equipment',
172
-	                    'DNG' => 'Dangerous',
173
-	                    'DOM' => 'Domestic',
174
-	                    'DPT' => 'Depth',
175
-	                    'DR' => 'Dead Reckoning',
176
-	                    'DRG' => 'During',
177
-	                    'DTAM' => 'Descend To And Maintain',
178
-	                    'DTG' => 'Date-time Group',
179
-	                    'DTHR' => 'Displaced Runway Threshold',
180
-	                    'DTRT' => 'Deteriorating',
181
-	                    'DTW' => 'Dual Tandem Wheels',
182
-	                    'DUPE' => 'This Is A Duplicate Message',
183
-	                    'DUR' => 'Duration',
184
-	                    'DVOR' => 'Doppler VOR',
185
-	                    'DW' => 'Dual Wheels',
186
-	                    'EAT' => 'Expected Approach Time',
187
-	                    'EB' => 'Eastbound',
188
-	                    'EDA' => 'Elevation Differential Area',
189
-	                    'EET' => 'Estimated Elapsed Time',
190
-	                    'EFC' => 'Expect Further Clearance',
191
-	                    'ELBA' => 'Emergency Location Beacon',
192
-	                    'ELEV' => 'Elevation',
193
-	                    'ELR' => 'Extra Long Range',
194
-	                    'EM' => 'Emission',
195
-	                    'EMERG' => 'Emergency',
196
-	                    'END' => 'Stop-end',
197
-	                    'ENE' => 'East-north-east',
198
-	                    'ENG' => 'Engine',
199
-	                    'ENR' => 'En-route',
200
-	                    'ENRC' => 'En-route Chart',
201
-	                    'EOBT' => 'Estimated Off-block Time',
202
-	                    'EQPT' => 'Equipment',
203
-	                    'ER' => 'Here',
204
-	                    'ESE' => 'East-south-east',
205
-	                    'EST' => 'Estimate',
206
-	                    'ETA' => 'Estimated Time Of Arrival',
207
-	                    'ETD' => 'Estimated Time Of Departure',
208
-	                    'ETO' => 'Estimated Time Over Significant Point',
209
-	                    'EV' => 'Every',
210
-	                    'EXC' => 'Except',
211
-	                    'EXER' => 'Exercise',
212
-	                    'EXP' => 'Expect',
213
-	                    'EXTD' => 'Extend',
214
-	                    'FAC' => 'Facilities',
215
-	                    'FAF' => 'Final Approach Fix',
216
-	                    'FAL' => 'Facilitation of International Airtransport',
217
-	                    'FAP' => 'Final Approach Point',
218
-	                    'FATO' => 'Final Approach And Take-off Area',
219
-	                    'FAX' => 'Fax',
220
-	                    'FBL' => 'Light',
221
-	                    'FCST' => 'Forecast',
222
-	                    'FCT' => 'Friction Coefficient',
223
-	                    'FDPS' => 'Flight Data Processing System',
224
-	                    'FEB' => 'February',
225
-	                    'FIR' => 'Flight information region',
226
-	                    'FIS' => 'Flight information service',
227
-	                    'FLD' => 'Field',
228
-	                    'FLG' => 'Flashing',
229
-	                    'FLR' => 'Flares',
230
-	                    'FLT' => 'Flight',
231
-	                    'FLTS' => 'Flights',
232
-	                    'FLTCK' => 'Flight Check',
233
-	                    'FLUC' => 'Fluctuating',
234
-	                    'FLW' => 'Follow(s)',
235
-	                    'FLY' => 'Fly',
236
-	                    'FM' => 'From',
237
-	                    'FMS' => 'Flight Management System',
238
-	                    'FMU' => 'Flow Management Unit',
239
-	                    'FNA' => 'Final Approach',
240
-	                    'FPAP' => 'Flight Path Alignment Point',
241
-	                    'FPL' => 'Flight Plan',
242
-	                    'FPLS' => 'Flight Plans',
243
-	                    'FPM' => 'Feet Per Minute',
244
-	                    'FPR' => 'Flight Plan Route',
245
-	                    'FR' => 'Fuel Remaining',
246
-	                    'FREQ' => 'Frequency',
247
-	                    'FRI' => 'Friday',
248
-	                    'FRMG' => 'Missile, gun or rocket firing',
249
-	                    'FRNG' => 'Firing',
250
-	                    'FRONT' => 'Front',
251
-	                    'FRQ' => 'Frequent',
252
-	                    'FSL' => 'Full Stop Landing',
253
-	                    'FSS' => 'Flight Service Station',
254
-	                    'FST' => 'First',
255
-	                    'FTP' => 'Fictitious Threshold Point',
256
-	                    'G/A' => 'Ground-to-air',
257
-	                    'G/A/G' => 'Ground-to-air and Air-to-ground',
258
-	                    'GARP' => 'GBAS Azimuth Reference Point',
259
-	                    'GBAS' => 'Ground-based Augmentation System',
260
-	                    'GCAJ' => 'Ground Controlled Approach',
261
-	                    'GCA' => 'Ground Controlled Approach System',
262
-	                    'GEN' => 'General',
263
-	                    'GEO' => 'Geographic or True',
264
-	                    'GES' => 'Ground Earth Station',
265
-	                    'GLD' => 'Glider',
266
-	                    'GMC' => 'Ground Movement Chart',
267
-	                    'GND' => 'Ground',
268
-	                    'GNDCK' => 'Ground Check',
269
-	                    'GP' => 'Glide Path',
270
-	                    'GRASS' => 'Grass landing area',
271
-	                    'GRVL' => 'Gravel',
272
-	                    'GUND' => 'Geoid Undulation',
273
-	                    'H24' => '24 Hours',
274
-	                    'HAPI' => 'Helicopter Approach Path Indicator',
275
-	                    'HBN' => 'Hazard Beacon',
276
-	                    'HDG' => 'Heading',
277
-	                    'HEL' => 'Helicopter',
278
-	                    'HGT' => 'Height',
279
-	                    'HJ' => 'Sunrise to Sunset',
280
-	                    'HLDG' => 'Holding',
281
-	                    'HN' => 'Sunset to Sunrise',
282
-	                    'HO' => 'Service Available To Meet Operational Requirements',
283
-	                    'HOL' => 'Holiday',
284
-	                    'HOSP' => 'Hospital Aircraft',
285
-	                    'HOT' => 'Height',
286
-	                    'HPA' => 'Hectopascal',
287
-	                    'HR' => 'Hours',
288
-	                    'HRS' => 'Hours',
289
-	                    'HS' => 'Service Available During Hours Of Scheduled Operations',
290
-	                    'HURCN' => 'Hurricane',
291
-	                    'HVY' => 'Heavy',
292
-	                    'HX' => 'No Specific Working Hours',
293
-	                    'HYR' => 'Higher',
294
-	                    'IAC' => 'Instrument Approach Chart',
295
-	                    'IAF' => 'Initial Approach Fix',
296
-	                    'IAO' => 'In And Out Of Clouds',
297
-	                    'IAP' => 'Instrument Approach Procedure',
298
-	                    'IAR' => 'Intersection Of Air Routes',
299
-	                    'IBN' => 'Identification Beacon',
300
-	                    'ID' => 'Identifier',
301
-	                    'IDENT' => 'Identification',
302
-	                    'IFF' => 'Identification Friend/Foe',
303
-	                    'IGA' => 'International General Aviation',
304
-	                    'IM' => 'Inner Marker',
305
-	                    'IMPR' => 'Improving',
306
-	                    'IMT' => 'Immediately',
307
-	                    'INA' => 'Initial Approach',
308
-	                    'INBD' => 'Inbound',
309
-	                    'INCERFA' => 'Uncertainty Phase',
310
-	                    'INFO' => 'Information',
311
-	                    'INOP' => 'Inoperative',
312
-	                    'INP' => 'If Not Possible',
313
-	                    'INPR' => 'In Progress',
314
-	                    'INSTL' => 'Installation',
315
-	                    'INSTR' => 'Instrument',
316
-	                    'INT' => 'Intersection',
317
-	                    'INTS' => 'Intersections',
318
-	                    'INTL' => 'International',
319
-	                    'INTRG' => 'Interrogator',
320
-	                    'INTRP' => 'Interruption',
321
-	                    'INTSF' => 'Intensifying',
322
-	                    'INTST' => 'Intensity',
323
-	                    'ISA' => 'International Standard Atmosphere',
324
-	                    'JAN' => 'January',
325
-	                    'JTST' => 'Jet stream',
326
-	                    'JUL' => 'July',
327
-	                    'JUN' => 'June',
328
-	                    'KMH' => 'Kilometres Per Hour',
329
-	                    'KPA' => 'Kilopascal',
330
-	                    'KT' => 'Knots',
331
-	                    'KW' => 'Kilowatts',
332
-	                    'LAN' => 'Inland',
333
-	                    'LAT' => 'Latitude',
334
-	                    'LDA' => 'Landing Distance Available',
335
-	                    'LDAH' => 'Landing Distance Available, Helicopter',
336
-	                    'LDG' => 'Landing',
337
-	                    'LDI' => 'Landing Direction Indicator',
338
-	                    'LEN' => 'Length',
339
-	                    'LGT' => 'Lighting',
340
-	                    'LGTD' => 'Lighted',
341
-	                    'LIH' => 'Light Intensity High',
342
-	                    'LIL' => 'Light Intensity Low',
343
-	                    'LIM' => 'Light Intensity Medium',
344
-	                    'LLZ' => 'Localizer',
345
-	                    'LM' => 'Locator, Middle',
346
-	                    'LMT' => 'Local Mean Time',
347
-	                    'LNG' => 'Long',
348
-	                    'LO' => 'Locator, Outer',
349
-	                    'LOG' => 'Located',
350
-	                    'LONG' => 'Longitude',
351
-	                    'LRG' => 'Long Range',
352
-	                    'LTD' => 'Limited',
353
-	                    'LTP' => 'Landing Threshold Point',
354
-	                    'LVE' => 'Leaving',
355
-	                    'LVL' => 'Level',
356
-	                    'LYR' => 'Layer',
357
-	                    'MAA' => 'Maximum Authorized Altitude',
358
-	                    'MAG' => 'Magnetic',
359
-	                    'MAINT' => 'Maintenance',
360
-	                    'MAP' => 'Aeronautical Maps and Charts',
361
-	                    'MAPT' => 'Missed Approach Point',
362
-	                    'MAR' => 'March',
363
-	                    'MAX' => 'Maximum',
364
-	                    'MAY' => 'May',
365
-	                    'MBST' => 'Microburst',
366
-	                    'MCA' => 'Minimum Crossing Altitude',
367
-	                    'MCW' => 'Modulated Continuous Wave',
368
-	                    'MDA' => 'Minimum Descent Altitude',
369
-	                    'MDH' => 'Minimum Descent Height',
370
-	                    'MEA' => 'Minimum En-route Altitude',
371
-	                    'MEHT' => 'Minimum Eye Height Over Threshold',
372
-	                    'MET' => 'Meteorological',
373
-	                    'MID' => 'Mid-point',
374
-	                    'MIL' => 'Military',
375
-	                    'MIN' => 'Minutes',
376
-	                    'MKR' => 'Marker Radio Beacon',
377
-	                    'MLS' => 'Microwave Landing System',
378
-	                    'MM' => 'Middle Marker',
379
-	                    'MNM' => 'Minimum',
380
-	                    'MNPS' => 'Minimum Navigation Performance Specifications',
381
-	                    'MNT' => 'Monitor',
382
-	                    'MNTN' => 'Maintain',
383
-	                    'MOA' => 'Military Operating Area',
384
-	                    'MOC' => 'Minimum Obstacle Clearance',
385
-	                    'MOD' => 'Moderate',
386
-	                    'MON' => 'Monday',
387
-	                    'MOPS' => 'Minimum Operational Performance Standards',
388
-	                    'MOV' => 'Movement',
389
-	                    'MRA' => 'Minimum Reception Altitude',
390
-	                    'MRG' => 'Medium Range',
391
-	                    'MRP' => 'ATS/MET Reporting Point',
392
-	                    'MS' => 'Minus',
393
-	                    'MSA' => 'Minimum Sector Altitude',
394
-	                    'MSAW' => 'Minimum Safe Altitude Warning',
395
-	                    'MSG' => 'Message',
396
-	                    'MSSR' => 'Monopulse Secondary Surveillance Radar',
397
-	                    'MT' => 'Mountain',
398
-	                    'MTU' => 'Metric Units',
399
-	                    'MTW' => 'Mountain Waves',
400
-	                    'NASC' => 'National AIS System Centre',
401
-	                    'NAT' => 'North Atlantic',
402
-	                    'NAV' => 'Navigation',
403
-	                    'NB' => 'Northbound',
404
-	                    'NBFR' => 'Not Before',
405
-	                    'NE' => 'North-east',
406
-	                    'NEB' => 'North-eastbound',
407
-	                    'NEG' => 'Negative',
408
-	                    'NGT' => 'Night',
409
-	                    'NIL' => 'None',
410
-	                    'NML' => 'Normal',
411
-	                    'NNE' => 'North-north-east',
412
-	                    'NNW' => 'North-north-west',
413
-	                    'NOF' => 'International NOTAM Office',
414
-	                    'NOV' => 'November',
415
-	                    'NOZ' => 'Normal Operating Zone',
416
-	                    'NR' => 'Number',
417
-	                    'NRH' => 'No Reply Heard',
418
-	                    'NTL' => 'National',
419
-	                    'NTZ' => 'No Transgression Zone',
420
-	                    'NW' => 'North-west',
421
-	                    'NWB' => 'North-westbound',
422
-	                    'NXT' => 'Next',
423
-	                    'O/R' => 'On Request',
424
-	                    'OAC' => 'Oceanic Area Control Centre',
425
-	                    'OAS' => 'Obstacle Assessment Surface',
426
-	                    'OBS' => 'Observe',
427
-	                    'OBST' => 'Obstacle',
428
-	                    'OBSTS' => 'Obstacles',
429
-	                    'OCA' => 'Oceanic Control Area',
430
-	                    'OCH' => 'Obstacle Clearance Height',
431
-	                    'OCL' => 'Obstacle Clearance Limit',
432
-	                    'OCS' => 'Obstacle Clearance Surface',
433
-	                    'OCT' => 'October',
434
-	                    'OFZ' => 'Obstacle Free Zone',
435
-	                    'OGN' => 'Originate',
436
-	                    'OHD' => 'Overhead',
437
-	                    'OM' => 'Outer Marker',
438
-	                    'OPC' => 'Control Indicated Is Operational Control',
439
-	                    'OPMET' => 'Operational Meteorological',
440
-	                    'OPN' => 'Open',
441
-	                    'OPR' => 'Operate',
442
-	                    'OPS' => 'Operations',
443
-	                    'ORD' => 'Order',
444
-	                    'OSV' => 'Ocean Station Vessel',
445
-	                    'OTLK' => 'Outlook',
446
-	                    'OTP' => 'On Top',
447
-	                    'OTS' => 'Organized Track System',
448
-	                    'OUBD' => 'Outbound',
449
-	                    'PA' => 'Precision Approach',
450
-	                    'PALS' => 'Precision Approach Lighting System',
451
-	                    'PANS' => 'Procedures for Air Navigation Services',
452
-	                    'PAR' => 'Precision Approach Radar',
453
-	                    'PARL' => 'Parallel',
454
-	                    'PATC' => 'Precision Approach Terrain Chart',
455
-	                    'PAX' => 'Passenger(s)',
456
-	                    'PCD' => 'Proceed',
457
-	                    'PCL' => 'Pilot-controlled Lighting',
458
-	                    'PCN' => 'Pavement Classification Number',
459
-	                    'PDC' => 'Pre-departure Clearance',
460
-	                    'PDG' => 'Procedure Design Gradient',
461
-	                    'PER' => 'Performance',
462
-	                    'PERM' => 'Permanent',
463
-	                    'PIB' => 'Pre-flight Information Bulletin',
464
-	                    'PJE' => 'Parachute Jumping Exercise',
465
-	                    'PLA' => 'Practice Low Approach',
466
-	                    'PLN' => 'Flight Plan',
467
-	                    'PLVL' => 'Present Level',
468
-	                    'PN' => 'Prior Notice Required',
469
-	                    'PNR' => 'Point Of No Return',
470
-	                    'POB' => 'Persons On Board',
471
-	                    'POSS' => 'Possible',
472
-	                    'PPI' => 'Plan Position Indicator',
473
-	                    'PPR' => 'Prior Permission Required',
474
-	                    'PPSN' => 'Present Position',
475
-	                    'PRI' => 'Primary',
476
-	                    'PRKG' => 'Parking',
477
-	                    'PROB' => 'Probability',
478
-	                    'PROC' => 'Procedure',
479
-	                    'PROV' => 'Provisional',
480
-	                    'PS' => 'Plus',
481
-	                    'PSG' => 'Passing',
482
-	                    'PSN' => 'Position',
483
-	                    'PSNS' => 'Positions',
484
-	                    'PSR' => 'Primary Surveillance Radar',
485
-	                    'PSYS' => 'Pressure System(s)',
486
-	                    'PTN' => 'Procedure Turn',
487
-	                    'PTS' => 'Polar Track Structure',
488
-	                    'PWR' => 'Power',
489
-	                    'QUAD' => 'Quadrant',
490
-	                    'RAC' => 'Rules of The Air and Air Traffic Services',
491
-	                    'RAG' => 'Runway Arresting Gear',
492
-	                    'RAI' => 'Runway Alignment Indicator',
493
-	                    'RASC' => 'Regional AIS System Centre',
494
-	                    'RASS' => 'Remote Altimeter Setting Source',
495
-	                    'RB' => 'Rescue Boat',
496
-	                    'RCA' => 'Reach Cruising Altitude',
497
-	                    'RCC' => 'Rescue Coordination Centre',
498
-	                    'RCF' => 'Radiocommunication Failure',
499
-	                    'RCH' => 'Reaching',
500
-	                    'RCL' => 'Runway Centre Line',
501
-	                    'RCLL' => 'Runway Centre Line Light(s)',
502
-	                    'RCLR' => 'Recleared',
503
-	                    'RDH' => 'Reference Datum Height',
504
-	                    'RDL' => 'Radial',
505
-	                    'RDO' => 'Radio',
506
-	                    'RE' => 'Recent',
507
-	                    'REC' => 'Receiver',
508
-	                    'REDL' => 'Runway Edge Light(s)',
509
-	                    'REF' => 'Refer To',
510
-	                    'REG' => 'Registration',
511
-	                    'RENL' => 'Runway End Light(s)',
512
-	                    'REP' => 'Report',
513
-	                    'REQ' => 'Requested',
514
-	                    'RERTE' => 'Re-route',
515
-	                    'RESA' => 'Runway End Safety Area',
516
-	                    'RG' => 'Range (lights)',
517
-	                    'RHC' => 'Right-hand Circuit',
518
-	                    'RIF' => 'Reclearance In Flight',
519
-	                    'RITE' => 'Right',
520
-	                    'RL' => 'Report Leaving',
521
-	                    'RLA' => 'Relay To',
522
-	                    'RLCE' => 'Request Level Change En Route',
523
-	                    'RLLS' => 'Runway Lead-in Lighting System',
524
-	                    'RLNA' => 'Request Level Not Available',
525
-	                    'RMAC' => 'Radar Minimum Altitude Chart',
526
-	                    'RMK' => 'Remark',
527
-	                    'RNG' => 'Radio Range',
528
-	                    'RNP' => 'Required Navigation Performance',
529
-	                    'ROC' => 'Rate Of Climb',
530
-	                    'ROD' => 'Rate Of Descent',
531
-	                    'ROFOR' => 'Route Forecast',
532
-	                    'RON' => 'Receiving Only',
533
-	                    'RPI' => 'Radar Position Indicator',
534
-	                    'RPL' => 'Repetitive Flight Plan',
535
-	                    'RPLC' => 'Replaced',
536
-	                    'RPS' => 'Radar Position Symbol',
537
-	                    'RQMNTS' => 'Requirements',
538
-	                    'RQP' => 'Request Flight Plan',
539
-	                    'RQS' => 'Request Supplementary Flight Plan',
540
-	                    'RR' => 'Report Reaching',
541
-	                    'RSC' => 'Rescue Sub-centre',
542
-	                    'RSCD' => 'Runway Surface Condition',
543
-	                    'RSP' => 'Responder Beacon',
544
-	                    'RSR' => 'En-route Surveillance Radar',
545
-	                    'RTE' => 'Route',
546
-	                    'RTES' => 'Routes',
547
-	                    'RTF' => 'Radiotelephone',
548
-	                    'RTG' => 'Radiotelegraph',
549
-	                    'RTHL' => 'Runway Threshold Light(s)',
550
-	                    'RTN' => 'Return',
551
-	                    'RTODAH' => 'Rejected Take-off Distance Available, Helicopter',
552
-	                    'RTS' => 'Return To Service',
553
-	                    'RTT' => 'Radioteletypewriter',
554
-	                    'RTZL' => 'Runway Touchdown Zone Light(s)',
555
-	                    'RUT' => 'Standard Regional Route Transmitting Frequencies',
556
-	                    'RV' => 'Rescue Vessel',
557
-	                    'RVSM' => 'Reduced Vertical Separation Minimum',
558
-	                    'RWY' => 'Runway',
559
-	                    'RWYS' => 'Runways',
560
-	                    'SALS' => 'Simple Approach Lighting System',
561
-	                    'SAN' => 'Sanitary',
562
-	                    'SAP' => 'As Soon As Possible',
563
-	                    'SAR' => 'Search and Rescue',
564
-	                    'SARPS' => 'Standards and Recommended Practices',
565
-	                    'SAT' => 'Saturday',
566
-	                    'SATCOM' => 'Satellite Communication',
567
-	                    'SB' => 'Southbound',
568
-	                    'SBAS' => 'Satellite-based Augmentation System',
569
-	                    'SDBY' => 'Stand by',
570
-	                    'SE' => 'South-east',
571
-	                    'SEA' => 'Sea',
572
-	                    'SEB' => 'South-eastbound',
573
-	                    'SEC' => 'Seconds',
574
-	                    'SECN' => 'Section',
575
-	                    'SECT' => 'Sector',
576
-	                    'SELCAL' => 'Selective calling system',
577
-	                    'SEP' => 'September',
578
-	                    'SER' => 'Service',
579
-	                    'SEV' => 'Severe',
580
-	                    'SFC' => 'Surface',
581
-	                    'SGL' => 'Signal',
582
-	                    'SID' => 'Standard Instrument Departure',
583
-	                    'SIF' => 'Selective Identification Feature',
584
-	                    'SIG' => 'Significant',
585
-	                    'SIMUL' => 'Simultaneous',
586
-	                    'SKED' => 'Schedule',
587
-	                    'SLP' => 'Speed Limiting Point',
588
-	                    'SLW' => 'Slow',
589
-	                    'SMC' => 'Surface Movement Control',
590
-	                    'SMR' => 'Surface Movement Radar',
591
-	                    'SPL' => 'Supplementary Flight Plan',
592
-	                    'SPOC' => 'SAR Point Of Contact',
593
-	                    'SPOT' => 'Spot Wind',
594
-	                    'SR' => 'Sunrise',
595
-	                    'SRA' => 'Surveillance Radar Approach',
596
-	                    'SRE' => 'Surveillance Radar Element Of Precision Approach Radar System',
597
-	                    'SRG' => 'Short Range',
598
-	                    'SRR' => 'Search and Rescue Region',
599
-	                    'SRY' => 'Secondary',
600
-	                    'SS' => 'Sunset',
601
-	                    'SSE' => 'South-south-east',
602
-	                    'SSR' => 'Secondary Surveillance Radar',
603
-	                    'SST' => 'Supersonic Transport',
604
-	                    'SSW' => 'South-south-west',
605
-	                    'STA' => 'Straight-in Approach',
606
-	                    'STAR' => 'Standard Instrument Arrival',
607
-	                    'STD' => 'Standard',
608
-	                    'STN' => 'Station',
609
-	                    'STNR' => 'Stationary',
610
-	                    'STOL' => 'Short Take-off and Landing',
611
-	                    'STS' => 'Status',
612
-	                    'STWL' => 'Stopway Light(s)',
613
-	                    'SUBJ' => 'Subject To',
614
-	                    'SUN' => 'Sunday',
615
-	                    'SUP' => 'Supplement',
616
-	                    'SUPPS' => 'Regional Supplementary Procedures Service Message',
617
-	                    'SVCBL' => 'Serviceable',
618
-	                    'SW' => 'South-west',
619
-	                    'SWB' => 'South-westbound',
620
-	                    'SWY' => 'Stopway',
621
-	                    'TA' => 'Transition Altitude',
622
-	                    'TAA' => 'Terminal Arrival Altitude',
623
-	                    'TAF' => 'Aerodrome Forecast',
624
-	                    'TAIL' => 'Tail Wind',
625
-	                    'TAR' => 'Terminal Area Surveillance Radar',
626
-	                    'TAX' => 'Taxi',
627
-	                    'TCAC' => 'Tropical Cyclone Advisory Centre',
628
-	                    'TDO' => 'Tornado',
629
-	                    'TDZ' => 'Touchdown Zone',
630
-	                    'TECR' => 'Technical Reason',
631
-	                    'TEMPO' => 'Temporarily',
632
-	                    'TFC' => 'Traffic',
633
-	                    'TGL' => 'Touch-and-go',
634
-	                    'TGS' => 'Taxiing Guidance System',
635
-	                    'THR' => 'Threshold',
636
-	                    'THRU' => 'Through',
637
-	                    'THU' => 'Thursday',
638
-	                    'TIBA' => 'Traffic Information Broadcast By Aircraft',
639
-	                    'TIL' => 'Until',
640
-	                    'TIP' => 'Until Past',
641
-	                    'TKOF' => 'Take-off',
642
-	                    'TL' => 'Till',
643
-	                    'TLOF' => 'Touchdown And Lift-off Area',
644
-	                    'TMA' => 'Terminal Control Area',
645
-	                    'TNA' => 'Turn Altitude',
646
-	                    'TNH' => 'Turn Height',
647
-	                    'TOC' => 'Top of Climb',
648
-	                    'TODA' => 'Take-off Distance Available',
649
-	                    'TODAH' => 'Take-off Distance Available, Helicopter',
650
-	                    'TORA' => 'Take-off Run Available',
651
-	                    'TP' => 'Turning Point',
652
-	                    'TR' => 'Track',
653
-	                    'TRA' => 'Temporary Reserved Airspace',
654
-	                    'TRANS' => 'Transmitter',
655
-	                    'TRL' => 'Transition Level',
656
-	                    'TUE' => 'Tuesday',
657
-	                    'TURB' => 'Turbulence',
658
-	                    'TVOR' => 'Terminal VOR',
659
-	                    'TWR' => 'Tower',
660
-	                    'TWY' => 'Taxiway',
661
-	                    'TWYL' => 'Taxiway-link',
662
-	                    'TXT' => 'Text',
663
-	                    'TYP' => 'Type of Aircraft',
664
-	                    'U/S' => 'Unserviceable',
665
-	                    'UAB' => 'Until Advised By',
666
-	                    'UAC' => 'Upper Area Control Centre',
667
-	                    'UAR' => 'Upper Air Route',
668
-	                    'UDA' => 'Upper advisory area',
669
-	                    'UFN' => 'Until Further Notice',
670
-	                    'UHDT' => 'Unable Higher Due Traffic',
671
-	                    'UIC' => 'Upper Information Centre',
672
-	                    'UIR' => 'Upper Flight Information Region',
673
-	                    'ULR' => 'Ultra Long Range',
674
-	                    'UNA' => 'Unable',
675
-	                    'UNAP' => 'Unable To Approve',
676
-	                    'UNL' => 'Unlimited',
677
-	                    'UNREL' => 'Unreliable',
678
-	                    'UTA' => 'Upper Control Area',
679
-	                    'VAAC' => 'Volcanic Ash Advisory Centre',
680
-	                    'VAC' => 'Visual Approach Chart',
681
-	                    'VAL' => 'In Valleys',
682
-	                    'VAN' => 'Runway Control Van',
683
-	                    'VAR' => 'Visual-aural Radio Range',
684
-	                    'VC' => 'Vicinity',
685
-	                    'VCY' => 'Vicinity',
686
-	                    'VER' => 'Vertical',
687
-	                    'VIS' => 'Visibility',
688
-	                    'VLR' => 'Very Long Range',
689
-	                    'VPA' => 'Vertical Path Angle',
690
-	                    'VRB' => 'Variable',
691
-	                    'VSA' => 'By Visual Reference To The Ground',
692
-	                    'VSP' => 'Vertical Speed',
693
-	                    'VTOL' => 'Vertical Take-off And Landing',
694
-	                    'WAC' => 'World Aeronautical Chart',
695
-	                    'WAFC' => 'World Area Forecast Centre',
696
-	                    'WB' => 'Westbound',
697
-	                    'WBAR' => 'Wing Bar Lights',
698
-	                    'WDI' => 'Wind Direction Indicator',
699
-	                    'WDSPR' => 'Widespread',
700
-	                    'WED' => 'Wednesday',
701
-	                    'WEF' => 'Effective From',
702
-	                    'WI' => 'Within',
703
-	                    'WID' => 'Width',
704
-	                    'WIE' => 'Effective Immediately',
705
-	                    'WILCO' => 'Will Comply',
706
-	                    'WIND' => 'Wind',
707
-	                    'WINTEM' => 'Forecast Upper Wind And Temperature For Aviation',
708
-	                    'WIP' => 'Work In Progress',
709
-	                    'WKN' => 'Weaken',
710
-	                    'WNW' => 'West-north-west',
711
-	                    'WO' => 'Without',
712
-	                    'WPT' => 'Way-point',
713
-	                    'WRNG' => 'Warning',
714
-	                    'WSW' => 'West-south-west',
715
-	                    'WT' => 'Weight',
716
-	                    'WWW' => 'Worldwide Web',
717
-	                    'WX' => 'Weather',
718
-	                    'XBAR' => 'Crossbar',
719
-	                    'XNG' => 'Crossing',
720
-	                    'XS' => 'Atmospherics',
721
-	                    'YCZ' => 'Yellow Caution Zone',
722
-	                    'YR' => 'Your');
10
+						'A/A' => 'Air-to-air',
11
+						'A/G' => 'Air-to-ground',
12
+						'AAL' => 'Above Aerodrome Level',
13
+						'ABM' => 'Abeam',
14
+						'ABN' => 'Aerodrome Beacon',
15
+						'ABT' => 'About',
16
+						'ABV' => 'Above',
17
+						'ACC' => 'Area Control',
18
+						'ACFT' => 'Aircraft',
19
+						'ACK' => 'Acknowledge',
20
+						'ACL' => 'Altimeter Check Location',
21
+						'ACN' => 'Aircraft Classification Number',
22
+						'ACPT' => 'Accepted',
23
+						'ACT' => 'Active',
24
+						'AD' => 'Aerodrome',
25
+						'ADA' => 'Advisory Area',
26
+						'ADC' => 'Aerodrome Chart',
27
+						'ADDN' => 'Additional',
28
+						'ADIZ' => 'Air defense identification zone',
29
+						'ADJ' => 'Adjacent',
30
+						'ADR' => 'Advisory Route',
31
+						'ADS' => 'Automatic Dependent Surveillance',
32
+						'ADVS' => 'Advisory Service',
33
+						'ADZ' => 'Advised',
34
+						'AFIL' => 'Flight Plan Filed In The Air',
35
+						'AFIS' => 'Airport flight information service',
36
+						'AFM' => 'Affirm',
37
+						'AFT' => 'After',
38
+						'AGA' => 'Aerodromes, Air Routes and Ground Aids',
39
+						'AGN' => 'Again',
40
+						'AIS' => 'Aeronautical information service',
41
+						'ALERFA' => 'Alert Phase',
42
+						'ALRS' => 'Alerting Service',
43
+						'ALS' => 'Approach Lighting System',
44
+						'ALT' => 'Altitude',
45
+						'ALTN' => 'Alternate',
46
+						'AMA' => 'Area Minimum Altitude',
47
+						'ANC' => 'Aeronautical Chart',
48
+						'ANCS' => 'Aeronautical Navigation Chart',
49
+						'ANS' => 'Answer',
50
+						'AOC' => 'Aerodrome Obstacle Chart',
51
+						'AP' => 'Airport',
52
+						'APCH' => 'Approach',
53
+						'APDC' => 'Aircraft Parking/docking Chart',
54
+						'APN' => 'Apron',
55
+						'APNS' => 'Aprons',
56
+						'APP' => 'Approach Control',
57
+						'APR' => 'April',
58
+						'APRX' => 'Approximately',
59
+						'APSG' => 'After Passing',
60
+						'APV' => 'Approved',
61
+						'ARC' => 'Area Chart',
62
+						'ARNG' => 'Arrange',
63
+						'ARO' => 'Air Traffic Services Reporting Office',
64
+						'ARP' => 'Aerodrome Reference Point',
65
+						'ARR' => 'Arriving',
66
+						'ARST' => 'Arresting',
67
+						'ASC' => 'Ascend To',
68
+						'ASDA' => 'Accelerate-Stop Distance Available',
69
+						'ASPEEDG' => 'Airspeed Gain',
70
+						'ASPEEDL' => 'Airspeed Loss',
71
+						'ASPH' => 'Asphalt',
72
+						'ATA' => 'Actual Time of Arrival',
73
+						'ATD' => 'Actual Time of Departure',
74
+						'ATFM' => 'Air Traffic Flow Management',
75
+						'ATIS' => 'Automatic terminal information service',
76
+						'ATM' => 'Air Traffic Management',
77
+						'ATP' => 'At',
78
+						'ATTN' => 'Attention',
79
+						'ATZ' => 'Aerodrome Traffic Zone',
80
+						'AUG' => 'August',
81
+						'AUTH' => 'Authorization',
82
+						'AUW' => 'All Up Weight',
83
+						'AUX' => 'Auxiliary',
84
+						'AVBL' => 'Available',
85
+						'AVG' => 'Average',
86
+						'AVGAS' => 'Aviation Gasoline',
87
+						'AWTA' => 'Advise At What Time Able',
88
+						'AWY' => 'Airway',
89
+						'AWYS' => 'Airways',
90
+						'AZM' => 'Azimuth',
91
+						'BA' => 'Braking Action',
92
+						'BCN' => 'Beacon',
93
+						'BCST' => 'Broadcast',
94
+						'BDRY' => 'Boundary',
95
+						'BFR' => 'Before',
96
+						'BLDG' => 'Building',
97
+						'BLO' => 'Below Clouds',
98
+						'BLW' => 'Below',
99
+						'BRF' => 'Short',
100
+						'BRG' => 'Bearing',
101
+						'BRKG' => 'Breaking',
102
+						'BTL' => 'Between Layers',
103
+						'BTN' => 'Between',
104
+						'CD' => 'Candela',
105
+						'CDN' => 'Coordination',
106
+						'CF' => 'Change Frequency To',
107
+						'CFM' => 'Confirm',
108
+						'CGL' => 'Circling Guidance Light(s)',
109
+						'CH' => 'Channel',
110
+						'CHG' => 'Changed',
111
+						'CIT' => 'Near or Over Large Towns',
112
+						'CIV' => 'Civil',
113
+						'CK' => 'Check',
114
+						'CL' => 'Centre Line',
115
+						'CLBR' => 'Calibration',
116
+						'CLD' => 'Cloud',
117
+						'CLG' => 'Calling',
118
+						'CLIMB-OUT' => 'Climb-out Area',
119
+						'CLR' => 'Clearance',
120
+						'CLRD' => 'Cleared',
121
+						'CLSD' => 'Closed',
122
+						'CMB' => 'Climb',
123
+						'CMPL' => 'Complete',
124
+						'CNL' => 'Cancel',
125
+						'CNS' => 'Communications, Navigation And Surveillance',
126
+						'COM' => 'Communications',
127
+						'CONC' => 'Concrete',
128
+						'COND' => 'Condition',
129
+						'CONS' => 'Continuous',
130
+						'CONST' => 'Construction',
131
+						'CONT' => 'Continued',
132
+						'COOR' => 'Coordination',
133
+						'COORD' => 'Coordinates',
134
+						'COP' => 'Change-over Point',
135
+						'COR' => 'Correction',
136
+						'COT' => 'At The Coast',
137
+						'COV' => 'Covered',
138
+						'CPDLC' => 'Controller-pilot Data Link Communications',
139
+						'CPL' => 'Current Flight Plan',
140
+						'CRC' => 'Cyclic Redundancy Check',
141
+						'CRZ' => 'Cruise',
142
+						'CTA' => 'Control area',
143
+						'CTAM' => 'Climb To And Maintain',
144
+						'CTC' => 'Contact',
145
+						'CTL' => 'Control',
146
+						'CTN' => 'Caution',
147
+						'CTR' => 'Control Zone',
148
+						'CVR' => 'Cockpit Voice Recorder',
149
+						'CW' => 'Continuous Wave',
150
+						'CWY' => 'Clearway',
151
+						'DA' => 'Decision Altitude',
152
+						'DCKG' => 'Docking',
153
+						'DCP' => 'Datum Crossing Point',
154
+						'DCPC' => 'Direct Controller-pilot Communications',
155
+						'DCT' => 'Direct',
156
+						'DEC' => 'December',
157
+						'DEG' => 'Degrees',
158
+						'DEP' => 'Departing',
159
+						'DES' => 'Descend',
160
+						'DEST' => 'Destination',
161
+						'DETRESFA' => 'Distress Phase',
162
+						'DEV' => 'Deviating',
163
+						'DFDR' => 'Digital Flight Data Recorder',
164
+						'DFTI' => 'Distance From Touchdown Indicator',
165
+						'DH' => 'Decision Height',
166
+						'DIP' => 'Diffuse',
167
+						'DIST' => 'Distance',
168
+						'DIV' => 'Divert',
169
+						'DLA' => 'Delay',
170
+						'DLY' => 'Daily',
171
+						'DME' => 'Distance measuring equipment',
172
+						'DNG' => 'Dangerous',
173
+						'DOM' => 'Domestic',
174
+						'DPT' => 'Depth',
175
+						'DR' => 'Dead Reckoning',
176
+						'DRG' => 'During',
177
+						'DTAM' => 'Descend To And Maintain',
178
+						'DTG' => 'Date-time Group',
179
+						'DTHR' => 'Displaced Runway Threshold',
180
+						'DTRT' => 'Deteriorating',
181
+						'DTW' => 'Dual Tandem Wheels',
182
+						'DUPE' => 'This Is A Duplicate Message',
183
+						'DUR' => 'Duration',
184
+						'DVOR' => 'Doppler VOR',
185
+						'DW' => 'Dual Wheels',
186
+						'EAT' => 'Expected Approach Time',
187
+						'EB' => 'Eastbound',
188
+						'EDA' => 'Elevation Differential Area',
189
+						'EET' => 'Estimated Elapsed Time',
190
+						'EFC' => 'Expect Further Clearance',
191
+						'ELBA' => 'Emergency Location Beacon',
192
+						'ELEV' => 'Elevation',
193
+						'ELR' => 'Extra Long Range',
194
+						'EM' => 'Emission',
195
+						'EMERG' => 'Emergency',
196
+						'END' => 'Stop-end',
197
+						'ENE' => 'East-north-east',
198
+						'ENG' => 'Engine',
199
+						'ENR' => 'En-route',
200
+						'ENRC' => 'En-route Chart',
201
+						'EOBT' => 'Estimated Off-block Time',
202
+						'EQPT' => 'Equipment',
203
+						'ER' => 'Here',
204
+						'ESE' => 'East-south-east',
205
+						'EST' => 'Estimate',
206
+						'ETA' => 'Estimated Time Of Arrival',
207
+						'ETD' => 'Estimated Time Of Departure',
208
+						'ETO' => 'Estimated Time Over Significant Point',
209
+						'EV' => 'Every',
210
+						'EXC' => 'Except',
211
+						'EXER' => 'Exercise',
212
+						'EXP' => 'Expect',
213
+						'EXTD' => 'Extend',
214
+						'FAC' => 'Facilities',
215
+						'FAF' => 'Final Approach Fix',
216
+						'FAL' => 'Facilitation of International Airtransport',
217
+						'FAP' => 'Final Approach Point',
218
+						'FATO' => 'Final Approach And Take-off Area',
219
+						'FAX' => 'Fax',
220
+						'FBL' => 'Light',
221
+						'FCST' => 'Forecast',
222
+						'FCT' => 'Friction Coefficient',
223
+						'FDPS' => 'Flight Data Processing System',
224
+						'FEB' => 'February',
225
+						'FIR' => 'Flight information region',
226
+						'FIS' => 'Flight information service',
227
+						'FLD' => 'Field',
228
+						'FLG' => 'Flashing',
229
+						'FLR' => 'Flares',
230
+						'FLT' => 'Flight',
231
+						'FLTS' => 'Flights',
232
+						'FLTCK' => 'Flight Check',
233
+						'FLUC' => 'Fluctuating',
234
+						'FLW' => 'Follow(s)',
235
+						'FLY' => 'Fly',
236
+						'FM' => 'From',
237
+						'FMS' => 'Flight Management System',
238
+						'FMU' => 'Flow Management Unit',
239
+						'FNA' => 'Final Approach',
240
+						'FPAP' => 'Flight Path Alignment Point',
241
+						'FPL' => 'Flight Plan',
242
+						'FPLS' => 'Flight Plans',
243
+						'FPM' => 'Feet Per Minute',
244
+						'FPR' => 'Flight Plan Route',
245
+						'FR' => 'Fuel Remaining',
246
+						'FREQ' => 'Frequency',
247
+						'FRI' => 'Friday',
248
+						'FRMG' => 'Missile, gun or rocket firing',
249
+						'FRNG' => 'Firing',
250
+						'FRONT' => 'Front',
251
+						'FRQ' => 'Frequent',
252
+						'FSL' => 'Full Stop Landing',
253
+						'FSS' => 'Flight Service Station',
254
+						'FST' => 'First',
255
+						'FTP' => 'Fictitious Threshold Point',
256
+						'G/A' => 'Ground-to-air',
257
+						'G/A/G' => 'Ground-to-air and Air-to-ground',
258
+						'GARP' => 'GBAS Azimuth Reference Point',
259
+						'GBAS' => 'Ground-based Augmentation System',
260
+						'GCAJ' => 'Ground Controlled Approach',
261
+						'GCA' => 'Ground Controlled Approach System',
262
+						'GEN' => 'General',
263
+						'GEO' => 'Geographic or True',
264
+						'GES' => 'Ground Earth Station',
265
+						'GLD' => 'Glider',
266
+						'GMC' => 'Ground Movement Chart',
267
+						'GND' => 'Ground',
268
+						'GNDCK' => 'Ground Check',
269
+						'GP' => 'Glide Path',
270
+						'GRASS' => 'Grass landing area',
271
+						'GRVL' => 'Gravel',
272
+						'GUND' => 'Geoid Undulation',
273
+						'H24' => '24 Hours',
274
+						'HAPI' => 'Helicopter Approach Path Indicator',
275
+						'HBN' => 'Hazard Beacon',
276
+						'HDG' => 'Heading',
277
+						'HEL' => 'Helicopter',
278
+						'HGT' => 'Height',
279
+						'HJ' => 'Sunrise to Sunset',
280
+						'HLDG' => 'Holding',
281
+						'HN' => 'Sunset to Sunrise',
282
+						'HO' => 'Service Available To Meet Operational Requirements',
283
+						'HOL' => 'Holiday',
284
+						'HOSP' => 'Hospital Aircraft',
285
+						'HOT' => 'Height',
286
+						'HPA' => 'Hectopascal',
287
+						'HR' => 'Hours',
288
+						'HRS' => 'Hours',
289
+						'HS' => 'Service Available During Hours Of Scheduled Operations',
290
+						'HURCN' => 'Hurricane',
291
+						'HVY' => 'Heavy',
292
+						'HX' => 'No Specific Working Hours',
293
+						'HYR' => 'Higher',
294
+						'IAC' => 'Instrument Approach Chart',
295
+						'IAF' => 'Initial Approach Fix',
296
+						'IAO' => 'In And Out Of Clouds',
297
+						'IAP' => 'Instrument Approach Procedure',
298
+						'IAR' => 'Intersection Of Air Routes',
299
+						'IBN' => 'Identification Beacon',
300
+						'ID' => 'Identifier',
301
+						'IDENT' => 'Identification',
302
+						'IFF' => 'Identification Friend/Foe',
303
+						'IGA' => 'International General Aviation',
304
+						'IM' => 'Inner Marker',
305
+						'IMPR' => 'Improving',
306
+						'IMT' => 'Immediately',
307
+						'INA' => 'Initial Approach',
308
+						'INBD' => 'Inbound',
309
+						'INCERFA' => 'Uncertainty Phase',
310
+						'INFO' => 'Information',
311
+						'INOP' => 'Inoperative',
312
+						'INP' => 'If Not Possible',
313
+						'INPR' => 'In Progress',
314
+						'INSTL' => 'Installation',
315
+						'INSTR' => 'Instrument',
316
+						'INT' => 'Intersection',
317
+						'INTS' => 'Intersections',
318
+						'INTL' => 'International',
319
+						'INTRG' => 'Interrogator',
320
+						'INTRP' => 'Interruption',
321
+						'INTSF' => 'Intensifying',
322
+						'INTST' => 'Intensity',
323
+						'ISA' => 'International Standard Atmosphere',
324
+						'JAN' => 'January',
325
+						'JTST' => 'Jet stream',
326
+						'JUL' => 'July',
327
+						'JUN' => 'June',
328
+						'KMH' => 'Kilometres Per Hour',
329
+						'KPA' => 'Kilopascal',
330
+						'KT' => 'Knots',
331
+						'KW' => 'Kilowatts',
332
+						'LAN' => 'Inland',
333
+						'LAT' => 'Latitude',
334
+						'LDA' => 'Landing Distance Available',
335
+						'LDAH' => 'Landing Distance Available, Helicopter',
336
+						'LDG' => 'Landing',
337
+						'LDI' => 'Landing Direction Indicator',
338
+						'LEN' => 'Length',
339
+						'LGT' => 'Lighting',
340
+						'LGTD' => 'Lighted',
341
+						'LIH' => 'Light Intensity High',
342
+						'LIL' => 'Light Intensity Low',
343
+						'LIM' => 'Light Intensity Medium',
344
+						'LLZ' => 'Localizer',
345
+						'LM' => 'Locator, Middle',
346
+						'LMT' => 'Local Mean Time',
347
+						'LNG' => 'Long',
348
+						'LO' => 'Locator, Outer',
349
+						'LOG' => 'Located',
350
+						'LONG' => 'Longitude',
351
+						'LRG' => 'Long Range',
352
+						'LTD' => 'Limited',
353
+						'LTP' => 'Landing Threshold Point',
354
+						'LVE' => 'Leaving',
355
+						'LVL' => 'Level',
356
+						'LYR' => 'Layer',
357
+						'MAA' => 'Maximum Authorized Altitude',
358
+						'MAG' => 'Magnetic',
359
+						'MAINT' => 'Maintenance',
360
+						'MAP' => 'Aeronautical Maps and Charts',
361
+						'MAPT' => 'Missed Approach Point',
362
+						'MAR' => 'March',
363
+						'MAX' => 'Maximum',
364
+						'MAY' => 'May',
365
+						'MBST' => 'Microburst',
366
+						'MCA' => 'Minimum Crossing Altitude',
367
+						'MCW' => 'Modulated Continuous Wave',
368
+						'MDA' => 'Minimum Descent Altitude',
369
+						'MDH' => 'Minimum Descent Height',
370
+						'MEA' => 'Minimum En-route Altitude',
371
+						'MEHT' => 'Minimum Eye Height Over Threshold',
372
+						'MET' => 'Meteorological',
373
+						'MID' => 'Mid-point',
374
+						'MIL' => 'Military',
375
+						'MIN' => 'Minutes',
376
+						'MKR' => 'Marker Radio Beacon',
377
+						'MLS' => 'Microwave Landing System',
378
+						'MM' => 'Middle Marker',
379
+						'MNM' => 'Minimum',
380
+						'MNPS' => 'Minimum Navigation Performance Specifications',
381
+						'MNT' => 'Monitor',
382
+						'MNTN' => 'Maintain',
383
+						'MOA' => 'Military Operating Area',
384
+						'MOC' => 'Minimum Obstacle Clearance',
385
+						'MOD' => 'Moderate',
386
+						'MON' => 'Monday',
387
+						'MOPS' => 'Minimum Operational Performance Standards',
388
+						'MOV' => 'Movement',
389
+						'MRA' => 'Minimum Reception Altitude',
390
+						'MRG' => 'Medium Range',
391
+						'MRP' => 'ATS/MET Reporting Point',
392
+						'MS' => 'Minus',
393
+						'MSA' => 'Minimum Sector Altitude',
394
+						'MSAW' => 'Minimum Safe Altitude Warning',
395
+						'MSG' => 'Message',
396
+						'MSSR' => 'Monopulse Secondary Surveillance Radar',
397
+						'MT' => 'Mountain',
398
+						'MTU' => 'Metric Units',
399
+						'MTW' => 'Mountain Waves',
400
+						'NASC' => 'National AIS System Centre',
401
+						'NAT' => 'North Atlantic',
402
+						'NAV' => 'Navigation',
403
+						'NB' => 'Northbound',
404
+						'NBFR' => 'Not Before',
405
+						'NE' => 'North-east',
406
+						'NEB' => 'North-eastbound',
407
+						'NEG' => 'Negative',
408
+						'NGT' => 'Night',
409
+						'NIL' => 'None',
410
+						'NML' => 'Normal',
411
+						'NNE' => 'North-north-east',
412
+						'NNW' => 'North-north-west',
413
+						'NOF' => 'International NOTAM Office',
414
+						'NOV' => 'November',
415
+						'NOZ' => 'Normal Operating Zone',
416
+						'NR' => 'Number',
417
+						'NRH' => 'No Reply Heard',
418
+						'NTL' => 'National',
419
+						'NTZ' => 'No Transgression Zone',
420
+						'NW' => 'North-west',
421
+						'NWB' => 'North-westbound',
422
+						'NXT' => 'Next',
423
+						'O/R' => 'On Request',
424
+						'OAC' => 'Oceanic Area Control Centre',
425
+						'OAS' => 'Obstacle Assessment Surface',
426
+						'OBS' => 'Observe',
427
+						'OBST' => 'Obstacle',
428
+						'OBSTS' => 'Obstacles',
429
+						'OCA' => 'Oceanic Control Area',
430
+						'OCH' => 'Obstacle Clearance Height',
431
+						'OCL' => 'Obstacle Clearance Limit',
432
+						'OCS' => 'Obstacle Clearance Surface',
433
+						'OCT' => 'October',
434
+						'OFZ' => 'Obstacle Free Zone',
435
+						'OGN' => 'Originate',
436
+						'OHD' => 'Overhead',
437
+						'OM' => 'Outer Marker',
438
+						'OPC' => 'Control Indicated Is Operational Control',
439
+						'OPMET' => 'Operational Meteorological',
440
+						'OPN' => 'Open',
441
+						'OPR' => 'Operate',
442
+						'OPS' => 'Operations',
443
+						'ORD' => 'Order',
444
+						'OSV' => 'Ocean Station Vessel',
445
+						'OTLK' => 'Outlook',
446
+						'OTP' => 'On Top',
447
+						'OTS' => 'Organized Track System',
448
+						'OUBD' => 'Outbound',
449
+						'PA' => 'Precision Approach',
450
+						'PALS' => 'Precision Approach Lighting System',
451
+						'PANS' => 'Procedures for Air Navigation Services',
452
+						'PAR' => 'Precision Approach Radar',
453
+						'PARL' => 'Parallel',
454
+						'PATC' => 'Precision Approach Terrain Chart',
455
+						'PAX' => 'Passenger(s)',
456
+						'PCD' => 'Proceed',
457
+						'PCL' => 'Pilot-controlled Lighting',
458
+						'PCN' => 'Pavement Classification Number',
459
+						'PDC' => 'Pre-departure Clearance',
460
+						'PDG' => 'Procedure Design Gradient',
461
+						'PER' => 'Performance',
462
+						'PERM' => 'Permanent',
463
+						'PIB' => 'Pre-flight Information Bulletin',
464
+						'PJE' => 'Parachute Jumping Exercise',
465
+						'PLA' => 'Practice Low Approach',
466
+						'PLN' => 'Flight Plan',
467
+						'PLVL' => 'Present Level',
468
+						'PN' => 'Prior Notice Required',
469
+						'PNR' => 'Point Of No Return',
470
+						'POB' => 'Persons On Board',
471
+						'POSS' => 'Possible',
472
+						'PPI' => 'Plan Position Indicator',
473
+						'PPR' => 'Prior Permission Required',
474
+						'PPSN' => 'Present Position',
475
+						'PRI' => 'Primary',
476
+						'PRKG' => 'Parking',
477
+						'PROB' => 'Probability',
478
+						'PROC' => 'Procedure',
479
+						'PROV' => 'Provisional',
480
+						'PS' => 'Plus',
481
+						'PSG' => 'Passing',
482
+						'PSN' => 'Position',
483
+						'PSNS' => 'Positions',
484
+						'PSR' => 'Primary Surveillance Radar',
485
+						'PSYS' => 'Pressure System(s)',
486
+						'PTN' => 'Procedure Turn',
487
+						'PTS' => 'Polar Track Structure',
488
+						'PWR' => 'Power',
489
+						'QUAD' => 'Quadrant',
490
+						'RAC' => 'Rules of The Air and Air Traffic Services',
491
+						'RAG' => 'Runway Arresting Gear',
492
+						'RAI' => 'Runway Alignment Indicator',
493
+						'RASC' => 'Regional AIS System Centre',
494
+						'RASS' => 'Remote Altimeter Setting Source',
495
+						'RB' => 'Rescue Boat',
496
+						'RCA' => 'Reach Cruising Altitude',
497
+						'RCC' => 'Rescue Coordination Centre',
498
+						'RCF' => 'Radiocommunication Failure',
499
+						'RCH' => 'Reaching',
500
+						'RCL' => 'Runway Centre Line',
501
+						'RCLL' => 'Runway Centre Line Light(s)',
502
+						'RCLR' => 'Recleared',
503
+						'RDH' => 'Reference Datum Height',
504
+						'RDL' => 'Radial',
505
+						'RDO' => 'Radio',
506
+						'RE' => 'Recent',
507
+						'REC' => 'Receiver',
508
+						'REDL' => 'Runway Edge Light(s)',
509
+						'REF' => 'Refer To',
510
+						'REG' => 'Registration',
511
+						'RENL' => 'Runway End Light(s)',
512
+						'REP' => 'Report',
513
+						'REQ' => 'Requested',
514
+						'RERTE' => 'Re-route',
515
+						'RESA' => 'Runway End Safety Area',
516
+						'RG' => 'Range (lights)',
517
+						'RHC' => 'Right-hand Circuit',
518
+						'RIF' => 'Reclearance In Flight',
519
+						'RITE' => 'Right',
520
+						'RL' => 'Report Leaving',
521
+						'RLA' => 'Relay To',
522
+						'RLCE' => 'Request Level Change En Route',
523
+						'RLLS' => 'Runway Lead-in Lighting System',
524
+						'RLNA' => 'Request Level Not Available',
525
+						'RMAC' => 'Radar Minimum Altitude Chart',
526
+						'RMK' => 'Remark',
527
+						'RNG' => 'Radio Range',
528
+						'RNP' => 'Required Navigation Performance',
529
+						'ROC' => 'Rate Of Climb',
530
+						'ROD' => 'Rate Of Descent',
531
+						'ROFOR' => 'Route Forecast',
532
+						'RON' => 'Receiving Only',
533
+						'RPI' => 'Radar Position Indicator',
534
+						'RPL' => 'Repetitive Flight Plan',
535
+						'RPLC' => 'Replaced',
536
+						'RPS' => 'Radar Position Symbol',
537
+						'RQMNTS' => 'Requirements',
538
+						'RQP' => 'Request Flight Plan',
539
+						'RQS' => 'Request Supplementary Flight Plan',
540
+						'RR' => 'Report Reaching',
541
+						'RSC' => 'Rescue Sub-centre',
542
+						'RSCD' => 'Runway Surface Condition',
543
+						'RSP' => 'Responder Beacon',
544
+						'RSR' => 'En-route Surveillance Radar',
545
+						'RTE' => 'Route',
546
+						'RTES' => 'Routes',
547
+						'RTF' => 'Radiotelephone',
548
+						'RTG' => 'Radiotelegraph',
549
+						'RTHL' => 'Runway Threshold Light(s)',
550
+						'RTN' => 'Return',
551
+						'RTODAH' => 'Rejected Take-off Distance Available, Helicopter',
552
+						'RTS' => 'Return To Service',
553
+						'RTT' => 'Radioteletypewriter',
554
+						'RTZL' => 'Runway Touchdown Zone Light(s)',
555
+						'RUT' => 'Standard Regional Route Transmitting Frequencies',
556
+						'RV' => 'Rescue Vessel',
557
+						'RVSM' => 'Reduced Vertical Separation Minimum',
558
+						'RWY' => 'Runway',
559
+						'RWYS' => 'Runways',
560
+						'SALS' => 'Simple Approach Lighting System',
561
+						'SAN' => 'Sanitary',
562
+						'SAP' => 'As Soon As Possible',
563
+						'SAR' => 'Search and Rescue',
564
+						'SARPS' => 'Standards and Recommended Practices',
565
+						'SAT' => 'Saturday',
566
+						'SATCOM' => 'Satellite Communication',
567
+						'SB' => 'Southbound',
568
+						'SBAS' => 'Satellite-based Augmentation System',
569
+						'SDBY' => 'Stand by',
570
+						'SE' => 'South-east',
571
+						'SEA' => 'Sea',
572
+						'SEB' => 'South-eastbound',
573
+						'SEC' => 'Seconds',
574
+						'SECN' => 'Section',
575
+						'SECT' => 'Sector',
576
+						'SELCAL' => 'Selective calling system',
577
+						'SEP' => 'September',
578
+						'SER' => 'Service',
579
+						'SEV' => 'Severe',
580
+						'SFC' => 'Surface',
581
+						'SGL' => 'Signal',
582
+						'SID' => 'Standard Instrument Departure',
583
+						'SIF' => 'Selective Identification Feature',
584
+						'SIG' => 'Significant',
585
+						'SIMUL' => 'Simultaneous',
586
+						'SKED' => 'Schedule',
587
+						'SLP' => 'Speed Limiting Point',
588
+						'SLW' => 'Slow',
589
+						'SMC' => 'Surface Movement Control',
590
+						'SMR' => 'Surface Movement Radar',
591
+						'SPL' => 'Supplementary Flight Plan',
592
+						'SPOC' => 'SAR Point Of Contact',
593
+						'SPOT' => 'Spot Wind',
594
+						'SR' => 'Sunrise',
595
+						'SRA' => 'Surveillance Radar Approach',
596
+						'SRE' => 'Surveillance Radar Element Of Precision Approach Radar System',
597
+						'SRG' => 'Short Range',
598
+						'SRR' => 'Search and Rescue Region',
599
+						'SRY' => 'Secondary',
600
+						'SS' => 'Sunset',
601
+						'SSE' => 'South-south-east',
602
+						'SSR' => 'Secondary Surveillance Radar',
603
+						'SST' => 'Supersonic Transport',
604
+						'SSW' => 'South-south-west',
605
+						'STA' => 'Straight-in Approach',
606
+						'STAR' => 'Standard Instrument Arrival',
607
+						'STD' => 'Standard',
608
+						'STN' => 'Station',
609
+						'STNR' => 'Stationary',
610
+						'STOL' => 'Short Take-off and Landing',
611
+						'STS' => 'Status',
612
+						'STWL' => 'Stopway Light(s)',
613
+						'SUBJ' => 'Subject To',
614
+						'SUN' => 'Sunday',
615
+						'SUP' => 'Supplement',
616
+						'SUPPS' => 'Regional Supplementary Procedures Service Message',
617
+						'SVCBL' => 'Serviceable',
618
+						'SW' => 'South-west',
619
+						'SWB' => 'South-westbound',
620
+						'SWY' => 'Stopway',
621
+						'TA' => 'Transition Altitude',
622
+						'TAA' => 'Terminal Arrival Altitude',
623
+						'TAF' => 'Aerodrome Forecast',
624
+						'TAIL' => 'Tail Wind',
625
+						'TAR' => 'Terminal Area Surveillance Radar',
626
+						'TAX' => 'Taxi',
627
+						'TCAC' => 'Tropical Cyclone Advisory Centre',
628
+						'TDO' => 'Tornado',
629
+						'TDZ' => 'Touchdown Zone',
630
+						'TECR' => 'Technical Reason',
631
+						'TEMPO' => 'Temporarily',
632
+						'TFC' => 'Traffic',
633
+						'TGL' => 'Touch-and-go',
634
+						'TGS' => 'Taxiing Guidance System',
635
+						'THR' => 'Threshold',
636
+						'THRU' => 'Through',
637
+						'THU' => 'Thursday',
638
+						'TIBA' => 'Traffic Information Broadcast By Aircraft',
639
+						'TIL' => 'Until',
640
+						'TIP' => 'Until Past',
641
+						'TKOF' => 'Take-off',
642
+						'TL' => 'Till',
643
+						'TLOF' => 'Touchdown And Lift-off Area',
644
+						'TMA' => 'Terminal Control Area',
645
+						'TNA' => 'Turn Altitude',
646
+						'TNH' => 'Turn Height',
647
+						'TOC' => 'Top of Climb',
648
+						'TODA' => 'Take-off Distance Available',
649
+						'TODAH' => 'Take-off Distance Available, Helicopter',
650
+						'TORA' => 'Take-off Run Available',
651
+						'TP' => 'Turning Point',
652
+						'TR' => 'Track',
653
+						'TRA' => 'Temporary Reserved Airspace',
654
+						'TRANS' => 'Transmitter',
655
+						'TRL' => 'Transition Level',
656
+						'TUE' => 'Tuesday',
657
+						'TURB' => 'Turbulence',
658
+						'TVOR' => 'Terminal VOR',
659
+						'TWR' => 'Tower',
660
+						'TWY' => 'Taxiway',
661
+						'TWYL' => 'Taxiway-link',
662
+						'TXT' => 'Text',
663
+						'TYP' => 'Type of Aircraft',
664
+						'U/S' => 'Unserviceable',
665
+						'UAB' => 'Until Advised By',
666
+						'UAC' => 'Upper Area Control Centre',
667
+						'UAR' => 'Upper Air Route',
668
+						'UDA' => 'Upper advisory area',
669
+						'UFN' => 'Until Further Notice',
670
+						'UHDT' => 'Unable Higher Due Traffic',
671
+						'UIC' => 'Upper Information Centre',
672
+						'UIR' => 'Upper Flight Information Region',
673
+						'ULR' => 'Ultra Long Range',
674
+						'UNA' => 'Unable',
675
+						'UNAP' => 'Unable To Approve',
676
+						'UNL' => 'Unlimited',
677
+						'UNREL' => 'Unreliable',
678
+						'UTA' => 'Upper Control Area',
679
+						'VAAC' => 'Volcanic Ash Advisory Centre',
680
+						'VAC' => 'Visual Approach Chart',
681
+						'VAL' => 'In Valleys',
682
+						'VAN' => 'Runway Control Van',
683
+						'VAR' => 'Visual-aural Radio Range',
684
+						'VC' => 'Vicinity',
685
+						'VCY' => 'Vicinity',
686
+						'VER' => 'Vertical',
687
+						'VIS' => 'Visibility',
688
+						'VLR' => 'Very Long Range',
689
+						'VPA' => 'Vertical Path Angle',
690
+						'VRB' => 'Variable',
691
+						'VSA' => 'By Visual Reference To The Ground',
692
+						'VSP' => 'Vertical Speed',
693
+						'VTOL' => 'Vertical Take-off And Landing',
694
+						'WAC' => 'World Aeronautical Chart',
695
+						'WAFC' => 'World Area Forecast Centre',
696
+						'WB' => 'Westbound',
697
+						'WBAR' => 'Wing Bar Lights',
698
+						'WDI' => 'Wind Direction Indicator',
699
+						'WDSPR' => 'Widespread',
700
+						'WED' => 'Wednesday',
701
+						'WEF' => 'Effective From',
702
+						'WI' => 'Within',
703
+						'WID' => 'Width',
704
+						'WIE' => 'Effective Immediately',
705
+						'WILCO' => 'Will Comply',
706
+						'WIND' => 'Wind',
707
+						'WINTEM' => 'Forecast Upper Wind And Temperature For Aviation',
708
+						'WIP' => 'Work In Progress',
709
+						'WKN' => 'Weaken',
710
+						'WNW' => 'West-north-west',
711
+						'WO' => 'Without',
712
+						'WPT' => 'Way-point',
713
+						'WRNG' => 'Warning',
714
+						'WSW' => 'West-south-west',
715
+						'WT' => 'Weight',
716
+						'WWW' => 'Worldwide Web',
717
+						'WX' => 'Weather',
718
+						'XBAR' => 'Crossbar',
719
+						'XNG' => 'Crossing',
720
+						'XS' => 'Atmospherics',
721
+						'YCZ' => 'Yellow Caution Zone',
722
+						'YR' => 'Your');
723 723
 	public $code_airspace = array(
724
-			    'AA' => 'Minimum altitude',
725
-			    'AC' => 'Class B, C, D, or E Surface Area',
726
-			    'AD' => 'Air defense identification zone',
727
-			    'AE' => 'Control area',
728
-			    'AF' => 'Flight information region',
729
-			    'AH' => 'Upper control area',
730
-			    'AL' => 'Minimum usable flight level',
731
-			    'AN' => 'Area navigation route',
732
-			    'AO' => 'Oceanic control area',
733
-			    'AP' => 'Reporting point',
734
-			    'AR' => 'ATS route',
735
-			    'AT' => 'Class B Airspace',
736
-			    'AU' => 'Upper flight information region',
737
-			    'AV' => 'Upper advisory area',
738
-			    'AX' => 'Intersection',
739
-			    'AZ' => 'Aerodrome traffic zone');
724
+				'AA' => 'Minimum altitude',
725
+				'AC' => 'Class B, C, D, or E Surface Area',
726
+				'AD' => 'Air defense identification zone',
727
+				'AE' => 'Control area',
728
+				'AF' => 'Flight information region',
729
+				'AH' => 'Upper control area',
730
+				'AL' => 'Minimum usable flight level',
731
+				'AN' => 'Area navigation route',
732
+				'AO' => 'Oceanic control area',
733
+				'AP' => 'Reporting point',
734
+				'AR' => 'ATS route',
735
+				'AT' => 'Class B Airspace',
736
+				'AU' => 'Upper flight information region',
737
+				'AV' => 'Upper advisory area',
738
+				'AX' => 'Intersection',
739
+				'AZ' => 'Aerodrome traffic zone');
740 740
 	public $code_comradar = array(
741
-			    'CA' => 'Air/ground',
742
-			    'CE' => 'En route surveillance radar',
743
-			    'CG' => 'Ground controlled approach system',
744
-			    'CL' => 'Selective calling system',
745
-			    'CM' => 'Surface movement radar',
746
-			    'CP' => 'Precision approach radar',
747
-			    'CR' => 'Surveillance radar element of precision approach radar system',
748
-			    'CS' => 'Secondary surveillance radar',
749
-			    'CT' => 'Terminal area surveillance radar');
741
+				'CA' => 'Air/ground',
742
+				'CE' => 'En route surveillance radar',
743
+				'CG' => 'Ground controlled approach system',
744
+				'CL' => 'Selective calling system',
745
+				'CM' => 'Surface movement radar',
746
+				'CP' => 'Precision approach radar',
747
+				'CR' => 'Surveillance radar element of precision approach radar system',
748
+				'CS' => 'Secondary surveillance radar',
749
+				'CT' => 'Terminal area surveillance radar');
750 750
 	public $code_facilities = array(
751
-			    'FA' => 'airport',
752
-			    'FB' => 'Braking action measurement equipment',
753
-			    'FC' => 'Ceiling measurement equipment',
754
-			    'FD' => 'Docking system',
755
-			    'FF' => 'Fire fighting and rescue',
756
-			    'FG' => 'Ground movement control',
757
-			    'FH' => 'Helicopter alighting area/platform',
758
-			    'FL' => 'Landing direction indicator',
759
-			    'FM' => 'Meteorological service',
760
-			    'FO' => 'Fog dispersal system',
761
-			    'FP' => 'Heliport',
762
-			    'FS' => 'Snow removal equipment',
763
-			    'FT' => 'Transmissometer',
764
-			    'FU' => 'Fuel availability',
765
-			    'FW' => 'Wind direction indicator',
766
-			    'FZ' => 'Customs');
751
+				'FA' => 'airport',
752
+				'FB' => 'Braking action measurement equipment',
753
+				'FC' => 'Ceiling measurement equipment',
754
+				'FD' => 'Docking system',
755
+				'FF' => 'Fire fighting and rescue',
756
+				'FG' => 'Ground movement control',
757
+				'FH' => 'Helicopter alighting area/platform',
758
+				'FL' => 'Landing direction indicator',
759
+				'FM' => 'Meteorological service',
760
+				'FO' => 'Fog dispersal system',
761
+				'FP' => 'Heliport',
762
+				'FS' => 'Snow removal equipment',
763
+				'FT' => 'Transmissometer',
764
+				'FU' => 'Fuel availability',
765
+				'FW' => 'Wind direction indicator',
766
+				'FZ' => 'Customs');
767 767
 	public $code_instrumentlanding = array(
768
-			    'ID' => 'DME associated with ILS',
769
-			    'IG' => 'Glide path',
770
-			    'II' => 'Inner marker',
771
-			    'IL' => 'Localizer',
772
-			    'IM' => 'Middle marker',
773
-			    'IO' => 'Outer marker',
774
-			    'IS' => 'ILS Category I',
775
-			    'IT' => 'ILS Category II',
776
-			    'IU' => 'ILS Category III',
777
-			    'IW' => 'Microwave landing system',
778
-			    'IX' => 'Locator, outer',
779
-			    'IY' => 'Locator, middle');
768
+				'ID' => 'DME associated with ILS',
769
+				'IG' => 'Glide path',
770
+				'II' => 'Inner marker',
771
+				'IL' => 'Localizer',
772
+				'IM' => 'Middle marker',
773
+				'IO' => 'Outer marker',
774
+				'IS' => 'ILS Category I',
775
+				'IT' => 'ILS Category II',
776
+				'IU' => 'ILS Category III',
777
+				'IW' => 'Microwave landing system',
778
+				'IX' => 'Locator, outer',
779
+				'IY' => 'Locator, middle');
780 780
 	public $code_lightingfacilities = array(
781
-			    'LA' => 'Approach lighting system',
782
-			    'LB' => 'Airport beacon',
783
-			    'LC' => 'Runway center line lights',
784
-			    'LD' => 'Landing direction indicator lights',
785
-			    'LE' => 'Runway edge lights',
786
-			    'LF' => 'Sequenced flashing lights',
787
-			    'LH' => 'High intensity runway lights',
788
-			    'LI' => 'Runway end identifier lights',
789
-			    'LK' => 'Category II components of approach lighting system',
790
-			    'LL' => 'Low intensity runway lights',
791
-			    'LM' => 'Medium intensity runway lights',
792
-			    'LP' => 'Precision approach path indicator',
793
-			    'LR' => 'All landing area lighting facilities',
794
-			    'LS' => 'Stopway lights',
795
-			    'LT' => 'Threshold lights',
796
-			    'LV' => 'Visual approach slope indicator system',
797
-			    'LW' => 'Heliport lighting',
798
-			    'LX' => 'Taxiway center line lights',
799
-			    'LY' => 'Taxiway edge lights',
800
-			    'LZ' => 'Runway touchdown zone lights');
781
+				'LA' => 'Approach lighting system',
782
+				'LB' => 'Airport beacon',
783
+				'LC' => 'Runway center line lights',
784
+				'LD' => 'Landing direction indicator lights',
785
+				'LE' => 'Runway edge lights',
786
+				'LF' => 'Sequenced flashing lights',
787
+				'LH' => 'High intensity runway lights',
788
+				'LI' => 'Runway end identifier lights',
789
+				'LK' => 'Category II components of approach lighting system',
790
+				'LL' => 'Low intensity runway lights',
791
+				'LM' => 'Medium intensity runway lights',
792
+				'LP' => 'Precision approach path indicator',
793
+				'LR' => 'All landing area lighting facilities',
794
+				'LS' => 'Stopway lights',
795
+				'LT' => 'Threshold lights',
796
+				'LV' => 'Visual approach slope indicator system',
797
+				'LW' => 'Heliport lighting',
798
+				'LX' => 'Taxiway center line lights',
799
+				'LY' => 'Taxiway edge lights',
800
+				'LZ' => 'Runway touchdown zone lights');
801 801
 	public $code_movementareas = array(
802
-			    'MA' => 'Movement area',
803
-			    'MB' => 'Bearing strength',
804
-			    'MC' => 'Clearway',
805
-			    'MD' => 'Declared distances',
806
-			    'MG' => 'Taxiing guidance system',
807
-			    'MH' => 'Runway arresting gear',
808
-			    'MK' => 'Parking area',
809
-			    'MM' => 'Daylight markings',
810
-			    'MN' => 'Apron',
811
-			    'MP' => 'Aircraft stands',
812
-			    'MR' => 'Runway',
813
-			    'MS' => 'Stopway',
814
-			    'MT' => 'Threshold',
815
-			    'MU' => 'Runway turning bay',
816
-			    'MW' => 'Strip',
817
-			    'MX' => 'Taxiway');
802
+				'MA' => 'Movement area',
803
+				'MB' => 'Bearing strength',
804
+				'MC' => 'Clearway',
805
+				'MD' => 'Declared distances',
806
+				'MG' => 'Taxiing guidance system',
807
+				'MH' => 'Runway arresting gear',
808
+				'MK' => 'Parking area',
809
+				'MM' => 'Daylight markings',
810
+				'MN' => 'Apron',
811
+				'MP' => 'Aircraft stands',
812
+				'MR' => 'Runway',
813
+				'MS' => 'Stopway',
814
+				'MT' => 'Threshold',
815
+				'MU' => 'Runway turning bay',
816
+				'MW' => 'Strip',
817
+				'MX' => 'Taxiway');
818 818
 	public $code_terminalfacilities = array(
819
-			    'NA' => 'All radio navigation facilities',
820
-			    'NB' => 'Non directional beacon',
821
-			    'NC' => 'DECCA',
822
-			    'ND' => 'Distance measuring equipment',
823
-			    'NF' => 'Fan marker',
824
-			    'NL' => 'Locator',
825
-			    'NM' => 'VOR/DME',
826
-			    'NN' => 'TACAN',
827
-			    'NO' => 'OMEGA',
828
-			    'NT' => 'VORTAC',
829
-			    'NV' => 'VOR',
830
-			    'NX' => 'Direction finding station');
819
+				'NA' => 'All radio navigation facilities',
820
+				'NB' => 'Non directional beacon',
821
+				'NC' => 'DECCA',
822
+				'ND' => 'Distance measuring equipment',
823
+				'NF' => 'Fan marker',
824
+				'NL' => 'Locator',
825
+				'NM' => 'VOR/DME',
826
+				'NN' => 'TACAN',
827
+				'NO' => 'OMEGA',
828
+				'NT' => 'VORTAC',
829
+				'NV' => 'VOR',
830
+				'NX' => 'Direction finding station');
831 831
 	public $code_information = array(
832
-			    'OA' => 'Aeronautical information service',
833
-			    'OB' => 'Obstacle',
834
-			    'OE' => 'Aircraft entry requirements',
835
-			    'OL' => 'Obstacle lights on',
836
-			    'OR' => 'Rescue coordination centre');
832
+				'OA' => 'Aeronautical information service',
833
+				'OB' => 'Obstacle',
834
+				'OE' => 'Aircraft entry requirements',
835
+				'OL' => 'Obstacle lights on',
836
+				'OR' => 'Rescue coordination centre');
837 837
 	public $code_airtraffic = array(
838
-			    'PA' => 'Standard instrument arrival',
839
-			    'PD' => 'Standard instrument departure',
840
-			    'PF' => 'Flow control procedure',
841
-			    'PH' => 'Holding procedure',
842
-			    'PI' => 'Instrument approach procedure',
843
-			    'PL' => 'Obstacle clearance limit',
844
-			    'PM' => 'Aerodrome operating minima',
845
-			    'PO' => 'Obstacle clearance altitude',
846
-			    'PP' => 'Obstacle clearance height',
847
-			    'PR' => 'Radio failure procedure',
848
-			    'PT' => 'Transition altitude',
849
-			    'PU' => 'Missed approach procedure',
850
-			    'PX' => 'Minimum holding altitude',
851
-			    'PZ' => 'ADIZ procedure');
838
+				'PA' => 'Standard instrument arrival',
839
+				'PD' => 'Standard instrument departure',
840
+				'PF' => 'Flow control procedure',
841
+				'PH' => 'Holding procedure',
842
+				'PI' => 'Instrument approach procedure',
843
+				'PL' => 'Obstacle clearance limit',
844
+				'PM' => 'Aerodrome operating minima',
845
+				'PO' => 'Obstacle clearance altitude',
846
+				'PP' => 'Obstacle clearance height',
847
+				'PR' => 'Radio failure procedure',
848
+				'PT' => 'Transition altitude',
849
+				'PU' => 'Missed approach procedure',
850
+				'PX' => 'Minimum holding altitude',
851
+				'PZ' => 'ADIZ procedure');
852 852
 	public $code_navigationw = array(
853
-			    'RA' => 'Airspace reservation',
854
-			    'RD' => 'Danger area',
855
-			    'RO' => 'Overflying of',
856
-			    'RP' => 'Prohibited area',
857
-			    'RR' => 'Restricted area',
858
-			    'RT' => 'Temporary restricted area');
853
+				'RA' => 'Airspace reservation',
854
+				'RD' => 'Danger area',
855
+				'RO' => 'Overflying of',
856
+				'RP' => 'Prohibited area',
857
+				'RR' => 'Restricted area',
858
+				'RT' => 'Temporary restricted area');
859 859
 	public $code_volmet = array(
860
-			    'SA' => 'Automatic terminal information service',
861
-			    'SB' => 'ATS reporting office',
862
-			    'SC' => 'Area control center',
863
-			    'SE' => 'Flight information service',
864
-			    'SF' => 'Airport flight information service',
865
-			    'SL' => 'Flow control centre',
866
-			    'SO' => 'Oceanic area control centre',
867
-			    'SP' => 'Approach control service',
868
-			    'SS' => 'Flight service station',
869
-			    'ST' => 'Airport control tower',
870
-			    'SU' => 'Upper area control centre',
871
-			    'SV' => 'VOLMET broadcast',
872
-			    'SY' => 'Upper advisory service');
860
+				'SA' => 'Automatic terminal information service',
861
+				'SB' => 'ATS reporting office',
862
+				'SC' => 'Area control center',
863
+				'SE' => 'Flight information service',
864
+				'SF' => 'Airport flight information service',
865
+				'SL' => 'Flow control centre',
866
+				'SO' => 'Oceanic area control centre',
867
+				'SP' => 'Approach control service',
868
+				'SS' => 'Flight service station',
869
+				'ST' => 'Airport control tower',
870
+				'SU' => 'Upper area control centre',
871
+				'SV' => 'VOLMET broadcast',
872
+				'SY' => 'Upper advisory service');
873 873
 	public $code_warnings = array(
874
-			    'WA' => 'Air display',
875
-			    'WB' => 'Aerobatics',
876
-			    'WC' => 'Captive balloon or kite',
877
-			    'WD' => 'Demolition of explosives',
878
-			    'WE' => 'Exercises',
879
-			    'WF' => 'Air refueling',
880
-			    'WG' => 'Glider flying',
881
-			    'WJ' => 'Banner/target towing',
882
-			    'WL' => 'Ascent of free balloon',
883
-			    'WM' => 'Missile, gun or rocket firing',
884
-			    'WP' => 'Parachute jumping exercise',
885
-			    'WS' => 'Burning or blowing gas',
886
-			    'WT' => 'Mass movement of aircraft',
887
-			    'WV' => 'Formation flight',
888
-			    'WZ' => 'model flying');
874
+				'WA' => 'Air display',
875
+				'WB' => 'Aerobatics',
876
+				'WC' => 'Captive balloon or kite',
877
+				'WD' => 'Demolition of explosives',
878
+				'WE' => 'Exercises',
879
+				'WF' => 'Air refueling',
880
+				'WG' => 'Glider flying',
881
+				'WJ' => 'Banner/target towing',
882
+				'WL' => 'Ascent of free balloon',
883
+				'WM' => 'Missile, gun or rocket firing',
884
+				'WP' => 'Parachute jumping exercise',
885
+				'WS' => 'Burning or blowing gas',
886
+				'WT' => 'Mass movement of aircraft',
887
+				'WV' => 'Formation flight',
888
+				'WZ' => 'model flying');
889 889
 	public $code_sp_availabity = array(
890
-			    'AC' => 'Withdrawn for maintenance',
891
-			    'AD' => 'Available for daylight operation',
892
-			    'AF' => 'Flight checked and found reliable',
893
-			    'AG' => 'Operating but ground checked only, awaiting flight check',
894
-			    'AH' => 'Hours of service are now',
895
-			    'AK' => 'Resumed normal operations',
896
-			    'AM' => 'Military operations only',
897
-			    'AN' => 'Available for night operation',
898
-			    'AO' => 'Operational',
899
-			    'AP' => 'Available, prior permission required',
900
-			    'AR' => 'Available on request',
901
-			    'AS' => 'Unserviceable',
902
-			    'AU' => 'Not available',
903
-			    'AW' => 'Completely withdrawn',
904
-			    'AX' => 'Previously promulgated shutdown has been cancelled');
890
+				'AC' => 'Withdrawn for maintenance',
891
+				'AD' => 'Available for daylight operation',
892
+				'AF' => 'Flight checked and found reliable',
893
+				'AG' => 'Operating but ground checked only, awaiting flight check',
894
+				'AH' => 'Hours of service are now',
895
+				'AK' => 'Resumed normal operations',
896
+				'AM' => 'Military operations only',
897
+				'AN' => 'Available for night operation',
898
+				'AO' => 'Operational',
899
+				'AP' => 'Available, prior permission required',
900
+				'AR' => 'Available on request',
901
+				'AS' => 'Unserviceable',
902
+				'AU' => 'Not available',
903
+				'AW' => 'Completely withdrawn',
904
+				'AX' => 'Previously promulgated shutdown has been cancelled');
905 905
 	public $code_sp_changes = array(
906
-			    'CA' => 'Activated',
907
-			    'CC' => 'Completed',
908
-			    'CD' => 'Deactivated',
909
-			    'CE' => 'Erected',
910
-			    'CF' => 'Operating frequency(ies) changed to',
911
-			    'CG' => 'Downgraded to',
912
-			    'CH' => 'Changed',
913
-			    'CI' => 'dentification or radio call sign changed to',
914
-			    'CL' => 'Realigned',
915
-			    'CM' => 'Displaced',
916
-			    'CO' => 'Operating',
917
-			    'CP' => 'Operating on reduced power',
918
-			    'CR' => 'Temporarily replaced by',
919
-			    'CS' => 'Installed',
920
-			    'CT' => 'On test, do not use');
906
+				'CA' => 'Activated',
907
+				'CC' => 'Completed',
908
+				'CD' => 'Deactivated',
909
+				'CE' => 'Erected',
910
+				'CF' => 'Operating frequency(ies) changed to',
911
+				'CG' => 'Downgraded to',
912
+				'CH' => 'Changed',
913
+				'CI' => 'dentification or radio call sign changed to',
914
+				'CL' => 'Realigned',
915
+				'CM' => 'Displaced',
916
+				'CO' => 'Operating',
917
+				'CP' => 'Operating on reduced power',
918
+				'CR' => 'Temporarily replaced by',
919
+				'CS' => 'Installed',
920
+				'CT' => 'On test, do not use');
921 921
 	public $code_sp_hazardous = array(
922
-			    'HA' => 'Braking action is',
923
-			    'HB' => 'Braking coefficient is',
924
-			    'HC' => 'Covered by compacted snow to depth of x Ft',
925
-			    'HD' => 'Covered by dry snow to a depth of x Ft',
926
-			    'HE' => 'Covered by water to a depth of x Ft',
927
-			    'HF' => 'Totally free of snow and ice',
928
-			    'HG' => 'Grass cutting in progress',
929
-			    'HH' => 'Hazard due to',
930
-			    'HI' => 'Covered by ice',
931
-			    'HJ' => 'Launch planned',
932
-			    'HK' => 'Migration in progress',
933
-			    'HL' => 'Snow clearance completed',
934
-			    'HM' => 'Marked by',
935
-			    'HN' => 'Covered by wet snow or slush to a depth of x Ft',
936
-			    'HO' => 'Obscured by snow',
937
-			    'HP' => 'Snow clearance in progress',
938
-			    'HQ' => 'Operation cancelled',
939
-			    'HR' => 'Standing water',
940
-			    'HS' => 'Sanding in progress',
941
-			    'HT' => 'Approach according to signal area only',
942
-			    'HU' => 'Launch in progress',
943
-			    'HV' => 'Work completed',
944
-			    'HW' => 'Work in progress',
945
-			    'HX' => 'Concentration of birds',
946
-			    'HY' => 'Snow banks exist',
947
-			    'HZ' => 'Covered by frozen ruts and ridges');
922
+				'HA' => 'Braking action is',
923
+				'HB' => 'Braking coefficient is',
924
+				'HC' => 'Covered by compacted snow to depth of x Ft',
925
+				'HD' => 'Covered by dry snow to a depth of x Ft',
926
+				'HE' => 'Covered by water to a depth of x Ft',
927
+				'HF' => 'Totally free of snow and ice',
928
+				'HG' => 'Grass cutting in progress',
929
+				'HH' => 'Hazard due to',
930
+				'HI' => 'Covered by ice',
931
+				'HJ' => 'Launch planned',
932
+				'HK' => 'Migration in progress',
933
+				'HL' => 'Snow clearance completed',
934
+				'HM' => 'Marked by',
935
+				'HN' => 'Covered by wet snow or slush to a depth of x Ft',
936
+				'HO' => 'Obscured by snow',
937
+				'HP' => 'Snow clearance in progress',
938
+				'HQ' => 'Operation cancelled',
939
+				'HR' => 'Standing water',
940
+				'HS' => 'Sanding in progress',
941
+				'HT' => 'Approach according to signal area only',
942
+				'HU' => 'Launch in progress',
943
+				'HV' => 'Work completed',
944
+				'HW' => 'Work in progress',
945
+				'HX' => 'Concentration of birds',
946
+				'HY' => 'Snow banks exist',
947
+				'HZ' => 'Covered by frozen ruts and ridges');
948 948
 	public $code_sp_limitations = array(
949
-			    'LA' => 'Operating on Auxiliary Power Supply',
950
-			    'LB' => 'Reserved for aircraft based therein',
951
-			    'LC' => 'Closed',
952
-			    'LD' => 'Unsafe',
953
-			    'LE' => 'Operated without auxiliary power supply',
954
-			    'LF' => 'Interference from',
955
-			    'LG' => 'Operating without identification',
956
-			    'LH' => 'Unserviceable for aircraft heavier than',
957
-			    'LI' => 'Close to IFR operations',
958
-			    'LK' => 'Operating as a fixed light',
959
-			    'LL' => 'Usable for lenght of... and width of...',
960
-			    'LN' => 'Close to all night operations',
961
-			    'LP' => 'Prohibited to',
962
-			    'LR' => 'Aircraft restricted to runways and taxiways',
963
-			    'LS' => 'Subject to interruption',
964
-			    'LT' => 'Limited to',
965
-			    'LV' => 'Close to VFR operations',
966
-			    'LW' => 'Will take place',
967
-			    'LX' => 'Operating but caution advised to'); 
949
+				'LA' => 'Operating on Auxiliary Power Supply',
950
+				'LB' => 'Reserved for aircraft based therein',
951
+				'LC' => 'Closed',
952
+				'LD' => 'Unsafe',
953
+				'LE' => 'Operated without auxiliary power supply',
954
+				'LF' => 'Interference from',
955
+				'LG' => 'Operating without identification',
956
+				'LH' => 'Unserviceable for aircraft heavier than',
957
+				'LI' => 'Close to IFR operations',
958
+				'LK' => 'Operating as a fixed light',
959
+				'LL' => 'Usable for lenght of... and width of...',
960
+				'LN' => 'Close to all night operations',
961
+				'LP' => 'Prohibited to',
962
+				'LR' => 'Aircraft restricted to runways and taxiways',
963
+				'LS' => 'Subject to interruption',
964
+				'LT' => 'Limited to',
965
+				'LV' => 'Close to VFR operations',
966
+				'LW' => 'Will take place',
967
+				'LX' => 'Operating but caution advised to'); 
968 968
 
969 969
 	public function __construct($dbc = null) {
970 970
 		$Connection = new Connection($dbc);
Please login to merge, or discard this patch.
notam-geojson.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		date_default_timezone_set('UTC');
43 43
 		//waypoint plotting
44 44
 		$output .= '{"type": "Feature",';
45
-		    $output .= '"properties": {';
45
+			$output .= '"properties": {';
46 46
 			$output .= '"ref": "'.$spotter_item['ref'].'",';
47 47
 			$output .= '"title": "'.$spotter_item['title'].'",';
48 48
 			$output .= '"fir": "'.$spotter_item['fir'].'",';
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
 //			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
62 62
 //			if ($spotter_item['radius'] > 30) $spotter_item['radius'] = 30;
63 63
 			if ($spotter_item['scope'] == 'Airport warning') {
64
-			    $output .= '"color": "#EACC04",';
64
+				$output .= '"color": "#EACC04",';
65 65
 			} elseif ($spotter_item['scope'] == 'Airport/Enroute warning') {
66
-			    $output .= '"color": "#EA7D00",';
66
+				$output .= '"color": "#EA7D00",';
67 67
 			} elseif ($spotter_item['scope'] == 'Airport/Navigation warning') {
68
-			    $output .= '"color": "#DBEA00",';
68
+				$output .= '"color": "#DBEA00",';
69 69
 			} elseif ($spotter_item['scope'] == 'Navigation warning') {
70
-			    $output .= '"color": "#BBEA00",';
70
+				$output .= '"color": "#BBEA00",';
71 71
 			} else {
72
-			    $output .= '"color": "#FF0000",';
72
+				$output .= '"color": "#FF0000",';
73 73
 			}
74 74
 			$radius = $spotter_item['radius']*1852;
75 75
 			$output .= '"radiusm": "'.$radius.'",';
76 76
 			$output .= '"radiusnm": "'.$spotter_item['radius'].'",';
77 77
 			if ($radius > 25000) $radius = 25000;
78 78
 			$output .= '"radius": '.$radius.'';
79
-		    $output .= '},';
80
-		    $output .= '"geometry": {';
79
+			$output .= '},';
80
+			$output .= '"geometry": {';
81 81
 			$output .= '"type": "Point",';
82 82
 			$output .= '"coordinates": [';
83
-			    $output .= $spotter_item['center_longitude'].', '.$spotter_item['center_latitude'];
83
+				$output .= $spotter_item['center_longitude'].', '.$spotter_item['center_latitude'];
84 84
 			$output .= ']';
85
-		    $output .= '}';
85
+			$output .= '}';
86 86
 		$output .= '},';
87 87
 	}
88 88
 	$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
waypoints-geojson.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		date_default_timezone_set('UTC');
27 27
 		//waypoint plotting
28 28
 		$output .= '{"type": "Feature",';
29
-		    $output .= '"properties": {';
29
+			$output .= '"properties": {';
30 30
 			$output .= '"segment_name": "'.$spotter_item['segment_name'].'",';
31 31
 			$output .= '"base": "'.$spotter_item['base'].'",';
32 32
 			$output .= '"top": "'.$spotter_item['top'].'",';
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 				$output .= '"stroke": "#f0f0f0",';
50 50
 				$output .= '"stroke-width": 2';
51 51
 //			}
52
-		    $output .= '},';
53
-		    $output .= '"geometry": {';
52
+			$output .= '},';
53
+			$output .= '"geometry": {';
54 54
 			$output .= '"type": "LineString",';
55 55
 			$output .= '"coordinates": [';
56
-			    //$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']';
57
-			    $output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']';
56
+				//$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']';
57
+				$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']';
58 58
 			//    $output .= '['.$spotter_item['latitude_begin'].', '.$spotter_item['longitude_begin'].'], ['.$spotter_item['latitude_end'].', '.$spotter_item['longitude_end'].']';
59 59
 			$output .= ']';
60
-		    $output .= '}';
60
+			$output .= '}';
61 61
 /*		    $output .= '"geometry": {';
62 62
 			$output .= '"type": "Point",';
63 63
 			$output .= '"coordinates": [';
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$output .= '},';
69 69
 		//waypoint plotting
70 70
 		$output .= '{"type": "Feature",';
71
-		    $output .= '"properties": {';
71
+			$output .= '"properties": {';
72 72
 			$output .= '"ident": "'.$spotter_item['name_begin'].'",';
73 73
 			$output .= '"high": "'.$spotter_item['high'].'",';
74 74
 			$output .= '"alt": "'.$spotter_item['base'].'",';
@@ -98,17 +98,17 @@  discard block
 block discarded – undo
98 98
 				$output .= '"marker-size": "small",';
99 99
 				$output .= '"marker-color": "#0000ff"';
100 100
 			}
101
-		    $output .= '},';
102
-		    $output .= '"geometry": {';
101
+			$output .= '},';
102
+			$output .= '"geometry": {';
103 103
 			$output .= '"type": "Point",';
104 104
 			$output .= '"coordinates": [';
105
-			    $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);;
105
+				$output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);;
106 106
 			$output .= ']';
107
-		    $output .= '}';
107
+			$output .= '}';
108 108
 
109 109
 		$output .= '},';
110 110
 		$output .= '{"type": "Feature",';
111
-		    $output .= '"properties": {';
111
+			$output .= '"properties": {';
112 112
 			$output .= '"ident": "'.$spotter_item['name_end'].'",';
113 113
 			$output .= '"high": "'.$spotter_item['high'].'",';
114 114
 			$output .= '"alt": "'.$spotter_item['top'].'",';
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 				$output .= '"marker-size": "small",';
146 146
 				$output .= '"marker-color": "#0000ff"';
147 147
 			}
148
-		    $output .= '},';
149
-		    $output .= '"geometry": {';
148
+			$output .= '},';
149
+			$output .= '"geometry": {';
150 150
 			$output .= '"type": "Point",';
151 151
 			$output .= '"coordinates": [';
152
-			    $output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048);
152
+				$output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048);
153 153
 			$output .= ']';
154
-		    $output .= '}';
154
+			$output .= '}';
155 155
 
156 156
 		$output .= '},';
157 157
 	}
Please login to merge, or discard this patch.