Completed
Push — master ( 5a808c...3474b8 )
by Yannick
08:59
created
statistics-pilot.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
statistics-airport-arrival.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 14
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $airport_airport_array = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
29 29
 
30 30
 print 'var series = [';
31
-    $airport_data = '';
31
+	$airport_data = '';
32 32
 foreach($airport_airport_array as $airport_item)
33 33
 {
34 34
 	$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
Please login to merge, or discard this patch.
statistics-registration.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
statistics-country.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 
14 14
 require_once('header.php');
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 */
31 31
 print '<div id="chart" class="chart" width="100%"></div><script>';
32 32
 print 'var series = [';
33
-            $flightover_data = '';
33
+			$flightover_data = '';
34 34
 foreach($flightover_array as $flightover_item)
35 35
 {
36 36
 	$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
Please login to merge, or discard this patch.
statistics.php 1 patch
Indentation   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
52 52
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
53 53
 	}
54
-    ?>
54
+	?>
55 55
     </div>
56 56
     <?php include('statistics-sub-menu.php'); ?>
57 57
     <p class="global-stats">
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
         <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
61 61
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
62 62
 	<?php
63
-	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
63
+		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
64 64
 	?>
65 65
     	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
66 66
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
67 67
         <?php
68
-    	    } else {
69
-    	?>
68
+			} else {
69
+		?>
70 70
     	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
71 71
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
72 72
     	<?php
73
-    	    }
74
-    	?>
73
+			}
74
+		?>
75 75
         <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
76 76
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
77 77
         <?php
78
-    		if ($airline_icao == '') {
79
-    	?>
78
+			if ($airline_icao == '') {
79
+		?>
80 80
         <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
81 81
 	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
82 82
 	<?php
@@ -99,88 +99,88 @@  discard block
 block discarded – undo
99 99
             <div class="col-md-6">
100 100
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
101 101
                  <?php
102
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
103
-		    if (count($aircraft_array) == 0) print _("No data available");
104
-		    else {
105
-                    print '<div id="chart1" class="chart" width="100%"></div><script>';
106
-                    $aircraft_data = '';
107
-                    foreach($aircraft_array as $aircraft_item)
108
-                    {
109
-                        $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
110
-                    }
111
-                    $aircraft_data = substr($aircraft_data, 0, -1);
112
-		    print 'var series = ['.$aircraft_data.'];';
113
-		    print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
114
-		    print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#e6e6f6","#1a3151"]);';
115
-		    print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
116
-                    print 'var aircraftype = new d3pie("chart1",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
117
-                    print 'dataset';
118
-                    print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
119
-                    print '</script>';
120
-                  }
121
-                  ?>
102
+				  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
103
+			if (count($aircraft_array) == 0) print _("No data available");
104
+			else {
105
+					print '<div id="chart1" class="chart" width="100%"></div><script>';
106
+					$aircraft_data = '';
107
+					foreach($aircraft_array as $aircraft_item)
108
+					{
109
+						$aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
110
+					}
111
+					$aircraft_data = substr($aircraft_data, 0, -1);
112
+			print 'var series = ['.$aircraft_data.'];';
113
+			print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
114
+			print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#e6e6f6","#1a3151"]);';
115
+			print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
116
+					print 'var aircraftype = new d3pie("chart1",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
117
+					print 'dataset';
118
+					print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
119
+					print '</script>';
120
+				  }
121
+				  ?>
122 122
                 <div class="more">
123 123
             	    <?php
124
-            		if ($year != '' && $month != '') {
125
-            	    ?>
124
+					if ($year != '' && $month != '') {
125
+					?>
126 126
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
127 127
             	    <?php
128
-            		} else {
129
-            	    ?>
128
+					} else {
129
+					?>
130 130
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
131 131
             	    <?php
132
-            		}
133
-            	    ?>
132
+					}
133
+					?>
134 134
                 </div>
135 135
             </div>
136 136
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
137 137
 <?php
138 138
 //    echo $airline_icao;
139
-    if ($airline_icao == '' || $airline_icao == 'all') {
139
+	if ($airline_icao == '' || $airline_icao == 'all') {
140 140
 	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
141 141
 	if (count($airline_array) > 0) {
142
-            print '<div class="col-md-6">';
143
-	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
144
-	    print '<div id="chart2" class="chart" width="100%"></div><script>';
145
-	    $airline_data = '';
146
-	    foreach($airline_array as $airline_item)
147
-	    {
142
+			print '<div class="col-md-6">';
143
+		print '<h2>'._("Top 10 Most Common Airline").'</h2>';
144
+		print '<div id="chart2" class="chart" width="100%"></div><script>';
145
+		$airline_data = '';
146
+		foreach($airline_array as $airline_item)
147
+		{
148 148
 		$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
149
-	    }
150
-	    $airline_data = substr($airline_data, 0, -1);
151
-	    print 'var series = ['.$airline_data.'];';
152
-	    print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
153
-	    print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
154
-	    print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
155
-            print 'var airlinescnt = new d3pie("chart2",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
156
-	    print 'dataset';
157
-            print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
158
-            print '</script>';
159
-	    if ($year != '' && $month != '') {
149
+		}
150
+		$airline_data = substr($airline_data, 0, -1);
151
+		print 'var series = ['.$airline_data.'];';
152
+		print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
153
+		print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
154
+		print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
155
+			print 'var airlinescnt = new d3pie("chart2",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
156
+		print 'dataset';
157
+			print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
158
+			print '</script>';
159
+		if ($year != '' && $month != '') {
160 160
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
161 161
 		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
162 162
 		print '/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
163
-	    } else {
163
+		} else {
164 164
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
165 165
 		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
166 166
 		print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
167
-	    }
168
-    	    print '</div>';
167
+		}
168
+			print '</div>';
169 169
 	}
170 170
 ?>
171 171
         </div>
172 172
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
173 173
 <?php
174
-    }
174
+	}
175 175
 ?>
176 176
         <div class="row column">
177 177
 <?php
178
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
179
-    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
178
+	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
179
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
180 180
 	if (empty($flightover_array)) {
181
-	    print '<div class="col-md-12">';
181
+		print '<div class="col-md-12">';
182 182
 	} else {
183
-            print '<div class="col-md-6">';
183
+			print '<div class="col-md-6">';
184 184
 	}
185 185
 ?>
186 186
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
@@ -188,23 +188,23 @@  discard block
 block discarded – undo
188 188
 	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
189 189
 	if (count($pilot_array) == 0) print _("No data available");
190 190
 	else {
191
-	    print '<div id="chart7" class="chart" width="100%"></div><script>';
192
-	    $pilot_data = '';
193
-	    foreach($pilot_array as $pilot_item)
194
-	    {
191
+		print '<div id="chart7" class="chart" width="100%"></div><script>';
192
+		$pilot_data = '';
193
+		foreach($pilot_array as $pilot_item)
194
+		{
195 195
 		$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
196
-	    }
197
-	    $pilot_data = substr($pilot_data, 0, -1);
198
-	    print 'var series = ['.$pilot_data.'];';
199
-	    print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
200
-	    print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
201
-	    print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
202
-            print 'var pilotcnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
203
-	    print 'dataset';
204
-            print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
205
-            print '</script>';
206
-        }
207
-        print '<div class="more">';
196
+		}
197
+		$pilot_data = substr($pilot_data, 0, -1);
198
+		print 'var series = ['.$pilot_data.'];';
199
+		print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
200
+		print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
201
+		print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
202
+			print 'var pilotcnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
203
+		print 'dataset';
204
+			print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
205
+			print '</script>';
206
+		}
207
+		print '<div class="more">';
208 208
 	print '<a href="'.$globalURL.'/statistics/pilot'; 
209 209
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
210 210
 	print'" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a>';
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         
215 215
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
216 216
 <?php
217
-    } else {
217
+	} else {
218 218
 ?>
219 219
             <div class="col-md-6">
220 220
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
@@ -222,21 +222,21 @@  discard block
 block discarded – undo
222 222
 	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
223 223
 	if (count($owner_array) == 0) print _("No data available");
224 224
 	else {
225
-	    print '<div id="chart7" class="chart" width="100%"></div><script>';
226
-	    $owner_data = '';
227
-	    foreach($owner_array as $owner_item)
228
-	    {
225
+		print '<div id="chart7" class="chart" width="100%"></div><script>';
226
+		$owner_data = '';
227
+		foreach($owner_array as $owner_item)
228
+		{
229 229
 		$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
230
-	    }
231
-	    $owner_data = substr($owner_data, 0, -1);
232
-	    print 'var series = ['.$owner_data.'];';
233
-	    print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
234
-	    print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
235
-	    print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
236
-            print 'var ownercnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
237
-	    print 'dataset';
238
-            print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
239
-	    print '</script>';
230
+		}
231
+		$owner_data = substr($owner_data, 0, -1);
232
+		print 'var series = ['.$owner_data.'];';
233
+		print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
234
+		print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
235
+		print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});';
236
+			print 'var ownercnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":';
237
+		print 'dataset';
238
+			print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});';
239
+		print '</script>';
240 240
 	}
241 241
 ?>
242 242
                 <div class="more">
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
         
247 247
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
248 248
 <?php
249
-    }
250
-    if (!empty($flightover_array)) {
249
+	}
250
+	if (!empty($flightover_array)) {
251 251
 ?>
252 252
             <div class="col-md-6">
253 253
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
256 256
 	if (count($flightover_array) == 0) print _("No data available");
257 257
 	else {
258
-	    print '<div id="chart10" class="chart" width="100%"></div><script>';
259
-	    print 'var series = [';
260
-            $flightover_data = '';
261
-	    foreach($flightover_array as $flightover_item)
262
-	    {
258
+		print '<div id="chart10" class="chart" width="100%"></div><script>';
259
+		print 'var series = [';
260
+			$flightover_data = '';
261
+		foreach($flightover_array as $flightover_item)
262
+		{
263 263
 		$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
264
-	    }
265
-	    $flightover_data = substr($flightover_data, 0, -1);
266
-	    print $flightover_data;
267
-	    print '];';
268
-	    print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
269
-	    print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
270
-	    print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});';
271
-	    print 'new Datamap({
264
+		}
265
+		$flightover_data = substr($flightover_data, 0, -1);
266
+		print $flightover_data;
267
+		print '];';
268
+		print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
269
+		print 'var paletteScale = d3.scale.linear().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
270
+		print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});';
271
+		print 'new Datamap({
272 272
     		element: document.getElementById("chart10"),
273 273
     		projection: "mercator", // big world map
274 274
     		fills: { defaultFill: "#F5F5F5" },
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         	    }
294 294
 		}
295 295
 	    });";
296
-	    print '</script>';
296
+		print '</script>';
297 297
 	}
298 298
 ?>
299 299
                 <div class="more">
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
                 </div>
302 302
             </div>
303 303
 <?php
304
-    }
304
+	}
305 305
 ?>
306 306
         </div>
307 307
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
         <div class="row column">
312 312
             <div class="col-md-6">
313 313
 <?php
314
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
315
-    if (count($airport_airport_array) > 0) {
314
+	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
315
+	if (count($airport_airport_array) > 0) {
316 316
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
317 317
 	print '<div id="chart3" class="chart" width="100%"></div><script>';
318
-        print "\n";
319
-        print 'var series = [';
320
-        $airport_data = '';
318
+		print "\n";
319
+		print 'var series = [';
320
+		$airport_data = '';
321 321
 	foreach($airport_airport_array as $airport_item)
322 322
 	{
323 323
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
@@ -366,20 +366,20 @@  discard block
 block discarded – undo
366 366
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure'; 
367 367
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
368 368
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
369
-    }
369
+	}
370 370
 ?>
371 371
             </div>
372 372
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
373 373
 
374 374
             <div class="col-md-6">
375 375
 <?php
376
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
377
-    if (count($airport_airport_array2) > 0) {
376
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
377
+	if (count($airport_airport_array2) > 0) {
378 378
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
379 379
 	print '<div id="chart4" class="chart" width="100%"></div><script>';
380
-        print "\n";
381
-        print 'var series = [';
382
-        $airport_data = '';
380
+		print "\n";
381
+		print 'var series = [';
382
+		$airport_data = '';
383 383
 	foreach($airport_airport_array2 as $airport_item)
384 384
 	{
385 385
 		$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
@@ -429,28 +429,28 @@  discard block
 block discarded – undo
429 429
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival';
430 430
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
431 431
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
432
-    }
432
+	}
433 433
 ?>
434 434
             </div>
435 435
         </div>
436 436
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
437 437
 <?php
438
-    if ($year == '' && $month == '') {
438
+	if ($year == '' && $month == '') {
439 439
 ?>
440 440
         <div class="row column">
441 441
             <div class="col-md-6">
442 442
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
443 443
                 <?php
444
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
445
-		    if (count($year_array) == 0) print _("No data available");
446
-		    else {
444
+				  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
445
+			if (count($year_array) == 0) print _("No data available");
446
+			else {
447 447
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
448 448
 			$year_data = '';
449 449
 			$year_cnt = '';
450 450
 			foreach($year_array as $year_item)
451 451
 			{
452
-			    $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
453
-			    $year_cnt .= $year_item['date_count'].',';
452
+				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
453
+				$year_cnt .= $year_item['date_count'].',';
454 454
 			}
455 455
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
456 456
 			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
                 	     columns: ['.$year_data.','.$year_cnt.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
461 461
                 	     axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m"}}, y: { label: "# of Flights"}},legend: { show: false }});';
462 462
 			print '</script>';
463
-                    }
464
-                  ?>
463
+					}
464
+				  ?>
465 465
                 <div class="more">
466 466
                     <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
467 467
                 </div>
@@ -470,16 +470,16 @@  discard block
 block discarded – undo
470 470
             <div class="col-md-6">
471 471
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
472 472
                 <?php
473
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
474
-		    if (count($month_array) == 0) print _("No data available");
475
-		    else {
476
-                	print '<div id="chart9" class="chart" width="100%"></div><script>';
477
-                        $month_data = '';
473
+				  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
474
+			if (count($month_array) == 0) print _("No data available");
475
+			else {
476
+					print '<div id="chart9" class="chart" width="100%"></div><script>';
477
+						$month_data = '';
478 478
 			$month_cnt = '';
479 479
 			foreach($month_array as $month_item)
480 480
 			{
481
-			    $month_data .= '"'.$month_item['date_name'].'",';
482
-			    $month_cnt .= $month_item['date_count'].',';
481
+				$month_data .= '"'.$month_item['date_name'].'",';
482
+				$month_cnt .= $month_item['date_count'].',';
483 483
 			}
484 484
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
485 485
 			$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
@@ -489,9 +489,9 @@  discard block
 block discarded – undo
489 489
                 	     columns: ['.$month_data.','.$month_cnt.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
490 490
                 	     axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m-%d"}}, y: { label: "# of Flights"}},legend: { show: false }});';
491 491
 			
492
-            		print '</script>';
493
-                    }
494
-                  ?>
492
+					print '</script>';
493
+					}
494
+				  ?>
495 495
                 <div class="more">
496 496
                     <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
497 497
                 </div>
@@ -501,16 +501,16 @@  discard block
 block discarded – undo
501 501
             <div class="col-md-6">
502 502
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
503 503
                 <?php
504
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
505
-		    if (empty($date_array)) print _("No data available");
506
-		    else {
507
-                	print '<div id="chart5" class="chart" width="100%"></div><script>';
508
-                        $date_data = '';
504
+					$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
505
+			if (empty($date_array)) print _("No data available");
506
+			else {
507
+					print '<div id="chart5" class="chart" width="100%"></div><script>';
508
+						$date_data = '';
509 509
 			$date_cnt = '';
510 510
 			foreach($date_array as $date_item)
511 511
 			{
512
-			    $date_data .= '"'.$date_item['date_name'].'",';
513
-			    $date_cnt .= $date_item['date_count'].',';
512
+				$date_data .= '"'.$date_item['date_name'].'",';
513
+				$date_cnt .= $date_item['date_count'].',';
514 514
 			}
515 515
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
516 516
 			$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
@@ -520,9 +520,9 @@  discard block
 block discarded – undo
520 520
                 	     columns: ['.$date_data.','.$date_cnt.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
521 521
                 	     axis: { x: { type: "timeseries",tick: { format: "%Y-%m-%d"}}, y: { label: "# of Flights"}},legend: { show: false }});';
522 522
 			
523
-                	print '</script>';
524
-                    }
525
-                  ?>
523
+					print '</script>';
524
+					}
525
+				  ?>
526 526
                 <div class="more">
527 527
                     <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
528 528
                 </div>
@@ -531,16 +531,16 @@  discard block
 block discarded – undo
531 531
             <div class="col-md-6">
532 532
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
533 533
                 <?php
534
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
535
-		    if (empty($hour_array)) print _("No data available");
536
-		    else {
537
-                	print '<div id="chart6" class="chart" width="100%"></div><script>';
538
-                        $hour_data = '';
534
+				  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
535
+			if (empty($hour_array)) print _("No data available");
536
+			else {
537
+					print '<div id="chart6" class="chart" width="100%"></div><script>';
538
+						$hour_data = '';
539 539
 			$hour_cnt = '';
540 540
 			foreach($hour_array as $hour_item)
541 541
 			{
542
-			    $hour_data .= '"'.$hour_item['hour_name'].':00",';
543
-			    $hour_cnt .= $hour_item['hour_count'].',';
542
+				$hour_data .= '"'.$hour_item['hour_name'].':00",';
543
+				$hour_cnt .= $hour_item['hour_count'].',';
544 544
 			}
545 545
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
546 546
 			$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
@@ -550,9 +550,9 @@  discard block
 block discarded – undo
550 550
                 	     columns: ['.$hour_cnt.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
551 551
                 	     axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});';
552 552
 
553
-            	     print '</script>';
554
-                  }
555
-                ?>
553
+					 print '</script>';
554
+				  }
555
+				?>
556 556
                 <div class="more">
557 557
                     <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
558 558
                 </div>
@@ -560,26 +560,26 @@  discard block
 block discarded – undo
560 560
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
561 561
         </div>
562 562
 <?php
563
-    }
563
+	}
564 564
 ?>
565 565
 
566 566
 <?php
567
-    if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
567
+	if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
568 568
 ?>
569 569
         <div class="row column">
570 570
             <div class="col-md-6">
571 571
                 <h2><?php echo _("Fatalities by Years"); ?></h2>
572 572
                 <?php
573
-                  $year_array = $Stats->countFatalitiesByYear();
574
-		    if (count($year_array) == 0) print _("No data available");
575
-		    else {
573
+				  $year_array = $Stats->countFatalitiesByYear();
574
+			if (count($year_array) == 0) print _("No data available");
575
+			else {
576 576
 			print '<div id="chart32" class="chart" width="100%"></div><script>';
577
-                        $year_data = '';
577
+						$year_data = '';
578 578
 			$year_cnt = '';
579 579
 			foreach($year_array as $year_item)
580 580
 			{
581
-			    $year_data .= '"'.$year_item['year'].'-01-01",';
582
-			    $year_cnt .= $year_item['count'].',';
581
+				$year_data .= '"'.$year_item['year'].'-01-01",';
582
+				$year_cnt .= $year_item['count'].',';
583 583
 			}
584 584
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
585 585
 			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
@@ -590,8 +590,8 @@  discard block
 block discarded – undo
590 590
                 	     axis: { x: { type: "timeseries",tick: { format: "%Y"}}, y: { label: "# of Flights"}},legend: { show: false }});';
591 591
 
592 592
 			print '</script>';
593
-		    }
594
-                  ?>
593
+			}
594
+				  ?>
595 595
                 <div class="more">
596 596
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
597 597
                 </div>
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
             <div class="col-md-6">
603 603
                 <h2><?php echo _("Fatalities last 12 Months"); ?></h2>
604 604
                 <?php
605
-                  $year_array = $Stats->countFatalitiesLast12Months();
606
-		    if (count($year_array) == 0) print _("No data available");
607
-		    else {
605
+				  $year_array = $Stats->countFatalitiesLast12Months();
606
+			if (count($year_array) == 0) print _("No data available");
607
+			else {
608 608
 			print '<div id="chart33" class="chart" width="100%"></div><script>';
609
-                        $year_data = '';
609
+						$year_data = '';
610 610
 			$year_cnt = '';
611 611
 			foreach($year_array as $year_item)
612 612
 			{
613
-			    $year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
614
-			    $year_cnt .= $year_item['count'].',';
613
+				$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
614
+				$year_cnt .= $year_item['count'].',';
615 615
 			}
616 616
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
617 617
 			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
                 	     columns: ['.$year_data.','.$year_cnt.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
622 622
                 	     axis: { x: { type: "timeseries",tick: { format: "%Y-%m"}}, y: { label: "# of Flights"}},legend: { show: false }});';
623 623
 			print '</script>';
624
-		    }
625
-                  ?>
624
+			}
625
+				  ?>
626 626
                 <div class="more">
627 627
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
628 628
                 </div>
@@ -630,30 +630,30 @@  discard block
 block discarded – undo
630 630
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
631 631
 <br/>
632 632
 <?php
633
-    }
633
+	}
634 634
 ?>
635 635
 
636 636
 <?php
637
-    if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
637
+	if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
638 638
 ?>
639 639
         <div class="row column">
640 640
         	<?php
641
-        	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
642
-        	    if ($year == '' && $month == '') {
643
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
644
-		    } else {
645
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
646
-        	    }
647
-        	    if (!empty($polar)) {
648
-            		print '<h2>'._("Coverage pattern").'</h2>';
649
-        		foreach ($polar as $eachpolar) {
650
-        		    unset($polar_data);
651
-	        	    $Spotter = new Spotter();
652
-        		    $data = json_decode($eachpolar['source_data']);
653
-        		    foreach($data as $value => $key) {
654
-        			$direction = $Spotter->parseDirection(($value*22.5));
655
-        			$distance = $key;
656
-        			$unit = 'km';
641
+				//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
642
+				if ($year == '' && $month == '') {
643
+				$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
644
+			} else {
645
+				$polar = $Stats->getStatsSource('polar',$year,$month);
646
+				}
647
+				if (!empty($polar)) {
648
+					print '<h2>'._("Coverage pattern").'</h2>';
649
+				foreach ($polar as $eachpolar) {
650
+					unset($polar_data);
651
+					$Spotter = new Spotter();
652
+					$data = json_decode($eachpolar['source_data']);
653
+					foreach($data as $value => $key) {
654
+					$direction = $Spotter->parseDirection(($value*22.5));
655
+					$distance = $key;
656
+					$unit = 'km';
657 657
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
658 658
 					$distance = round($distance*0.539957);
659 659
 					$unit = 'nm';
@@ -664,10 +664,10 @@  discard block
 block discarded – undo
664 664
 					$distance = $distance;
665 665
 					$unit = 'km';
666 666
 				}
667
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
668
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
669
-        		    }
670
-        	?>
667
+					if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
668
+						else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
669
+					}
670
+			?>
671 671
             <div class="col-md-6">
672 672
                 <h4><?php print $eachpolar['source_name']; ?></h4>
673 673
         	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
@@ -699,27 +699,27 @@  discard block
 block discarded – undo
699 699
 		</script>
700 700
             </div>
701 701
             <?php
702
-        	    }
703
-        	}
704
-            ?>
702
+				}
703
+			}
704
+			?>
705 705
         </div>
706 706
         <div class="row column">
707 707
             <div class="col-md-6">
708 708
         	<?php
709
-        	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
710
-        	    if ($year == '' && $month == '') {
711
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
712
-        	    } else {
713
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
714
-        	    }
715
-        	    if (!empty($msg)) {
716
-            		print '<h2>'._("Messages received").'</h2>';
717
-        		foreach ($msg as $eachmsg) {
718
-        		    //$eachmsg = $msg[0];
719
-        		    $data = $eachmsg['source_data'];
720
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
721
-        		    else $max = 500;
722
-        	?>
709
+				//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
710
+				if ($year == '' && $month == '') {
711
+				$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
712
+				} else {
713
+				$msg = $Stats->getStatsSource('msg',$year,$month);
714
+				}
715
+				if (!empty($msg)) {
716
+					print '<h2>'._("Messages received").'</h2>';
717
+				foreach ($msg as $eachmsg) {
718
+					//$eachmsg = $msg[0];
719
+					$data = $eachmsg['source_data'];
720
+					if ($data > 500) $max = (round(($data+100)/100))*100;
721
+					else $max = 500;
722
+			?>
723 723
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
724 724
         	<script>
725 725
 		      var g = new JustGage({
@@ -735,9 +735,9 @@  discard block
 block discarded – undo
735 735
 			  });
736 736
 		</script>
737 737
             <?php
738
-        	   }
739
-        	}
740
-            ?>
738
+			   }
739
+			}
740
+			?>
741 741
             </div>
742 742
         </div>
743 743
         <div class="row column">
@@ -775,26 +775,26 @@  discard block
 block discarded – undo
775 775
 			//$hist_data = substr($hist_data, 0, -1);
776 776
 			$distance_data = "['x',".substr($distance_data, 0, -1)."]";
777 777
 			$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
778
-            ?>
778
+			?>
779 779
             <div class="col-md-6">
780 780
                 <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
781 781
                 <?php
782
-                    print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
783
-		    print 'c3.generate({
782
+					print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
783
+			print 'c3.generate({
784 784
 			bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
785 785
 			data: { x: "x",
786 786
 			columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area-spline"}, colors: { flights: "#1a3151"}},
787 787
 			axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
788
-		    print '</script>';
789
-        	?>
788
+			print '</script>';
789
+			?>
790 790
     	    </div>
791 791
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
792 792
         	<?php
793
-                  }
794
-                ?>
793
+				  }
794
+				?>
795 795
         </div>
796 796
 <?php
797
-    }
797
+	}
798 798
 ?>
799 799
     </div>
800 800
 </div>  
Please login to merge, or discard this patch.
require/class.Connection.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -7,32 +7,32 @@  discard block
 block discarded – undo
7 7
 	public $latest_schema = 37;
8 8
 	
9 9
 	public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) {
10
-	    global $globalDBdriver, $globalNoDB;
11
-	    if (isset($globalNoDB) && $globalNoDB === TRUE) return true;
12
-	    if ($dbc === null) {
10
+		global $globalDBdriver, $globalNoDB;
11
+		if (isset($globalNoDB) && $globalNoDB === TRUE) return true;
12
+		if ($dbc === null) {
13 13
 		if ($this->db === null && $dbname === null) {
14
-		    if ($user === null && $pass === null) {
15
-		        $this->createDBConnection();
16
-		    } else {
17
-		        $this->createDBConnection(null,$user,$pass);
18
-		    }
14
+			if ($user === null && $pass === null) {
15
+				$this->createDBConnection();
16
+			} else {
17
+				$this->createDBConnection(null,$user,$pass);
18
+			}
19 19
 		} else {
20
-		    $this->createDBConnection($dbname);
20
+			$this->createDBConnection($dbname);
21 21
 		}
22
-	    } elseif ($dbname === null || $dbname === 'default') {
23
-	        $this->db = $dbc;
24
-	        if ($this->connectionExists() === false) {
25
-		    /*
22
+		} elseif ($dbname === null || $dbname === 'default') {
23
+			$this->db = $dbc;
24
+			if ($this->connectionExists() === false) {
25
+			/*
26 26
 		    echo 'Restart Connection !!!'."\n";
27 27
 		    $e = new \Exception;
28 28
 		    var_dump($e->getTraceAsString());
29 29
 		    */
30
-		    $this->createDBConnection();
30
+			$this->createDBConnection();
31 31
 		}
32
-	    } else {
32
+		} else {
33 33
 		//$this->connectionExists();
34 34
 		$this->dbs[$dbname] = $dbc;
35
-	    }
35
+		}
36 36
 	}
37 37
 
38 38
 	public function db() {
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	/**
51
-	* Creates the database connection
52
-	*
53
-	* @return Boolean of the database connection
54
-	*
55
-	*/
51
+	 * Creates the database connection
52
+	 *
53
+	 * @return Boolean of the database connection
54
+	 *
55
+	 */
56 56
 
57 57
 	public function createDBConnection($DBname = null, $user = null, $pass = null)
58 58
 	{
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			return false;
150 150
 		}
151 151
 		if($results->rowCount()>0) {
152
-		    return true; 
152
+			return true; 
153 153
 		}
154 154
 		else return false;
155 155
 	}
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 				$sum = $sum->fetchColumn(0);
167 167
 			} else $sum = 0;
168 168
 			if (intval($sum) !== 2) {
169
-			     return false;
169
+				 return false;
170 170
 			}
171 171
 			
172 172
 		} catch(PDOException $e) {
173 173
 			if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) {
174
-            			throw $e;
175
-	                }
176
-	                //echo 'error ! '.$e->getMessage();
174
+						throw $e;
175
+					}
176
+					//echo 'error ! '.$e->getMessage();
177 177
 			return false;
178 178
 		}
179 179
 		return true; 
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 		$version = 0;
278 278
 		if ($this->tableExists('aircraft')) {
279 279
 			if (!$this->tableExists('config')) {
280
-	    			$version = '1';
281
-	    			return $version;
280
+					$version = '1';
281
+					return $version;
282 282
 			} else {
283 283
 				$query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1";
284 284
 				try {
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
 	* @return Boolean if latest version or not
300 300
 	*/
301 301
 	public function latest() {
302
-	    global $globalNoDB;
303
-	    if (isset($globalNoDB) && $globalNoDB === TRUE) return true;
304
-	    if ($this->check_schema_version() == $this->latest_schema) return true;
305
-	    else return false;
302
+		global $globalNoDB;
303
+		if (isset($globalNoDB) && $globalNoDB === TRUE) return true;
304
+		if ($this->check_schema_version() == $this->latest_schema) return true;
305
+		else return false;
306 306
 	}
307 307
 
308 308
 }
Please login to merge, or discard this patch.
require/class.Stats.php 1 patch
Indentation   +820 added lines, -820 removed lines patch added patch discarded remove patch
@@ -16,33 +16,33 @@  discard block
 block discarded – undo
16 16
 		if (isset($globalFilterName)) $this->filter_name = $globalFilterName;
17 17
 		$Connection = new Connection($dbc);
18 18
 		$this->db = $Connection->db();
19
-        }
19
+		}
20 20
               
21 21
 	public function addLastStatsUpdate($type,$stats_date) {
22
-                $query = "DELETE FROM config WHERE name = :type;
22
+				$query = "DELETE FROM config WHERE name = :type;
23 23
             		INSERT INTO config (name,value) VALUES (:type,:stats_date);";
24
-                $query_values = array('type' => $type,':stats_date' => $stats_date);
25
-                 try {
26
-                        $sth = $this->db->prepare($query);
27
-                        $sth->execute($query_values);
28
-                } catch(PDOException $e) {
29
-                        return "error : ".$e->getMessage();
30
-                }
31
-        }
24
+				$query_values = array('type' => $type,':stats_date' => $stats_date);
25
+				 try {
26
+						$sth = $this->db->prepare($query);
27
+						$sth->execute($query_values);
28
+				} catch(PDOException $e) {
29
+						return "error : ".$e->getMessage();
30
+				}
31
+		}
32 32
 
33 33
 	public function getLastStatsUpdate($type = 'last_update_stats') {
34
-                $query = "SELECT value FROM config WHERE name = :type";
35
-                 try {
36
-                        $sth = $this->db->prepare($query);
37
-                        $sth->execute(array(':type' => $type));
38
-                } catch(PDOException $e) {
39
-                        echo "error : ".$e->getMessage();
40
-                }
41
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
42
-                return $all;
43
-        }
44
-        public function deleteStats($filter_name = '') {
45
-        	/*
34
+				$query = "SELECT value FROM config WHERE name = :type";
35
+				 try {
36
+						$sth = $this->db->prepare($query);
37
+						$sth->execute(array(':type' => $type));
38
+				} catch(PDOException $e) {
39
+						echo "error : ".$e->getMessage();
40
+				}
41
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
42
+				return $all;
43
+		}
44
+		public function deleteStats($filter_name = '') {
45
+			/*
46 46
         	$query = "DELETE FROM config WHERE name = 'last_update_stats'";
47 47
                  try {
48 48
                         $sth = $this->db->prepare($query);
@@ -51,109 +51,109 @@  discard block
 block discarded – undo
51 51
                         return "error : ".$e->getMessage();
52 52
                 }
53 53
                 */
54
-        	$query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;";
55
-                 try {
56
-                        $sth = $this->db->prepare($query);
57
-                        $sth->execute(array(':filter_name' => $filter_name));
58
-                } catch(PDOException $e) {
59
-                        return "error : ".$e->getMessage();
60
-                }
61
-        }
62
-        public function deleteOldStats($filter_name = '') {
63
-        	if ($filter_name == '') {
64
-        		$query = "DELETE FROM config WHERE name = 'last_update_stats'";
65
-        	} else {
66
-        		$query = "DELETE FROM config WHERE name = 'last_update_stats_".$filter_name."'";
67
-        	}
68
-                 try {
69
-                        $sth = $this->db->prepare($query);
70
-                        $sth->execute();
71
-                } catch(PDOException $e) {
72
-                        return "error : ".$e->getMessage();
73
-                }
54
+			$query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;";
55
+				 try {
56
+						$sth = $this->db->prepare($query);
57
+						$sth->execute(array(':filter_name' => $filter_name));
58
+				} catch(PDOException $e) {
59
+						return "error : ".$e->getMessage();
60
+				}
61
+		}
62
+		public function deleteOldStats($filter_name = '') {
63
+			if ($filter_name == '') {
64
+				$query = "DELETE FROM config WHERE name = 'last_update_stats'";
65
+			} else {
66
+				$query = "DELETE FROM config WHERE name = 'last_update_stats_".$filter_name."'";
67
+			}
68
+				 try {
69
+						$sth = $this->db->prepare($query);
70
+						$sth->execute();
71
+				} catch(PDOException $e) {
72
+						return "error : ".$e->getMessage();
73
+				}
74 74
                 
75
-        	$query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;";
76
-                 try {
77
-                        $sth = $this->db->prepare($query);
78
-                        $sth->execute(array(':filter_name' => $filter_name));
79
-                } catch(PDOException $e) {
80
-                        return "error : ".$e->getMessage();
81
-                }
82
-        }
75
+			$query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;";
76
+				 try {
77
+						$sth = $this->db->prepare($query);
78
+						$sth->execute(array(':filter_name' => $filter_name));
79
+				} catch(PDOException $e) {
80
+						return "error : ".$e->getMessage();
81
+				}
82
+		}
83 83
 	public function getAllAirlineNames($filter_name = '') {
84 84
 		if ($filter_name == '') $filter_name = $this->filter_name;
85
-                $query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC";
86
-                 try {
87
-                        $sth = $this->db->prepare($query);
88
-                        $sth->execute(array(':filter_name' => $filter_name));
89
-                } catch(PDOException $e) {
90
-                        echo "error : ".$e->getMessage();
91
-                }
92
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
93
-                return $all;
94
-        }
85
+				$query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC";
86
+				 try {
87
+						$sth = $this->db->prepare($query);
88
+						$sth->execute(array(':filter_name' => $filter_name));
89
+				} catch(PDOException $e) {
90
+						echo "error : ".$e->getMessage();
91
+				}
92
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
93
+				return $all;
94
+		}
95 95
 	public function getAllAircraftTypes($stats_airline = '',$filter_name = '') {
96 96
 		if ($filter_name == '') $filter_name = $this->filter_name;
97
-                $query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC";
98
-                 try {
99
-                        $sth = $this->db->prepare($query);
100
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
101
-                } catch(PDOException $e) {
102
-                        echo "error : ".$e->getMessage();
103
-                }
104
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
105
-                return $all;
106
-        }
97
+				$query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC";
98
+				 try {
99
+						$sth = $this->db->prepare($query);
100
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
101
+				} catch(PDOException $e) {
102
+						echo "error : ".$e->getMessage();
103
+				}
104
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
105
+				return $all;
106
+		}
107 107
 	public function getAllManufacturers($stats_airline = '',$filter_name = '') {
108 108
 		if ($filter_name == '') $filter_name = $this->filter_name;
109
-                $query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC";
110
-                 try {
111
-                        $sth = $this->db->prepare($query);
112
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
113
-                } catch(PDOException $e) {
114
-                        echo "error : ".$e->getMessage();
115
-                }
116
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
117
-                return $all;
118
-        }
109
+				$query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC";
110
+				 try {
111
+						$sth = $this->db->prepare($query);
112
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
113
+				} catch(PDOException $e) {
114
+						echo "error : ".$e->getMessage();
115
+				}
116
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
117
+				return $all;
118
+		}
119 119
 	public function getAllAirportNames($stats_airline = '',$filter_name = '') {
120 120
 		if ($filter_name == '') $filter_name = $this->filter_name;
121
-                $query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC";
122
-                 try {
123
-                        $sth = $this->db->prepare($query);
124
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
125
-                } catch(PDOException $e) {
126
-                        echo "error : ".$e->getMessage();
127
-                }
128
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
129
-                return $all;
130
-        }
121
+				$query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC";
122
+				 try {
123
+						$sth = $this->db->prepare($query);
124
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
125
+				} catch(PDOException $e) {
126
+						echo "error : ".$e->getMessage();
127
+				}
128
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
129
+				return $all;
130
+		}
131 131
 
132 132
 	public function getAllOwnerNames($stats_airline = '',$filter_name = '') {
133 133
 		if ($filter_name == '') $filter_name = $this->filter_name;
134
-                $query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC";
135
-                 try {
136
-                        $sth = $this->db->prepare($query);
137
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
138
-                } catch(PDOException $e) {
139
-                        echo "error : ".$e->getMessage();
140
-                }
141
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
142
-                return $all;
143
-        }
134
+				$query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC";
135
+				 try {
136
+						$sth = $this->db->prepare($query);
137
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
138
+				} catch(PDOException $e) {
139
+						echo "error : ".$e->getMessage();
140
+				}
141
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
142
+				return $all;
143
+		}
144 144
 
145 145
 	public function getAllPilotNames($stats_airline = '',$filter_name = '') {
146 146
 		if ($filter_name == '') $filter_name = $this->filter_name;
147
-                $query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC";
148
-                 try {
149
-                        $sth = $this->db->prepare($query);
150
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
151
-                } catch(PDOException $e) {
152
-                        echo "error : ".$e->getMessage();
153
-                }
154
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
155
-                return $all;
156
-        }
147
+				$query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC";
148
+				 try {
149
+						$sth = $this->db->prepare($query);
150
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
151
+				} catch(PDOException $e) {
152
+						echo "error : ".$e->getMessage();
153
+				}
154
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
155
+				return $all;
156
+		}
157 157
 
158 158
 
159 159
 	public function countAllAircraftTypes($limit = true, $stats_airline = '', $filter_name = '',$year = '', $month = '') {
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 			}
171 171
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
172 172
 		} else $all = array();
173
-                if (empty($all)) {
174
-            	    $filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
175
-            	    if ($filter_name != '') {
176
-            		    $filters = array_merge($filters,$globalStatsFilters[$filter_name]);
177
-            	    }
178
-            	    $Spotter = new Spotter($this->db);
179
-            	    //$all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month);
180
-            	    $all = $Spotter->countAllAircraftTypes($limit,0,'',$filters);
181
-                }
182
-                return $all;
173
+				if (empty($all)) {
174
+					$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
175
+					if ($filter_name != '') {
176
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
177
+					}
178
+					$Spotter = new Spotter($this->db);
179
+					//$all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month);
180
+					$all = $Spotter->countAllAircraftTypes($limit,0,'',$filters);
181
+				}
182
+				return $all;
183 183
 	}
184 184
 	public function countAllAirlineCountries($limit = true,$filter_name = '',$year = '',$month = '') {
185 185
 		global $globalStatsFilters;
@@ -195,17 +195,17 @@  discard block
 block discarded – undo
195 195
 			}
196 196
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
197 197
 		} else $all = array();
198
-                if (empty($all)) {
199
-            		$Spotter = new Spotter($this->db);
200
-            		$filters = array();
201
-            		$filters = array('year' => $year,'month' => $month);
202
-            		if ($filter_name != '') {
203
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
204
-			}
205
-            		//$all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month);
206
-            		$all = $Spotter->countAllAirlineCountries($limit,$filters);
207
-                }
208
-                return $all;
198
+				if (empty($all)) {
199
+					$Spotter = new Spotter($this->db);
200
+					$filters = array();
201
+					$filters = array('year' => $year,'month' => $month);
202
+					if ($filter_name != '') {
203
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
204
+			}
205
+					//$all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month);
206
+					$all = $Spotter->countAllAirlineCountries($limit,$filters);
207
+				}
208
+				return $all;
209 209
 	}
210 210
 	public function countAllAircraftManufacturers($limit = true,$stats_airline = '', $filter_name = '',$year = '', $month = '') {
211 211
 		global $globalStatsFilters;
@@ -247,39 +247,39 @@  discard block
 block discarded – undo
247 247
 			}
248 248
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
249 249
 		} else $all = array();
250
-                if (empty($all)) {
250
+				if (empty($all)) {
251 251
 			$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
252 252
 			if ($filter_name != '') {
253
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
253
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
254 254
 			}
255 255
 			$Spotter = new Spotter($this->db);
256 256
 			//$all = $Spotter->countAllArrivalCountries($limit,$filters,$year,$month);
257 257
 			$all = $Spotter->countAllArrivalCountries($limit,$filters);
258
-                }
259
-                return $all;
258
+				}
259
+				return $all;
260 260
 	}
261 261
 	public function countAllDepartureCountries($limit = true, $stats_airline = '', $filter_name = '', $year = '', $month = '') {
262 262
 		global $globalStatsFilters;
263 263
 		if ($filter_name == '') $filter_name = $this->filter_name;
264 264
 		if ($limit) $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count, countries.iso3 as airport_departure_country_iso3 FROM stats_airport, countries WHERE countries.name = stats_airport.airport_country AND stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country, countries.iso3 ORDER BY airport_departure_country_count DESC LIMIT 10 OFFSET 0";
265 265
 		else $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count, countries.iso3 as airport_departure_country_iso3 FROM stats_airport, countries WHERE countries.iso3 = stats_airport.airport_country AND stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country, countries.iso3 ORDER BY airport_departure_country_count DESC";
266
-                 try {
267
-                        $sth = $this->db->prepare($query);
268
-                        $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
269
-                } catch(PDOException $e) {
270
-                        echo "error : ".$e->getMessage();
271
-                }
272
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
273
-                if (empty($all)) {
266
+				 try {
267
+						$sth = $this->db->prepare($query);
268
+						$sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name));
269
+				} catch(PDOException $e) {
270
+						echo "error : ".$e->getMessage();
271
+				}
272
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
273
+				if (empty($all)) {
274 274
 			$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
275 275
 			if ($filter_name != '') {
276
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
276
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
277 277
 			}
278 278
 			$Spotter = new Spotter($this->db);
279 279
 			//$all = $Spotter->countAllDepartureCountries($filters,$year,$month);
280 280
 			$all = $Spotter->countAllDepartureCountries($filters);
281
-                }
282
-                return $all;
281
+				}
282
+				return $all;
283 283
 	}
284 284
 
285 285
 	public function countAllAirlines($limit = true,$filter_name = '',$year = '',$month = '') {
@@ -305,17 +305,17 @@  discard block
 block discarded – undo
305 305
 			}
306 306
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
307 307
 		} else $all = array();
308
-                if (empty($all)) {
309
-	                $Spotter = new Spotter($this->db);
310
-            		$filters = array();
308
+				if (empty($all)) {
309
+					$Spotter = new Spotter($this->db);
310
+					$filters = array();
311 311
 			$filters = array('year' => $year,'month' => $month);
312
-            		if ($filter_name != '') {
313
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
312
+					if ($filter_name != '') {
313
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
314 314
 			}
315 315
 			//$all = $Spotter->countAllAirlines($limit,0,'',$filters,$year,$month);
316
-    		        $all = $Spotter->countAllAirlines($limit,0,'',$filters);
317
-                }
318
-                return $all;
316
+					$all = $Spotter->countAllAirlines($limit,0,'',$filters);
317
+				}
318
+				return $all;
319 319
 	}
320 320
 	public function countAllAircraftRegistrations($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') {
321 321
 		global $globalStatsFilters;
@@ -331,16 +331,16 @@  discard block
 block discarded – undo
331 331
 			}
332 332
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
333 333
 		} else $all = array();
334
-                if (empty($all)) {
334
+				if (empty($all)) {
335 335
 			$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
336 336
 			if ($filter_name != '') {
337 337
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
338 338
 			}
339
-	                $Spotter = new Spotter($this->db);
340
-    		        //$all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month);
341
-    		        $all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters);
342
-                }
343
-                return $all;
339
+					$Spotter = new Spotter($this->db);
340
+					//$all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month);
341
+					$all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters);
342
+				}
343
+				return $all;
344 344
 	}
345 345
 	public function countAllCallsigns($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') {
346 346
 		global $globalStatsFilters;
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 					echo "error : ".$e->getMessage();
382 382
 				}
383 383
 				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
384
-                /*
384
+				/*
385 385
                 if (empty($all)) {
386 386
 	                $Spotter = new Spotter($this->db);
387 387
     		        $all = $Spotter->countAllFlightOverCountries($limit);
@@ -433,16 +433,16 @@  discard block
 block discarded – undo
433 433
 			}
434 434
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
435 435
 		} else $all = array();
436
-                if (empty($all)) {
436
+				if (empty($all)) {
437 437
 			$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
438 438
 			if ($filter_name != '') {
439 439
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
440 440
 			}
441
-            		$Spotter = new Spotter($this->db);
442
-            		//$all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month);
443
-            		$all = $Spotter->countAllOwners($limit,0,'',$filters);
444
-                }
445
-                return $all;
441
+					$Spotter = new Spotter($this->db);
442
+					//$all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month);
443
+					$all = $Spotter->countAllOwners($limit,0,'',$filters);
444
+				}
445
+				return $all;
446 446
 	}
447 447
 	public function countAllDepartureAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') {
448 448
 		global $globalStatsFilters;
@@ -458,35 +458,35 @@  discard block
 block discarded – undo
458 458
 			}
459 459
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
460 460
 		} else $all = array();
461
-                if (empty($all)) {
461
+				if (empty($all)) {
462 462
 			$filters = array('airlines' => array($stats_airline),'year' => $year,'month' => $month);
463
-            		if ($filter_name != '') {
464
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
463
+					if ($filter_name != '') {
464
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
465 465
 			}
466
-            		$Spotter = new Spotter($this->db);
466
+					$Spotter = new Spotter($this->db);
467 467
 //            		$pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters,$year,$month);
468 468
   //      		$dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters,$year,$month);
469
-            		$pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters);
470
-        		$dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters);
471
-        		$all = array();
472
-        		foreach ($pall as $value) {
473
-        			$icao = $value['airport_departure_icao'];
474
-        			$all[$icao] = $value;
475
-        		}
469
+					$pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters);
470
+				$dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters);
471
+				$all = array();
472
+				foreach ($pall as $value) {
473
+					$icao = $value['airport_departure_icao'];
474
+					$all[$icao] = $value;
475
+				}
476 476
         		
477
-        		foreach ($dall as $value) {
478
-        			$icao = $value['airport_departure_icao'];
479
-        			if (isset($all[$icao])) {
480
-        				$all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
481
-        			} else $all[$icao] = $value;
482
-        		}
483
-        		$count = array();
484
-        		foreach ($all as $key => $row) {
485
-        			$count[$key] = $row['airport_departure_icao_count'];
486
-        		}
487
-        		array_multisort($count,SORT_DESC,$all);
488
-                }
489
-                return $all;
477
+				foreach ($dall as $value) {
478
+					$icao = $value['airport_departure_icao'];
479
+					if (isset($all[$icao])) {
480
+						$all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
481
+					} else $all[$icao] = $value;
482
+				}
483
+				$count = array();
484
+				foreach ($all as $key => $row) {
485
+					$count[$key] = $row['airport_departure_icao_count'];
486
+				}
487
+				array_multisort($count,SORT_DESC,$all);
488
+				}
489
+				return $all;
490 490
 	}
491 491
 	public function countAllArrivalAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') {
492 492
 		global $globalStatsFilters;
@@ -512,26 +512,26 @@  discard block
 block discarded – undo
512 512
 //			$dall = $Spotter->countAllDetectedArrivalAirports($limit,0,'',false,$filters,$year,$month);
513 513
 			$pall = $Spotter->countAllArrivalAirports($limit,0,'',false,$filters);
514 514
 			$dall = $Spotter->countAllDetectedArrivalAirports($limit,0,'',false,$filters);
515
-        		$all = array();
516
-        		foreach ($pall as $value) {
517
-        			$icao = $value['airport_arrival_icao'];
518
-        			$all[$icao] = $value;
519
-        		}
515
+				$all = array();
516
+				foreach ($pall as $value) {
517
+					$icao = $value['airport_arrival_icao'];
518
+					$all[$icao] = $value;
519
+				}
520 520
         		
521
-        		foreach ($dall as $value) {
522
-        			$icao = $value['airport_arrival_icao'];
523
-        			if (isset($all[$icao])) {
524
-        				$all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
525
-        			} else $all[$icao] = $value;
526
-        		}
527
-        		$count = array();
528
-        		foreach ($all as $key => $row) {
529
-        			$count[$key] = $row['airport_arrival_icao_count'];
530
-        		}
531
-        		array_multisort($count,SORT_DESC,$all);
532
-                }
521
+				foreach ($dall as $value) {
522
+					$icao = $value['airport_arrival_icao'];
523
+					if (isset($all[$icao])) {
524
+						$all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
525
+					} else $all[$icao] = $value;
526
+				}
527
+				$count = array();
528
+				foreach ($all as $key => $row) {
529
+					$count[$key] = $row['airport_arrival_icao_count'];
530
+				}
531
+				array_multisort($count,SORT_DESC,$all);
532
+				}
533 533
  
534
-                return $all;
534
+				return $all;
535 535
 	}
536 536
 	public function countAllMonthsLastYear($limit = true,$stats_airline = '',$filter_name = '') {
537 537
 		global $globalDBdriver, $globalStatsFilters;
@@ -544,23 +544,23 @@  discard block
 block discarded – undo
544 544
 			else $query = "SELECT EXTRACT(MONTH FROM stats_date) as month_name, EXTRACT(YEAR FROM stats_date) as year_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name";
545 545
 		}
546 546
 		$query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name);
547
-                 try {
548
-                        $sth = $this->db->prepare($query);
549
-                        $sth->execute($query_data);
550
-                } catch(PDOException $e) {
551
-                        echo "error : ".$e->getMessage();
552
-                }
553
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
554
-                if (empty($all)) {
547
+				 try {
548
+						$sth = $this->db->prepare($query);
549
+						$sth->execute($query_data);
550
+				} catch(PDOException $e) {
551
+						echo "error : ".$e->getMessage();
552
+				}
553
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
554
+				if (empty($all)) {
555 555
 			$filters = array('airlines' => array($stats_airline));
556 556
 			if ($filter_name != '') {
557 557
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
558 558
 			}
559
-            		$Spotter = new Spotter($this->db);
560
-            		$all = $Spotter->countAllMonthsLastYear($filters);
561
-                }
559
+					$Spotter = new Spotter($this->db);
560
+					$all = $Spotter->countAllMonthsLastYear($filters);
561
+				}
562 562
                 
563
-                return $all;
563
+				return $all;
564 564
 	}
565 565
 	
566 566
 	public function countAllDatesLastMonth($stats_airline = '',$filter_name = '') {
@@ -568,22 +568,22 @@  discard block
 block discarded – undo
568 568
 		if ($filter_name == '') $filter_name = $this->filter_name;
569 569
 		$query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND stats_airline = :stats_airline AND filter_name = :filter_name";
570 570
 		$query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name);
571
-                 try {
572
-                        $sth = $this->db->prepare($query);
573
-                        $sth->execute($query_data);
574
-                } catch(PDOException $e) {
575
-                        echo "error : ".$e->getMessage();
576
-                }
577
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
578
-                if (empty($all)) {
571
+				 try {
572
+						$sth = $this->db->prepare($query);
573
+						$sth->execute($query_data);
574
+				} catch(PDOException $e) {
575
+						echo "error : ".$e->getMessage();
576
+				}
577
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
578
+				if (empty($all)) {
579 579
 			$filters = array('airlines' => array($stats_airline));
580 580
 			if ($filter_name != '') {
581 581
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
582 582
 			}
583
-            		$Spotter = new Spotter($this->db);
584
-            		$all = $Spotter->countAllDatesLastMonth($filters);
585
-                }
586
-                return $all;
583
+					$Spotter = new Spotter($this->db);
584
+					$all = $Spotter->countAllDatesLastMonth($filters);
585
+				}
586
+				return $all;
587 587
 	}
588 588
 	public function countAllDatesLast7Days($stats_airline = '',$filter_name = '') {
589 589
 		global $globalDBdriver, $globalStatsFilters;
@@ -594,66 +594,66 @@  discard block
 block discarded – undo
594 594
 			$query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND flight_date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '7 DAYS' AND stats_airline = :stats_airline AND filter_name = :filter_name";
595 595
 		}
596 596
 		$query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name);
597
-                 try {
598
-                        $sth = $this->db->prepare($query);
599
-                        $sth->execute($query_data);
600
-                } catch(PDOException $e) {
601
-                        echo "error : ".$e->getMessage();
602
-                }
603
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
604
-                if (empty($all)) {
597
+				 try {
598
+						$sth = $this->db->prepare($query);
599
+						$sth->execute($query_data);
600
+				} catch(PDOException $e) {
601
+						echo "error : ".$e->getMessage();
602
+				}
603
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
604
+				if (empty($all)) {
605 605
 			$filters = array('airlines' => array($stats_airline));
606 606
 			if ($filter_name != '') {
607 607
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
608 608
 			}
609
-            		$Spotter = new Spotter($this->db);
610
-            		$all = $Spotter->countAllDatesLast7Days($filters);
611
-                }
612
-                return $all;
609
+					$Spotter = new Spotter($this->db);
610
+					$all = $Spotter->countAllDatesLast7Days($filters);
611
+				}
612
+				return $all;
613 613
 	}
614 614
 	public function countAllDates($stats_airline = '',$filter_name = '') {
615 615
 		global $globalStatsFilters;
616 616
 		if ($filter_name == '') $filter_name = $this->filter_name;
617 617
 		$query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND stats_airline = :stats_airline AND filter_name = :filter_name";
618 618
 		$query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name);
619
-                 try {
620
-                        $sth = $this->db->prepare($query);
621
-                        $sth->execute($query_data);
622
-                } catch(PDOException $e) {
623
-                        echo "error : ".$e->getMessage();
624
-                }
625
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
626
-                if (empty($all)) {
619
+				 try {
620
+						$sth = $this->db->prepare($query);
621
+						$sth->execute($query_data);
622
+				} catch(PDOException $e) {
623
+						echo "error : ".$e->getMessage();
624
+				}
625
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
626
+				if (empty($all)) {
627 627
 			$filters = array('airlines' => array($stats_airline));
628 628
 			if ($filter_name != '') {
629
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
629
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
630 630
 			}
631
-            		$Spotter = new Spotter($this->db);
632
-            		$all = $Spotter->countAllDates($filters);
633
-                }
634
-                return $all;
631
+					$Spotter = new Spotter($this->db);
632
+					$all = $Spotter->countAllDates($filters);
633
+				}
634
+				return $all;
635 635
 	}
636 636
 	public function countAllDatesByAirlines($filter_name = '') {
637 637
 		global $globalStatsFilters;
638 638
 		if ($filter_name == '') $filter_name = $this->filter_name;
639 639
 		$query = "SELECT stats_airline as airline_icao, flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND filter_name = :filter_name";
640 640
 		$query_data = array('filter_name' => $filter_name);
641
-                 try {
642
-                        $sth = $this->db->prepare($query);
643
-                        $sth->execute($query_data);
644
-                } catch(PDOException $e) {
645
-                        echo "error : ".$e->getMessage();
646
-                }
647
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
648
-                if (empty($all)) {
649
-            		$filters = array();
650
-            		if ($filter_name != '') {
651
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
641
+				 try {
642
+						$sth = $this->db->prepare($query);
643
+						$sth->execute($query_data);
644
+				} catch(PDOException $e) {
645
+						echo "error : ".$e->getMessage();
646
+				}
647
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
648
+				if (empty($all)) {
649
+					$filters = array();
650
+					if ($filter_name != '') {
651
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
652 652
 			}
653
-            		$Spotter = new Spotter($this->db);
654
-            		$all = $Spotter->countAllDatesByAirlines($filters);
655
-                }
656
-                return $all;
653
+					$Spotter = new Spotter($this->db);
654
+					$all = $Spotter->countAllDatesByAirlines($filters);
655
+				}
656
+				return $all;
657 657
 	}
658 658
 	public function countAllMonths($stats_airline = '',$filter_name = '') {
659 659
 		global $globalStatsFilters, $globalDBdriver;
@@ -663,24 +663,24 @@  discard block
 block discarded – undo
663 663
 		} else {
664 664
 			$query = "SELECT EXTRACT(YEAR FROM stats_date) AS year_name,EXTRACT(MONTH FROM stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name";
665 665
 		}
666
-                 try {
667
-                        $sth = $this->db->prepare($query);
668
-                        $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
669
-                } catch(PDOException $e) {
670
-                        echo "error : ".$e->getMessage();
671
-                }
672
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
666
+				 try {
667
+						$sth = $this->db->prepare($query);
668
+						$sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
669
+				} catch(PDOException $e) {
670
+						echo "error : ".$e->getMessage();
671
+				}
672
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
673 673
                 
674
-                if (empty($all)) {
674
+				if (empty($all)) {
675 675
 			$filters = array('airlines' => array($stats_airline));
676 676
 			if ($filter_name != '') {
677 677
 				$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
678 678
 			}
679
-            		$Spotter = new Spotter($this->db);
680
-            		$all = $Spotter->countAllMonths($filters);
681
-                }
679
+					$Spotter = new Spotter($this->db);
680
+					$all = $Spotter->countAllMonths($filters);
681
+				}
682 682
                 
683
-                return $all;
683
+				return $all;
684 684
 	}
685 685
 	public function countFatalitiesLast12Months() {
686 686
 		global $globalStatsFilters, $globalDBdriver;
@@ -689,19 +689,19 @@  discard block
 block discarded – undo
689 689
 		} else {
690 690
 			$query = "SELECT EXTRACT(YEAR FROM stats_date) AS year, EXTRACT(MONTH FROM stats_date) as month,cnt as count FROM stats WHERE stats_type = 'fatalities_bymonth' ORDER BY stats_date";
691 691
 		}
692
-                 try {
693
-                        $sth = $this->db->prepare($query);
694
-                        $sth->execute();
695
-                } catch(PDOException $e) {
696
-                        echo "error : ".$e->getMessage();
697
-                }
698
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
692
+				 try {
693
+						$sth = $this->db->prepare($query);
694
+						$sth->execute();
695
+				} catch(PDOException $e) {
696
+						echo "error : ".$e->getMessage();
697
+				}
698
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
699 699
                 
700
-                if (empty($all)) {
701
-            		$Accident = new Accident($this->db);
702
-            		$all = $Accident->countFatalitiesLast12Months();
703
-                }
704
-                return $all;
700
+				if (empty($all)) {
701
+					$Accident = new Accident($this->db);
702
+					$all = $Accident->countFatalitiesLast12Months();
703
+				}
704
+				return $all;
705 705
 	}
706 706
 	public function countFatalitiesByYear() {
707 707
 		global $globalStatsFilters, $globalDBdriver;
@@ -710,40 +710,40 @@  discard block
 block discarded – undo
710 710
 		} else {
711 711
 			$query = "SELECT EXTRACT(YEAR FROM stats_date) AS year, cnt as count FROM stats WHERE stats_type = 'fatalities_byyear' ORDER BY stats_date";
712 712
 		}
713
-                 try {
714
-                        $sth = $this->db->prepare($query);
715
-                        $sth->execute();
716
-                } catch(PDOException $e) {
717
-                        echo "error : ".$e->getMessage();
718
-                }
719
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
713
+				 try {
714
+						$sth = $this->db->prepare($query);
715
+						$sth->execute();
716
+				} catch(PDOException $e) {
717
+						echo "error : ".$e->getMessage();
718
+				}
719
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
720 720
                 
721
-                if (empty($all)) {
722
-            		$Accident = new Accident($this->db);
723
-            		$all = $Accident->countFatalitiesByYear();
724
-                }
725
-                return $all;
721
+				if (empty($all)) {
722
+					$Accident = new Accident($this->db);
723
+					$all = $Accident->countFatalitiesByYear();
724
+				}
725
+				return $all;
726 726
 	}
727 727
 	public function countAllMilitaryMonths($filter_name = '') {
728 728
 		global $globalStatsFilters;
729 729
 		if ($filter_name == '') $filter_name = $this->filter_name;
730
-	    	$query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name";
731
-                 try {
732
-                        $sth = $this->db->prepare($query);
733
-                        $sth->execute(array(':filter_name' => $filter_name));
734
-                } catch(PDOException $e) {
735
-                        echo "error : ".$e->getMessage();
736
-                }
737
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
738
-                if (empty($all)) {
739
-            		$filters = array();
740
-            		if ($filter_name != '') {
741
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
730
+			$query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name";
731
+				 try {
732
+						$sth = $this->db->prepare($query);
733
+						$sth->execute(array(':filter_name' => $filter_name));
734
+				} catch(PDOException $e) {
735
+						echo "error : ".$e->getMessage();
736
+				}
737
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
738
+				if (empty($all)) {
739
+					$filters = array();
740
+					if ($filter_name != '') {
741
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
742 742
 			}
743
-            		$Spotter = new Spotter($this->db);
744
-            		$all = $Spotter->countAllMilitaryMonths($filters);
745
-                }
746
-                return $all;
743
+					$Spotter = new Spotter($this->db);
744
+					$all = $Spotter->countAllMilitaryMonths($filters);
745
+				}
746
+				return $all;
747 747
 	}
748 748
 	public function countAllHours($orderby = 'hour',$limit = true,$stats_airline = '',$filter_name = '') {
749 749
 		global $globalTimezone, $globalDBdriver, $globalStatsFilters;
@@ -759,22 +759,22 @@  discard block
 block discarded – undo
759 759
 			}
760 760
 		}
761 761
 		if ($orderby == 'count') $query .= " ORDER BY hour_count DESC";
762
-                 try {
763
-                        $sth = $this->db->prepare($query);
764
-                        $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
765
-                } catch(PDOException $e) {
766
-                        echo "error : ".$e->getMessage();
767
-                }
768
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
769
-                if (empty($all)) {
762
+				 try {
763
+						$sth = $this->db->prepare($query);
764
+						$sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
765
+				} catch(PDOException $e) {
766
+						echo "error : ".$e->getMessage();
767
+				}
768
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
769
+				if (empty($all)) {
770 770
 			$filters = array('airlines' => array($stats_airline));
771 771
 			if ($filter_name != '') {
772
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
772
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
773 773
 			}
774
-            		$Spotter = new Spotter($this->db);
775
-            		$all = $Spotter->countAllHours($orderby,$filters);
776
-                }
777
-                return $all;
774
+					$Spotter = new Spotter($this->db);
775
+					$all = $Spotter->countAllHours($orderby,$filters);
776
+				}
777
+				return $all;
778 778
 	}
779 779
 	
780 780
 	public function countOverallFlights($stats_airline = '', $filter_name = '',$year = '',$month = '') {
@@ -799,10 +799,10 @@  discard block
 block discarded – undo
799 799
 		if ($year == '') $year = date('Y');
800 800
 		$all = $this->getSumStats('military_flights_bymonth',$year,'',$filter_name,$month);
801 801
 		if (empty($all)) {
802
-		        $filters = array();
802
+				$filters = array();
803 803
 			$filters = array('year' => $year,'month' => $month);
804
-            		if ($filter_name != '') {
805
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
804
+					if ($filter_name != '') {
805
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
806 806
 			}
807 807
 			$Spotter = new Spotter($this->db);
808 808
 			//$all = $Spotter->countOverallMilitaryFlights($filters,$year,$month);
@@ -866,10 +866,10 @@  discard block
 block discarded – undo
866 866
 			$all = $result[0]['nb_airline'];
867 867
 		} else $all = $this->getSumStats('airlines_bymonth',$year,'',$filter_name,$month);
868 868
 		if (empty($all)) {
869
-            		$filters = array();
869
+					$filters = array();
870 870
 			$filters = array('year' => $year,'month' => $month);
871
-            		if ($filter_name != '') {
872
-            			$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
871
+					if ($filter_name != '') {
872
+						$filters = array_merge($filters,$globalStatsFilters[$filter_name]);
873 873
 			}
874 874
 			$Spotter = new Spotter($this->db);
875 875
 			//$all = $Spotter->countOverallAirlines($filters,$year,$month);
@@ -939,44 +939,44 @@  discard block
 block discarded – undo
939 939
 		if ($filter_name == '') $filter_name = $this->filter_name;
940 940
 		$query = "SELECT * FROM stats_airport WHERE stats_type = 'daily' AND airport_icao = :airport_icao AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY date";
941 941
 		$query_values = array(':airport_icao' => $airport_icao,':stats_airline' => $stats_airline, ':filter_name' => $filter_name);
942
-                 try {
943
-                        $sth = $this->db->prepare($query);
944
-                        $sth->execute($query_values);
945
-                } catch(PDOException $e) {
946
-                        echo "error : ".$e->getMessage();
947
-                }
948
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
949
-                return $all;
942
+				 try {
943
+						$sth = $this->db->prepare($query);
944
+						$sth->execute($query_values);
945
+				} catch(PDOException $e) {
946
+						echo "error : ".$e->getMessage();
947
+				}
948
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
949
+				return $all;
950 950
 	}
951 951
 	public function getStats($type,$stats_airline = '', $filter_name = '') {
952 952
 		if ($filter_name == '') $filter_name = $this->filter_name;
953
-                $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date";
954
-                $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
955
-                 try {
956
-                        $sth = $this->db->prepare($query);
957
-                        $sth->execute($query_values);
958
-                } catch(PDOException $e) {
959
-                        echo "error : ".$e->getMessage();
960
-                }
961
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
962
-                return $all;
963
-        }
953
+				$query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date";
954
+				$query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
955
+				 try {
956
+						$sth = $this->db->prepare($query);
957
+						$sth->execute($query_values);
958
+				} catch(PDOException $e) {
959
+						echo "error : ".$e->getMessage();
960
+				}
961
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
962
+				return $all;
963
+		}
964 964
 	public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') {
965 965
 		if ($filter_name == '') $filter_name = $this->filter_name;
966
-                $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name";
967
-                $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
968
-                 try {
969
-                        $sth = $this->db->prepare($query);
970
-                        $sth->execute($query_values);
971
-                } catch(PDOException $e) {
972
-                        echo "error : ".$e->getMessage();
973
-                }
974
-        }
966
+				$query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name";
967
+				$query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
968
+				 try {
969
+						$sth = $this->db->prepare($query);
970
+						$sth->execute($query_values);
971
+				} catch(PDOException $e) {
972
+						echo "error : ".$e->getMessage();
973
+				}
974
+		}
975 975
 	public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') {
976 976
 		if ($filter_name == '') $filter_name = $this->filter_name;
977
-    		global $globalArchiveMonths, $globalDBdriver;
978
-    		if ($globalDBdriver == 'mysql') {
979
-    			if ($month == '') {
977
+			global $globalArchiveMonths, $globalDBdriver;
978
+			if ($globalDBdriver == 'mysql') {
979
+				if ($month == '') {
980 980
 				$query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND YEAR(stats_date) = :year AND stats_airline = :stats_airline AND filter_name = :filter_name";
981 981
 				$query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
982 982
 			} else {
@@ -991,165 +991,165 @@  discard block
 block discarded – undo
991 991
 				$query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND EXTRACT(YEAR FROM stats_date) = :year AND EXTRACT(MONTH FROM stats_date) = :month AND stats_airline = :stats_airline AND filter_name = :filter_name";
992 992
 				$query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name,':month' => $month);
993 993
 			}
994
-                }
995
-                 try {
996
-                        $sth = $this->db->prepare($query);
997
-                        $sth->execute($query_values);
998
-                } catch(PDOException $e) {
999
-                        echo "error : ".$e->getMessage();
1000
-                }
1001
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1002
-                return $all[0]['total'];
1003
-        }
994
+				}
995
+				 try {
996
+						$sth = $this->db->prepare($query);
997
+						$sth->execute($query_values);
998
+				} catch(PDOException $e) {
999
+						echo "error : ".$e->getMessage();
1000
+				}
1001
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1002
+				return $all[0]['total'];
1003
+		}
1004 1004
 	public function getStatsTotal($type, $stats_airline = '', $filter_name = '') {
1005
-    		global $globalArchiveMonths, $globalDBdriver;
1005
+			global $globalArchiveMonths, $globalDBdriver;
1006 1006
 		if ($filter_name == '') $filter_name = $this->filter_name;
1007
-    		if ($globalDBdriver == 'mysql') {
1007
+			if ($globalDBdriver == 'mysql') {
1008 1008
 			$query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL ".$globalArchiveMonths." MONTH) AND stats_airline = :stats_airline AND filter_name = :filter_name";
1009 1009
 		} else {
1010 1010
 			$query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalArchiveMonths." MONTHS' AND stats_airline = :stats_airline AND filter_name = :filter_name";
1011
-                }
1012
-                $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name);
1013
-                 try {
1014
-                        $sth = $this->db->prepare($query);
1015
-                        $sth->execute($query_values);
1016
-                } catch(PDOException $e) {
1017
-                        echo "error : ".$e->getMessage();
1018
-                }
1019
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1020
-                return $all[0]['total'];
1021
-        }
1011
+				}
1012
+				$query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name);
1013
+				 try {
1014
+						$sth = $this->db->prepare($query);
1015
+						$sth->execute($query_values);
1016
+				} catch(PDOException $e) {
1017
+						echo "error : ".$e->getMessage();
1018
+				}
1019
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1020
+				return $all[0]['total'];
1021
+		}
1022 1022
 	public function getStatsAircraftTotal($stats_airline = '', $filter_name = '') {
1023
-    		global $globalArchiveMonths, $globalDBdriver;
1023
+			global $globalArchiveMonths, $globalDBdriver;
1024 1024
 		if ($filter_name == '') $filter_name = $this->filter_name;
1025
-    		if ($globalDBdriver == 'mysql') {
1025
+			if ($globalDBdriver == 'mysql') {
1026 1026
 			$query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name";
1027
-                } else {
1027
+				} else {
1028 1028
 			$query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name";
1029
-                }
1030
-                 try {
1031
-                        $sth = $this->db->prepare($query);
1032
-                        $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
1033
-                } catch(PDOException $e) {
1034
-                        echo "error : ".$e->getMessage();
1035
-                }
1036
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1037
-                return $all[0]['total'];
1038
-        }
1029
+				}
1030
+				 try {
1031
+						$sth = $this->db->prepare($query);
1032
+						$sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name));
1033
+				} catch(PDOException $e) {
1034
+						echo "error : ".$e->getMessage();
1035
+				}
1036
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1037
+				return $all[0]['total'];
1038
+		}
1039 1039
 	public function getStatsAirlineTotal($filter_name = '') {
1040
-    		global $globalArchiveMonths, $globalDBdriver;
1040
+			global $globalArchiveMonths, $globalDBdriver;
1041 1041
 		if ($filter_name == '') $filter_name = $this->filter_name;
1042
-    		if ($globalDBdriver == 'mysql') {
1042
+			if ($globalDBdriver == 'mysql') {
1043 1043
 			$query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name";
1044
-                } else {
1044
+				} else {
1045 1045
 			$query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name";
1046
-                }
1047
-                 try {
1048
-                        $sth = $this->db->prepare($query);
1049
-                        $sth->execute(array(':filter_name' => $filter_name));
1050
-                } catch(PDOException $e) {
1051
-                        echo "error : ".$e->getMessage();
1052
-                }
1053
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1054
-                return $all[0]['total'];
1055
-        }
1046
+				}
1047
+				 try {
1048
+						$sth = $this->db->prepare($query);
1049
+						$sth->execute(array(':filter_name' => $filter_name));
1050
+				} catch(PDOException $e) {
1051
+						echo "error : ".$e->getMessage();
1052
+				}
1053
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1054
+				return $all[0]['total'];
1055
+		}
1056 1056
 	public function getStatsOwnerTotal($filter_name = '') {
1057
-    		global $globalArchiveMonths, $globalDBdriver;
1057
+			global $globalArchiveMonths, $globalDBdriver;
1058 1058
 		if ($filter_name == '') $filter_name = $this->filter_name;
1059
-    		if ($globalDBdriver == 'mysql') {
1059
+			if ($globalDBdriver == 'mysql') {
1060 1060
 			$query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name";
1061 1061
 		} else {
1062 1062
 			$query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name";
1063
-                }
1064
-                 try {
1065
-                        $sth = $this->db->prepare($query);
1066
-                        $sth->execute(array(':filter_name' => $filter_name));
1067
-                } catch(PDOException $e) {
1068
-                        echo "error : ".$e->getMessage();
1069
-                }
1070
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1071
-                return $all[0]['total'];
1072
-        }
1063
+				}
1064
+				 try {
1065
+						$sth = $this->db->prepare($query);
1066
+						$sth->execute(array(':filter_name' => $filter_name));
1067
+				} catch(PDOException $e) {
1068
+						echo "error : ".$e->getMessage();
1069
+				}
1070
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1071
+				return $all[0]['total'];
1072
+		}
1073 1073
 	public function getStatsOwner($owner_name,$filter_name = '') {
1074
-    		global $globalArchiveMonths, $globalDBdriver;
1074
+			global $globalArchiveMonths, $globalDBdriver;
1075 1075
 		if ($filter_name == '') $filter_name = $this->filter_name;
1076 1076
 		$query = "SELECT cnt FROM stats_owner WHERE filter_name = :filter_name AND owner_name = :owner_name";
1077
-                 try {
1078
-                        $sth = $this->db->prepare($query);
1079
-                        $sth->execute(array(':filter_name' => $filter_name,':owner_name' => $owner_name));
1080
-                } catch(PDOException $e) {
1081
-                        echo "error : ".$e->getMessage();
1082
-                }
1083
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1084
-                if (isset($all[0]['cnt'])) return $all[0]['cnt'];
1085
-                else return 0;
1086
-        }
1077
+				 try {
1078
+						$sth = $this->db->prepare($query);
1079
+						$sth->execute(array(':filter_name' => $filter_name,':owner_name' => $owner_name));
1080
+				} catch(PDOException $e) {
1081
+						echo "error : ".$e->getMessage();
1082
+				}
1083
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1084
+				if (isset($all[0]['cnt'])) return $all[0]['cnt'];
1085
+				else return 0;
1086
+		}
1087 1087
 	public function getStatsPilotTotal($filter_name = '') {
1088
-    		global $globalArchiveMonths, $globalDBdriver;
1088
+			global $globalArchiveMonths, $globalDBdriver;
1089 1089
 		if ($filter_name == '') $filter_name = $this->filter_name;
1090
-    		if ($globalDBdriver == 'mysql') {
1091
-            		$query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name";
1092
-            	} else {
1093
-            		$query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name";
1094
-            	}
1095
-                 try {
1096
-                        $sth = $this->db->prepare($query);
1097
-                        $sth->execute(array(':filter_name' => $filter_name));
1098
-                } catch(PDOException $e) {
1099
-                        echo "error : ".$e->getMessage();
1100
-                }
1101
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1102
-                return $all[0]['total'];
1103
-        }
1090
+			if ($globalDBdriver == 'mysql') {
1091
+					$query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name";
1092
+				} else {
1093
+					$query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name";
1094
+				}
1095
+				 try {
1096
+						$sth = $this->db->prepare($query);
1097
+						$sth->execute(array(':filter_name' => $filter_name));
1098
+				} catch(PDOException $e) {
1099
+						echo "error : ".$e->getMessage();
1100
+				}
1101
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1102
+				return $all[0]['total'];
1103
+		}
1104 1104
 	public function getStatsPilot($pilot,$filter_name = '') {
1105
-    		global $globalArchiveMonths, $globalDBdriver;
1105
+			global $globalArchiveMonths, $globalDBdriver;
1106 1106
 		if ($filter_name == '') $filter_name = $this->filter_name;
1107 1107
 		$query = "SELECT cnt FROM stats_pilot WHERE filter_name = :filter_name AND (pilot_name = :pilot OR pilot_id = :pilot)";
1108
-                 try {
1109
-                        $sth = $this->db->prepare($query);
1110
-                        $sth->execute(array(':filter_name' => $filter_name,':pilot' => $pilot));
1111
-                } catch(PDOException $e) {
1112
-                        echo "error : ".$e->getMessage();
1113
-                }
1114
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
1115
-                if (isset($all[0]['cnt'])) return $all[0]['cnt'];
1116
-                else return 0;
1117
-        }
1108
+				 try {
1109
+						$sth = $this->db->prepare($query);
1110
+						$sth->execute(array(':filter_name' => $filter_name,':pilot' => $pilot));
1111
+				} catch(PDOException $e) {
1112
+						echo "error : ".$e->getMessage();
1113
+				}
1114
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1115
+				if (isset($all[0]['cnt'])) return $all[0]['cnt'];
1116
+				else return 0;
1117
+		}
1118 1118
 
1119 1119
 	public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') {
1120 1120
 		global $globalDBdriver;
1121 1121
 		if ($filter_name == '') $filter_name = $this->filter_name;
1122 1122
 		if ($globalDBdriver == 'mysql') {
1123 1123
 			$query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = :cnt";
1124
-                } else {
1124
+				} else {
1125 1125
 			$query = "UPDATE stats SET cnt = :cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE  stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; 
1126 1126
 		}
1127
-                $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1128
-                 try {
1129
-                        $sth = $this->db->prepare($query);
1130
-                        $sth->execute($query_values);
1131
-                } catch(PDOException $e) {
1132
-                        return "error : ".$e->getMessage();
1133
-                }
1134
-        }
1127
+				$query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1128
+				 try {
1129
+						$sth = $this->db->prepare($query);
1130
+						$sth->execute($query_values);
1131
+				} catch(PDOException $e) {
1132
+						return "error : ".$e->getMessage();
1133
+				}
1134
+		}
1135 1135
 	public function updateStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') {
1136 1136
 		global $globalDBdriver;
1137 1137
 		if ($filter_name == '') $filter_name = $this->filter_name;
1138 1138
 		if ($globalDBdriver == 'mysql') {
1139 1139
 			$query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date";
1140 1140
 		} else {
1141
-            		//$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date";
1141
+					//$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date";
1142 1142
 			$query = "UPDATE stats SET cnt = cnt+:cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE  stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; 
1143
-                }
1144
-                $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1145
-                 try {
1146
-                        $sth = $this->db->prepare($query);
1147
-                        $sth->execute($query_values);
1148
-                } catch(PDOException $e) {
1149
-                        return "error : ".$e->getMessage();
1150
-                }
1151
-        }
1152
-        /*
1143
+				}
1144
+				$query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1145
+				 try {
1146
+						$sth = $this->db->prepare($query);
1147
+						$sth->execute($query_values);
1148
+				} catch(PDOException $e) {
1149
+						return "error : ".$e->getMessage();
1150
+				}
1151
+		}
1152
+		/*
1153 1153
 	public function getStatsSource($date,$stats_type = '') {
1154 1154
 		if ($stats_type == '') {
1155 1155
 			$query = "SELECT * FROM stats_source WHERE stats_date = :date ORDER BY source_name";
@@ -1218,25 +1218,25 @@  discard block
 block discarded – undo
1218 1218
 			$query = "INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) VALUES (:data,:source_name,:stats_type,:stats_date) ON DUPLICATE KEY UPDATE source_data = :data";
1219 1219
 		} else {
1220 1220
 			$query = "UPDATE stats_source SET source_data = :data WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type; INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) SELECT :data,:source_name,:stats_type,:stats_date WHERE NOT EXISTS (SELECT 1 FROM stats_source WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type);"; 
1221
-                }
1222
-                $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type);
1223
-                 try {
1224
-                        $sth = $this->db->prepare($query);
1225
-                        $sth->execute($query_values);
1226
-                } catch(PDOException $e) {
1227
-                        return "error : ".$e->getMessage();
1228
-                }
1229
-        }
1230
-	public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') {
1231
-                $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)";
1232
-                $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1233
-                 try {
1234
-                        $sth = $this->db->prepare($query);
1235
-                        $sth->execute($query_values);
1236
-                } catch(PDOException $e) {
1237
-                        return "error : ".$e->getMessage();
1238
-                }
1239
-        }
1221
+				}
1222
+				$query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type);
1223
+				 try {
1224
+						$sth = $this->db->prepare($query);
1225
+						$sth->execute($query_values);
1226
+				} catch(PDOException $e) {
1227
+						return "error : ".$e->getMessage();
1228
+				}
1229
+		}
1230
+	public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') {
1231
+				$query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)";
1232
+				$query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1233
+				 try {
1234
+						$sth = $this->db->prepare($query);
1235
+						$sth->execute($query_values);
1236
+				} catch(PDOException $e) {
1237
+						return "error : ".$e->getMessage();
1238
+				}
1239
+		}
1240 1240
 	public function addStatAircraftRegistration($registration,$cnt,$aircraft_icao = '',$airline_icao = '',$filter_name = '',$reset = false) {
1241 1241
 		global $globalDBdriver;
1242 1242
 		if ($globalDBdriver == 'mysql') {
@@ -1252,14 +1252,14 @@  discard block
 block discarded – undo
1252 1252
 				$query = "UPDATE stats_registration SET cnt = cnt+:cnt WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_registration (aircraft_icao,registration,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:registration,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_registration WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name);"; 
1253 1253
 			}
1254 1254
 		}
1255
-                $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name);
1256
-                 try {
1257
-                        $sth = $this->db->prepare($query);
1258
-                        $sth->execute($query_values);
1259
-                } catch(PDOException $e) {
1260
-                        return "error : ".$e->getMessage();
1261
-                }
1262
-        }
1255
+				$query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name);
1256
+				 try {
1257
+						$sth = $this->db->prepare($query);
1258
+						$sth->execute($query_values);
1259
+				} catch(PDOException $e) {
1260
+						return "error : ".$e->getMessage();
1261
+				}
1262
+		}
1263 1263
 	public function addStatCallsign($callsign_icao,$cnt,$airline_icao = '', $filter_name = '', $reset = false) {
1264 1264
 		global $globalDBdriver;
1265 1265
 		if ($globalDBdriver == 'mysql') {
@@ -1275,14 +1275,14 @@  discard block
 block discarded – undo
1275 1275
 				$query = "UPDATE stats_callsign SET cnt = cnt+:cnt WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name; INSERT INTO stats_callsign (callsign_icao,airline_icao,cnt,filter_name) SELECT :callsign_icao,:airline_icao,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_callsign WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name);"; 
1276 1276
 			}
1277 1277
 		}
1278
-                $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name);
1279
-                 try {
1280
-                        $sth = $this->db->prepare($query);
1281
-                        $sth->execute($query_values);
1282
-                } catch(PDOException $e) {
1283
-                        return "error : ".$e->getMessage();
1284
-                }
1285
-        }
1278
+				$query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name);
1279
+				 try {
1280
+						$sth = $this->db->prepare($query);
1281
+						$sth->execute($query_values);
1282
+				} catch(PDOException $e) {
1283
+						return "error : ".$e->getMessage();
1284
+				}
1285
+		}
1286 1286
 	public function addStatCountry($iso2,$iso3,$name,$cnt,$airline_icao = '',$filter_name = '',$reset = false) {
1287 1287
 		global $globalDBdriver;
1288 1288
 		if ($globalDBdriver == 'mysql') {
@@ -1298,14 +1298,14 @@  discard block
 block discarded – undo
1298 1298
 				$query = "UPDATE stats_country SET cnt = cnt+:cnt WHERE iso2 = :iso2 AND filter_name = :filter_name AND stats_airline = :airline; INSERT INTO stats_country (iso2,iso3,name,cnt,stats_airline,filter_name) SELECT :iso2,:iso3,:name,:cnt,:airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_country WHERE iso2 = :iso2 AND filter_name = :filter_name AND stats_airline = :airline);"; 
1299 1299
 			}
1300 1300
 		}
1301
-                $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name,':airline' => $airline_icao);
1302
-                 try {
1303
-                        $sth = $this->db->prepare($query);
1304
-                        $sth->execute($query_values);
1305
-                } catch(PDOException $e) {
1306
-                        return "error : ".$e->getMessage();
1307
-                }
1308
-        }
1301
+				$query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name,':airline' => $airline_icao);
1302
+				 try {
1303
+						$sth = $this->db->prepare($query);
1304
+						$sth->execute($query_values);
1305
+				} catch(PDOException $e) {
1306
+						return "error : ".$e->getMessage();
1307
+				}
1308
+		}
1309 1309
 	public function addStatAircraft($aircraft_icao,$cnt,$aircraft_name = '',$aircraft_manufacturer = '', $airline_icao = '', $filter_name = '', $reset = false) {
1310 1310
 		global $globalDBdriver;
1311 1311
 		if ($globalDBdriver == 'mysql') {
@@ -1321,14 +1321,14 @@  discard block
 block discarded – undo
1321 1321
 				$query = "UPDATE stats_aircraft SET cnt = cnt+:cnt, aircraft_name = :aircraft_name, aircraft_manufacturer = :aircraft_manufacturer, filter_name = :filter_name WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_aircraft (aircraft_icao,aircraft_name,aircraft_manufacturer,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:aircraft_name,:aircraft_manufacturer,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_aircraft WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name);"; 
1322 1322
 			}
1323 1323
 		}
1324
-                $query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name);
1325
-                 try {
1326
-                        $sth = $this->db->prepare($query);
1327
-                        $sth->execute($query_values);
1328
-                } catch(PDOException $e) {
1329
-                        return "error : ".$e->getMessage();
1330
-                }
1331
-        }
1324
+				$query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name);
1325
+				 try {
1326
+						$sth = $this->db->prepare($query);
1327
+						$sth->execute($query_values);
1328
+				} catch(PDOException $e) {
1329
+						return "error : ".$e->getMessage();
1330
+				}
1331
+		}
1332 1332
 	public function addStatAirline($airline_icao,$cnt,$airline_name = '',$filter_name = '', $reset = false) {
1333 1333
 		global $globalDBdriver;
1334 1334
 		if ($globalDBdriver == 'mysql') {
@@ -1344,14 +1344,14 @@  discard block
 block discarded – undo
1344 1344
 				$query = "UPDATE stats_airline SET cnt = cnt+:cnt WHERE airline_icao = :airline_icao AND filter_name = :filter_name; INSERT INTO stats_airline (airline_icao,airline_name,cnt,filter_name) SELECT :airline_icao,:airline_name,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airline WHERE airline_icao = :airline_icao AND filter_name = :filter_name);"; 
1345 1345
 			}
1346 1346
 		}
1347
-                $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name);
1348
-                 try {
1349
-                        $sth = $this->db->prepare($query);
1350
-                        $sth->execute($query_values);
1351
-                } catch(PDOException $e) {
1352
-                        return "error : ".$e->getMessage();
1353
-                }
1354
-        }
1347
+				$query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name);
1348
+				 try {
1349
+						$sth = $this->db->prepare($query);
1350
+						$sth->execute($query_values);
1351
+				} catch(PDOException $e) {
1352
+						return "error : ".$e->getMessage();
1353
+				}
1354
+		}
1355 1355
 	public function addStatOwner($owner_name,$cnt,$stats_airline = '', $filter_name = '', $reset = false) {
1356 1356
 		global $globalDBdriver;
1357 1357
 		if ($globalDBdriver == 'mysql') {
@@ -1367,14 +1367,14 @@  discard block
 block discarded – undo
1367 1367
 				$query = "UPDATE stats_owner SET cnt = cnt+:cnt WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_owner (owner_name,cnt,stats_airline,filter_name) SELECT :owner_name,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_owner WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name);"; 
1368 1368
 			}
1369 1369
 		}
1370
-                $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1371
-                 try {
1372
-                        $sth = $this->db->prepare($query);
1373
-                        $sth->execute($query_values);
1374
-                } catch(PDOException $e) {
1375
-                        return "error : ".$e->getMessage();
1376
-                }
1377
-        }
1370
+				$query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name);
1371
+				 try {
1372
+						$sth = $this->db->prepare($query);
1373
+						$sth->execute($query_values);
1374
+				} catch(PDOException $e) {
1375
+						return "error : ".$e->getMessage();
1376
+				}
1377
+		}
1378 1378
 	public function addStatPilot($pilot_id,$cnt,$pilot_name,$stats_airline = '',$filter_name = '',$format_source = '',$reset = false) {
1379 1379
 		global $globalDBdriver;
1380 1380
 		if ($globalDBdriver == 'mysql') {
@@ -1390,14 +1390,14 @@  discard block
 block discarded – undo
1390 1390
 				$query = "UPDATE stats_pilot SET cnt = cnt+:cnt, pilot_name = :pilot_name WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source; INSERT INTO stats_pilot (pilot_id,cnt,pilot_name,stats_airline,filter_name,format_source) SELECT :pilot_id,:cnt,:pilot_name,:stats_airline,:filter_name,:format_source WHERE NOT EXISTS (SELECT 1 FROM stats_pilot WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source);"; 
1391 1391
 			}
1392 1392
 		}
1393
-                $query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source);
1394
-                 try {
1395
-                        $sth = $this->db->prepare($query);
1396
-                        $sth->execute($query_values);
1397
-                } catch(PDOException $e) {
1398
-                        return "error : ".$e->getMessage();
1399
-                }
1400
-        }
1393
+				$query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source);
1394
+				 try {
1395
+						$sth = $this->db->prepare($query);
1396
+						$sth->execute($query_values);
1397
+				} catch(PDOException $e) {
1398
+						return "error : ".$e->getMessage();
1399
+				}
1400
+		}
1401 1401
 	public function addStatDepartureAirports($airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '',$reset = false) {
1402 1402
 		global $globalDBdriver;
1403 1403
 		if ($airport_icao != '') {
@@ -1421,8 +1421,8 @@  discard block
 block discarded – undo
1421 1421
 			} catch(PDOException $e) {
1422 1422
 				return "error : ".$e->getMessage();
1423 1423
 			}
1424
-                }
1425
-        }
1424
+				}
1425
+		}
1426 1426
 	public function addStatDepartureAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '') {
1427 1427
 		global $globalDBdriver;
1428 1428
 		if ($airport_icao != '') {
@@ -1438,8 +1438,8 @@  discard block
 block discarded – undo
1438 1438
 			} catch(PDOException $e) {
1439 1439
 				return "error : ".$e->getMessage();
1440 1440
 			}
1441
-                }
1442
-        }
1441
+				}
1442
+		}
1443 1443
 	public function addStatArrivalAirports($airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '',$reset = false) {
1444 1444
 		global $globalDBdriver;
1445 1445
 		if ($airport_icao != '') {
@@ -1456,15 +1456,15 @@  discard block
 block discarded – undo
1456 1456
 					$query = "UPDATE stats_airport SET arrival = arrival+:arrival WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name; INSERT INTO stats_airport (airport_icao,airport_name,airport_city,airport_country,arrival,stats_type,date,stats_airline,filter_name) SELECT :airport_icao,:airport_name,:airport_city,:airport_country,:arrival,'yearly',:date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airport WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name);"; 
1457 1457
 				}
1458 1458
 			}
1459
-	                $query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name);
1459
+					$query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name);
1460 1460
 			 try {
1461
-                    		$sth = $this->db->prepare($query);
1462
-	                        $sth->execute($query_values);
1463
-    		        } catch(PDOException $e) {
1464
-            		        return "error : ".$e->getMessage();
1465
-	                }
1466
-	        }
1467
-        }
1461
+							$sth = $this->db->prepare($query);
1462
+							$sth->execute($query_values);
1463
+					} catch(PDOException $e) {
1464
+							return "error : ".$e->getMessage();
1465
+					}
1466
+			}
1467
+		}
1468 1468
 	public function addStatArrivalAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '') {
1469 1469
 		global $globalDBdriver;
1470 1470
 		if ($airport_icao != '') {
@@ -1480,46 +1480,46 @@  discard block
 block discarded – undo
1480 1480
 			} catch(PDOException $e) {
1481 1481
 				return "error : ".$e->getMessage();
1482 1482
 			}
1483
-                }
1484
-        }
1483
+				}
1484
+		}
1485 1485
 
1486 1486
 	public function deleteStat($id) {
1487
-                $query = "DELETE FROM stats WHERE stats_id = :id";
1488
-                $query_values = array(':id' => $id);
1489
-                 try {
1490
-                        $sth = $this->db->prepare($query);
1491
-                        $sth->execute($query_values);
1492
-                } catch(PDOException $e) {
1493
-                        return "error : ".$e->getMessage();
1494
-                }
1495
-        }
1487
+				$query = "DELETE FROM stats WHERE stats_id = :id";
1488
+				$query_values = array(':id' => $id);
1489
+				 try {
1490
+						$sth = $this->db->prepare($query);
1491
+						$sth->execute($query_values);
1492
+				} catch(PDOException $e) {
1493
+						return "error : ".$e->getMessage();
1494
+				}
1495
+		}
1496 1496
 	public function deleteStatFlight($type) {
1497
-                $query = "DELETE FROM stats_flight WHERE stats_type = :type";
1498
-                $query_values = array(':type' => $type);
1499
-                 try {
1500
-                        $sth = $this->db->prepare($query);
1501
-                        $sth->execute($query_values);
1502
-                } catch(PDOException $e) {
1503
-                        return "error : ".$e->getMessage();
1504
-                }
1505
-        }
1497
+				$query = "DELETE FROM stats_flight WHERE stats_type = :type";
1498
+				$query_values = array(':type' => $type);
1499
+				 try {
1500
+						$sth = $this->db->prepare($query);
1501
+						$sth->execute($query_values);
1502
+				} catch(PDOException $e) {
1503
+						return "error : ".$e->getMessage();
1504
+				}
1505
+		}
1506 1506
 	public function deleteStatAirport($type) {
1507
-                $query = "DELETE FROM stats_airport WHERE stats_type = :type";
1508
-                $query_values = array(':type' => $type);
1509
-                 try {
1510
-                        $sth = $this->db->prepare($query);
1511
-                        $sth->execute($query_values);
1512
-                } catch(PDOException $e) {
1513
-                        return "error : ".$e->getMessage();
1514
-                }
1515
-        }
1507
+				$query = "DELETE FROM stats_airport WHERE stats_type = :type";
1508
+				$query_values = array(':type' => $type);
1509
+				 try {
1510
+						$sth = $this->db->prepare($query);
1511
+						$sth->execute($query_values);
1512
+				} catch(PDOException $e) {
1513
+						return "error : ".$e->getMessage();
1514
+				}
1515
+		}
1516 1516
         
1517
-        public function addOldStats() {
1518
-    		global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear;
1519
-    		$Common = new Common();
1520
-    		$Connection = new Connection();
1521
-    		date_default_timezone_set('UTC');
1522
-    		$last_update = $this->getLastStatsUpdate('last_update_stats');
1517
+		public function addOldStats() {
1518
+			global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear;
1519
+			$Common = new Common();
1520
+			$Connection = new Connection();
1521
+			date_default_timezone_set('UTC');
1522
+			$last_update = $this->getLastStatsUpdate('last_update_stats');
1523 1523
 			if ($globalDebug) echo 'Update stats !'."\n";
1524 1524
 			if (isset($last_update[0]['value'])) {
1525 1525
 				$last_update_day = $last_update[0]['value'];
@@ -1566,24 +1566,24 @@  discard block
 block discarded – undo
1566 1566
 			if ($globalDebug) echo 'Count all departure airports...'."\n";
1567 1567
 			$pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day);
1568 1568
 			if ($globalDebug) echo 'Count all detected departure airports...'."\n";
1569
-        		$dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day);
1569
+				$dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day);
1570 1570
 			if ($globalDebug) echo 'Order departure airports...'."\n";
1571
-	        	$alldata = array();
1571
+				$alldata = array();
1572 1572
 	        	
1573
-    			foreach ($pall as $value) {
1574
-	        		$icao = $value['airport_departure_icao'];
1575
-    				$alldata[$icao] = $value;
1576
-	        	}
1577
-	        	foreach ($dall as $value) {
1578
-    				$icao = $value['airport_departure_icao'];
1579
-        			if (isset($alldata[$icao])) {
1580
-    					$alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
1581
-        			} else $alldata[$icao] = $value;
1582
-			}
1583
-    			$count = array();
1584
-    			foreach ($alldata as $key => $row) {
1585
-    				$count[$key] = $row['airport_departure_icao_count'];
1586
-        		}
1573
+				foreach ($pall as $value) {
1574
+					$icao = $value['airport_departure_icao'];
1575
+					$alldata[$icao] = $value;
1576
+				}
1577
+				foreach ($dall as $value) {
1578
+					$icao = $value['airport_departure_icao'];
1579
+					if (isset($alldata[$icao])) {
1580
+						$alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
1581
+					} else $alldata[$icao] = $value;
1582
+			}
1583
+				$count = array();
1584
+				foreach ($alldata as $key => $row) {
1585
+					$count[$key] = $row['airport_departure_icao_count'];
1586
+				}
1587 1587
 			array_multisort($count,SORT_DESC,$alldata);
1588 1588
 			foreach ($alldata as $number) {
1589 1589
 				echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'','',$reset);
@@ -1591,25 +1591,25 @@  discard block
 block discarded – undo
1591 1591
 			if ($globalDebug) echo 'Count all arrival airports...'."\n";
1592 1592
 			$pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day);
1593 1593
 			if ($globalDebug) echo 'Count all detected arrival airports...'."\n";
1594
-        		$dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day);
1594
+				$dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day);
1595 1595
 			if ($globalDebug) echo 'Order arrival airports...'."\n";
1596
-	        	$alldata = array();
1597
-    			foreach ($pall as $value) {
1598
-	        		$icao = $value['airport_arrival_icao'];
1599
-    				$alldata[$icao] = $value;
1600
-	        	}
1601
-	        	foreach ($dall as $value) {
1602
-    				$icao = $value['airport_arrival_icao'];
1603
-        			if (isset($alldata[$icao])) {
1604
-        				$alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
1605
-	        		} else $alldata[$icao] = $value;
1606
-    			}
1607
-        		$count = array();
1608
-        		foreach ($alldata as $key => $row) {
1609
-        			$count[$key] = $row['airport_arrival_icao_count'];
1610
-	        	}
1611
-    			array_multisort($count,SORT_DESC,$alldata);
1612
-                        foreach ($alldata as $number) {
1596
+				$alldata = array();
1597
+				foreach ($pall as $value) {
1598
+					$icao = $value['airport_arrival_icao'];
1599
+					$alldata[$icao] = $value;
1600
+				}
1601
+				foreach ($dall as $value) {
1602
+					$icao = $value['airport_arrival_icao'];
1603
+					if (isset($alldata[$icao])) {
1604
+						$alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
1605
+					} else $alldata[$icao] = $value;
1606
+				}
1607
+				$count = array();
1608
+				foreach ($alldata as $key => $row) {
1609
+					$count[$key] = $row['airport_arrival_icao_count'];
1610
+				}
1611
+				array_multisort($count,SORT_DESC,$alldata);
1612
+						foreach ($alldata as $number) {
1613 1613
 				echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'','',$reset);
1614 1614
 			}
1615 1615
 			if ($Connection->tableExists('countries')) {
@@ -1682,8 +1682,8 @@  discard block
 block discarded – undo
1682 1682
 //			$pall = $Spotter->getLast7DaysAirportsDeparture();
1683 1683
   //      		$dall = $Spotter->getLast7DaysDetectedAirportsDeparture();
1684 1684
 			$pall = $Spotter->getLast7DaysAirportsDeparture();
1685
-        		$dall = $Spotter->getLast7DaysDetectedAirportsDeparture();
1686
-        		/*
1685
+				$dall = $Spotter->getLast7DaysDetectedAirportsDeparture();
1686
+				/*
1687 1687
 	        	$alldata = array();
1688 1688
     			foreach ($pall as $value) {
1689 1689
 	        		$icao = $value['departure_airport_icao'];
@@ -1702,29 +1702,29 @@  discard block
 block discarded – undo
1702 1702
 	        	}
1703 1703
     			array_multisort($count,SORT_DESC,$alldata);
1704 1704
     			*/
1705
-    			foreach ($dall as $value) {
1706
-    				$icao = $value['departure_airport_icao'];
1707
-    				$ddate = $value['date'];
1708
-    				$find = false;
1709
-    				foreach ($pall as $pvalue) {
1710
-    					if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
1711
-    						$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
1712
-    						$find = true;
1713
-    						break;
1714
-    					}
1715
-    				}
1716
-    				if ($find === false) {
1717
-    					$pall[] = $value;
1718
-    				}
1719
-    			}
1720
-    			$alldata = $pall;
1705
+				foreach ($dall as $value) {
1706
+					$icao = $value['departure_airport_icao'];
1707
+					$ddate = $value['date'];
1708
+					$find = false;
1709
+					foreach ($pall as $pvalue) {
1710
+						if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
1711
+							$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
1712
+							$find = true;
1713
+							break;
1714
+						}
1715
+					}
1716
+					if ($find === false) {
1717
+						$pall[] = $value;
1718
+					}
1719
+				}
1720
+				$alldata = $pall;
1721 1721
 			foreach ($alldata as $number) {
1722 1722
 				$this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count']);
1723 1723
 			}
1724 1724
 			echo '...Arrival'."\n";
1725 1725
 			$pall = $Spotter->getLast7DaysAirportsArrival();
1726
-        		$dall = $Spotter->getLast7DaysDetectedAirportsArrival();
1727
-        		/*
1726
+				$dall = $Spotter->getLast7DaysDetectedAirportsArrival();
1727
+				/*
1728 1728
 	        	$alldata = array();
1729 1729
     			foreach ($pall as $value) {
1730 1730
 	        		$icao = $value['arrival_airport_icao'];
@@ -1744,22 +1744,22 @@  discard block
 block discarded – undo
1744 1744
     			*/
1745 1745
 
1746 1746
 
1747
-    			foreach ($dall as $value) {
1748
-    				$icao = $value['arrival_airport_icao'];
1749
-    				$ddate = $value['date'];
1750
-    				$find = false;
1751
-    				foreach ($pall as $pvalue) {
1752
-    					if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
1753
-    						$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
1754
-    						$find = true;
1755
-    						break;
1756
-    					}
1757
-    				}
1758
-    				if ($find === false) {
1759
-    					$pall[] = $value;
1760
-    				}
1761
-    			}
1762
-    			$alldata = $pall;
1747
+				foreach ($dall as $value) {
1748
+					$icao = $value['arrival_airport_icao'];
1749
+					$ddate = $value['date'];
1750
+					$find = false;
1751
+					foreach ($pall as $pvalue) {
1752
+						if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
1753
+							$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
1754
+							$find = true;
1755
+							break;
1756
+						}
1757
+					}
1758
+					if ($find === false) {
1759
+						$pall[] = $value;
1760
+					}
1761
+				}
1762
+				$alldata = $pall;
1763 1763
 			foreach ($alldata as $number) {
1764 1764
 				$this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count']);
1765 1765
 			}
@@ -1834,51 +1834,51 @@  discard block
 block discarded – undo
1834 1834
 			if ($globalDebug) echo 'Count all departure airports by airlines...'."\n";
1835 1835
 			$pall = $Spotter->countAllDepartureAirportsByAirlines(false,0,$last_update_day);
1836 1836
 			if ($globalDebug) echo 'Count all detected departure airports by airlines...'."\n";
1837
-       			$dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day);
1837
+	   			$dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day);
1838 1838
 			if ($globalDebug) echo 'Order detected departure airports by airlines...'."\n";
1839
-	        	//$alldata = array();
1840
-    			foreach ($dall as $value) {
1841
-    				$icao = $value['airport_departure_icao'];
1842
-    				$dicao = $value['airline_icao'];
1843
-    				$find = false;
1844
-    				foreach ($pall as $pvalue) {
1845
-    					if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) {
1846
-    						$pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
1847
-    						$find = true;
1848
-    						break;
1849
-    					}
1850
-    				}
1851
-    				if ($find === false) {
1852
-    					$pall[] = $value;
1853
-    				}
1854
-    			}
1855
-    			$alldata = $pall;
1839
+				//$alldata = array();
1840
+				foreach ($dall as $value) {
1841
+					$icao = $value['airport_departure_icao'];
1842
+					$dicao = $value['airline_icao'];
1843
+					$find = false;
1844
+					foreach ($pall as $pvalue) {
1845
+						if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) {
1846
+							$pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
1847
+							$find = true;
1848
+							break;
1849
+						}
1850
+					}
1851
+					if ($find === false) {
1852
+						$pall[] = $value;
1853
+					}
1854
+				}
1855
+				$alldata = $pall;
1856 1856
 			foreach ($alldata as $number) {
1857 1857
 				echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],$number['airline_icao'],'',$reset);
1858 1858
 			}
1859 1859
 			if ($globalDebug) echo 'Count all arrival airports by airlines...'."\n";
1860 1860
 			$pall = $Spotter->countAllArrivalAirportsByAirlines(false,0,$last_update_day);
1861 1861
 			if ($globalDebug) echo 'Count all detected arrival airports by airlines...'."\n";
1862
-        		$dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day);
1862
+				$dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day);
1863 1863
 			if ($globalDebug) echo 'Order arrival airports by airlines...'."\n";
1864
-	        	//$alldata = array();
1865
-    			foreach ($dall as $value) {
1866
-    				$icao = $value['airport_arrival_icao'];
1867
-    				$dicao = $value['airline_icao'];
1868
-    				$find = false;
1869
-    				foreach ($pall as $pvalue) {
1870
-    					if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) {
1871
-    						$pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
1872
-    						$find = true;
1873
-    						break;
1874
-    					}
1875
-    				}
1876
-    				if ($find === false) {
1877
-    					$pall[] = $value;
1878
-    				}
1879
-    			}
1880
-    			$alldata = $pall;
1881
-                        foreach ($alldata as $number) {
1864
+				//$alldata = array();
1865
+				foreach ($dall as $value) {
1866
+					$icao = $value['airport_arrival_icao'];
1867
+					$dicao = $value['airline_icao'];
1868
+					$find = false;
1869
+					foreach ($pall as $pvalue) {
1870
+						if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) {
1871
+							$pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
1872
+							$find = true;
1873
+							break;
1874
+						}
1875
+					}
1876
+					if ($find === false) {
1877
+						$pall[] = $value;
1878
+					}
1879
+				}
1880
+				$alldata = $pall;
1881
+						foreach ($alldata as $number) {
1882 1882
 				if ($number['airline_icao'] != '') echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],$number['airline_icao'],'',$reset);
1883 1883
 			}
1884 1884
 			if ($globalDebug) echo 'Count all flights by months by airlines...'."\n";
@@ -1911,47 +1911,47 @@  discard block
 block discarded – undo
1911 1911
 			}
1912 1912
 			if ($globalDebug) echo '...Departure'."\n";
1913 1913
 			$pall = $Spotter->getLast7DaysAirportsDepartureByAirlines();
1914
-        		$dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines();
1915
-    			foreach ($dall as $value) {
1916
-    				$icao = $value['departure_airport_icao'];
1917
-    				$airline = $value['airline_icao'];
1918
-    				$ddate = $value['date'];
1919
-    				$find = false;
1920
-    				foreach ($pall as $pvalue) {
1921
-    					if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) {
1922
-    						$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
1923
-    						$find = true;
1924
-    						break;
1925
-    					}
1926
-    				}
1927
-    				if ($find === false) {
1928
-    					$pall[] = $value;
1929
-    				}
1930
-    			}
1931
-    			$alldata = $pall;
1914
+				$dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines();
1915
+				foreach ($dall as $value) {
1916
+					$icao = $value['departure_airport_icao'];
1917
+					$airline = $value['airline_icao'];
1918
+					$ddate = $value['date'];
1919
+					$find = false;
1920
+					foreach ($pall as $pvalue) {
1921
+						if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) {
1922
+							$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
1923
+							$find = true;
1924
+							break;
1925
+						}
1926
+					}
1927
+					if ($find === false) {
1928
+						$pall[] = $value;
1929
+					}
1930
+				}
1931
+				$alldata = $pall;
1932 1932
 			foreach ($alldata as $number) {
1933 1933
 				$this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],$number['airline_icao']);
1934 1934
 			}
1935 1935
 			if ($globalDebug) echo '...Arrival'."\n";
1936 1936
 			$pall = $Spotter->getLast7DaysAirportsArrivalByAirlines();
1937
-        		$dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines();
1938
-    			foreach ($dall as $value) {
1939
-    				$icao = $value['arrival_airport_icao'];
1940
-    				$airline = $value['airline_icao'];
1941
-    				$ddate = $value['date'];
1942
-    				$find = false;
1943
-    				foreach ($pall as $pvalue) {
1944
-    					if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) {
1945
-    						$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
1946
-    						$find = true;
1947
-    						break;
1948
-    					}
1949
-    				}
1950
-    				if ($find === false) {
1951
-    					$pall[] = $value;
1952
-    				}
1953
-    			}
1954
-    			$alldata = $pall;
1937
+				$dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines();
1938
+				foreach ($dall as $value) {
1939
+					$icao = $value['arrival_airport_icao'];
1940
+					$airline = $value['airline_icao'];
1941
+					$ddate = $value['date'];
1942
+					$find = false;
1943
+					foreach ($pall as $pvalue) {
1944
+						if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) {
1945
+							$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
1946
+							$find = true;
1947
+							break;
1948
+						}
1949
+					}
1950
+					if ($find === false) {
1951
+						$pall[] = $value;
1952
+					}
1953
+				}
1954
+				$alldata = $pall;
1955 1955
 			foreach ($alldata as $number) {
1956 1956
 				$this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],$number['airline_icao']);
1957 1957
 			}
@@ -2036,44 +2036,44 @@  discard block
 block discarded – undo
2036 2036
 					$this->addStatPilot($number['pilot_id'],$number['pilot_count'],$number['pilot_name'],'',$filter_name,$number['format_source'],$reset);
2037 2037
 				}
2038 2038
 				$pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day,$filter);
2039
-	       			$dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter);
2040
-		        	$alldata = array();
2041
-	    			foreach ($pall as $value) {
2042
-		        		$icao = $value['airport_departure_icao'];
2043
-    					$alldata[$icao] = $value;
2044
-	    			}
2045
-		        	foreach ($dall as $value) {
2046
-	    				$icao = $value['airport_departure_icao'];
2047
-        				if (isset($alldata[$icao])) {
2048
-    						$alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
2049
-        				} else $alldata[$icao] = $value;
2050
-				}
2051
-	    			$count = array();
2052
-    				foreach ($alldata as $key => $row) {
2053
-    					$count[$key] = $row['airport_departure_icao_count'];
2054
-    				}
2039
+		   			$dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter);
2040
+					$alldata = array();
2041
+					foreach ($pall as $value) {
2042
+						$icao = $value['airport_departure_icao'];
2043
+						$alldata[$icao] = $value;
2044
+					}
2045
+					foreach ($dall as $value) {
2046
+						$icao = $value['airport_departure_icao'];
2047
+						if (isset($alldata[$icao])) {
2048
+							$alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count'];
2049
+						} else $alldata[$icao] = $value;
2050
+				}
2051
+					$count = array();
2052
+					foreach ($alldata as $key => $row) {
2053
+						$count[$key] = $row['airport_departure_icao_count'];
2054
+					}
2055 2055
 				array_multisort($count,SORT_DESC,$alldata);
2056 2056
 				foreach ($alldata as $number) {
2057
-    					echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset);
2057
+						echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset);
2058 2058
 				}
2059 2059
 				$pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day,false,$filter);
2060
-    				$dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter);
2060
+					$dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter);
2061 2061
 				$alldata = array();
2062
-    				foreach ($pall as $value) {
2063
-		        		$icao = $value['airport_arrival_icao'];
2064
-    					$alldata[$icao] = $value;
2065
-	    			}
2066
-		        	foreach ($dall as $value) {
2067
-	    				$icao = $value['airport_arrival_icao'];
2068
-        				if (isset($alldata[$icao])) {
2069
-        					$alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
2070
-		        		} else $alldata[$icao] = $value;
2071
-	    			}
2072
-        			$count = array();
2073
-        			foreach ($alldata as $key => $row) {
2074
-    					$count[$key] = $row['airport_arrival_icao_count'];
2075
-		        	}
2076
-        			array_multisort($count,SORT_DESC,$alldata);
2062
+					foreach ($pall as $value) {
2063
+						$icao = $value['airport_arrival_icao'];
2064
+						$alldata[$icao] = $value;
2065
+					}
2066
+					foreach ($dall as $value) {
2067
+						$icao = $value['airport_arrival_icao'];
2068
+						if (isset($alldata[$icao])) {
2069
+							$alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count'];
2070
+						} else $alldata[$icao] = $value;
2071
+					}
2072
+					$count = array();
2073
+					foreach ($alldata as $key => $row) {
2074
+						$count[$key] = $row['airport_arrival_icao_count'];
2075
+					}
2076
+					array_multisort($count,SORT_DESC,$alldata);
2077 2077
 				foreach ($alldata as $number) {
2078 2078
 					echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'',$filter_name,$reset);
2079 2079
 				}
@@ -2106,45 +2106,45 @@  discard block
 block discarded – undo
2106 2106
 				}
2107 2107
 				echo '...Departure'."\n";
2108 2108
 				$pall = $Spotter->getLast7DaysAirportsDeparture('',$filter);
2109
-        			$dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter);
2109
+					$dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter);
2110 2110
 				foreach ($dall as $value) {
2111
-    					$icao = $value['departure_airport_icao'];
2112
-    					$ddate = $value['date'];
2113
-    					$find = false;
2114
-    					foreach ($pall as $pvalue) {
2115
-    						if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
2116
-    							$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
2117
-	    						$find = true;
2118
-    							break;
2119
-    						}
2120
-    					}
2121
-    					if ($find === false) {
2122
-    						$pall[] = $value;
2123
-	    				}
2124
-    				}
2125
-	    			$alldata = $pall;
2111
+						$icao = $value['departure_airport_icao'];
2112
+						$ddate = $value['date'];
2113
+						$find = false;
2114
+						foreach ($pall as $pvalue) {
2115
+							if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
2116
+								$pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count'];
2117
+								$find = true;
2118
+								break;
2119
+							}
2120
+						}
2121
+						if ($find === false) {
2122
+							$pall[] = $value;
2123
+						}
2124
+					}
2125
+					$alldata = $pall;
2126 2126
 				foreach ($alldata as $number) {
2127 2127
 					$this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],'',$filter_name);
2128 2128
 				}
2129 2129
 				echo '...Arrival'."\n";
2130 2130
 				$pall = $Spotter->getLast7DaysAirportsArrival('',$filter);
2131
-    				$dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter);
2131
+					$dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter);
2132 2132
 				foreach ($dall as $value) {
2133 2133
 					$icao = $value['arrival_airport_icao'];
2134 2134
 					$ddate = $value['date'];
2135
-    					$find = false;
2135
+						$find = false;
2136 2136
 					foreach ($pall as $pvalue) {
2137
-    						if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
2138
-    							$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
2139
-    							$find = true;
2140
-    							break;
2141
-	    					}
2142
-    					}
2143
-    					if ($find === false) {
2144
-    						$pall[] = $value;
2145
-	    				}
2146
-    				}
2147
-    				$alldata = $pall;
2137
+							if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) {
2138
+								$pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count'];
2139
+								$find = true;
2140
+								break;
2141
+							}
2142
+						}
2143
+						if ($find === false) {
2144
+							$pall[] = $value;
2145
+						}
2146
+					}
2147
+					$alldata = $pall;
2148 2148
 				foreach ($alldata as $number) {
2149 2149
 					$this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],'',$filter_name);
2150 2150
 				}
Please login to merge, or discard this patch.
require/class.Spotter.php 1 patch
Indentation   +1454 added lines, -1454 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	/**
58
-	* Get SQL query part for filter used
59
-	* @param Array $filter the filter
60
-	* @return Array the SQL part
61
-	*/
58
+	 * Get SQL query part for filter used
59
+	 * @param Array $filter the filter
60
+	 * @return Array the SQL part
61
+	 */
62 62
 	public function getFilter($filter = array(),$where = false,$and = false) {
63 63
 		global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver;
64 64
 		$filters = array();
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 	}
167 167
 
168 168
 	/**
169
-	* Executes the SQL statements to get the spotter information
170
-	*
171
-	* @param String $query the SQL query
172
-	* @param Array $params parameter of the query
173
-	* @param String $limitQuery the limit query
174
-	* @return Array the spotter information
175
-	*
176
-	*/
169
+	 * Executes the SQL statements to get the spotter information
170
+	 *
171
+	 * @param String $query the SQL query
172
+	 * @param Array $params parameter of the query
173
+	 * @param String $limitQuery the limit query
174
+	 * @return Array the spotter information
175
+	 *
176
+	 */
177 177
 	public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false)
178 178
 	{
179 179
 		global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM;
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 					if ($aircraft_array[0]['aircraft_shadow'] != NULL) {
343 343
 						$temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow'];
344 344
 					} else $temp_array['aircraft_shadow'] = 'default.png';
345
-                                } else {
346
-                            		$temp_array['aircraft_shadow'] = 'default.png';
345
+								} else {
346
+									$temp_array['aircraft_shadow'] = 'default.png';
347 347
 					$temp_array['aircraft_name'] = 'N/A';
348 348
 					$temp_array['aircraft_manufacturer'] = 'N/A';
349
-                            	}
349
+								}
350 350
 			}
351 351
 			$fromsource = NULL;
352 352
 			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource;
@@ -542,11 +542,11 @@  discard block
 block discarded – undo
542 542
 	
543 543
 	
544 544
 	/**
545
-	* Gets all the spotter information
546
-	*
547
-	* @return Array the spotter information
548
-	*
549
-	*/
545
+	 * Gets all the spotter information
546
+	 *
547
+	 * @return Array the spotter information
548
+	 *
549
+	 */
550 550
 	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 = '',$filters = array())
551 551
 	{
552 552
 		global $globalTimezone, $globalDBdriver;
@@ -893,11 +893,11 @@  discard block
 block discarded – undo
893 893
 	
894 894
 	
895 895
 	/**
896
-	* Gets all the spotter information based on the latest data entry
897
-	*
898
-	* @return Array the spotter information
899
-	*
900
-	*/
896
+	 * Gets all the spotter information based on the latest data entry
897
+	 *
898
+	 * @return Array the spotter information
899
+	 *
900
+	 */
901 901
 	public function getLatestSpotterData($limit = '', $sort = '', $filter = array())
902 902
 	{
903 903
 		global $global_query;
@@ -936,12 +936,12 @@  discard block
 block discarded – undo
936 936
 	}
937 937
     
938 938
     
939
-    /**
940
-	* Gets all the spotter information based on a user's latitude and longitude
941
-	*
942
-	* @return Array the spotter information
943
-	*
944
-	*/
939
+	/**
940
+	 * Gets all the spotter information based on a user's latitude and longitude
941
+	 *
942
+	 * @return Array the spotter information
943
+	 *
944
+	 */
945 945
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
946 946
 	{
947 947
 		date_default_timezone_set('UTC');
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 				return false;
970 970
 			}
971 971
 		}
972
-    		$additional_query = '';
972
+			$additional_query = '';
973 973
 		if ($interval != "")
974 974
 		{
975 975
 			if (!is_string($interval))
@@ -1009,12 +1009,12 @@  discard block
 block discarded – undo
1009 1009
 	}
1010 1010
     
1011 1011
     
1012
-    /**
1013
-	* Gets all the spotter information sorted by the newest aircraft type
1014
-	*
1015
-	* @return Array the spotter information
1016
-	*
1017
-	*/
1012
+	/**
1013
+	 * Gets all the spotter information sorted by the newest aircraft type
1014
+	 *
1015
+	 * @return Array the spotter information
1016
+	 *
1017
+	 */
1018 1018
 	public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array())
1019 1019
 	{
1020 1020
 		global $global_query;
@@ -1055,11 +1055,11 @@  discard block
 block discarded – undo
1055 1055
     
1056 1056
     
1057 1057
 	/**
1058
-	* Gets all the spotter information sorted by the newest aircraft registration
1059
-	*
1060
-	* @return Array the spotter information
1061
-	*
1062
-	*/
1058
+	 * Gets all the spotter information sorted by the newest aircraft registration
1059
+	 *
1060
+	 * @return Array the spotter information
1061
+	 *
1062
+	 */
1063 1063
 	public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array())
1064 1064
 	{
1065 1065
 		global $global_query;
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
 
1101 1101
 	/**
1102
-	* Gets all the spotter information sorted by the newest airline
1103
-	*
1104
-	* @return Array the spotter information
1105
-	*
1106
-	*/
1102
+	 * Gets all the spotter information sorted by the newest airline
1103
+	 *
1104
+	 * @return Array the spotter information
1105
+	 *
1106
+	 */
1107 1107
 	public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array())
1108 1108
 	{
1109 1109
 		global $global_query;
@@ -1142,12 +1142,12 @@  discard block
 block discarded – undo
1142 1142
 	}
1143 1143
     
1144 1144
     
1145
-    /**
1146
-	* Gets all the spotter information sorted by the newest departure airport
1147
-	*
1148
-	* @return Array the spotter information
1149
-	*
1150
-	*/
1145
+	/**
1146
+	 * Gets all the spotter information sorted by the newest departure airport
1147
+	 *
1148
+	 * @return Array the spotter information
1149
+	 *
1150
+	 */
1151 1151
 	public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array())
1152 1152
 	{
1153 1153
 		global $global_query;
@@ -1189,11 +1189,11 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
 
1191 1191
 	/**
1192
-	* Gets all the spotter information sorted by the newest arrival airport
1193
-	*
1194
-	* @return Array the spotter information
1195
-	*
1196
-	*/
1192
+	 * Gets all the spotter information sorted by the newest arrival airport
1193
+	 *
1194
+	 * @return Array the spotter information
1195
+	 *
1196
+	 */
1197 1197
 	public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array())
1198 1198
 	{
1199 1199
 		global $global_query;
@@ -1232,11 +1232,11 @@  discard block
 block discarded – undo
1232 1232
 	
1233 1233
 
1234 1234
 	/**
1235
-	* Gets all the spotter information based on the spotter id
1236
-	*
1237
-	* @return Array the spotter information
1238
-	*
1239
-	*/
1235
+	 * Gets all the spotter information based on the spotter id
1236
+	 *
1237
+	 * @return Array the spotter information
1238
+	 *
1239
+	 */
1240 1240
 	public function getSpotterDataByID($id = '')
1241 1241
 	{
1242 1242
 		global $global_query;
@@ -1258,11 +1258,11 @@  discard block
 block discarded – undo
1258 1258
 	
1259 1259
 	
1260 1260
 	/**
1261
-	* Gets all the spotter information based on the callsign
1262
-	*
1263
-	* @return Array the spotter information
1264
-	*
1265
-	*/
1261
+	 * Gets all the spotter information based on the callsign
1262
+	 *
1263
+	 * @return Array the spotter information
1264
+	 *
1265
+	 */
1266 1266
 	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '', $filter = array())
1267 1267
 	{
1268 1268
 		global $global_query;
@@ -1314,11 +1314,11 @@  discard block
 block discarded – undo
1314 1314
 	}
1315 1315
 	
1316 1316
 	/**
1317
-	* Gets all the spotter information based on the owner
1318
-	*
1319
-	* @return Array the spotter information
1320
-	*
1321
-	*/
1317
+	 * Gets all the spotter information based on the owner
1318
+	 *
1319
+	 * @return Array the spotter information
1320
+	 *
1321
+	 */
1322 1322
 	public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $filter = array())
1323 1323
 	{
1324 1324
 		global $global_query;
@@ -1371,11 +1371,11 @@  discard block
 block discarded – undo
1371 1371
 	}
1372 1372
 	
1373 1373
 	/**
1374
-	* Gets all the spotter information based on the pilot
1375
-	*
1376
-	* @return Array the spotter information
1377
-	*
1378
-	*/
1374
+	 * Gets all the spotter information based on the pilot
1375
+	 *
1376
+	 * @return Array the spotter information
1377
+	 *
1378
+	 */
1379 1379
 	public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array())
1380 1380
 	{
1381 1381
 		global $global_query;
@@ -1424,11 +1424,11 @@  discard block
 block discarded – undo
1424 1424
 	
1425 1425
 	
1426 1426
 	/**
1427
-	* Gets all the spotter information based on the aircraft type
1428
-	*
1429
-	* @return Array the spotter information
1430
-	*
1431
-	*/
1427
+	 * Gets all the spotter information based on the aircraft type
1428
+	 *
1429
+	 * @return Array the spotter information
1430
+	 *
1431
+	 */
1432 1432
 	public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array())
1433 1433
 	{
1434 1434
 		global $global_query;
@@ -1482,11 +1482,11 @@  discard block
 block discarded – undo
1482 1482
 	
1483 1483
 	
1484 1484
 	/**
1485
-	* Gets all the spotter information based on the aircraft registration
1486
-	*
1487
-	* @return Array the spotter information
1488
-	*
1489
-	*/
1485
+	 * Gets all the spotter information based on the aircraft registration
1486
+	 *
1487
+	 * @return Array the spotter information
1488
+	 *
1489
+	 */
1490 1490
 	public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array())
1491 1491
 	{
1492 1492
 		global $global_query;
@@ -1543,11 +1543,11 @@  discard block
 block discarded – undo
1543 1543
 	
1544 1544
 	
1545 1545
 	/**
1546
-	* Gets all the spotter information based on the airline
1547
-	*
1548
-	* @return Array the spotter information
1549
-	*
1550
-	*/
1546
+	 * Gets all the spotter information based on the airline
1547
+	 *
1548
+	 * @return Array the spotter information
1549
+	 *
1550
+	 */
1551 1551
 	public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array())
1552 1552
 	{
1553 1553
 		global $global_query;
@@ -1600,11 +1600,11 @@  discard block
 block discarded – undo
1600 1600
 	
1601 1601
 	
1602 1602
 	/**
1603
-	* Gets all the spotter information based on the airport
1604
-	*
1605
-	* @return Array the spotter information
1606
-	*
1607
-	*/
1603
+	 * Gets all the spotter information based on the airport
1604
+	 *
1605
+	 * @return Array the spotter information
1606
+	 *
1607
+	 */
1608 1608
 	public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array())
1609 1609
 	{
1610 1610
 		global $global_query;
@@ -1658,11 +1658,11 @@  discard block
 block discarded – undo
1658 1658
 
1659 1659
 
1660 1660
 	/**
1661
-	* Gets all the spotter information based on the date
1662
-	*
1663
-	* @return Array the spotter information
1664
-	*
1665
-	*/
1661
+	 * Gets all the spotter information based on the date
1662
+	 *
1663
+	 * @return Array the spotter information
1664
+	 *
1665
+	 */
1666 1666
 	public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array())
1667 1667
 	{
1668 1668
 		global $global_query, $globalTimezone, $globalDBdriver;
@@ -1726,11 +1726,11 @@  discard block
 block discarded – undo
1726 1726
 
1727 1727
 
1728 1728
 	/**
1729
-	* Gets all the spotter information based on the country name
1730
-	*
1731
-	* @return Array the spotter information
1732
-	*
1733
-	*/
1729
+	 * Gets all the spotter information based on the country name
1730
+	 *
1731
+	 * @return Array the spotter information
1732
+	 *
1733
+	 */
1734 1734
 	public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array())
1735 1735
 	{
1736 1736
 		global $global_query;
@@ -1784,11 +1784,11 @@  discard block
 block discarded – undo
1784 1784
 	
1785 1785
 	
1786 1786
 	/**
1787
-	* Gets all the spotter information based on the manufacturer name
1788
-	*
1789
-	* @return Array the spotter information
1790
-	*
1791
-	*/
1787
+	 * Gets all the spotter information based on the manufacturer name
1788
+	 *
1789
+	 * @return Array the spotter information
1790
+	 *
1791
+	 */
1792 1792
 	public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array())
1793 1793
 	{
1794 1794
 		global $global_query;
@@ -1844,13 +1844,13 @@  discard block
 block discarded – undo
1844 1844
   
1845 1845
   
1846 1846
 	/**
1847
-	* Gets a list of all aircraft that take a route
1848
-	*
1849
-	* @param String $departure_airport_icao ICAO code of departure airport
1850
-	* @param String $arrival_airport_icao ICAO code of arrival airport
1851
-	* @return Array the spotter information
1852
-	*
1853
-	*/
1847
+	 * Gets a list of all aircraft that take a route
1848
+	 *
1849
+	 * @param String $departure_airport_icao ICAO code of departure airport
1850
+	 * @param String $arrival_airport_icao ICAO code of arrival airport
1851
+	 * @return Array the spotter information
1852
+	 *
1853
+	 */
1854 1854
 	public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array())
1855 1855
 	{
1856 1856
 		global $global_query;
@@ -1919,11 +1919,11 @@  discard block
 block discarded – undo
1919 1919
 	
1920 1920
 	
1921 1921
 	/**
1922
-	* Gets all the spotter information based on the special column in the table
1923
-	*
1924
-	* @return Array the spotter information
1925
-	*
1926
-	*/
1922
+	 * Gets all the spotter information based on the special column in the table
1923
+	 *
1924
+	 * @return Array the spotter information
1925
+	 *
1926
+	 */
1927 1927
 	public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array())
1928 1928
 	{
1929 1929
 		global $global_query;
@@ -1962,11 +1962,11 @@  discard block
 block discarded – undo
1962 1962
 	}
1963 1963
 
1964 1964
 	/**
1965
-	* Gets all the highlight based on a aircraft registration
1966
-	*
1967
-	* @return String the highlight text
1968
-	*
1969
-	*/
1965
+	 * Gets all the highlight based on a aircraft registration
1966
+	 *
1967
+	 * @return String the highlight text
1968
+	 *
1969
+	 */
1970 1970
 	public function getHighlightByRegistration($registration,$filter = array())
1971 1971
 	{
1972 1972
 		global $global_query;
@@ -1988,13 +1988,13 @@  discard block
 block discarded – undo
1988 1988
 
1989 1989
 	
1990 1990
 	/**
1991
-	* Gets the squawk usage from squawk code
1992
-	*
1993
-	* @param String $squawk squawk code
1994
-	* @param String $country country
1995
-	* @return String usage
1996
-	*
1997
-	*/
1991
+	 * Gets the squawk usage from squawk code
1992
+	 *
1993
+	 * @param String $squawk squawk code
1994
+	 * @param String $country country
1995
+	 * @return String usage
1996
+	 *
1997
+	 */
1998 1998
 	public function getSquawkUsage($squawk = '',$country = 'FR')
1999 1999
 	{
2000 2000
 		
@@ -2015,12 +2015,12 @@  discard block
 block discarded – undo
2015 2015
 	}
2016 2016
 
2017 2017
 	/**
2018
-	* Gets the airport icao from the iata
2019
-	*
2020
-	* @param String $airport_iata the iata code of the airport
2021
-	* @return String airport iata
2022
-	*
2023
-	*/
2018
+	 * Gets the airport icao from the iata
2019
+	 *
2020
+	 * @param String $airport_iata the iata code of the airport
2021
+	 * @return String airport iata
2022
+	 *
2023
+	 */
2024 2024
 	public function getAirportIcao($airport_iata = '')
2025 2025
 	{
2026 2026
 		
@@ -2040,14 +2040,14 @@  discard block
 block discarded – undo
2040 2040
 	}
2041 2041
 
2042 2042
 	/**
2043
-	* Gets the airport distance
2044
-	*
2045
-	* @param String $airport_icao the icao code of the airport
2046
-	* @param Float $latitude the latitude
2047
-	* @param Float $longitude the longitude
2048
-	* @return Float distance to the airport
2049
-	*
2050
-	*/
2043
+	 * Gets the airport distance
2044
+	 *
2045
+	 * @param String $airport_icao the icao code of the airport
2046
+	 * @param Float $latitude the latitude
2047
+	 * @param Float $longitude the longitude
2048
+	 * @return Float distance to the airport
2049
+	 *
2050
+	 */
2051 2051
 	public function getAirportDistance($airport_icao,$latitude,$longitude)
2052 2052
 	{
2053 2053
 		
@@ -2068,12 +2068,12 @@  discard block
 block discarded – undo
2068 2068
 	}
2069 2069
 	
2070 2070
 	/**
2071
-	* Gets the airport info based on the icao
2072
-	*
2073
-	* @param String $airport the icao code of the airport
2074
-	* @return Array airport information
2075
-	*
2076
-	*/
2071
+	 * Gets the airport info based on the icao
2072
+	 *
2073
+	 * @param String $airport the icao code of the airport
2074
+	 * @return Array airport information
2075
+	 *
2076
+	 */
2077 2077
 	public function getAllAirportInfo($airport = '')
2078 2078
 	{
2079 2079
 		
@@ -2119,12 +2119,12 @@  discard block
 block discarded – undo
2119 2119
 	}
2120 2120
 	
2121 2121
 	/**
2122
-	* Gets the airport info based on the country
2123
-	*
2124
-	* @param Array $countries Airports countries
2125
-	* @return Array airport information
2126
-	*
2127
-	*/
2122
+	 * Gets the airport info based on the country
2123
+	 *
2124
+	 * @param Array $countries Airports countries
2125
+	 * @return Array airport information
2126
+	 *
2127
+	 */
2128 2128
 	public function getAllAirportInfobyCountry($countries)
2129 2129
 	{
2130 2130
 		$lst_countries = '';
@@ -2162,12 +2162,12 @@  discard block
 block discarded – undo
2162 2162
 	}
2163 2163
 	
2164 2164
 	/**
2165
-	* Gets airports info based on the coord
2166
-	*
2167
-	* @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
2168
-	* @return Array airport information
2169
-	*
2170
-	*/
2165
+	 * Gets airports info based on the coord
2166
+	 *
2167
+	 * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
2168
+	 * @return Array airport information
2169
+	 *
2170
+	 */
2171 2171
 	public function getAllAirportInfobyCoord($coord)
2172 2172
 	{
2173 2173
 		global $globalDBdriver;
@@ -2198,12 +2198,12 @@  discard block
 block discarded – undo
2198 2198
 	}
2199 2199
 
2200 2200
 	/**
2201
-	* Gets waypoints info based on the coord
2202
-	*
2203
-	* @param Array $coord waypoints coord
2204
-	* @return Array airport information
2205
-	*
2206
-	*/
2201
+	 * Gets waypoints info based on the coord
2202
+	 *
2203
+	 * @param Array $coord waypoints coord
2204
+	 * @return Array airport information
2205
+	 *
2206
+	 */
2207 2207
 	public function getAllWaypointsInfobyCoord($coord)
2208 2208
 	{
2209 2209
 		if (is_array($coord)) {
@@ -2237,12 +2237,12 @@  discard block
 block discarded – undo
2237 2237
 	
2238 2238
 	
2239 2239
 	/**
2240
-	* Gets the airline info based on the icao code or iata code
2241
-	*
2242
-	* @param String $airline_icao the iata code of the airport
2243
-	* @return Array airport information
2244
-	*
2245
-	*/
2240
+	 * Gets the airline info based on the icao code or iata code
2241
+	 *
2242
+	 * @param String $airline_icao the iata code of the airport
2243
+	 * @return Array airport information
2244
+	 *
2245
+	 */
2246 2246
 	public function getAllAirlineInfo($airline_icao, $fromsource = NULL)
2247 2247
 	{
2248 2248
 		global $globalUseRealAirlines;
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
 			} else {
2274 2274
 				$sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource));
2275 2275
 			}
2276
-                        /*
2276
+						/*
2277 2277
 			$airline_array = array();
2278 2278
 			$temp_array = array();
2279 2279
 		
@@ -2306,12 +2306,12 @@  discard block
 block discarded – undo
2306 2306
 	}
2307 2307
 	
2308 2308
 	/**
2309
-	* Gets the airline info based on the airline name
2310
-	*
2311
-	* @param String $airline_name the name of the airline
2312
-	* @return Array airline information
2313
-	*
2314
-	*/
2309
+	 * Gets the airline info based on the airline name
2310
+	 *
2311
+	 * @param String $airline_name the name of the airline
2312
+	 * @return Array airline information
2313
+	 *
2314
+	 */
2315 2315
 	public function getAllAirlineInfoByName($airline_name, $fromsource = NULL)
2316 2316
 	{
2317 2317
 		global $globalUseRealAirlines;
@@ -2339,12 +2339,12 @@  discard block
 block discarded – undo
2339 2339
 	
2340 2340
 	
2341 2341
 	/**
2342
-	* Gets the aircraft info based on the aircraft type
2343
-	*
2344
-	* @param String $aircraft_type the aircraft type
2345
-	* @return Array aircraft information
2346
-	*
2347
-	*/
2342
+	 * Gets the aircraft info based on the aircraft type
2343
+	 *
2344
+	 * @param String $aircraft_type the aircraft type
2345
+	 * @return Array aircraft information
2346
+	 *
2347
+	 */
2348 2348
 	public function getAllAircraftInfo($aircraft_type)
2349 2349
 	{
2350 2350
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2376,12 +2376,12 @@  discard block
 block discarded – undo
2376 2376
 	}
2377 2377
 
2378 2378
 	/**
2379
-	* Gets the aircraft icao based on the aircraft name/type
2380
-	*
2381
-	* @param String $aircraft_type the aircraft type
2382
-	* @return String aircraft information
2383
-	*
2384
-	*/
2379
+	 * Gets the aircraft icao based on the aircraft name/type
2380
+	 *
2381
+	 * @param String $aircraft_type the aircraft type
2382
+	 * @return String aircraft information
2383
+	 *
2384
+	 */
2385 2385
 	public function getAircraftIcao($aircraft_type)
2386 2386
 	{
2387 2387
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2406,12 +2406,12 @@  discard block
 block discarded – undo
2406 2406
 	}
2407 2407
 	
2408 2408
 	/**
2409
-	* Gets the aircraft info based on the aircraft modes
2410
-	*
2411
-	* @param String $aircraft_modes the aircraft ident (hex)
2412
-	* @return String aircraft type
2413
-	*
2414
-	*/
2409
+	 * Gets the aircraft info based on the aircraft modes
2410
+	 *
2411
+	 * @param String $aircraft_modes the aircraft ident (hex)
2412
+	 * @return String aircraft type
2413
+	 *
2414
+	 */
2415 2415
 	public function getAllAircraftType($aircraft_modes,$source_type = '')
2416 2416
 	{
2417 2417
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -2438,12 +2438,12 @@  discard block
 block discarded – undo
2438 2438
 	}
2439 2439
 
2440 2440
 	/**
2441
-	* Gets the aircraft info based on the aircraft registration
2442
-	*
2443
-	* @param String $registration the aircraft registration
2444
-	* @return String aircraft type
2445
-	*
2446
-	*/
2441
+	 * Gets the aircraft info based on the aircraft registration
2442
+	 *
2443
+	 * @param String $registration the aircraft registration
2444
+	 * @return String aircraft type
2445
+	 *
2446
+	 */
2447 2447
 	public function getAllAircraftTypeByRegistration($registration)
2448 2448
 	{
2449 2449
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2461,12 +2461,12 @@  discard block
 block discarded – undo
2461 2461
 	}
2462 2462
 
2463 2463
 	/**
2464
-	* Gets the spotter_id and flightaware_id based on the aircraft registration
2465
-	*
2466
-	* @param String $registration the aircraft registration
2467
-	* @return Array spotter_id and flightaware_id
2468
-	*
2469
-	*/
2464
+	 * Gets the spotter_id and flightaware_id based on the aircraft registration
2465
+	 *
2466
+	 * @param String $registration the aircraft registration
2467
+	 * @return Array spotter_id and flightaware_id
2468
+	 *
2469
+	 */
2470 2470
 	public function getAllIDByRegistration($registration)
2471 2471
 	{
2472 2472
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2485,12 +2485,12 @@  discard block
 block discarded – undo
2485 2485
 	}
2486 2486
 
2487 2487
 	/**
2488
-	* Gets correct aircraft operator code
2489
-	*
2490
-	* @param String $operator the aircraft operator code (callsign)
2491
-	* @return String aircraft operator code
2492
-	*
2493
-	*/
2488
+	 * Gets correct aircraft operator code
2489
+	 *
2490
+	 * @param String $operator the aircraft operator code (callsign)
2491
+	 * @return String aircraft operator code
2492
+	 *
2493
+	 */
2494 2494
 	public function getOperator($operator)
2495 2495
 	{
2496 2496
 		$operator = filter_var($operator,FILTER_SANITIZE_STRING);
@@ -2507,16 +2507,16 @@  discard block
 block discarded – undo
2507 2507
 	}
2508 2508
 
2509 2509
 	/**
2510
-	* Gets the aircraft route based on the aircraft callsign
2511
-	*
2512
-	* @param String $callsign the aircraft callsign
2513
-	* @return Array aircraft type
2514
-	*
2515
-	*/
2510
+	 * Gets the aircraft route based on the aircraft callsign
2511
+	 *
2512
+	 * @param String $callsign the aircraft callsign
2513
+	 * @return Array aircraft type
2514
+	 *
2515
+	 */
2516 2516
 	public function getRouteInfo($callsign)
2517 2517
 	{
2518 2518
 		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
2519
-                if ($callsign == '') return array();
2519
+				if ($callsign == '') return array();
2520 2520
 		$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";
2521 2521
 		
2522 2522
 		$sth = $this->db->prepare($query);
@@ -2530,12 +2530,12 @@  discard block
 block discarded – undo
2530 2530
 	}
2531 2531
 	
2532 2532
 	/**
2533
-	* Gets the aircraft info based on the aircraft registration
2534
-	*
2535
-	* @param String $registration the aircraft registration
2536
-	* @return Array aircraft information
2537
-	*
2538
-	*/
2533
+	 * Gets the aircraft info based on the aircraft registration
2534
+	 *
2535
+	 * @param String $registration the aircraft registration
2536
+	 * @return Array aircraft information
2537
+	 *
2538
+	 */
2539 2539
 	public function getAircraftInfoByRegistration($registration)
2540 2540
 	{
2541 2541
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2562,12 +2562,12 @@  discard block
 block discarded – undo
2562 2562
 	}
2563 2563
 	
2564 2564
 	/**
2565
-	* Gets the aircraft owner & base based on the aircraft registration
2566
-	*
2567
-	* @param String $registration the aircraft registration
2568
-	* @return Array aircraft information
2569
-	*
2570
-	*/
2565
+	 * Gets the aircraft owner & base based on the aircraft registration
2566
+	 *
2567
+	 * @param String $registration the aircraft registration
2568
+	 * @return Array aircraft information
2569
+	 *
2570
+	 */
2571 2571
 	public function getAircraftOwnerByRegistration($registration)
2572 2572
 	{
2573 2573
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2584,11 +2584,11 @@  discard block
 block discarded – undo
2584 2584
 	
2585 2585
   
2586 2586
   /**
2587
-	* Gets all flights (but with only little info)
2588
-	*
2589
-	* @return Array basic flight information
2590
-	*
2591
-	*/
2587
+   * Gets all flights (but with only little info)
2588
+   *
2589
+   * @return Array basic flight information
2590
+   *
2591
+   */
2592 2592
 	public function getAllFlightsforSitemap()
2593 2593
 	{
2594 2594
 		//$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 ";
@@ -2596,7 +2596,7 @@  discard block
 block discarded – undo
2596 2596
 		
2597 2597
 		$sth = $this->db->prepare($query);
2598 2598
 		$sth->execute();
2599
-                  /*
2599
+				  /*
2600 2600
 		$flight_array = array();
2601 2601
 		$temp_array = array();
2602 2602
 		
@@ -2618,11 +2618,11 @@  discard block
 block discarded – undo
2618 2618
 	}
2619 2619
   
2620 2620
 	/**
2621
-	* Gets a list of all aircraft manufacturers
2622
-	*
2623
-	* @return Array list of aircraft types
2624
-	*
2625
-	*/
2621
+	 * Gets a list of all aircraft manufacturers
2622
+	 *
2623
+	 * @return Array list of aircraft types
2624
+	 *
2625
+	 */
2626 2626
 	public function getAllManufacturers()
2627 2627
 	{
2628 2628
 		/*
@@ -2651,11 +2651,11 @@  discard block
 block discarded – undo
2651 2651
   
2652 2652
   
2653 2653
   /**
2654
-	* Gets a list of all aircraft types
2655
-	*
2656
-	* @return Array list of aircraft types
2657
-	*
2658
-	*/
2654
+   * Gets a list of all aircraft types
2655
+   *
2656
+   * @return Array list of aircraft types
2657
+   *
2658
+   */
2659 2659
 	public function getAllAircraftTypes($filters = array())
2660 2660
 	{
2661 2661
 		/*
@@ -2690,11 +2690,11 @@  discard block
 block discarded – undo
2690 2690
 	
2691 2691
 	
2692 2692
 	/**
2693
-	* Gets a list of all aircraft registrations
2694
-	*
2695
-	* @return Array list of aircraft registrations
2696
-	*
2697
-	*/
2693
+	 * Gets a list of all aircraft registrations
2694
+	 *
2695
+	 * @return Array list of aircraft registrations
2696
+	 *
2697
+	 */
2698 2698
 	public function getAllAircraftRegistrations($filters = array())
2699 2699
 	{
2700 2700
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2719,12 +2719,12 @@  discard block
 block discarded – undo
2719 2719
 	}
2720 2720
 
2721 2721
 	/**
2722
-	* Gets all source name
2723
-	*
2724
-	* @param String type format of source
2725
-	* @return Array list of source name
2726
-	*
2727
-	*/
2722
+	 * Gets all source name
2723
+	 *
2724
+	 * @param String type format of source
2725
+	 * @return Array list of source name
2726
+	 *
2727
+	 */
2728 2728
 	public function getAllSourceName($type = '',$filters = array())
2729 2729
 	{
2730 2730
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2755,11 +2755,11 @@  discard block
 block discarded – undo
2755 2755
 
2756 2756
 
2757 2757
 	/**
2758
-	* Gets a list of all airline names
2759
-	*
2760
-	* @return Array list of airline names
2761
-	*
2762
-	*/
2758
+	 * Gets a list of all airline names
2759
+	 *
2760
+	 * @return Array list of airline names
2761
+	 *
2762
+	 */
2763 2763
 	public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array())
2764 2764
 	{
2765 2765
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
@@ -2808,11 +2808,11 @@  discard block
 block discarded – undo
2808 2808
 	}
2809 2809
 	
2810 2810
 	/**
2811
-	* Gets a list of all alliance names
2812
-	*
2813
-	* @return Array list of alliance names
2814
-	*
2815
-	*/
2811
+	 * Gets a list of all alliance names
2812
+	 *
2813
+	 * @return Array list of alliance names
2814
+	 *
2815
+	 */
2816 2816
 	public function getAllAllianceNames($forsource = NULL,$filters = array())
2817 2817
 	{
2818 2818
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
@@ -2837,11 +2837,11 @@  discard block
 block discarded – undo
2837 2837
 	}
2838 2838
 	
2839 2839
 	/**
2840
-	* Gets a list of all airline countries
2841
-	*
2842
-	* @return Array list of airline countries
2843
-	*
2844
-	*/
2840
+	 * Gets a list of all airline countries
2841
+	 *
2842
+	 * @return Array list of airline countries
2843
+	 *
2844
+	 */
2845 2845
 	public function getAllAirlineCountries($filters = array())
2846 2846
 	{
2847 2847
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2869,11 +2869,11 @@  discard block
 block discarded – undo
2869 2869
 	
2870 2870
 	
2871 2871
 	/**
2872
-	* Gets a list of all departure & arrival names
2873
-	*
2874
-	* @return Array list of airport names
2875
-	*
2876
-	*/
2872
+	 * Gets a list of all departure & arrival names
2873
+	 *
2874
+	 * @return Array list of airport names
2875
+	 *
2876
+	 */
2877 2877
 	public function getAllAirportNames($filters = array())
2878 2878
 	{
2879 2879
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2921,11 +2921,11 @@  discard block
 block discarded – undo
2921 2921
 	} 
2922 2922
 
2923 2923
 	/**
2924
-	* Gets a list of all owner names
2925
-	*
2926
-	* @return Array list of owner names
2927
-	*
2928
-	*/
2924
+	 * Gets a list of all owner names
2925
+	 *
2926
+	 * @return Array list of owner names
2927
+	 *
2928
+	 */
2929 2929
 	public function getAllOwnerNames($filters = array())
2930 2930
 	{
2931 2931
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2939,11 +2939,11 @@  discard block
 block discarded – undo
2939 2939
 	} 
2940 2940
 
2941 2941
 	/**
2942
-	* Gets a list of all pilot names and pilot ids
2943
-	*
2944
-	* @return Array list of pilot names and pilot ids
2945
-	*
2946
-	*/
2942
+	 * Gets a list of all pilot names and pilot ids
2943
+	 *
2944
+	 * @return Array list of pilot names and pilot ids
2945
+	 *
2946
+	 */
2947 2947
 	public function getAllPilotNames($filters = array())
2948 2948
 	{
2949 2949
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2958,11 +2958,11 @@  discard block
 block discarded – undo
2958 2958
 	
2959 2959
 	
2960 2960
 	/**
2961
-	* Gets a list of all departure & arrival airport countries
2962
-	*
2963
-	* @return Array list of airport countries
2964
-	*
2965
-	*/
2961
+	 * Gets a list of all departure & arrival airport countries
2962
+	 *
2963
+	 * @return Array list of airport countries
2964
+	 *
2965
+	 */
2966 2966
 	public function getAllAirportCountries($filters = array())
2967 2967
 	{
2968 2968
 		$airport_array = array();
@@ -3010,11 +3010,11 @@  discard block
 block discarded – undo
3010 3010
 	
3011 3011
 	
3012 3012
 	/**
3013
-	* Gets a list of all countries (airline, departure airport & arrival airport)
3014
-	*
3015
-	* @return Array list of countries
3016
-	*
3017
-	*/
3013
+	 * Gets a list of all countries (airline, departure airport & arrival airport)
3014
+	 *
3015
+	 * @return Array list of countries
3016
+	 *
3017
+	 */
3018 3018
 	public function getAllCountries($filters = array())
3019 3019
 	{
3020 3020
 		$Connection= new Connection($this->db);
@@ -3091,11 +3091,11 @@  discard block
 block discarded – undo
3091 3091
 	
3092 3092
 	
3093 3093
 	/**
3094
-	* Gets a list of all idents/callsigns
3095
-	*
3096
-	* @return Array list of ident/callsign names
3097
-	*
3098
-	*/
3094
+	 * Gets a list of all idents/callsigns
3095
+	 *
3096
+	 * @return Array list of ident/callsign names
3097
+	 *
3098
+	 */
3099 3099
 	public function getAllIdents($filters = array())
3100 3100
 	{
3101 3101
 		$filter_query = $this->getFilter($filters,true,true);
@@ -3119,9 +3119,9 @@  discard block
 block discarded – undo
3119 3119
 	}
3120 3120
 
3121 3121
 	/**
3122
-	* Get a list of flights from airport since 7 days
3123
-	* @return Array number, icao, name and city of airports
3124
-	*/
3122
+	 * Get a list of flights from airport since 7 days
3123
+	 * @return Array number, icao, name and city of airports
3124
+	 */
3125 3125
 
3126 3126
 	public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) {
3127 3127
 		global $globalTimezone, $globalDBdriver;
@@ -3152,9 +3152,9 @@  discard block
 block discarded – undo
3152 3152
 	}
3153 3153
 
3154 3154
 	/**
3155
-	* Get a list of flights from airport since 7 days
3156
-	* @return Array number, icao, name and city of airports
3157
-	*/
3155
+	 * Get a list of flights from airport since 7 days
3156
+	 * @return Array number, icao, name and city of airports
3157
+	 */
3158 3158
 
3159 3159
 	public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') {
3160 3160
 		global $globalTimezone, $globalDBdriver;
@@ -3184,9 +3184,9 @@  discard block
 block discarded – undo
3184 3184
 	}
3185 3185
 
3186 3186
 	/**
3187
-	* Get a list of flights from detected airport since 7 days
3188
-	* @return Array number, icao, name and city of airports
3189
-	*/
3187
+	 * Get a list of flights from detected airport since 7 days
3188
+	 * @return Array number, icao, name and city of airports
3189
+	 */
3190 3190
 
3191 3191
 	public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) {
3192 3192
 		global $globalTimezone, $globalDBdriver;
@@ -3224,9 +3224,9 @@  discard block
 block discarded – undo
3224 3224
 	}
3225 3225
 
3226 3226
 	/**
3227
-	* Get a list of flights from detected airport since 7 days
3228
-	* @return Array number, icao, name and city of airports
3229
-	*/
3227
+	 * Get a list of flights from detected airport since 7 days
3228
+	 * @return Array number, icao, name and city of airports
3229
+	 */
3230 3230
 
3231 3231
 	public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') {
3232 3232
 		global $globalTimezone, $globalDBdriver;
@@ -3268,9 +3268,9 @@  discard block
 block discarded – undo
3268 3268
 
3269 3269
 
3270 3270
 	/**
3271
-	* Get a list of flights to airport since 7 days
3272
-	* @return Array number, icao, name and city of airports
3273
-	*/
3271
+	 * Get a list of flights to airport since 7 days
3272
+	 * @return Array number, icao, name and city of airports
3273
+	 */
3274 3274
 
3275 3275
 	public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) {
3276 3276
 		global $globalTimezone, $globalDBdriver;
@@ -3303,9 +3303,9 @@  discard block
 block discarded – undo
3303 3303
 
3304 3304
 
3305 3305
 	/**
3306
-	* Get a list of flights detected to airport since 7 days
3307
-	* @return Array number, icao, name and city of airports
3308
-	*/
3306
+	 * Get a list of flights detected to airport since 7 days
3307
+	 * @return Array number, icao, name and city of airports
3308
+	 */
3309 3309
 
3310 3310
 	public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) {
3311 3311
 		global $globalTimezone, $globalDBdriver;
@@ -3346,9 +3346,9 @@  discard block
 block discarded – undo
3346 3346
 
3347 3347
 
3348 3348
 	/**
3349
-	* Get a list of flights to airport since 7 days
3350
-	* @return Array number, icao, name and city of airports
3351
-	*/
3349
+	 * Get a list of flights to airport since 7 days
3350
+	 * @return Array number, icao, name and city of airports
3351
+	 */
3352 3352
 
3353 3353
 	public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') {
3354 3354
 		global $globalTimezone, $globalDBdriver;
@@ -3380,9 +3380,9 @@  discard block
 block discarded – undo
3380 3380
 
3381 3381
 
3382 3382
 	/**
3383
-	* Get a list of flights detected to airport since 7 days
3384
-	* @return Array number, icao, name and city of airports
3385
-	*/
3383
+	 * Get a list of flights detected to airport since 7 days
3384
+	 * @return Array number, icao, name and city of airports
3385
+	 */
3386 3386
 
3387 3387
 	public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') {
3388 3388
 		global $globalTimezone, $globalDBdriver;
@@ -3426,11 +3426,11 @@  discard block
 block discarded – undo
3426 3426
 
3427 3427
 
3428 3428
 	/**
3429
-	* Gets a list of all dates
3430
-	*
3431
-	* @return Array list of date names
3432
-	*
3433
-	*/
3429
+	 * Gets a list of all dates
3430
+	 *
3431
+	 * @return Array list of date names
3432
+	 *
3433
+	 */
3434 3434
 	public function getAllDates()
3435 3435
 	{
3436 3436
 		global $globalTimezone, $globalDBdriver;
@@ -3471,11 +3471,11 @@  discard block
 block discarded – undo
3471 3471
 	
3472 3472
 	
3473 3473
 	/**
3474
-	* Gets all route combinations
3475
-	*
3476
-	* @return Array the route list
3477
-	*
3478
-	*/
3474
+	 * Gets all route combinations
3475
+	 *
3476
+	 * @return Array the route list
3477
+	 *
3478
+	 */
3479 3479
 	public function getAllRoutes()
3480 3480
 	{
3481 3481
 		$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 
@@ -3501,13 +3501,13 @@  discard block
 block discarded – undo
3501 3501
 	}
3502 3502
 
3503 3503
 	/**
3504
-	* Update ident spotter data
3505
-	*
3506
-	* @param String $flightaware_id the ID from flightaware
3507
-	* @param String $ident the flight ident
3508
-	* @return String success or false
3509
-	*
3510
-	*/	
3504
+	 * Update ident spotter data
3505
+	 *
3506
+	 * @param String $flightaware_id the ID from flightaware
3507
+	 * @param String $ident the flight ident
3508
+	 * @return String success or false
3509
+	 *
3510
+	 */	
3511 3511
 	public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL)
3512 3512
 	{
3513 3513
 		if (!is_numeric(substr($ident, 0, 3)))
@@ -3528,14 +3528,14 @@  discard block
 block discarded – undo
3528 3528
 		} else {
3529 3529
 			$airline_array = $this->getAllAirlineInfo("NA");
3530 3530
 		}
3531
-                $airline_name = $airline_array[0]['name'];
3532
-                $airline_icao = $airline_array[0]['icao'];
3533
-                $airline_country = $airline_array[0]['country'];
3534
-                $airline_type = $airline_array[0]['type'];
3531
+				$airline_name = $airline_array[0]['name'];
3532
+				$airline_icao = $airline_array[0]['icao'];
3533
+				$airline_country = $airline_array[0]['country'];
3534
+				$airline_type = $airline_array[0]['type'];
3535 3535
 
3536 3536
 
3537 3537
 		$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';
3538
-                $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);
3538
+				$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);
3539 3539
 
3540 3540
 		try {
3541 3541
 			$sth = $this->db->prepare($query);
@@ -3548,19 +3548,19 @@  discard block
 block discarded – undo
3548 3548
 
3549 3549
 	}
3550 3550
 	/**
3551
-	* Update latest spotter data
3552
-	*
3553
-	* @param String $flightaware_id the ID from flightaware
3554
-	* @param String $ident the flight ident
3555
-	* @param String $arrival_airport_icao the arrival airport
3556
-	* @return String success or false
3557
-	*
3558
-	*/	
3551
+	 * Update latest spotter data
3552
+	 *
3553
+	 * @param String $flightaware_id the ID from flightaware
3554
+	 * @param String $ident the flight ident
3555
+	 * @param String $arrival_airport_icao the arrival airport
3556
+	 * @return String success or false
3557
+	 *
3558
+	 */	
3559 3559
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3560 3560
 	{
3561 3561
 		if ($groundspeed == '') $groundspeed = NULL;
3562 3562
 		$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';
3563
-                $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);
3563
+				$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);
3564 3564
 
3565 3565
 		try {
3566 3566
 			$sth = $this->db->prepare($query);
@@ -3574,32 +3574,32 @@  discard block
 block discarded – undo
3574 3574
 	}
3575 3575
 
3576 3576
 	/**
3577
-	* Adds a new spotter data
3578
-	*
3579
-	* @param String $flightaware_id the ID from flightaware
3580
-	* @param String $ident the flight ident
3581
-	* @param String $aircraft_icao the aircraft type
3582
-	* @param String $departure_airport_icao the departure airport
3583
-	* @param String $arrival_airport_icao the arrival airport
3584
-	* @param String $latitude latitude of flight
3585
-	* @param String $longitude latitude of flight
3586
-	* @param String $waypoints waypoints of flight
3587
-	* @param String $altitude altitude of flight
3588
-	* @param String $heading heading of flight
3589
-	* @param String $groundspeed speed of flight
3590
-	* @param String $date date of flight
3591
-	* @param String $departure_airport_time departure time of flight
3592
-	* @param String $arrival_airport_time arrival time of flight
3593
-	* @param String $squawk squawk code of flight
3594
-	* @param String $route_stop route stop of flight
3595
-	* @param String $highlight highlight or not
3596
-	* @param String $ModeS ModesS code of flight
3597
-	* @param String $registration registration code of flight
3598
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
3599
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
3600
-	* @param String $verticalrate vertival rate of flight
3601
-	* @return String success or false
3602
-	*/
3577
+	 * Adds a new spotter data
3578
+	 *
3579
+	 * @param String $flightaware_id the ID from flightaware
3580
+	 * @param String $ident the flight ident
3581
+	 * @param String $aircraft_icao the aircraft type
3582
+	 * @param String $departure_airport_icao the departure airport
3583
+	 * @param String $arrival_airport_icao the arrival airport
3584
+	 * @param String $latitude latitude of flight
3585
+	 * @param String $longitude latitude of flight
3586
+	 * @param String $waypoints waypoints of flight
3587
+	 * @param String $altitude altitude of flight
3588
+	 * @param String $heading heading of flight
3589
+	 * @param String $groundspeed speed of flight
3590
+	 * @param String $date date of flight
3591
+	 * @param String $departure_airport_time departure time of flight
3592
+	 * @param String $arrival_airport_time arrival time of flight
3593
+	 * @param String $squawk squawk code of flight
3594
+	 * @param String $route_stop route stop of flight
3595
+	 * @param String $highlight highlight or not
3596
+	 * @param String $ModeS ModesS code of flight
3597
+	 * @param String $registration registration code of flight
3598
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
3599
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
3600
+	 * @param String $verticalrate vertival rate of flight
3601
+	 * @return String success or false
3602
+	 */
3603 3603
 	public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$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 = '',$source_type = '')
3604 3604
 	{
3605 3605
 		global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM;
@@ -3814,8 +3814,8 @@  discard block
 block discarded – undo
3814 3814
     
3815 3815
 		if ($globalIVAO && $aircraft_icao != '')
3816 3816
 		{
3817
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3818
-            		else $airline_icao = '';
3817
+					if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3818
+					else $airline_icao = '';
3819 3819
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3820 3820
 			if (!isset($image_array[0]['registration']))
3821 3821
 			{
@@ -3846,53 +3846,53 @@  discard block
 block discarded – undo
3846 3846
 	
3847 3847
 		if (count($airline_array) == 0) 
3848 3848
 		{
3849
-                        $airline_array = $this->getAllAirlineInfo('NA');
3850
-                }
3851
-                if (count($aircraft_array) == 0) 
3852
-                {
3853
-                        $aircraft_array = $this->getAllAircraftInfo('NA');
3854
-                }
3855
-                if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3856
-                {
3857
-                        $departure_airport_array = $this->getAllAirportInfo('NA');
3858
-                }
3859
-                if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3860
-                {
3861
-                        $arrival_airport_array = $this->getAllAirportInfo('NA');
3862
-                }
3863
-                if ($registration == '') $registration = 'NA';
3864
-                if ($latitude == '' && $longitude == '') {
3865
-            		$latitude = 0;
3866
-            		$longitude = 0;
3867
-            	}
3868
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3869
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3870
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3871
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3872
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3873
-                $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) 
3849
+						$airline_array = $this->getAllAirlineInfo('NA');
3850
+				}
3851
+				if (count($aircraft_array) == 0) 
3852
+				{
3853
+						$aircraft_array = $this->getAllAircraftInfo('NA');
3854
+				}
3855
+				if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3856
+				{
3857
+						$departure_airport_array = $this->getAllAirportInfo('NA');
3858
+				}
3859
+				if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3860
+				{
3861
+						$arrival_airport_array = $this->getAllAirportInfo('NA');
3862
+				}
3863
+				if ($registration == '') $registration = 'NA';
3864
+				if ($latitude == '' && $longitude == '') {
3865
+					$latitude = 0;
3866
+					$longitude = 0;
3867
+				}
3868
+				if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3869
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3870
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3871
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3872
+				if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3873
+				$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) 
3874 3874
                 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)";
3875 3875
 
3876
-                $airline_name = $airline_array[0]['name'];
3877
-                $airline_icao = $airline_array[0]['icao'];
3878
-                $airline_country = $airline_array[0]['country'];
3879
-                $airline_type = $airline_array[0]['type'];
3876
+				$airline_name = $airline_array[0]['name'];
3877
+				$airline_icao = $airline_array[0]['icao'];
3878
+				$airline_country = $airline_array[0]['country'];
3879
+				$airline_type = $airline_array[0]['type'];
3880 3880
 		if ($airline_type == '') {
3881 3881
 			$timeelapsed = microtime(true);
3882 3882
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3883 3883
 			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3884 3884
 		}
3885 3885
 		if ($airline_type == null) $airline_type = '';
3886
-                $aircraft_type = $aircraft_array[0]['type'];
3887
-                $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3888
-                $departure_airport_name = $departure_airport_array[0]['name'];
3889
-	        $departure_airport_city = $departure_airport_array[0]['city'];
3890
-            	$departure_airport_country = $departure_airport_array[0]['country'];
3886
+				$aircraft_type = $aircraft_array[0]['type'];
3887
+				$aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3888
+				$departure_airport_name = $departure_airport_array[0]['name'];
3889
+			$departure_airport_city = $departure_airport_array[0]['city'];
3890
+				$departure_airport_country = $departure_airport_array[0]['country'];
3891 3891
                 
3892
-                $arrival_airport_name = $arrival_airport_array[0]['name'];
3893
-                $arrival_airport_city = $arrival_airport_array[0]['city'];
3894
-                $arrival_airport_country = $arrival_airport_array[0]['country'];
3895
-                $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);
3892
+				$arrival_airport_name = $arrival_airport_array[0]['name'];
3893
+				$arrival_airport_city = $arrival_airport_array[0]['city'];
3894
+				$arrival_airport_country = $arrival_airport_array[0]['country'];
3895
+				$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);
3896 3896
 
3897 3897
 		try {
3898 3898
 		        
@@ -3900,7 +3900,7 @@  discard block
 block discarded – undo
3900 3900
 			$sth->execute($query_values);
3901 3901
 			$this->db = null;
3902 3902
 		} catch (PDOException $e) {
3903
-		    return "error : ".$e->getMessage();
3903
+			return "error : ".$e->getMessage();
3904 3904
 		}
3905 3905
 		
3906 3906
 		return "success";
@@ -3909,11 +3909,11 @@  discard block
 block discarded – undo
3909 3909
 	
3910 3910
   
3911 3911
 	/**
3912
-	* Gets the aircraft ident within the last hour
3913
-	*
3914
-	* @return String the ident
3915
-	*
3916
-	*/
3912
+	 * Gets the aircraft ident within the last hour
3913
+	 *
3914
+	 * @return String the ident
3915
+	 *
3916
+	 */
3917 3917
 	public function getIdentFromLastHour($ident)
3918 3918
 	{
3919 3919
 		global $globalDBdriver, $globalTimezone;
@@ -3929,11 +3929,11 @@  discard block
 block discarded – undo
3929 3929
 								AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
3930 3930
 								AND spotter_output.date < now() AT TIME ZONE 'UTC'";
3931 3931
 			$query_data = array(':ident' => $ident);
3932
-    		}
3932
+			}
3933 3933
 		
3934 3934
 		$sth = $this->db->prepare($query);
3935 3935
 		$sth->execute($query_data);
3936
-    		$ident_result='';
3936
+			$ident_result='';
3937 3937
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
3938 3938
 		{
3939 3939
 			$ident_result = $row['ident'];
@@ -3944,11 +3944,11 @@  discard block
 block discarded – undo
3944 3944
 	
3945 3945
 	
3946 3946
 	/**
3947
-	* Gets the aircraft data from the last 20 seconds
3948
-	*
3949
-	* @return Array the spotter data
3950
-	*
3951
-	*/
3947
+	 * Gets the aircraft data from the last 20 seconds
3948
+	 *
3949
+	 * @return Array the spotter data
3950
+	 *
3951
+	 */
3952 3952
 	public function getRealTimeData($q = '')
3953 3953
 	{
3954 3954
 		global $globalDBdriver;
@@ -3992,11 +3992,11 @@  discard block
 block discarded – undo
3992 3992
 	
3993 3993
 	
3994 3994
 	 /**
3995
-	* Gets all airlines that have flown over
3996
-	*
3997
-	* @return Array the airline list
3998
-	*
3999
-	*/
3995
+	  * Gets all airlines that have flown over
3996
+	  *
3997
+	  * @return Array the airline list
3998
+	  *
3999
+	  */
4000 4000
 	public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '')
4001 4001
 	{
4002 4002
 		global $globalDBdriver;
@@ -4010,7 +4010,7 @@  discard block
 block discarded – undo
4010 4010
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4011 4011
 			}
4012 4012
 		}
4013
-                if ($sincedate != '') {
4013
+				if ($sincedate != '') {
4014 4014
 			if ($globalDBdriver == 'mysql') {
4015 4015
 				$query .= " AND spotter_output.date > '".$sincedate."'";
4016 4016
 			} else {
@@ -4064,26 +4064,26 @@  discard block
 block discarded – undo
4064 4064
 	}
4065 4065
 
4066 4066
 	 /**
4067
-	* Gets all pilots that have flown over
4068
-	*
4069
-	* @return Array the pilots list
4070
-	*
4071
-	*/
4067
+	  * Gets all pilots that have flown over
4068
+	  *
4069
+	  * @return Array the pilots list
4070
+	  *
4071
+	  */
4072 4072
 	public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '')
4073 4073
 	{
4074 4074
 		global $globalDBdriver;
4075 4075
 		$filter_query = $this->getFilter($filters,true,true);
4076 4076
 		$query  = "SELECT DISTINCT spotter_output.pilot_id, s.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
4077 4077
 			FROM spotter_output LEFT JOIN (SELECT DISTINCT pilot_id, pilot_name, max(date) as date FROM spotter_output GROUP BY pilot_id, pilot_name) s ON s.pilot_id = spotter_output.pilot_id".$filter_query." spotter_output.pilot_id <> ''";
4078
-                if ($olderthanmonths > 0) {
4079
-            		if ($globalDBdriver == 'mysql') {
4078
+				if ($olderthanmonths > 0) {
4079
+					if ($globalDBdriver == 'mysql') {
4080 4080
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
4081 4081
 			} else {
4082 4082
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4083 4083
 			}
4084 4084
 		}
4085
-                if ($sincedate != '') {
4086
-            		if ($globalDBdriver == 'mysql') {
4085
+				if ($sincedate != '') {
4086
+					if ($globalDBdriver == 'mysql') {
4087 4087
 				$query .= " AND spotter_output.date > '".$sincedate."'";
4088 4088
 			} else {
4089 4089
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4138,25 +4138,25 @@  discard block
 block discarded – undo
4138 4138
 	}
4139 4139
 	
4140 4140
 	/**
4141
-	* Gets all pilots that have flown over
4142
-	*
4143
-	* @return Array the pilots list
4144
-	*
4145
-	*/
4141
+	 * Gets all pilots that have flown over
4142
+	 *
4143
+	 * @return Array the pilots list
4144
+	 *
4145
+	 */
4146 4146
 	public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
4147 4147
 	{
4148 4148
 		global $globalDBdriver;
4149 4149
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
4150 4150
 		 			FROM spotter_output WHERE spotter_output.pilot_id <> '' ";
4151
-                if ($olderthanmonths > 0) {
4152
-            		if ($globalDBdriver == 'mysql') {
4151
+				if ($olderthanmonths > 0) {
4152
+					if ($globalDBdriver == 'mysql') {
4153 4153
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4154 4154
 			} else {
4155 4155
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4156 4156
 			}
4157 4157
 		}
4158
-                if ($sincedate != '') {
4159
-            		if ($globalDBdriver == 'mysql') {
4158
+				if ($sincedate != '') {
4159
+					if ($globalDBdriver == 'mysql') {
4160 4160
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4161 4161
 			} else {
4162 4162
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4185,26 +4185,26 @@  discard block
 block discarded – undo
4185 4185
 	}
4186 4186
 	
4187 4187
 	 /**
4188
-	* Gets all owner that have flown over
4189
-	*
4190
-	* @return Array the pilots list
4191
-	*
4192
-	*/
4188
+	  * Gets all owner that have flown over
4189
+	  *
4190
+	  * @return Array the pilots list
4191
+	  *
4192
+	  */
4193 4193
 	public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
4194 4194
 	{
4195 4195
 		global $globalDBdriver;
4196 4196
 		$filter_query = $this->getFilter($filters,true,true);
4197 4197
 		$query  = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4198 4198
 					FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL";
4199
-                if ($olderthanmonths > 0) {
4200
-            		if ($globalDBdriver == 'mysql') {
4199
+				if ($olderthanmonths > 0) {
4200
+					if ($globalDBdriver == 'mysql') {
4201 4201
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
4202 4202
 			} else {
4203 4203
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4204 4204
 			}
4205 4205
 		}
4206
-                if ($sincedate != '') {
4207
-            		if ($globalDBdriver == 'mysql') {
4206
+				if ($sincedate != '') {
4207
+					if ($globalDBdriver == 'mysql') {
4208 4208
 				$query .= " AND spotter_output.date > '".$sincedate."' ";
4209 4209
 			} else {
4210 4210
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4255,26 +4255,26 @@  discard block
 block discarded – undo
4255 4255
 	}
4256 4256
 	
4257 4257
 	 /**
4258
-	* Gets all owner that have flown over
4259
-	*
4260
-	* @return Array the pilots list
4261
-	*
4262
-	*/
4258
+	  * Gets all owner that have flown over
4259
+	  *
4260
+	  * @return Array the pilots list
4261
+	  *
4262
+	  */
4263 4263
 	public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
4264 4264
 	{
4265 4265
 		global $globalDBdriver;
4266 4266
 		$filter_query = $this->getFilter($filters,true,true);
4267 4267
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4268 4268
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
4269
-                if ($olderthanmonths > 0) {
4270
-            		if ($globalDBdriver == 'mysql') {
4269
+				if ($olderthanmonths > 0) {
4270
+					if ($globalDBdriver == 'mysql') {
4271 4271
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4272 4272
 			} else {
4273 4273
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4274 4274
 			}
4275 4275
 		}
4276
-                if ($sincedate != '') {
4277
-            		if ($globalDBdriver == 'mysql') {
4276
+				if ($sincedate != '') {
4277
+					if ($globalDBdriver == 'mysql') {
4278 4278
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4279 4279
 			} else {
4280 4280
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4301,11 +4301,11 @@  discard block
 block discarded – undo
4301 4301
 	}
4302 4302
 
4303 4303
 	/**
4304
-	* Gets all airlines that have flown over by aircraft
4305
-	*
4306
-	* @return Array the airline list
4307
-	*
4308
-	*/
4304
+	 * Gets all airlines that have flown over by aircraft
4305
+	 *
4306
+	 * @return Array the airline list
4307
+	 *
4308
+	 */
4309 4309
 	public function countAllAirlinesByAircraft($aircraft_icao,$filters = array())
4310 4310
 	{
4311 4311
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -4337,11 +4337,11 @@  discard block
 block discarded – undo
4337 4337
 
4338 4338
 
4339 4339
 	/**
4340
-	* Gets all airline countries that have flown over by aircraft
4341
-	*
4342
-	* @return Array the airline country list
4343
-	*
4344
-	*/
4340
+	 * Gets all airline countries that have flown over by aircraft
4341
+	 *
4342
+	 * @return Array the airline country list
4343
+	 *
4344
+	 */
4345 4345
 	public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array())
4346 4346
 	{
4347 4347
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -4373,11 +4373,11 @@  discard block
 block discarded – undo
4373 4373
 	
4374 4374
 	
4375 4375
 	/**
4376
-	* Gets all airlines that have flown over by airport
4377
-	*
4378
-	* @return Array the airline list
4379
-	*
4380
-	*/
4376
+	 * Gets all airlines that have flown over by airport
4377
+	 *
4378
+	 * @return Array the airline list
4379
+	 *
4380
+	 */
4381 4381
 	public function countAllAirlinesByAirport($airport_icao,$filters = array())
4382 4382
 	{
4383 4383
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4408,11 +4408,11 @@  discard block
 block discarded – undo
4408 4408
 
4409 4409
 
4410 4410
 	/**
4411
-	* Gets all airline countries that have flown over by airport icao
4412
-	*
4413
-	* @return Array the airline country list
4414
-	*
4415
-	*/
4411
+	 * Gets all airline countries that have flown over by airport icao
4412
+	 *
4413
+	 * @return Array the airline country list
4414
+	 *
4415
+	 */
4416 4416
 	public function countAllAirlineCountriesByAirport($airport_icao,$filters = array())
4417 4417
 	{
4418 4418
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4442,11 +4442,11 @@  discard block
 block discarded – undo
4442 4442
 
4443 4443
 
4444 4444
 	/**
4445
-	* Gets all airlines that have flown over by aircraft manufacturer
4446
-	*
4447
-	* @return Array the airline list
4448
-	*
4449
-	*/
4445
+	 * Gets all airlines that have flown over by aircraft manufacturer
4446
+	 *
4447
+	 * @return Array the airline list
4448
+	 *
4449
+	 */
4450 4450
 	public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array())
4451 4451
 	{
4452 4452
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4477,11 +4477,11 @@  discard block
 block discarded – undo
4477 4477
 
4478 4478
 
4479 4479
 	/**
4480
-	* Gets all airline countries that have flown over by aircraft manufacturer
4481
-	*
4482
-	* @return Array the airline country list
4483
-	*
4484
-	*/
4480
+	 * Gets all airline countries that have flown over by aircraft manufacturer
4481
+	 *
4482
+	 * @return Array the airline country list
4483
+	 *
4484
+	 */
4485 4485
 	public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array())
4486 4486
 	{
4487 4487
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4510,11 +4510,11 @@  discard block
 block discarded – undo
4510 4510
 
4511 4511
 
4512 4512
 	/**
4513
-	* Gets all airlines that have flown over by date
4514
-	*
4515
-	* @return Array the airline list
4516
-	*
4517
-	*/
4513
+	 * Gets all airlines that have flown over by date
4514
+	 *
4515
+	 * @return Array the airline list
4516
+	 *
4517
+	 */
4518 4518
 	public function countAllAirlinesByDate($date,$filters = array())
4519 4519
 	{
4520 4520
 		global $globalTimezone, $globalDBdriver;
@@ -4558,11 +4558,11 @@  discard block
 block discarded – undo
4558 4558
 	
4559 4559
 	
4560 4560
 	/**
4561
-	* Gets all airline countries that have flown over by date
4562
-	*
4563
-	* @return Array the airline country list
4564
-	*
4565
-	*/
4561
+	 * Gets all airline countries that have flown over by date
4562
+	 *
4563
+	 * @return Array the airline country list
4564
+	 *
4565
+	 */
4566 4566
 	public function countAllAirlineCountriesByDate($date,$filters = array())
4567 4567
 	{
4568 4568
 		global $globalTimezone, $globalDBdriver;
@@ -4605,11 +4605,11 @@  discard block
 block discarded – undo
4605 4605
 
4606 4606
 
4607 4607
 	/**
4608
-	* Gets all airlines that have flown over by ident/callsign
4609
-	*
4610
-	* @return Array the airline list
4611
-	*
4612
-	*/
4608
+	 * Gets all airlines that have flown over by ident/callsign
4609
+	 *
4610
+	 * @return Array the airline list
4611
+	 *
4612
+	 */
4613 4613
 	public function countAllAirlinesByIdent($ident,$filters = array())
4614 4614
 	{
4615 4615
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4626,11 +4626,11 @@  discard block
 block discarded – undo
4626 4626
 	}
4627 4627
 
4628 4628
 	/**
4629
-	* Gets all airlines by owner
4630
-	*
4631
-	* @return Array the airline list
4632
-	*
4633
-	*/
4629
+	 * Gets all airlines by owner
4630
+	 *
4631
+	 * @return Array the airline list
4632
+	 *
4633
+	 */
4634 4634
 	public function countAllAirlinesByOwner($owner,$filters = array())
4635 4635
 	{
4636 4636
 		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
@@ -4647,11 +4647,11 @@  discard block
 block discarded – undo
4647 4647
 	}
4648 4648
 
4649 4649
 	/**
4650
-	* Gets flight duration by owner
4651
-	*
4652
-	* @return String Duration of all flights
4653
-	*
4654
-	*/
4650
+	 * Gets flight duration by owner
4651
+	 *
4652
+	 * @return String Duration of all flights
4653
+	 *
4654
+	 */
4655 4655
 	public function getFlightDurationByOwner($owner,$filters = array(),$year = '',$month = '',$day = '')
4656 4656
 	{
4657 4657
 		global $globalDBdriver;
@@ -4698,11 +4698,11 @@  discard block
 block discarded – undo
4698 4698
 	}
4699 4699
 
4700 4700
 	/**
4701
-	* Count flights by owner
4702
-	*
4703
-	* @return String Duration of all flights
4704
-	*
4705
-	*/
4701
+	 * Count flights by owner
4702
+	 *
4703
+	 * @return String Duration of all flights
4704
+	 *
4705
+	 */
4706 4706
 	public function countFlightsByOwner($owner,$filters = array())
4707 4707
 	{
4708 4708
 		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
@@ -4718,11 +4718,11 @@  discard block
 block discarded – undo
4718 4718
 	}
4719 4719
 
4720 4720
 	/**
4721
-	* Count flights by pilot
4722
-	*
4723
-	* @return String Duration of all flights
4724
-	*
4725
-	*/
4721
+	 * Count flights by pilot
4722
+	 *
4723
+	 * @return String Duration of all flights
4724
+	 *
4725
+	 */
4726 4726
 	public function countFlightsByPilot($pilot,$filters = array())
4727 4727
 	{
4728 4728
 		$pilot = filter_var($pilot,FILTER_SANITIZE_STRING);
@@ -4738,11 +4738,11 @@  discard block
 block discarded – undo
4738 4738
 	}
4739 4739
 
4740 4740
 	/**
4741
-	* Gets flight duration by pilot
4742
-	*
4743
-	* @return String Duration of all flights
4744
-	*
4745
-	*/
4741
+	 * Gets flight duration by pilot
4742
+	 *
4743
+	 * @return String Duration of all flights
4744
+	 *
4745
+	 */
4746 4746
 	public function getFlightDurationByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '')
4747 4747
 	{
4748 4748
 		global $globalDBdriver;
@@ -4788,11 +4788,11 @@  discard block
 block discarded – undo
4788 4788
 	}
4789 4789
 
4790 4790
 	/**
4791
-	* Gets all airlines used by pilot
4792
-	*
4793
-	* @return Array the airline list
4794
-	*
4795
-	*/
4791
+	 * Gets all airlines used by pilot
4792
+	 *
4793
+	 * @return Array the airline list
4794
+	 *
4795
+	 */
4796 4796
 	public function countAllAirlinesByPilot($pilot,$filters = array())
4797 4797
 	{
4798 4798
 		$pilot = filter_var($pilot,FILTER_SANITIZE_STRING);
@@ -4809,11 +4809,11 @@  discard block
 block discarded – undo
4809 4809
 	}
4810 4810
 
4811 4811
 	/**
4812
-	* Gets all airlines that have flown over by route
4813
-	*
4814
-	* @return Array the airline list
4815
-	*
4816
-	*/
4812
+	 * Gets all airlines that have flown over by route
4813
+	 *
4814
+	 * @return Array the airline list
4815
+	 *
4816
+	 */
4817 4817
 	public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
4818 4818
 	{
4819 4819
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4845,11 +4845,11 @@  discard block
 block discarded – undo
4845 4845
 	}
4846 4846
 
4847 4847
 	/**
4848
-	* Gets all airline countries that have flown over by route
4849
-	*
4850
-	* @return Array the airline country list
4851
-	*
4852
-	*/
4848
+	 * Gets all airline countries that have flown over by route
4849
+	 *
4850
+	 * @return Array the airline country list
4851
+	 *
4852
+	 */
4853 4853
 	public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array())
4854 4854
 	{
4855 4855
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4881,11 +4881,11 @@  discard block
 block discarded – undo
4881 4881
 
4882 4882
 
4883 4883
 	/**
4884
-	* Gets all airlines that have flown over by country
4885
-	*
4886
-	* @return Array the airline list
4887
-	*
4888
-	*/
4884
+	 * Gets all airlines that have flown over by country
4885
+	 *
4886
+	 * @return Array the airline list
4887
+	 *
4888
+	 */
4889 4889
 	public function countAllAirlinesByCountry($country,$filters = array())
4890 4890
 	{
4891 4891
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4915,11 +4915,11 @@  discard block
 block discarded – undo
4915 4915
 
4916 4916
 
4917 4917
 	/**
4918
-	* Gets all airline countries that have flown over by country
4919
-	*
4920
-	* @return Array the airline country list
4921
-	*
4922
-	*/
4918
+	 * Gets all airline countries that have flown over by country
4919
+	 *
4920
+	 * @return Array the airline country list
4921
+	 *
4922
+	 */
4923 4923
 	public function countAllAirlineCountriesByCountry($country,$filters = array())
4924 4924
 	{
4925 4925
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4948,11 +4948,11 @@  discard block
 block discarded – undo
4948 4948
 
4949 4949
 
4950 4950
 	/**
4951
-	* Gets all airlines countries
4952
-	*
4953
-	* @return Array the airline country list
4954
-	*
4955
-	*/
4951
+	 * Gets all airlines countries
4952
+	 *
4953
+	 * @return Array the airline country list
4954
+	 *
4955
+	 */
4956 4956
 	public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '')
4957 4957
 	{
4958 4958
 		global $globalDBdriver;
@@ -5008,11 +5008,11 @@  discard block
 block discarded – undo
5008 5008
 	}
5009 5009
 
5010 5010
 	/**
5011
-	* Gets all number of flight over countries
5012
-	*
5013
-	* @return Array the airline country list
5014
-	*
5015
-	*/
5011
+	 * Gets all number of flight over countries
5012
+	 *
5013
+	 * @return Array the airline country list
5014
+	 *
5015
+	 */
5016 5016
 	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5017 5017
 	{
5018 5018
 		global $globalDBdriver;
@@ -5034,15 +5034,15 @@  discard block
 block discarded – undo
5034 5034
 		$SpotterLive = new SpotterLive();
5035 5035
 		$filter_query = $SpotterLive->getFilter($filters,true,true);
5036 5036
 		$filter_query .= ' over_country IS NOT NULL';
5037
-                if ($olderthanmonths > 0) {
5037
+				if ($olderthanmonths > 0) {
5038 5038
 			if ($globalDBdriver == 'mysql') {
5039 5039
 				$filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5040 5040
 			} else {
5041 5041
 				$filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5042 5042
 			}
5043 5043
 		}
5044
-                if ($sincedate != '') {
5045
-            		if ($globalDBdriver == 'mysql') {
5044
+				if ($sincedate != '') {
5045
+					if ($globalDBdriver == 'mysql') {
5046 5046
 				$filter_query .= " AND spotter_live.date > '".$sincedate."' ";
5047 5047
 			} else {
5048 5048
 				$filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -5072,11 +5072,11 @@  discard block
 block discarded – undo
5072 5072
 	
5073 5073
 	
5074 5074
 	/**
5075
-	* Gets all aircraft types that have flown over
5076
-	*
5077
-	* @return Array the aircraft list
5078
-	*
5079
-	*/
5075
+	 * Gets all aircraft types that have flown over
5076
+	 *
5077
+	 * @return Array the aircraft list
5078
+	 *
5079
+	 */
5080 5080
 	public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
5081 5081
 	{
5082 5082
 		global $globalDBdriver;
@@ -5146,11 +5146,11 @@  discard block
 block discarded – undo
5146 5146
 	}
5147 5147
 
5148 5148
 	/**
5149
-	* Gets all aircraft types that have flown over by airline
5150
-	*
5151
-	* @return Array the aircraft list
5152
-	*
5153
-	*/
5149
+	 * Gets all aircraft types that have flown over by airline
5150
+	 *
5151
+	 * @return Array the aircraft list
5152
+	 *
5153
+	 */
5154 5154
 	public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '')
5155 5155
 	{
5156 5156
 		global $globalDBdriver;
@@ -5221,11 +5221,11 @@  discard block
 block discarded – undo
5221 5221
 	}
5222 5222
 
5223 5223
 	/**
5224
-	* Gets all aircraft types that have flown over by months
5225
-	*
5226
-	* @return Array the aircraft list
5227
-	*
5228
-	*/
5224
+	 * Gets all aircraft types that have flown over by months
5225
+	 *
5226
+	 * @return Array the aircraft list
5227
+	 *
5228
+	 */
5229 5229
 	public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5230 5230
 	{
5231 5231
 		global $globalDBdriver;
@@ -5269,11 +5269,11 @@  discard block
 block discarded – undo
5269 5269
 
5270 5270
 
5271 5271
 	/**
5272
-	* Gets all aircraft registration that have flown over by aircaft icao
5273
-	*
5274
-	* @return Array the aircraft list
5275
-	*
5276
-	*/
5272
+	 * Gets all aircraft registration that have flown over by aircaft icao
5273
+	 *
5274
+	 * @return Array the aircraft list
5275
+	 *
5276
+	 */
5277 5277
 	public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array())
5278 5278
 	{
5279 5279
 		$Image = new Image($this->db);
@@ -5312,11 +5312,11 @@  discard block
 block discarded – undo
5312 5312
 
5313 5313
 
5314 5314
 	/**
5315
-	* Gets all aircraft types that have flown over by airline icao
5316
-	*
5317
-	* @return Array the aircraft list
5318
-	*
5319
-	*/
5315
+	 * Gets all aircraft types that have flown over by airline icao
5316
+	 *
5317
+	 * @return Array the aircraft list
5318
+	 *
5319
+	 */
5320 5320
 	public function countAllAircraftTypesByAirline($airline_icao,$filters = array())
5321 5321
 	{
5322 5322
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5345,11 +5345,11 @@  discard block
 block discarded – undo
5345 5345
 
5346 5346
 
5347 5347
 	/**
5348
-	* Gets all aircraft registration that have flown over by airline icao
5349
-	*
5350
-	* @return Array the aircraft list
5351
-	*
5352
-	*/
5348
+	 * Gets all aircraft registration that have flown over by airline icao
5349
+	 *
5350
+	 * @return Array the aircraft list
5351
+	 *
5352
+	 */
5353 5353
 	public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array())
5354 5354
 	{
5355 5355
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5387,11 +5387,11 @@  discard block
 block discarded – undo
5387 5387
 
5388 5388
 
5389 5389
 	/**
5390
-	* Gets all aircraft manufacturer that have flown over by airline icao
5391
-	*
5392
-	* @return Array the aircraft list
5393
-	*
5394
-	*/
5390
+	 * Gets all aircraft manufacturer that have flown over by airline icao
5391
+	 *
5392
+	 * @return Array the aircraft list
5393
+	 *
5394
+	 */
5395 5395
 	public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array())
5396 5396
 	{
5397 5397
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5419,11 +5419,11 @@  discard block
 block discarded – undo
5419 5419
 
5420 5420
 
5421 5421
 	/**
5422
-	* Gets all aircraft types that have flown over by airline icao
5423
-	*
5424
-	* @return Array the aircraft list
5425
-	*
5426
-	*/
5422
+	 * Gets all aircraft types that have flown over by airline icao
5423
+	 *
5424
+	 * @return Array the aircraft list
5425
+	 *
5426
+	 */
5427 5427
 	public function countAllAircraftTypesByAirport($airport_icao,$filters = array())
5428 5428
 	{
5429 5429
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5452,11 +5452,11 @@  discard block
 block discarded – undo
5452 5452
 
5453 5453
 
5454 5454
 	/**
5455
-	* Gets all aircraft registration that have flown over by airport icao
5456
-	*
5457
-	* @return Array the aircraft list
5458
-	*
5459
-	*/
5455
+	 * Gets all aircraft registration that have flown over by airport icao
5456
+	 *
5457
+	 * @return Array the aircraft list
5458
+	 *
5459
+	 */
5460 5460
 	public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array())
5461 5461
 	{
5462 5462
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5493,11 +5493,11 @@  discard block
 block discarded – undo
5493 5493
 	
5494 5494
 	
5495 5495
 	/**
5496
-	* Gets all aircraft manufacturer that have flown over by airport icao
5497
-	*
5498
-	* @return Array the aircraft list
5499
-	*
5500
-	*/
5496
+	 * Gets all aircraft manufacturer that have flown over by airport icao
5497
+	 *
5498
+	 * @return Array the aircraft list
5499
+	 *
5500
+	 */
5501 5501
 	public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array())
5502 5502
 	{
5503 5503
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5523,11 +5523,11 @@  discard block
 block discarded – undo
5523 5523
 	}
5524 5524
 
5525 5525
 	/**
5526
-	* Gets all aircraft types that have flown over by aircraft manufacturer
5527
-	*
5528
-	* @return Array the aircraft list
5529
-	*
5530
-	*/
5526
+	 * Gets all aircraft types that have flown over by aircraft manufacturer
5527
+	 *
5528
+	 * @return Array the aircraft list
5529
+	 *
5530
+	 */
5531 5531
 	public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array())
5532 5532
 	{
5533 5533
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5554,11 +5554,11 @@  discard block
 block discarded – undo
5554 5554
 
5555 5555
 
5556 5556
 	/**
5557
-	* Gets all aircraft registration that have flown over by aircaft manufacturer
5558
-	*
5559
-	* @return Array the aircraft list
5560
-	*
5561
-	*/
5557
+	 * Gets all aircraft registration that have flown over by aircaft manufacturer
5558
+	 *
5559
+	 * @return Array the aircraft list
5560
+	 *
5561
+	 */
5562 5562
 	public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array())
5563 5563
 	{
5564 5564
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5594,11 +5594,11 @@  discard block
 block discarded – undo
5594 5594
 	}
5595 5595
 
5596 5596
 	/**
5597
-	* Gets all aircraft types that have flown over by date
5598
-	*
5599
-	* @return Array the aircraft list
5600
-	*
5601
-	*/
5597
+	 * Gets all aircraft types that have flown over by date
5598
+	 *
5599
+	 * @return Array the aircraft list
5600
+	 *
5601
+	 */
5602 5602
 	public function countAllAircraftTypesByDate($date,$filters = array())
5603 5603
 	{
5604 5604
 		global $globalTimezone, $globalDBdriver;
@@ -5640,11 +5640,11 @@  discard block
 block discarded – undo
5640 5640
 
5641 5641
 
5642 5642
 	/**
5643
-	* Gets all aircraft registration that have flown over by date
5644
-	*
5645
-	* @return Array the aircraft list
5646
-	*
5647
-	*/
5643
+	 * Gets all aircraft registration that have flown over by date
5644
+	 *
5645
+	 * @return Array the aircraft list
5646
+	 *
5647
+	 */
5648 5648
 	public function countAllAircraftRegistrationByDate($date,$filters = array())
5649 5649
 	{
5650 5650
 		global $globalTimezone, $globalDBdriver;
@@ -5695,11 +5695,11 @@  discard block
 block discarded – undo
5695 5695
 
5696 5696
 
5697 5697
 	/**
5698
-	* Gets all aircraft manufacturer that have flown over by date
5699
-	*
5700
-	* @return Array the aircraft manufacturer list
5701
-	*
5702
-	*/
5698
+	 * Gets all aircraft manufacturer that have flown over by date
5699
+	 *
5700
+	 * @return Array the aircraft manufacturer list
5701
+	 *
5702
+	 */
5703 5703
 	public function countAllAircraftManufacturerByDate($date,$filters = array())
5704 5704
 	{
5705 5705
 		global $globalTimezone, $globalDBdriver;
@@ -5741,11 +5741,11 @@  discard block
 block discarded – undo
5741 5741
 
5742 5742
 
5743 5743
 	/**
5744
-	* Gets all aircraft types that have flown over by ident/callsign
5745
-	*
5746
-	* @return Array the aircraft list
5747
-	*
5748
-	*/
5744
+	 * Gets all aircraft types that have flown over by ident/callsign
5745
+	 *
5746
+	 * @return Array the aircraft list
5747
+	 *
5748
+	 */
5749 5749
 	public function countAllAircraftTypesByIdent($ident,$filters = array())
5750 5750
 	{
5751 5751
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5773,11 +5773,11 @@  discard block
 block discarded – undo
5773 5773
 	}
5774 5774
 
5775 5775
 	/**
5776
-	* Gets all aircraft types that have flown over by pilot
5777
-	*
5778
-	* @return Array the aircraft list
5779
-	*
5780
-	*/
5776
+	 * Gets all aircraft types that have flown over by pilot
5777
+	 *
5778
+	 * @return Array the aircraft list
5779
+	 *
5780
+	 */
5781 5781
 	public function countAllAircraftTypesByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '')
5782 5782
 	{
5783 5783
 		global $globalDBdriver;
@@ -5823,11 +5823,11 @@  discard block
 block discarded – undo
5823 5823
 	}
5824 5824
 
5825 5825
 	/**
5826
-	* Gets all aircraft types that have flown over by owner
5827
-	*
5828
-	* @return Array the aircraft list
5829
-	*
5830
-	*/
5826
+	 * Gets all aircraft types that have flown over by owner
5827
+	 *
5828
+	 * @return Array the aircraft list
5829
+	 *
5830
+	 */
5831 5831
 	public function countAllAircraftTypesByOwner($owner,$filters = array(),$year = '',$month = '',$day = '')
5832 5832
 	{
5833 5833
 		global $globalDBdriver;
@@ -5872,11 +5872,11 @@  discard block
 block discarded – undo
5872 5872
 	}
5873 5873
 
5874 5874
 	/**
5875
-	* Gets all aircraft registration that have flown over by ident/callsign
5876
-	*
5877
-	* @return Array the aircraft list
5878
-	*
5879
-	*/
5875
+	 * Gets all aircraft registration that have flown over by ident/callsign
5876
+	 *
5877
+	 * @return Array the aircraft list
5878
+	 *
5879
+	 */
5880 5880
 	public function countAllAircraftRegistrationByIdent($ident,$filters = array())
5881 5881
 	{
5882 5882
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5915,11 +5915,11 @@  discard block
 block discarded – undo
5915 5915
 	}
5916 5916
 
5917 5917
 	/**
5918
-	* Gets all aircraft registration that have flown over by owner
5919
-	*
5920
-	* @return Array the aircraft list
5921
-	*
5922
-	*/
5918
+	 * Gets all aircraft registration that have flown over by owner
5919
+	 *
5920
+	 * @return Array the aircraft list
5921
+	 *
5922
+	 */
5923 5923
 	public function countAllAircraftRegistrationByOwner($owner,$filters = array(),$year = '',$month = '',$day = '')
5924 5924
 	{
5925 5925
 		global $globalDBdriver;
@@ -5990,11 +5990,11 @@  discard block
 block discarded – undo
5990 5990
 	}
5991 5991
 
5992 5992
 	/**
5993
-	* Gets all aircraft registration that have flown over by pilot
5994
-	*
5995
-	* @return Array the aircraft list
5996
-	*
5997
-	*/
5993
+	 * Gets all aircraft registration that have flown over by pilot
5994
+	 *
5995
+	 * @return Array the aircraft list
5996
+	 *
5997
+	 */
5998 5998
 	public function countAllAircraftRegistrationByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '')
5999 5999
 	{
6000 6000
 		global $globalDBdriver;
@@ -6066,11 +6066,11 @@  discard block
 block discarded – undo
6066 6066
 
6067 6067
 
6068 6068
 	/**
6069
-	* Gets all aircraft manufacturer that have flown over by ident/callsign
6070
-	*
6071
-	* @return Array the aircraft manufacturer list
6072
-	*
6073
-	*/
6069
+	 * Gets all aircraft manufacturer that have flown over by ident/callsign
6070
+	 *
6071
+	 * @return Array the aircraft manufacturer list
6072
+	 *
6073
+	 */
6074 6074
 	public function countAllAircraftManufacturerByIdent($ident,$filters = array())
6075 6075
 	{
6076 6076
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6095,11 +6095,11 @@  discard block
 block discarded – undo
6095 6095
 	}
6096 6096
 
6097 6097
 	/**
6098
-	* Gets all aircraft manufacturer that have flown over by owner
6099
-	*
6100
-	* @return Array the aircraft manufacturer list
6101
-	*
6102
-	*/
6098
+	 * Gets all aircraft manufacturer that have flown over by owner
6099
+	 *
6100
+	 * @return Array the aircraft manufacturer list
6101
+	 *
6102
+	 */
6103 6103
 	public function countAllAircraftManufacturerByOwner($owner,$filters = array(),$year = '',$month = '',$day = '')
6104 6104
 	{
6105 6105
 		global $globalDBdriver;
@@ -6147,11 +6147,11 @@  discard block
 block discarded – undo
6147 6147
 	}
6148 6148
 
6149 6149
 	/**
6150
-	* Gets all aircraft manufacturer that have flown over by pilot
6151
-	*
6152
-	* @return Array the aircraft manufacturer list
6153
-	*
6154
-	*/
6150
+	 * Gets all aircraft manufacturer that have flown over by pilot
6151
+	 *
6152
+	 * @return Array the aircraft manufacturer list
6153
+	 *
6154
+	 */
6155 6155
 	public function countAllAircraftManufacturerByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '')
6156 6156
 	{
6157 6157
 		global $globalDBdriver;
@@ -6200,11 +6200,11 @@  discard block
 block discarded – undo
6200 6200
 
6201 6201
 
6202 6202
 	/**
6203
-	* Gets all aircraft types that have flown over by route
6204
-	*
6205
-	* @return Array the aircraft list
6206
-	*
6207
-	*/
6203
+	 * Gets all aircraft types that have flown over by route
6204
+	 *
6205
+	 * @return Array the aircraft list
6206
+	 *
6207
+	 */
6208 6208
 	public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
6209 6209
 	{
6210 6210
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6233,11 +6233,11 @@  discard block
 block discarded – undo
6233 6233
 	}
6234 6234
 
6235 6235
 	/**
6236
-	* Gets all aircraft registration that have flown over by route
6237
-	*
6238
-	* @return Array the aircraft list
6239
-	*
6240
-	*/
6236
+	 * Gets all aircraft registration that have flown over by route
6237
+	 *
6238
+	 * @return Array the aircraft list
6239
+	 *
6240
+	 */
6241 6241
 	public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
6242 6242
 	{
6243 6243
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6279,11 +6279,11 @@  discard block
 block discarded – undo
6279 6279
 	
6280 6280
 	
6281 6281
 	/**
6282
-	* Gets all aircraft manufacturer that have flown over by route
6283
-	*
6284
-	* @return Array the aircraft manufacturer list
6285
-	*
6286
-	*/
6282
+	 * Gets all aircraft manufacturer that have flown over by route
6283
+	 *
6284
+	 * @return Array the aircraft manufacturer list
6285
+	 *
6286
+	 */
6287 6287
 	public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
6288 6288
 	{
6289 6289
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6317,11 +6317,11 @@  discard block
 block discarded – undo
6317 6317
 	
6318 6318
 	
6319 6319
 	/**
6320
-	* Gets all aircraft types that have flown over by country
6321
-	*
6322
-	* @return Array the aircraft list
6323
-	*
6324
-	*/
6320
+	 * Gets all aircraft types that have flown over by country
6321
+	 *
6322
+	 * @return Array the aircraft list
6323
+	 *
6324
+	 */
6325 6325
 	public function countAllAircraftTypesByCountry($country,$filters = array())
6326 6326
 	{
6327 6327
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6352,11 +6352,11 @@  discard block
 block discarded – undo
6352 6352
 
6353 6353
 
6354 6354
 	/**
6355
-	* Gets all aircraft registration that have flown over by country
6356
-	*
6357
-	* @return Array the aircraft list
6358
-	*
6359
-	*/
6355
+	 * Gets all aircraft registration that have flown over by country
6356
+	 *
6357
+	 * @return Array the aircraft list
6358
+	 *
6359
+	 */
6360 6360
 	public function countAllAircraftRegistrationByCountry($country,$filters = array())
6361 6361
 	{
6362 6362
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6396,11 +6396,11 @@  discard block
 block discarded – undo
6396 6396
 	
6397 6397
 	
6398 6398
 	/**
6399
-	* Gets all aircraft manufacturer that have flown over by country
6400
-	*
6401
-	* @return Array the aircraft manufacturer list
6402
-	*
6403
-	*/
6399
+	 * Gets all aircraft manufacturer that have flown over by country
6400
+	 *
6401
+	 * @return Array the aircraft manufacturer list
6402
+	 *
6403
+	 */
6404 6404
 	public function countAllAircraftManufacturerByCountry($country,$filters = array())
6405 6405
 	{
6406 6406
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6431,18 +6431,18 @@  discard block
 block discarded – undo
6431 6431
 	
6432 6432
 	
6433 6433
 	/**
6434
-	* Gets all aircraft manufacturers that have flown over
6435
-	*
6436
-	* @return Array the aircraft list
6437
-	*
6438
-	*/
6434
+	 * Gets all aircraft manufacturers that have flown over
6435
+	 *
6436
+	 * @return Array the aircraft list
6437
+	 *
6438
+	 */
6439 6439
 	public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '')
6440 6440
 	{
6441 6441
 		global $globalDBdriver;
6442 6442
 		$filter_query = $this->getFilter($filters,true,true);
6443 6443
 		$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
6444 6444
                     FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'";
6445
-                $query_values = array();
6445
+				$query_values = array();
6446 6446
 		if ($year != '') {
6447 6447
 			if ($globalDBdriver == 'mysql') {
6448 6448
 				$query .= " AND YEAR(spotter_output.date) = :year";
@@ -6495,11 +6495,11 @@  discard block
 block discarded – undo
6495 6495
 	
6496 6496
 	
6497 6497
 	/**
6498
-	* Gets all aircraft registrations that have flown over
6499
-	*
6500
-	* @return Array the aircraft list
6501
-	*
6502
-	*/
6498
+	 * Gets all aircraft registrations that have flown over
6499
+	 *
6500
+	 * @return Array the aircraft list
6501
+	 *
6502
+	 */
6503 6503
 	public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
6504 6504
 	{
6505 6505
 		global $globalDBdriver;
@@ -6507,15 +6507,15 @@  discard block
 block discarded – undo
6507 6507
 		$filter_query = $this->getFilter($filters,true,true);
6508 6508
 		$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    
6509 6509
                     FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'";
6510
-                if ($olderthanmonths > 0) {
6511
-            		if ($globalDBdriver == 'mysql') {
6510
+				if ($olderthanmonths > 0) {
6511
+					if ($globalDBdriver == 'mysql') {
6512 6512
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6513 6513
 			} else {
6514 6514
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6515 6515
 			}
6516 6516
 		}
6517
-                if ($sincedate != '') {
6518
-            		if ($globalDBdriver == 'mysql') {
6517
+				if ($sincedate != '') {
6518
+					if ($globalDBdriver == 'mysql') {
6519 6519
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6520 6520
 			} else {
6521 6521
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6580,11 +6580,11 @@  discard block
 block discarded – undo
6580 6580
 
6581 6581
 
6582 6582
 	/**
6583
-	* Gets all aircraft registrations that have flown over
6584
-	*
6585
-	* @return Array the aircraft list
6586
-	*
6587
-	*/
6583
+	 * Gets all aircraft registrations that have flown over
6584
+	 *
6585
+	 * @return Array the aircraft list
6586
+	 *
6587
+	 */
6588 6588
 	public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
6589 6589
 	{
6590 6590
 		global $globalDBdriver;
@@ -6592,15 +6592,15 @@  discard block
 block discarded – undo
6592 6592
 		$Image = new Image($this->db);
6593 6593
 		$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    
6594 6594
                     FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' ";
6595
-                if ($olderthanmonths > 0) {
6596
-            		if ($globalDBdriver == 'mysql') {
6595
+				if ($olderthanmonths > 0) {
6596
+					if ($globalDBdriver == 'mysql') {
6597 6597
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6598 6598
 			} else {
6599 6599
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6600 6600
 			}
6601 6601
 		}
6602
-                if ($sincedate != '') {
6603
-            		if ($globalDBdriver == 'mysql') {
6602
+				if ($sincedate != '') {
6603
+					if ($globalDBdriver == 'mysql') {
6604 6604
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6605 6605
 			} else {
6606 6606
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6609,7 +6609,7 @@  discard block
 block discarded – undo
6609 6609
 
6610 6610
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6611 6611
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6612
-                $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";
6612
+				$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";
6613 6613
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6614 6614
 		
6615 6615
 		$sth = $this->db->prepare($query);
@@ -6641,26 +6641,26 @@  discard block
 block discarded – undo
6641 6641
 	
6642 6642
 	
6643 6643
 	/**
6644
-	* Gets all departure airports of the airplanes that have flown over
6645
-	*
6646
-	* @return Array the airport list
6647
-	*
6648
-	*/
6644
+	 * Gets all departure airports of the airplanes that have flown over
6645
+	 *
6646
+	 * @return Array the airport list
6647
+	 *
6648
+	 */
6649 6649
 	public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6650 6650
 	{
6651 6651
 		global $globalDBdriver;
6652 6652
 		$filter_query = $this->getFilter($filters,true,true);
6653 6653
 		$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, airport.latitude, airport.longitude
6654 6654
 				FROM airport, spotter_output".$filter_query." airport.icao = spotter_output.departure_airport_icao AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''";
6655
-                if ($olderthanmonths > 0) {
6656
-            		if ($globalDBdriver == 'mysql') {
6655
+				if ($olderthanmonths > 0) {
6656
+					if ($globalDBdriver == 'mysql') {
6657 6657
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6658 6658
 			} else {
6659 6659
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6660 6660
 			}
6661
-                }
6662
-                if ($sincedate != '') {
6663
-            		if ($globalDBdriver == 'mysql') {
6661
+				}
6662
+				if ($sincedate != '') {
6663
+					if ($globalDBdriver == 'mysql') {
6664 6664
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6665 6665
 			} else {
6666 6666
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6694,7 +6694,7 @@  discard block
 block discarded – undo
6694 6694
 				$query_values = array_merge($query_values,array(':day' => $day));
6695 6695
 			}
6696 6696
 		}
6697
-                $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, airport.latitude, airport.longitude
6697
+				$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, airport.latitude, airport.longitude
6698 6698
 				ORDER BY airport_departure_icao_count DESC";
6699 6699
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6700 6700
 
@@ -6718,35 +6718,35 @@  discard block
 block discarded – undo
6718 6718
 	}
6719 6719
 
6720 6720
 	/**
6721
-	* Gets all departure airports of the airplanes that have flown over
6722
-	*
6723
-	* @return Array the airport list
6724
-	*
6725
-	*/
6721
+	 * Gets all departure airports of the airplanes that have flown over
6722
+	 *
6723
+	 * @return Array the airport list
6724
+	 *
6725
+	 */
6726 6726
 	public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6727 6727
 	{
6728 6728
 		global $globalDBdriver;
6729 6729
 		$filter_query = $this->getFilter($filters,true,true);
6730 6730
 		$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 
6731 6731
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' ";
6732
-                if ($olderthanmonths > 0) {
6733
-            		if ($globalDBdriver == 'mysql') {
6732
+				if ($olderthanmonths > 0) {
6733
+					if ($globalDBdriver == 'mysql') {
6734 6734
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6735 6735
 			} else {
6736 6736
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6737 6737
 			}
6738
-                }
6739
-                if ($sincedate != '') {
6740
-            		if ($globalDBdriver == 'mysql') {
6738
+				}
6739
+				if ($sincedate != '') {
6740
+					if ($globalDBdriver == 'mysql') {
6741 6741
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6742 6742
 			} else {
6743 6743
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6744 6744
 			}
6745 6745
 		}
6746 6746
 
6747
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6748
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6749
-                $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
6747
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6748
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6749
+				$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
6750 6750
 				ORDER BY airport_departure_icao_count DESC";
6751 6751
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6752 6752
       
@@ -6771,26 +6771,26 @@  discard block
 block discarded – undo
6771 6771
 	}
6772 6772
 
6773 6773
 	/**
6774
-	* Gets all detected departure airports of the airplanes that have flown over
6775
-	*
6776
-	* @return Array the airport list
6777
-	*
6778
-	*/
6774
+	 * Gets all detected departure airports of the airplanes that have flown over
6775
+	 *
6776
+	 * @return Array the airport list
6777
+	 *
6778
+	 */
6779 6779
 	public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6780 6780
 	{
6781 6781
 		global $globalDBdriver;
6782 6782
 		$filter_query = $this->getFilter($filters,true,true);
6783 6783
 		$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, airport.latitude as departure_airport_latitude, airport.longitude as departure_airport.longitude
6784 6784
 				FROM airport, spotter_output".$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";
6785
-                if ($olderthanmonths > 0) {
6786
-            		if ($globalDBdriver == 'mysql') {
6785
+				if ($olderthanmonths > 0) {
6786
+					if ($globalDBdriver == 'mysql') {
6787 6787
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6788 6788
 			} else {
6789 6789
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6790 6790
 			}
6791
-                }
6792
-                if ($sincedate != '') {
6793
-            		if ($globalDBdriver == 'mysql') {
6791
+				}
6792
+				if ($sincedate != '') {
6793
+					if ($globalDBdriver == 'mysql') {
6794 6794
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6795 6795
 			} else {
6796 6796
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6824,10 +6824,10 @@  discard block
 block discarded – undo
6824 6824
 				$query_values = array_merge($query_values,array(':day' => $day));
6825 6825
 			}
6826 6826
 		}
6827
-                $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude
6827
+				$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude
6828 6828
 				ORDER BY airport_departure_icao_count DESC";
6829 6829
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6830
-    		//echo $query;
6830
+			//echo $query;
6831 6831
 		$sth = $this->db->prepare($query);
6832 6832
 		$sth->execute($query_values);
6833 6833
       
@@ -6850,35 +6850,35 @@  discard block
 block discarded – undo
6850 6850
 	}
6851 6851
 	
6852 6852
 	/**
6853
-	* Gets all detected departure airports of the airplanes that have flown over
6854
-	*
6855
-	* @return Array the airport list
6856
-	*
6857
-	*/
6853
+	 * Gets all detected departure airports of the airplanes that have flown over
6854
+	 *
6855
+	 * @return Array the airport list
6856
+	 *
6857
+	 */
6858 6858
 	public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6859 6859
 	{
6860 6860
 		global $globalDBdriver;
6861 6861
 		$filter_query = $this->getFilter($filters,true,true);
6862 6862
 		$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
6863 6863
 				FROM airport, spotter_output".$filter_query." 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 ";
6864
-                if ($olderthanmonths > 0) {
6865
-            		if ($globalDBdriver == 'mysql') {
6864
+				if ($olderthanmonths > 0) {
6865
+					if ($globalDBdriver == 'mysql') {
6866 6866
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6867 6867
 			} else {
6868 6868
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6869 6869
 			}
6870
-                }
6871
-                if ($sincedate != '') {
6872
-            		if ($globalDBdriver == 'mysql') {
6870
+				}
6871
+				if ($sincedate != '') {
6872
+					if ($globalDBdriver == 'mysql') {
6873 6873
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6874 6874
 			} else {
6875 6875
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
6876 6876
 			}
6877 6877
 		}
6878 6878
 
6879
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6880
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6881
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6879
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6880
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6881
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6882 6882
 				ORDER BY airport_departure_icao_count DESC";
6883 6883
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6884 6884
       
@@ -6903,11 +6903,11 @@  discard block
 block discarded – undo
6903 6903
 	}	
6904 6904
 	
6905 6905
 	/**
6906
-	* Gets all departure airports of the airplanes that have flown over based on an airline icao
6907
-	*
6908
-	* @return Array the airport list
6909
-	*
6910
-	*/
6906
+	 * Gets all departure airports of the airplanes that have flown over based on an airline icao
6907
+	 *
6908
+	 * @return Array the airport list
6909
+	 *
6910
+	 */
6911 6911
 	public function countAllDepartureAirportsByAirline($airline_icao,$filters = array())
6912 6912
 	{
6913 6913
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6941,11 +6941,11 @@  discard block
 block discarded – undo
6941 6941
 	
6942 6942
 	
6943 6943
 	/**
6944
-	* Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6945
-	*
6946
-	* @return Array the airport list
6947
-	*
6948
-	*/
6944
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6945
+	 *
6946
+	 * @return Array the airport list
6947
+	 *
6948
+	 */
6949 6949
 	public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array())
6950 6950
 	{
6951 6951
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6976,11 +6976,11 @@  discard block
 block discarded – undo
6976 6976
 	
6977 6977
 	
6978 6978
 	/**
6979
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6980
-	*
6981
-	* @return Array the airport list
6982
-	*
6983
-	*/
6979
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6980
+	 *
6981
+	 * @return Array the airport list
6982
+	 *
6983
+	 */
6984 6984
 	public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array())
6985 6985
 	{
6986 6986
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7013,11 +7013,11 @@  discard block
 block discarded – undo
7013 7013
 	
7014 7014
 	
7015 7015
 	/**
7016
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7017
-	*
7018
-	* @return Array the airport list
7019
-	*
7020
-	*/
7016
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7017
+	 *
7018
+	 * @return Array the airport list
7019
+	 *
7020
+	 */
7021 7021
 	public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array())
7022 7022
 	{
7023 7023
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7047,11 +7047,11 @@  discard block
 block discarded – undo
7047 7047
 	
7048 7048
 	
7049 7049
 	/**
7050
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft registration
7051
-	*
7052
-	* @return Array the airport list
7053
-	*
7054
-	*/
7050
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft registration
7051
+	 *
7052
+	 * @return Array the airport list
7053
+	 *
7054
+	 */
7055 7055
 	public function countAllDepartureAirportsByRegistration($registration,$filters = array())
7056 7056
 	{
7057 7057
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7084,11 +7084,11 @@  discard block
 block discarded – undo
7084 7084
 	
7085 7085
 	
7086 7086
 	/**
7087
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
7088
-	*
7089
-	* @return Array the airport list
7090
-	*
7091
-	*/
7087
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
7088
+	 *
7089
+	 * @return Array the airport list
7090
+	 *
7091
+	 */
7092 7092
 	public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array())
7093 7093
 	{
7094 7094
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7118,11 +7118,11 @@  discard block
 block discarded – undo
7118 7118
 	
7119 7119
 	
7120 7120
 	/**
7121
-	* Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
7122
-	*
7123
-	* @return Array the airport list
7124
-	*
7125
-	*/
7121
+	 * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
7122
+	 *
7123
+	 * @return Array the airport list
7124
+	 *
7125
+	 */
7126 7126
 	public function countAllDepartureAirportsByAirport($airport_icao,$filters = array())
7127 7127
 	{
7128 7128
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7155,11 +7155,11 @@  discard block
 block discarded – undo
7155 7155
 	
7156 7156
 	
7157 7157
 	/**
7158
-	* Gets all departure airports by country of the airplanes that have flown over based on an airport icao
7159
-	*
7160
-	* @return Array the airport list
7161
-	*
7162
-	*/
7158
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airport icao
7159
+	 *
7160
+	 * @return Array the airport list
7161
+	 *
7162
+	 */
7163 7163
 	public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array())
7164 7164
 	{
7165 7165
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7190,11 +7190,11 @@  discard block
 block discarded – undo
7190 7190
 	
7191 7191
 	
7192 7192
 	/**
7193
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
7194
-	*
7195
-	* @return Array the airport list
7196
-	*
7197
-	*/
7193
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
7194
+	 *
7195
+	 * @return Array the airport list
7196
+	 *
7197
+	 */
7198 7198
 	public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array())
7199 7199
 	{
7200 7200
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7227,11 +7227,11 @@  discard block
 block discarded – undo
7227 7227
 	
7228 7228
 	
7229 7229
 	/**
7230
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
7231
-	*
7232
-	* @return Array the airport list
7233
-	*
7234
-	*/
7230
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
7231
+	 *
7232
+	 * @return Array the airport list
7233
+	 *
7234
+	 */
7235 7235
 	public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
7236 7236
 	{
7237 7237
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7261,11 +7261,11 @@  discard block
 block discarded – undo
7261 7261
 	
7262 7262
 	
7263 7263
 	/**
7264
-	* Gets all departure airports of the airplanes that have flown over based on a date
7265
-	*
7266
-	* @return Array the airport list
7267
-	*
7268
-	*/
7264
+	 * Gets all departure airports of the airplanes that have flown over based on a date
7265
+	 *
7266
+	 * @return Array the airport list
7267
+	 *
7268
+	 */
7269 7269
 	public function countAllDepartureAirportsByDate($date,$filters = array())
7270 7270
 	{
7271 7271
 		global $globalTimezone, $globalDBdriver;
@@ -7311,11 +7311,11 @@  discard block
 block discarded – undo
7311 7311
 	
7312 7312
 	
7313 7313
 	/**
7314
-	* Gets all departure airports by country of the airplanes that have flown over based on a date
7315
-	*
7316
-	* @return Array the airport list
7317
-	*
7318
-	*/
7314
+	 * Gets all departure airports by country of the airplanes that have flown over based on a date
7315
+	 *
7316
+	 * @return Array the airport list
7317
+	 *
7318
+	 */
7319 7319
 	public function countAllDepartureAirportCountriesByDate($date,$filters = array())
7320 7320
 	{
7321 7321
 		global $globalTimezone, $globalDBdriver;
@@ -7358,11 +7358,11 @@  discard block
 block discarded – undo
7358 7358
 	
7359 7359
 	
7360 7360
 	/**
7361
-	* Gets all departure airports of the airplanes that have flown over based on a ident/callsign
7362
-	*
7363
-	* @return Array the airport list
7364
-	*
7365
-	*/
7361
+	 * Gets all departure airports of the airplanes that have flown over based on a ident/callsign
7362
+	 *
7363
+	 * @return Array the airport list
7364
+	 *
7365
+	 */
7366 7366
 	public function countAllDepartureAirportsByIdent($ident,$filters = array())
7367 7367
 	{
7368 7368
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7394,11 +7394,11 @@  discard block
 block discarded – undo
7394 7394
 	}
7395 7395
 	
7396 7396
 	/**
7397
-	* Gets all departure airports of the airplanes that have flown over based on a owner
7398
-	*
7399
-	* @return Array the airport list
7400
-	*
7401
-	*/
7397
+	 * Gets all departure airports of the airplanes that have flown over based on a owner
7398
+	 *
7399
+	 * @return Array the airport list
7400
+	 *
7401
+	 */
7402 7402
 	public function countAllDepartureAirportsByOwner($owner,$filters = array())
7403 7403
 	{
7404 7404
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7430,11 +7430,11 @@  discard block
 block discarded – undo
7430 7430
 	}
7431 7431
 	
7432 7432
 	/**
7433
-	* Gets all departure airports of the airplanes that have flown over based on a pilot
7434
-	*
7435
-	* @return Array the airport list
7436
-	*
7437
-	*/
7433
+	 * Gets all departure airports of the airplanes that have flown over based on a pilot
7434
+	 *
7435
+	 * @return Array the airport list
7436
+	 *
7437
+	 */
7438 7438
 	public function countAllDepartureAirportsByPilot($pilot,$filters = array())
7439 7439
 	{
7440 7440
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7467,11 +7467,11 @@  discard block
 block discarded – undo
7467 7467
 	
7468 7468
 	
7469 7469
 	/**
7470
-	* Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7471
-	*
7472
-	* @return Array the airport list
7473
-	*
7474
-	*/
7470
+	 * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7471
+	 *
7472
+	 * @return Array the airport list
7473
+	 *
7474
+	 */
7475 7475
 	public function countAllDepartureAirportCountriesByIdent($ident,$filters = array())
7476 7476
 	{
7477 7477
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7500,11 +7500,11 @@  discard block
 block discarded – undo
7500 7500
 	}
7501 7501
 	
7502 7502
 	/**
7503
-	* Gets all departure airports by country of the airplanes that have flown over based on owner
7504
-	*
7505
-	* @return Array the airport list
7506
-	*
7507
-	*/
7503
+	 * Gets all departure airports by country of the airplanes that have flown over based on owner
7504
+	 *
7505
+	 * @return Array the airport list
7506
+	 *
7507
+	 */
7508 7508
 	public function countAllDepartureAirportCountriesByOwner($owner,$filters = array())
7509 7509
 	{
7510 7510
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7520,11 +7520,11 @@  discard block
 block discarded – undo
7520 7520
 	}
7521 7521
 	
7522 7522
 	/**
7523
-	* Gets all departure airports by country of the airplanes that have flown over based on pilot
7524
-	*
7525
-	* @return Array the airport list
7526
-	*
7527
-	*/
7523
+	 * Gets all departure airports by country of the airplanes that have flown over based on pilot
7524
+	 *
7525
+	 * @return Array the airport list
7526
+	 *
7527
+	 */
7528 7528
 	public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array())
7529 7529
 	{
7530 7530
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7542,11 +7542,11 @@  discard block
 block discarded – undo
7542 7542
 	
7543 7543
 	
7544 7544
 	/**
7545
-	* Gets all departure airports of the airplanes that have flown over based on a country
7546
-	*
7547
-	* @return Array the airport list
7548
-	*
7549
-	*/
7545
+	 * Gets all departure airports of the airplanes that have flown over based on a country
7546
+	 *
7547
+	 * @return Array the airport list
7548
+	 *
7549
+	 */
7550 7550
 	public function countAllDepartureAirportsByCountry($country,$filters = array())
7551 7551
 	{
7552 7552
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7580,11 +7580,11 @@  discard block
 block discarded – undo
7580 7580
 
7581 7581
 
7582 7582
 	/**
7583
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7584
-	*
7585
-	* @return Array the airport list
7586
-	*
7587
-	*/
7583
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7584
+	 *
7585
+	 * @return Array the airport list
7586
+	 *
7587
+	 */
7588 7588
 	public function countAllDepartureAirportCountriesByCountry($country,$filters = array())
7589 7589
 	{
7590 7590
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7614,31 +7614,31 @@  discard block
 block discarded – undo
7614 7614
 	
7615 7615
 
7616 7616
 	/**
7617
-	* Gets all arrival airports of the airplanes that have flown over
7618
-	*
7619
-	* @param Boolean $limit Limit result to 10 or not
7620
-	* @param Integer $olderthanmonths Only show result older than x months
7621
-	* @param String $sincedate Only show result since x date
7622
-	* @param Boolean $icaoaskey Show result by ICAO
7623
-	* @param Array $filters Filter used here
7624
-	* @return Array the airport list
7625
-	*
7626
-	*/
7617
+	 * Gets all arrival airports of the airplanes that have flown over
7618
+	 *
7619
+	 * @param Boolean $limit Limit result to 10 or not
7620
+	 * @param Integer $olderthanmonths Only show result older than x months
7621
+	 * @param String $sincedate Only show result since x date
7622
+	 * @param Boolean $icaoaskey Show result by ICAO
7623
+	 * @param Array $filters Filter used here
7624
+	 * @return Array the airport list
7625
+	 *
7626
+	 */
7627 7627
 	public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7628 7628
 	{
7629 7629
 		global $globalDBdriver;
7630 7630
 		$filter_query = $this->getFilter($filters,true,true);
7631 7631
 		$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, airport.latitude as arrival_airport_latitude, airport.longitude as arrival_airport_longitude 
7632 7632
 				FROM airport, spotter_output".$filter_query." airport.icao = spotter_output.arrival_airport_icao AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''";
7633
-                if ($olderthanmonths > 0) {
7634
-            		if ($globalDBdriver == 'mysql') {
7633
+				if ($olderthanmonths > 0) {
7634
+					if ($globalDBdriver == 'mysql') {
7635 7635
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7636 7636
 			} else {
7637 7637
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7638 7638
 			}
7639 7639
 		}
7640
-                if ($sincedate != '') {
7641
-            		if ($globalDBdriver == 'mysql') {
7640
+				if ($sincedate != '') {
7641
+					if ($globalDBdriver == 'mysql') {
7642 7642
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7643 7643
 			} else {
7644 7644
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7672,7 +7672,7 @@  discard block
 block discarded – undo
7672 7672
 				$query_values = array_merge($query_values,array(':day' => $day));
7673 7673
 			}
7674 7674
 		}
7675
-                $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, airport.latitude, airport.longitude
7675
+				$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, airport.latitude, airport.longitude
7676 7676
 					ORDER BY airport_arrival_icao_count DESC";
7677 7677
 		if ($limit) $query .= " LIMIT 10";
7678 7678
       
@@ -7703,35 +7703,35 @@  discard block
 block discarded – undo
7703 7703
 	}
7704 7704
 
7705 7705
 	/**
7706
-	* Gets all arrival airports of the airplanes that have flown over
7707
-	*
7708
-	* @return Array the airport list
7709
-	*
7710
-	*/
7706
+	 * Gets all arrival airports of the airplanes that have flown over
7707
+	 *
7708
+	 * @return Array the airport list
7709
+	 *
7710
+	 */
7711 7711
 	public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
7712 7712
 	{
7713 7713
 		global $globalDBdriver;
7714 7714
 		$filter_query = $this->getFilter($filters,true,true);
7715 7715
 		$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 
7716 7716
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' ";
7717
-                if ($olderthanmonths > 0) {
7718
-            		if ($globalDBdriver == 'mysql') {
7717
+				if ($olderthanmonths > 0) {
7718
+					if ($globalDBdriver == 'mysql') {
7719 7719
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7720 7720
 			} else {
7721 7721
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7722 7722
 			}
7723 7723
 		}
7724
-                if ($sincedate != '') {
7725
-            		if ($globalDBdriver == 'mysql') {
7724
+				if ($sincedate != '') {
7725
+					if ($globalDBdriver == 'mysql') {
7726 7726
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7727 7727
 			} else {
7728 7728
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7729 7729
 			}
7730 7730
 		}
7731 7731
 
7732
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7733
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7734
-                $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
7732
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7733
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7734
+				$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
7735 7735
 					ORDER BY airport_arrival_icao_count DESC";
7736 7736
 		if ($limit) $query .= " LIMIT 10";
7737 7737
       
@@ -7762,26 +7762,26 @@  discard block
 block discarded – undo
7762 7762
 
7763 7763
 
7764 7764
 	/**
7765
-	* Gets all detected arrival airports of the airplanes that have flown over
7766
-	*
7767
-	* @return Array the airport list
7768
-	*
7769
-	*/
7765
+	 * Gets all detected arrival airports of the airplanes that have flown over
7766
+	 *
7767
+	 * @return Array the airport list
7768
+	 *
7769
+	 */
7770 7770
 	public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7771 7771
 	{
7772 7772
 		global $globalDBdriver;
7773 7773
 		$filter_query = $this->getFilter($filters,true,true);
7774 7774
 		$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, airport.latitude AS arrival_airport_latitude, airport.longitude AS arrival_airport_longitude 
7775 7775
 			FROM airport,spotter_output".$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";
7776
-                if ($olderthanmonths > 0) {
7777
-            		if ($globalDBdriver == 'mysql') {
7776
+				if ($olderthanmonths > 0) {
7777
+					if ($globalDBdriver == 'mysql') {
7778 7778
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7779 7779
 			} else {
7780 7780
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7781 7781
 			}
7782 7782
 		}
7783
-                if ($sincedate != '') {
7784
-            		if ($globalDBdriver == 'mysql') {
7783
+				if ($sincedate != '') {
7784
+					if ($globalDBdriver == 'mysql') {
7785 7785
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7786 7786
 			} else {
7787 7787
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7843,35 +7843,35 @@  discard block
 block discarded – undo
7843 7843
 	}
7844 7844
 	
7845 7845
 	/**
7846
-	* Gets all detected arrival airports of the airplanes that have flown over
7847
-	*
7848
-	* @return Array the airport list
7849
-	*
7850
-	*/
7846
+	 * Gets all detected arrival airports of the airplanes that have flown over
7847
+	 *
7848
+	 * @return Array the airport list
7849
+	 *
7850
+	 */
7851 7851
 	public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
7852 7852
 	{
7853 7853
 		global $globalDBdriver;
7854 7854
 		$filter_query = $this->getFilter($filters,true,true);
7855 7855
 		$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 
7856 7856
 			FROM airport,spotter_output".$filter_query." 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 ";
7857
-                if ($olderthanmonths > 0) {
7858
-            		if ($globalDBdriver == 'mysql') {
7857
+				if ($olderthanmonths > 0) {
7858
+					if ($globalDBdriver == 'mysql') {
7859 7859
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7860 7860
 			} else {
7861 7861
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7862 7862
 			}
7863 7863
 		}
7864
-                if ($sincedate != '') {
7865
-            		if ($globalDBdriver == 'mysql') {
7864
+				if ($sincedate != '') {
7865
+					if ($globalDBdriver == 'mysql') {
7866 7866
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7867 7867
 			} else {
7868 7868
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7869 7869
 			}
7870 7870
 		}
7871 7871
 
7872
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7873
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7874
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7872
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7873
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7874
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7875 7875
 					ORDER BY airport_arrival_icao_count DESC";
7876 7876
 		if ($limit) $query .= " LIMIT 10";
7877 7877
       
@@ -7901,11 +7901,11 @@  discard block
 block discarded – undo
7901 7901
 	}	
7902 7902
 	
7903 7903
 	/**
7904
-	* Gets all arrival airports of the airplanes that have flown over based on an airline icao
7905
-	*
7906
-	* @return Array the airport list
7907
-	*
7908
-	*/
7904
+	 * Gets all arrival airports of the airplanes that have flown over based on an airline icao
7905
+	 *
7906
+	 * @return Array the airport list
7907
+	 *
7908
+	 */
7909 7909
 	public function countAllArrivalAirportsByAirline($airline_icao, $filters = array())
7910 7910
 	{
7911 7911
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7937,11 +7937,11 @@  discard block
 block discarded – undo
7937 7937
 	
7938 7938
 	
7939 7939
 	/**
7940
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7941
-	*
7942
-	* @return Array the airport list
7943
-	*
7944
-	*/
7940
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7941
+	 *
7942
+	 * @return Array the airport list
7943
+	 *
7944
+	 */
7945 7945
 	public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array())
7946 7946
 	{
7947 7947
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7972,11 +7972,11 @@  discard block
 block discarded – undo
7972 7972
 	
7973 7973
 	
7974 7974
 	/**
7975
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7976
-	*
7977
-	* @return Array the airport list
7978
-	*
7979
-	*/
7975
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7976
+	 *
7977
+	 * @return Array the airport list
7978
+	 *
7979
+	 */
7980 7980
 	public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array())
7981 7981
 	{
7982 7982
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8010,11 +8010,11 @@  discard block
 block discarded – undo
8010 8010
 	
8011 8011
 	
8012 8012
 	/**
8013
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
8014
-	*
8015
-	* @return Array the airport list
8016
-	*
8017
-	*/
8013
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
8014
+	 *
8015
+	 * @return Array the airport list
8016
+	 *
8017
+	 */
8018 8018
 	public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array())
8019 8019
 	{
8020 8020
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8044,11 +8044,11 @@  discard block
 block discarded – undo
8044 8044
 	
8045 8045
 	
8046 8046
 	/**
8047
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
8048
-	*
8049
-	* @return Array the airport list
8050
-	*
8051
-	*/
8047
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
8048
+	 *
8049
+	 * @return Array the airport list
8050
+	 *
8051
+	 */
8052 8052
 	public function countAllArrivalAirportsByRegistration($registration,$filters = array())
8053 8053
 	{
8054 8054
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8082,11 +8082,11 @@  discard block
 block discarded – undo
8082 8082
 	
8083 8083
 	
8084 8084
 	/**
8085
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
8086
-	*
8087
-	* @return Array the airport list
8088
-	*
8089
-	*/
8085
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
8086
+	 *
8087
+	 * @return Array the airport list
8088
+	 *
8089
+	 */
8090 8090
 	public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array())
8091 8091
 	{
8092 8092
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8117,11 +8117,11 @@  discard block
 block discarded – undo
8117 8117
 	
8118 8118
 	
8119 8119
 	/**
8120
-	* Gets all arrival airports of the airplanes that have flown over based on an departure airport
8121
-	*
8122
-	* @return Array the airport list
8123
-	*
8124
-	*/
8120
+	 * Gets all arrival airports of the airplanes that have flown over based on an departure airport
8121
+	 *
8122
+	 * @return Array the airport list
8123
+	 *
8124
+	 */
8125 8125
 	public function countAllArrivalAirportsByAirport($airport_icao,$filters = array())
8126 8126
 	{
8127 8127
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8154,11 +8154,11 @@  discard block
 block discarded – undo
8154 8154
 	
8155 8155
 	
8156 8156
 	/**
8157
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
8158
-	*
8159
-	* @return Array the airport list
8160
-	*
8161
-	*/
8157
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
8158
+	 *
8159
+	 * @return Array the airport list
8160
+	 *
8161
+	 */
8162 8162
 	public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array())
8163 8163
 	{
8164 8164
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8188,11 +8188,11 @@  discard block
 block discarded – undo
8188 8188
 	
8189 8189
 	
8190 8190
 	/**
8191
-	* Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
8192
-	*
8193
-	* @return Array the airport list
8194
-	*
8195
-	*/
8191
+	 * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
8192
+	 *
8193
+	 * @return Array the airport list
8194
+	 *
8195
+	 */
8196 8196
 	public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array())
8197 8197
 	{
8198 8198
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8226,11 +8226,11 @@  discard block
 block discarded – undo
8226 8226
 	
8227 8227
 	
8228 8228
 	/**
8229
-	* Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
8230
-	*
8231
-	* @return Array the airport list
8232
-	*
8233
-	*/
8229
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
8230
+	 *
8231
+	 * @return Array the airport list
8232
+	 *
8233
+	 */
8234 8234
 	public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
8235 8235
 	{
8236 8236
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8261,11 +8261,11 @@  discard block
 block discarded – undo
8261 8261
 	
8262 8262
 	
8263 8263
 	/**
8264
-	* Gets all arrival airports of the airplanes that have flown over based on a date
8265
-	*
8266
-	* @return Array the airport list
8267
-	*
8268
-	*/
8264
+	 * Gets all arrival airports of the airplanes that have flown over based on a date
8265
+	 *
8266
+	 * @return Array the airport list
8267
+	 *
8268
+	 */
8269 8269
 	public function countAllArrivalAirportsByDate($date,$filters = array())
8270 8270
 	{
8271 8271
 		global $globalTimezone, $globalDBdriver;
@@ -8311,11 +8311,11 @@  discard block
 block discarded – undo
8311 8311
 	
8312 8312
 	
8313 8313
 	/**
8314
-	* Gets all arrival airports by country of the airplanes that have flown over based on a date
8315
-	*
8316
-	* @return Array the airport list
8317
-	*
8318
-	*/
8314
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a date
8315
+	 *
8316
+	 * @return Array the airport list
8317
+	 *
8318
+	 */
8319 8319
 	public function countAllArrivalAirportCountriesByDate($date, $filters = array())
8320 8320
 	{
8321 8321
 		global $globalTimezone, $globalDBdriver;
@@ -8358,11 +8358,11 @@  discard block
 block discarded – undo
8358 8358
 	
8359 8359
 	
8360 8360
 	/**
8361
-	* Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
8362
-	*
8363
-	* @return Array the airport list
8364
-	*
8365
-	*/
8361
+	 * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
8362
+	 *
8363
+	 * @return Array the airport list
8364
+	 *
8365
+	 */
8366 8366
 	public function countAllArrivalAirportsByIdent($ident,$filters = array())
8367 8367
 	{
8368 8368
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8394,11 +8394,11 @@  discard block
 block discarded – undo
8394 8394
 	}
8395 8395
 	
8396 8396
 	/**
8397
-	* Gets all arrival airports of the airplanes that have flown over based on a owner
8398
-	*
8399
-	* @return Array the airport list
8400
-	*
8401
-	*/
8397
+	 * Gets all arrival airports of the airplanes that have flown over based on a owner
8398
+	 *
8399
+	 * @return Array the airport list
8400
+	 *
8401
+	 */
8402 8402
 	public function countAllArrivalAirportsByOwner($owner,$filters = array())
8403 8403
 	{
8404 8404
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8429,11 +8429,11 @@  discard block
 block discarded – undo
8429 8429
 	}
8430 8430
 
8431 8431
 	/**
8432
-	* Gets all arrival airports of the airplanes that have flown over based on a pilot
8433
-	*
8434
-	* @return Array the airport list
8435
-	*
8436
-	*/
8432
+	 * Gets all arrival airports of the airplanes that have flown over based on a pilot
8433
+	 *
8434
+	 * @return Array the airport list
8435
+	 *
8436
+	 */
8437 8437
 	public function countAllArrivalAirportsByPilot($pilot,$filters = array())
8438 8438
 	{
8439 8439
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8464,11 +8464,11 @@  discard block
 block discarded – undo
8464 8464
 	}
8465 8465
 	
8466 8466
 	/**
8467
-	* Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8468
-	*
8469
-	* @return Array the airport list
8470
-	*
8471
-	*/
8467
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8468
+	 *
8469
+	 * @return Array the airport list
8470
+	 *
8471
+	 */
8472 8472
 	public function countAllArrivalAirportCountriesByIdent($ident, $filters = array())
8473 8473
 	{
8474 8474
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8497,11 +8497,11 @@  discard block
 block discarded – undo
8497 8497
 	}
8498 8498
 	
8499 8499
 	/**
8500
-	* Gets all arrival airports by country of the airplanes that have flown over based on a owner
8501
-	*
8502
-	* @return Array the airport list
8503
-	*
8504
-	*/
8500
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a owner
8501
+	 *
8502
+	 * @return Array the airport list
8503
+	 *
8504
+	 */
8505 8505
 	public function countAllArrivalAirportCountriesByOwner($owner, $filters = array())
8506 8506
 	{
8507 8507
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8517,11 +8517,11 @@  discard block
 block discarded – undo
8517 8517
 	}
8518 8518
 	
8519 8519
 	/**
8520
-	* Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8521
-	*
8522
-	* @return Array the airport list
8523
-	*
8524
-	*/
8520
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8521
+	 *
8522
+	 * @return Array the airport list
8523
+	 *
8524
+	 */
8525 8525
 	public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array())
8526 8526
 	{
8527 8527
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8539,11 +8539,11 @@  discard block
 block discarded – undo
8539 8539
 	
8540 8540
 	
8541 8541
 	/**
8542
-	* Gets all arrival airports of the airplanes that have flown over based on a country
8543
-	*
8544
-	* @return Array the airport list
8545
-	*
8546
-	*/
8542
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
8543
+	 *
8544
+	 * @return Array the airport list
8545
+	 *
8546
+	 */
8547 8547
 	public function countAllArrivalAirportsByCountry($country,$filters = array())
8548 8548
 	{
8549 8549
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8576,11 +8576,11 @@  discard block
 block discarded – undo
8576 8576
 	
8577 8577
 	
8578 8578
 	/**
8579
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
8580
-	*
8581
-	* @return Array the airport list
8582
-	*
8583
-	*/
8579
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
8580
+	 *
8581
+	 * @return Array the airport list
8582
+	 *
8583
+	 */
8584 8584
 	public function countAllArrivalAirportCountriesByCountry($country,$filters = array())
8585 8585
 	{
8586 8586
 		global $globalDBdriver;
@@ -8612,11 +8612,11 @@  discard block
 block discarded – undo
8612 8612
 
8613 8613
 
8614 8614
 	/**
8615
-	* Counts all airport departure countries
8616
-	*
8617
-	* @return Array the airport departure list
8618
-	*
8619
-	*/
8615
+	 * Counts all airport departure countries
8616
+	 *
8617
+	 * @return Array the airport departure list
8618
+	 *
8619
+	 */
8620 8620
 	public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '')
8621 8621
 	{
8622 8622
 		global $globalDBdriver;
@@ -8675,11 +8675,11 @@  discard block
 block discarded – undo
8675 8675
 	
8676 8676
 	
8677 8677
 	/**
8678
-	* Counts all airport arrival countries
8679
-	*
8680
-	* @return Array the airport arrival list
8681
-	*
8682
-	*/
8678
+	 * Counts all airport arrival countries
8679
+	 *
8680
+	 * @return Array the airport arrival list
8681
+	 *
8682
+	 */
8683 8683
 	public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '')
8684 8684
 	{
8685 8685
 		global $globalDBdriver;
@@ -8742,11 +8742,11 @@  discard block
 block discarded – undo
8742 8742
 
8743 8743
 
8744 8744
 	/**
8745
-	* Gets all route combinations
8746
-	*
8747
-	* @return Array the route list
8748
-	*
8749
-	*/
8745
+	 * Gets all route combinations
8746
+	 *
8747
+	 * @return Array the route list
8748
+	 *
8749
+	 */
8750 8750
 	public function countAllRoutes($filters = array())
8751 8751
 	{
8752 8752
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8785,11 +8785,11 @@  discard block
 block discarded – undo
8785 8785
 	
8786 8786
 	
8787 8787
 	/**
8788
-	* Gets all route combinations based on an aircraft
8789
-	*
8790
-	* @return Array the route list
8791
-	*
8792
-	*/
8788
+	 * Gets all route combinations based on an aircraft
8789
+	 *
8790
+	 * @return Array the route list
8791
+	 *
8792
+	 */
8793 8793
 	public function countAllRoutesByAircraft($aircraft_icao,$filters = array())
8794 8794
 	{
8795 8795
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8825,11 +8825,11 @@  discard block
 block discarded – undo
8825 8825
 	
8826 8826
 	
8827 8827
 	/**
8828
-	* Gets all route combinations based on an aircraft registration
8829
-	*
8830
-	* @return Array the route list
8831
-	*
8832
-	*/
8828
+	 * Gets all route combinations based on an aircraft registration
8829
+	 *
8830
+	 * @return Array the route list
8831
+	 *
8832
+	 */
8833 8833
 	public function countAllRoutesByRegistration($registration, $filters = array())
8834 8834
 	{
8835 8835
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8867,11 +8867,11 @@  discard block
 block discarded – undo
8867 8867
 	
8868 8868
 	
8869 8869
 	/**
8870
-	* Gets all route combinations based on an airline
8871
-	*
8872
-	* @return Array the route list
8873
-	*
8874
-	*/
8870
+	 * Gets all route combinations based on an airline
8871
+	 *
8872
+	 * @return Array the route list
8873
+	 *
8874
+	 */
8875 8875
 	public function countAllRoutesByAirline($airline_icao, $filters = array())
8876 8876
 	{
8877 8877
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8909,11 +8909,11 @@  discard block
 block discarded – undo
8909 8909
 	
8910 8910
 	
8911 8911
 	/**
8912
-	* Gets all route combinations based on an airport
8913
-	*
8914
-	* @return Array the route list
8915
-	*
8916
-	*/
8912
+	 * Gets all route combinations based on an airport
8913
+	 *
8914
+	 * @return Array the route list
8915
+	 *
8916
+	 */
8917 8917
 	public function countAllRoutesByAirport($airport_icao, $filters = array())
8918 8918
 	{
8919 8919
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8950,11 +8950,11 @@  discard block
 block discarded – undo
8950 8950
 	
8951 8951
 	
8952 8952
 	/**
8953
-	* Gets all route combinations based on an country
8954
-	*
8955
-	* @return Array the route list
8956
-	*
8957
-	*/
8953
+	 * Gets all route combinations based on an country
8954
+	 *
8955
+	 * @return Array the route list
8956
+	 *
8957
+	 */
8958 8958
 	public function countAllRoutesByCountry($country, $filters = array())
8959 8959
 	{
8960 8960
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8990,11 +8990,11 @@  discard block
 block discarded – undo
8990 8990
 
8991 8991
 
8992 8992
 	/**
8993
-	* Gets all route combinations based on an date
8994
-	*
8995
-	* @return Array the route list
8996
-	*
8997
-	*/
8993
+	 * Gets all route combinations based on an date
8994
+	 *
8995
+	 * @return Array the route list
8996
+	 *
8997
+	 */
8998 8998
 	public function countAllRoutesByDate($date, $filters = array())
8999 8999
 	{
9000 9000
 		global $globalTimezone, $globalDBdriver;
@@ -9044,11 +9044,11 @@  discard block
 block discarded – undo
9044 9044
 	
9045 9045
 	
9046 9046
 	/**
9047
-	* Gets all route combinations based on an ident/callsign
9048
-	*
9049
-	* @return Array the route list
9050
-	*
9051
-	*/
9047
+	 * Gets all route combinations based on an ident/callsign
9048
+	 *
9049
+	 * @return Array the route list
9050
+	 *
9051
+	 */
9052 9052
 	public function countAllRoutesByIdent($ident, $filters = array())
9053 9053
 	{
9054 9054
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9084,11 +9084,11 @@  discard block
 block discarded – undo
9084 9084
 	}
9085 9085
 	
9086 9086
 	/**
9087
-	* Gets all route combinations based on an owner
9088
-	*
9089
-	* @return Array the route list
9090
-	*
9091
-	*/
9087
+	 * Gets all route combinations based on an owner
9088
+	 *
9089
+	 * @return Array the route list
9090
+	 *
9091
+	 */
9092 9092
 	public function countAllRoutesByOwner($owner,$filters = array())
9093 9093
 	{
9094 9094
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9124,11 +9124,11 @@  discard block
 block discarded – undo
9124 9124
 	}
9125 9125
 	
9126 9126
 	/**
9127
-	* Gets all route combinations based on a pilot
9128
-	*
9129
-	* @return Array the route list
9130
-	*
9131
-	*/
9127
+	 * Gets all route combinations based on a pilot
9128
+	 *
9129
+	 * @return Array the route list
9130
+	 *
9131
+	 */
9132 9132
 	public function countAllRoutesByPilot($pilot,$filters = array())
9133 9133
 	{
9134 9134
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9165,11 +9165,11 @@  discard block
 block discarded – undo
9165 9165
 	
9166 9166
 	
9167 9167
 	/**
9168
-	* Gets all route combinations based on an manufacturer
9169
-	*
9170
-	* @return Array the route list
9171
-	*
9172
-	*/
9168
+	 * Gets all route combinations based on an manufacturer
9169
+	 *
9170
+	 * @return Array the route list
9171
+	 *
9172
+	 */
9173 9173
 	public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array())
9174 9174
 	{
9175 9175
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9207,11 +9207,11 @@  discard block
 block discarded – undo
9207 9207
 	
9208 9208
 	
9209 9209
 	/**
9210
-	* Gets all route combinations with waypoints
9211
-	*
9212
-	* @return Array the route list
9213
-	*
9214
-	*/
9210
+	 * Gets all route combinations with waypoints
9211
+	 *
9212
+	 * @return Array the route list
9213
+	 *
9214
+	 */
9215 9215
 	public function countAllRoutesWithWaypoints($filters = array())
9216 9216
 	{
9217 9217
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9248,11 +9248,11 @@  discard block
 block discarded – undo
9248 9248
 	}
9249 9249
 	
9250 9250
 	/**
9251
-	* Gets all callsigns that have flown over
9252
-	*
9253
-	* @return Array the callsign list
9254
-	*
9255
-	*/
9251
+	 * Gets all callsigns that have flown over
9252
+	 *
9253
+	 * @return Array the callsign list
9254
+	 *
9255
+	 */
9256 9256
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
9257 9257
 	{
9258 9258
 		global $globalDBdriver;
@@ -9318,11 +9318,11 @@  discard block
 block discarded – undo
9318 9318
 	}
9319 9319
 
9320 9320
 	/**
9321
-	* Gets all callsigns that have flown over
9322
-	*
9323
-	* @return Array the callsign list
9324
-	*
9325
-	*/
9321
+	 * Gets all callsigns that have flown over
9322
+	 *
9323
+	 * @return Array the callsign list
9324
+	 *
9325
+	 */
9326 9326
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array())
9327 9327
 	{
9328 9328
 		global $globalDBdriver;
@@ -9363,11 +9363,11 @@  discard block
 block discarded – undo
9363 9363
 
9364 9364
 
9365 9365
 	/**
9366
-	* Counts all dates
9367
-	*
9368
-	* @return Array the date list
9369
-	*
9370
-	*/
9366
+	 * Counts all dates
9367
+	 *
9368
+	 * @return Array the date list
9369
+	 *
9370
+	 */
9371 9371
 	public function countAllDates($filters = array())
9372 9372
 	{
9373 9373
 		global $globalTimezone, $globalDBdriver;
@@ -9412,11 +9412,11 @@  discard block
 block discarded – undo
9412 9412
 	}
9413 9413
 	
9414 9414
 	/**
9415
-	* Counts all dates
9416
-	*
9417
-	* @return Array the date list
9418
-	*
9419
-	*/
9415
+	 * Counts all dates
9416
+	 *
9417
+	 * @return Array the date list
9418
+	 *
9419
+	 */
9420 9420
 	public function countAllDatesByAirlines($filters = array())
9421 9421
 	{
9422 9422
 		global $globalTimezone, $globalDBdriver;
@@ -9461,11 +9461,11 @@  discard block
 block discarded – undo
9461 9461
 	}	
9462 9462
 	
9463 9463
 	/**
9464
-	* Counts all dates during the last 7 days
9465
-	*
9466
-	* @return Array the date list
9467
-	*
9468
-	*/
9464
+	 * Counts all dates during the last 7 days
9465
+	 *
9466
+	 * @return Array the date list
9467
+	 *
9468
+	 */
9469 9469
 	public function countAllDatesLast7Days($filters = array())
9470 9470
 	{
9471 9471
 		global $globalTimezone, $globalDBdriver;
@@ -9487,7 +9487,7 @@  discard block
 block discarded – undo
9487 9487
 			$query .= " GROUP BY date_name 
9488 9488
 								ORDER BY date_name ASC";
9489 9489
 			$query_data = array(':offset' => $offset);
9490
-    		}
9490
+			}
9491 9491
 		
9492 9492
 		$sth = $this->db->prepare($query);
9493 9493
 		$sth->execute($query_data);
@@ -9507,11 +9507,11 @@  discard block
 block discarded – undo
9507 9507
 	}
9508 9508
 
9509 9509
 	/**
9510
-	* Counts all dates during the last month
9511
-	*
9512
-	* @return Array the date list
9513
-	*
9514
-	*/
9510
+	 * Counts all dates during the last month
9511
+	 *
9512
+	 * @return Array the date list
9513
+	 *
9514
+	 */
9515 9515
 	public function countAllDatesLastMonth($filters = array())
9516 9516
 	{
9517 9517
 		global $globalTimezone, $globalDBdriver;
@@ -9533,7 +9533,7 @@  discard block
 block discarded – undo
9533 9533
 			$query .= " GROUP BY date_name 
9534 9534
 								ORDER BY date_name ASC";
9535 9535
 			$query_data = array(':offset' => $offset);
9536
-    		}
9536
+			}
9537 9537
 		
9538 9538
 		$sth = $this->db->prepare($query);
9539 9539
 		$sth->execute($query_data);
@@ -9554,11 +9554,11 @@  discard block
 block discarded – undo
9554 9554
 
9555 9555
 
9556 9556
 	/**
9557
-	* Counts all dates during the last month
9558
-	*
9559
-	* @return Array the date list
9560
-	*
9561
-	*/
9557
+	 * Counts all dates during the last month
9558
+	 *
9559
+	 * @return Array the date list
9560
+	 *
9561
+	 */
9562 9562
 	public function countAllDatesLastMonthByAirlines($filters = array())
9563 9563
 	{
9564 9564
 		global $globalTimezone, $globalDBdriver;
@@ -9581,7 +9581,7 @@  discard block
 block discarded – undo
9581 9581
 								GROUP BY spotter_output.airline_icao, date_name 
9582 9582
 								ORDER BY date_name ASC";
9583 9583
 			$query_data = array(':offset' => $offset);
9584
-    		}
9584
+			}
9585 9585
 		
9586 9586
 		$sth = $this->db->prepare($query);
9587 9587
 		$sth->execute($query_data);
@@ -9603,11 +9603,11 @@  discard block
 block discarded – undo
9603 9603
 	
9604 9604
 
9605 9605
 	/**
9606
-	* Counts all month
9607
-	*
9608
-	* @return Array the month list
9609
-	*
9610
-	*/
9606
+	 * Counts all month
9607
+	 *
9608
+	 * @return Array the month list
9609
+	 *
9610
+	 */
9611 9611
 	public function countAllMonths($filters = array())
9612 9612
 	{
9613 9613
 		global $globalTimezone, $globalDBdriver;
@@ -9649,11 +9649,11 @@  discard block
 block discarded – undo
9649 9649
 	}
9650 9650
 
9651 9651
 	/**
9652
-	* Counts all month
9653
-	*
9654
-	* @return Array the month list
9655
-	*
9656
-	*/
9652
+	 * Counts all month
9653
+	 *
9654
+	 * @return Array the month list
9655
+	 *
9656
+	 */
9657 9657
 	public function countAllMonthsByAirlines($filters = array())
9658 9658
 	{
9659 9659
 		global $globalTimezone, $globalDBdriver;
@@ -9698,11 +9698,11 @@  discard block
 block discarded – undo
9698 9698
 	}
9699 9699
 
9700 9700
 	/**
9701
-	* Counts all military month
9702
-	*
9703
-	* @return Array the month list
9704
-	*
9705
-	*/
9701
+	 * Counts all military month
9702
+	 *
9703
+	 * @return Array the month list
9704
+	 *
9705
+	 */
9706 9706
 	public function countAllMilitaryMonths($filters = array())
9707 9707
 	{
9708 9708
 		global $globalTimezone, $globalDBdriver;
@@ -9743,11 +9743,11 @@  discard block
 block discarded – undo
9743 9743
 	}
9744 9744
 	
9745 9745
 	/**
9746
-	* Counts all month owners
9747
-	*
9748
-	* @return Array the month list
9749
-	*
9750
-	*/
9746
+	 * Counts all month owners
9747
+	 *
9748
+	 * @return Array the month list
9749
+	 *
9750
+	 */
9751 9751
 	public function countAllMonthsOwners($filters = array())
9752 9752
 	{
9753 9753
 		global $globalTimezone, $globalDBdriver;
@@ -9789,11 +9789,11 @@  discard block
 block discarded – undo
9789 9789
 	}
9790 9790
 	
9791 9791
 	/**
9792
-	* Counts all month owners
9793
-	*
9794
-	* @return Array the month list
9795
-	*
9796
-	*/
9792
+	 * Counts all month owners
9793
+	 *
9794
+	 * @return Array the month list
9795
+	 *
9796
+	 */
9797 9797
 	public function countAllMonthsOwnersByAirlines($filters = array())
9798 9798
 	{
9799 9799
 		global $globalTimezone, $globalDBdriver;
@@ -9836,11 +9836,11 @@  discard block
 block discarded – undo
9836 9836
 	}
9837 9837
 
9838 9838
 	/**
9839
-	* Counts all month pilot
9840
-	*
9841
-	* @return Array the month list
9842
-	*
9843
-	*/
9839
+	 * Counts all month pilot
9840
+	 *
9841
+	 * @return Array the month list
9842
+	 *
9843
+	 */
9844 9844
 	public function countAllMonthsPilots($filters = array())
9845 9845
 	{
9846 9846
 		global $globalTimezone, $globalDBdriver;
@@ -9882,11 +9882,11 @@  discard block
 block discarded – undo
9882 9882
 	}
9883 9883
 	
9884 9884
 	/**
9885
-	* Counts all month pilot
9886
-	*
9887
-	* @return Array the month list
9888
-	*
9889
-	*/
9885
+	 * Counts all month pilot
9886
+	 *
9887
+	 * @return Array the month list
9888
+	 *
9889
+	 */
9890 9890
 	public function countAllMonthsPilotsByAirlines($filters = array())
9891 9891
 	{
9892 9892
 		global $globalTimezone, $globalDBdriver;
@@ -9929,11 +9929,11 @@  discard block
 block discarded – undo
9929 9929
 	}
9930 9930
 
9931 9931
 	/**
9932
-	* Counts all month airline
9933
-	*
9934
-	* @return Array the month list
9935
-	*
9936
-	*/
9932
+	 * Counts all month airline
9933
+	 *
9934
+	 * @return Array the month list
9935
+	 *
9936
+	 */
9937 9937
 	public function countAllMonthsAirlines($filters = array())
9938 9938
 	{
9939 9939
 		global $globalTimezone, $globalDBdriver;
@@ -9975,11 +9975,11 @@  discard block
 block discarded – undo
9975 9975
 	}
9976 9976
 	
9977 9977
 	/**
9978
-	* Counts all month aircraft
9979
-	*
9980
-	* @return Array the month list
9981
-	*
9982
-	*/
9978
+	 * Counts all month aircraft
9979
+	 *
9980
+	 * @return Array the month list
9981
+	 *
9982
+	 */
9983 9983
 	public function countAllMonthsAircrafts($filters = array())
9984 9984
 	{
9985 9985
 		global $globalTimezone, $globalDBdriver;
@@ -10022,11 +10022,11 @@  discard block
 block discarded – undo
10022 10022
 	
10023 10023
 
10024 10024
 	/**
10025
-	* Counts all month aircraft
10026
-	*
10027
-	* @return Array the month list
10028
-	*
10029
-	*/
10025
+	 * Counts all month aircraft
10026
+	 *
10027
+	 * @return Array the month list
10028
+	 *
10029
+	 */
10030 10030
 	public function countAllMonthsAircraftsByAirlines($filters = array())
10031 10031
 	{
10032 10032
 		global $globalTimezone, $globalDBdriver;
@@ -10069,11 +10069,11 @@  discard block
 block discarded – undo
10069 10069
 	}
10070 10070
 
10071 10071
 	/**
10072
-	* Counts all month real arrival
10073
-	*
10074
-	* @return Array the month list
10075
-	*
10076
-	*/
10072
+	 * Counts all month real arrival
10073
+	 *
10074
+	 * @return Array the month list
10075
+	 *
10076
+	 */
10077 10077
 	public function countAllMonthsRealArrivals($filters = array())
10078 10078
 	{
10079 10079
 		global $globalTimezone, $globalDBdriver;
@@ -10116,11 +10116,11 @@  discard block
 block discarded – undo
10116 10116
 	
10117 10117
 
10118 10118
 	/**
10119
-	* Counts all month real arrival
10120
-	*
10121
-	* @return Array the month list
10122
-	*
10123
-	*/
10119
+	 * Counts all month real arrival
10120
+	 *
10121
+	 * @return Array the month list
10122
+	 *
10123
+	 */
10124 10124
 	public function countAllMonthsRealArrivalsByAirlines($filters = array())
10125 10125
 	{
10126 10126
 		global $globalTimezone, $globalDBdriver;
@@ -10164,11 +10164,11 @@  discard block
 block discarded – undo
10164 10164
 	
10165 10165
 
10166 10166
 	/**
10167
-	* Counts all dates during the last year
10168
-	*
10169
-	* @return Array the date list
10170
-	*
10171
-	*/
10167
+	 * Counts all dates during the last year
10168
+	 *
10169
+	 * @return Array the date list
10170
+	 *
10171
+	 */
10172 10172
 	public function countAllMonthsLastYear($filters)
10173 10173
 	{
10174 10174
 		global $globalTimezone, $globalDBdriver;
@@ -10190,7 +10190,7 @@  discard block
 block discarded – undo
10190 10190
 			$query .= " GROUP BY year_name, month_name
10191 10191
 								ORDER BY year_name, month_name ASC";
10192 10192
 			$query_data = array(':offset' => $offset);
10193
-    		}
10193
+			}
10194 10194
 		
10195 10195
 		$sth = $this->db->prepare($query);
10196 10196
 		$sth->execute($query_data);
@@ -10213,11 +10213,11 @@  discard block
 block discarded – undo
10213 10213
 	
10214 10214
 	
10215 10215
 	/**
10216
-	* Counts all hours
10217
-	*
10218
-	* @return Array the hour list
10219
-	*
10220
-	*/
10216
+	 * Counts all hours
10217
+	 *
10218
+	 * @return Array the hour list
10219
+	 *
10220
+	 */
10221 10221
 	public function countAllHours($orderby,$filters = array())
10222 10222
 	{
10223 10223
 		global $globalTimezone, $globalDBdriver;
@@ -10278,11 +10278,11 @@  discard block
 block discarded – undo
10278 10278
 	}
10279 10279
 	
10280 10280
 	/**
10281
-	* Counts all hours
10282
-	*
10283
-	* @return Array the hour list
10284
-	*
10285
-	*/
10281
+	 * Counts all hours
10282
+	 *
10283
+	 * @return Array the hour list
10284
+	 *
10285
+	 */
10286 10286
 	public function countAllHoursByAirlines($orderby, $filters = array())
10287 10287
 	{
10288 10288
 		global $globalTimezone, $globalDBdriver;
@@ -10345,11 +10345,11 @@  discard block
 block discarded – undo
10345 10345
 
10346 10346
 
10347 10347
 	/**
10348
-	* Counts all hours by airline
10349
-	*
10350
-	* @return Array the hour list
10351
-	*
10352
-	*/
10348
+	 * Counts all hours by airline
10349
+	 *
10350
+	 * @return Array the hour list
10351
+	 *
10352
+	 */
10353 10353
 	public function countAllHoursByAirline($airline_icao, $filters = array())
10354 10354
 	{
10355 10355
 		global $globalTimezone, $globalDBdriver;
@@ -10395,11 +10395,11 @@  discard block
 block discarded – undo
10395 10395
 	
10396 10396
 	
10397 10397
 	/**
10398
-	* Counts all hours by aircraft
10399
-	*
10400
-	* @return Array the hour list
10401
-	*
10402
-	*/
10398
+	 * Counts all hours by aircraft
10399
+	 *
10400
+	 * @return Array the hour list
10401
+	 *
10402
+	 */
10403 10403
 	public function countAllHoursByAircraft($aircraft_icao, $filters = array())
10404 10404
 	{
10405 10405
 		global $globalTimezone, $globalDBdriver;
@@ -10442,11 +10442,11 @@  discard block
 block discarded – undo
10442 10442
 	
10443 10443
 	
10444 10444
 	/**
10445
-	* Counts all hours by aircraft registration
10446
-	*
10447
-	* @return Array the hour list
10448
-	*
10449
-	*/
10445
+	 * Counts all hours by aircraft registration
10446
+	 *
10447
+	 * @return Array the hour list
10448
+	 *
10449
+	 */
10450 10450
 	public function countAllHoursByRegistration($registration, $filters = array())
10451 10451
 	{
10452 10452
 		global $globalTimezone, $globalDBdriver;
@@ -10489,11 +10489,11 @@  discard block
 block discarded – undo
10489 10489
 	
10490 10490
 	
10491 10491
 	/**
10492
-	* Counts all hours by airport
10493
-	*
10494
-	* @return Array the hour list
10495
-	*
10496
-	*/
10492
+	 * Counts all hours by airport
10493
+	 *
10494
+	 * @return Array the hour list
10495
+	 *
10496
+	 */
10497 10497
 	public function countAllHoursByAirport($airport_icao, $filters = array())
10498 10498
 	{
10499 10499
 		global $globalTimezone, $globalDBdriver;
@@ -10537,11 +10537,11 @@  discard block
 block discarded – undo
10537 10537
 	
10538 10538
 	
10539 10539
 	/**
10540
-	* Counts all hours by manufacturer
10541
-	*
10542
-	* @return Array the hour list
10543
-	*
10544
-	*/
10540
+	 * Counts all hours by manufacturer
10541
+	 *
10542
+	 * @return Array the hour list
10543
+	 *
10544
+	 */
10545 10545
 	public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array())
10546 10546
 	{
10547 10547
 		global $globalTimezone, $globalDBdriver;
@@ -10585,11 +10585,11 @@  discard block
 block discarded – undo
10585 10585
 	
10586 10586
 	
10587 10587
 	/**
10588
-	* Counts all hours by date
10589
-	*
10590
-	* @return Array the hour list
10591
-	*
10592
-	*/
10588
+	 * Counts all hours by date
10589
+	 *
10590
+	 * @return Array the hour list
10591
+	 *
10592
+	 */
10593 10593
 	public function countAllHoursByDate($date, $filters = array())
10594 10594
 	{
10595 10595
 		global $globalTimezone, $globalDBdriver;
@@ -10633,11 +10633,11 @@  discard block
 block discarded – undo
10633 10633
 	
10634 10634
 	
10635 10635
 	/**
10636
-	* Counts all hours by a ident/callsign
10637
-	*
10638
-	* @return Array the hour list
10639
-	*
10640
-	*/
10636
+	 * Counts all hours by a ident/callsign
10637
+	 *
10638
+	 * @return Array the hour list
10639
+	 *
10640
+	 */
10641 10641
 	public function countAllHoursByIdent($ident, $filters = array())
10642 10642
 	{
10643 10643
 		global $globalTimezone, $globalDBdriver;
@@ -10680,11 +10680,11 @@  discard block
 block discarded – undo
10680 10680
 	}
10681 10681
 	
10682 10682
 	/**
10683
-	* Counts all hours by a owner
10684
-	*
10685
-	* @return Array the hour list
10686
-	*
10687
-	*/
10683
+	 * Counts all hours by a owner
10684
+	 *
10685
+	 * @return Array the hour list
10686
+	 *
10687
+	 */
10688 10688
 	public function countAllHoursByOwner($owner, $filters = array())
10689 10689
 	{
10690 10690
 		global $globalTimezone, $globalDBdriver;
@@ -10727,11 +10727,11 @@  discard block
 block discarded – undo
10727 10727
 	}
10728 10728
 	
10729 10729
 	/**
10730
-	* Counts all hours by a pilot
10731
-	*
10732
-	* @return Array the hour list
10733
-	*
10734
-	*/
10730
+	 * Counts all hours by a pilot
10731
+	 *
10732
+	 * @return Array the hour list
10733
+	 *
10734
+	 */
10735 10735
 	public function countAllHoursByPilot($pilot, $filters = array())
10736 10736
 	{
10737 10737
 		global $globalTimezone, $globalDBdriver;
@@ -10776,11 +10776,11 @@  discard block
 block discarded – undo
10776 10776
 	
10777 10777
 	
10778 10778
 	/**
10779
-	* Counts all hours by route
10780
-	*
10781
-	* @return Array the hour list
10782
-	*
10783
-	*/
10779
+	 * Counts all hours by route
10780
+	 *
10781
+	 * @return Array the hour list
10782
+	 *
10783
+	 */
10784 10784
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array())
10785 10785
 	{
10786 10786
 		global $globalTimezone, $globalDBdriver;
@@ -10824,11 +10824,11 @@  discard block
 block discarded – undo
10824 10824
 	
10825 10825
 	
10826 10826
 	/**
10827
-	* Counts all hours by country
10828
-	*
10829
-	* @return Array the hour list
10830
-	*
10831
-	*/
10827
+	 * Counts all hours by country
10828
+	 *
10829
+	 * @return Array the hour list
10830
+	 *
10831
+	 */
10832 10832
 	public function countAllHoursByCountry($country, $filters = array())
10833 10833
 	{
10834 10834
 		global $globalTimezone, $globalDBdriver;
@@ -10873,11 +10873,11 @@  discard block
 block discarded – undo
10873 10873
 
10874 10874
 
10875 10875
 	/**
10876
-	* Counts all aircraft that have flown over
10877
-	*
10878
-	* @return Integer the number of aircrafts
10879
-	*
10880
-	*/
10876
+	 * Counts all aircraft that have flown over
10877
+	 *
10878
+	 * @return Integer the number of aircrafts
10879
+	 *
10880
+	 */
10881 10881
 	public function countOverallAircrafts($filters = array(),$year = '',$month = '')
10882 10882
 	{
10883 10883
 		global $globalDBdriver;
@@ -10910,11 +10910,11 @@  discard block
 block discarded – undo
10910 10910
 	}
10911 10911
 
10912 10912
 	/**
10913
-	* Counts all flight that really arrival
10914
-	*
10915
-	* @return Integer the number of aircrafts
10916
-	*
10917
-	*/
10913
+	 * Counts all flight that really arrival
10914
+	 *
10915
+	 * @return Integer the number of aircrafts
10916
+	 *
10917
+	 */
10918 10918
 	public function countOverallArrival($filters = array(),$year = '',$month = '')
10919 10919
 	{
10920 10920
 		global $globalDBdriver;
@@ -10947,11 +10947,11 @@  discard block
 block discarded – undo
10947 10947
 	}
10948 10948
 
10949 10949
 	/**
10950
-	* Counts all pilots that have flown over
10951
-	*
10952
-	* @return Integer the number of pilots
10953
-	*
10954
-	*/
10950
+	 * Counts all pilots that have flown over
10951
+	 *
10952
+	 * @return Integer the number of pilots
10953
+	 *
10954
+	 */
10955 10955
 	public function countOverallPilots($filters = array(),$year = '',$month = '')
10956 10956
 	{
10957 10957
 		global $globalDBdriver;
@@ -10983,11 +10983,11 @@  discard block
 block discarded – undo
10983 10983
 	}
10984 10984
 
10985 10985
 	/**
10986
-	* Counts all owners that have flown over
10987
-	*
10988
-	* @return Integer the number of owners
10989
-	*
10990
-	*/
10986
+	 * Counts all owners that have flown over
10987
+	 *
10988
+	 * @return Integer the number of owners
10989
+	 *
10990
+	 */
10991 10991
 	public function countOverallOwners($filters = array(),$year = '',$month = '')
10992 10992
 	{
10993 10993
 		global $globalDBdriver;
@@ -11020,11 +11020,11 @@  discard block
 block discarded – undo
11020 11020
 	
11021 11021
 	
11022 11022
 	/**
11023
-	* Counts all flights that have flown over
11024
-	*
11025
-	* @return Integer the number of flights
11026
-	*
11027
-	*/
11023
+	 * Counts all flights that have flown over
11024
+	 *
11025
+	 * @return Integer the number of flights
11026
+	 *
11027
+	 */
11028 11028
 	public function countOverallFlights($filters = array(),$year = '',$month = '')
11029 11029
 	{
11030 11030
 		global $globalDBdriver;
@@ -11058,11 +11058,11 @@  discard block
 block discarded – undo
11058 11058
 	}
11059 11059
 	
11060 11060
 	/**
11061
-	* Counts all military flights that have flown over
11062
-	*
11063
-	* @return Integer the number of flights
11064
-	*
11065
-	*/
11061
+	 * Counts all military flights that have flown over
11062
+	 *
11063
+	 * @return Integer the number of flights
11064
+	 *
11065
+	 */
11066 11066
 	public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '')
11067 11067
 	{
11068 11068
 		global $globalDBdriver;
@@ -11097,11 +11097,11 @@  discard block
 block discarded – undo
11097 11097
 	
11098 11098
 	
11099 11099
 	/**
11100
-	* Counts all airlines that have flown over
11101
-	*
11102
-	* @return Integer the number of airlines
11103
-	*
11104
-	*/
11100
+	 * Counts all airlines that have flown over
11101
+	 *
11102
+	 * @return Integer the number of airlines
11103
+	 *
11104
+	 */
11105 11105
 	public function countOverallAirlines($filters = array(),$year = '',$month = '')
11106 11106
 	{
11107 11107
 		global $globalDBdriver;
@@ -11128,8 +11128,8 @@  discard block
 block discarded – undo
11128 11128
 				$query_values = array_merge($query_values,array(':month' => $month));
11129 11129
 			}
11130 11130
 		}
11131
-                if ($query == '') $queryi .= $this->getFilter($filters);
11132
-                else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
11131
+				if ($query == '') $queryi .= $this->getFilter($filters);
11132
+				else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
11133 11133
 
11134 11134
 
11135 11135
 		$sth = $this->db->prepare($queryi);
@@ -11139,11 +11139,11 @@  discard block
 block discarded – undo
11139 11139
 
11140 11140
   
11141 11141
 	/**
11142
-	* Counts all hours of today
11143
-	*
11144
-	* @return Array the hour list
11145
-	*
11146
-	*/
11142
+	 * Counts all hours of today
11143
+	 *
11144
+	 * @return Array the hour list
11145
+	 *
11146
+	 */
11147 11147
 	public function countAllHoursFromToday($filters = array())
11148 11148
 	{
11149 11149
 		global $globalTimezone, $globalDBdriver;
@@ -11183,11 +11183,11 @@  discard block
 block discarded – undo
11183 11183
 	}
11184 11184
     
11185 11185
 	/**
11186
-	* Gets all the spotter information based on calculated upcoming flights
11187
-	*
11188
-	* @return Array the spotter information
11189
-	*
11190
-	*/
11186
+	 * Gets all the spotter information based on calculated upcoming flights
11187
+	 *
11188
+	 * @return Array the spotter information
11189
+	 *
11190
+	 */
11191 11191
 	public function getUpcomingFlights($limit = '', $sort = '', $filters = array())
11192 11192
 	{
11193 11193
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -11262,12 +11262,12 @@  discard block
 block discarded – undo
11262 11262
 	}
11263 11263
     
11264 11264
     
11265
-     /**
11266
-	* Gets the Barrie Spotter ID based on the FlightAware ID
11267
-	*
11268
-	* @return Integer the Barrie Spotter ID
11265
+	 /**
11266
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
11267
+	  *
11268
+	  * @return Integer the Barrie Spotter ID
11269 11269
 q	*
11270
-	*/
11270
+	  */
11271 11271
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
11272 11272
 	{
11273 11273
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -11288,13 +11288,13 @@  discard block
 block discarded – undo
11288 11288
   
11289 11289
  
11290 11290
 	/**
11291
-	* Parses a date string
11292
-	*
11293
-	* @param String $dateString the date string
11294
-	* @param String $timezone the timezone of a user
11295
-	* @return Array the time information
11296
-	*
11297
-	*/
11291
+	 * Parses a date string
11292
+	 *
11293
+	 * @param String $dateString the date string
11294
+	 * @param String $timezone the timezone of a user
11295
+	 * @return Array the time information
11296
+	 *
11297
+	 */
11298 11298
 	public function parseDateString($dateString, $timezone = '')
11299 11299
 	{
11300 11300
 		$time_array = array();
@@ -11330,12 +11330,12 @@  discard block
 block discarded – undo
11330 11330
 	
11331 11331
 	
11332 11332
 	/**
11333
-	* Parses the direction degrees to working
11334
-	*
11335
-	* @param Float $direction the direction in degrees
11336
-	* @return Array the direction information
11337
-	*
11338
-	*/
11333
+	 * Parses the direction degrees to working
11334
+	 *
11335
+	 * @param Float $direction the direction in degrees
11336
+	 * @return Array the direction information
11337
+	 *
11338
+	 */
11339 11339
 	public function parseDirection($direction = 0)
11340 11340
 	{
11341 11341
 		if ($direction == '') $direction = 0;
@@ -11414,12 +11414,12 @@  discard block
 block discarded – undo
11414 11414
 	
11415 11415
 	
11416 11416
 	/**
11417
-	* Gets the aircraft registration
11418
-	*
11419
-	* @param String $flightaware_id the flight aware id
11420
-	* @return String the aircraft registration
11421
-	*
11422
-	*/
11417
+	 * Gets the aircraft registration
11418
+	 *
11419
+	 * @param String $flightaware_id the flight aware id
11420
+	 * @return String the aircraft registration
11421
+	 *
11422
+	 */
11423 11423
 	
11424 11424
 	public function getAircraftRegistration($flightaware_id)
11425 11425
 	{
@@ -11448,12 +11448,12 @@  discard block
 block discarded – undo
11448 11448
 
11449 11449
 
11450 11450
 	/**
11451
-	* Gets the aircraft registration from ModeS
11452
-	*
11453
-	* @param String $aircraft_modes the flight ModeS in hex
11454
-	* @return String the aircraft registration
11455
-	*
11456
-	*/
11451
+	 * Gets the aircraft registration from ModeS
11452
+	 *
11453
+	 * @param String $aircraft_modes the flight ModeS in hex
11454
+	 * @return String the aircraft registration
11455
+	 *
11456
+	 */
11457 11457
 	public function getAircraftRegistrationBymodeS($aircraft_modes, $source_type = '')
11458 11458
 	{
11459 11459
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11469,8 +11469,8 @@  discard block
 block discarded – undo
11469 11469
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11470 11470
 		$sth->closeCursor();
11471 11471
 		if (count($row) > 0) {
11472
-		    //return $row['Registration'];
11473
-		    return $row['registration'];
11472
+			//return $row['Registration'];
11473
+			return $row['registration'];
11474 11474
 		} elseif ($source_type == 'flarm') {
11475 11475
 			return $this->getAircraftRegistrationBymodeS($aircraft_modes);
11476 11476
 		} else return '';
@@ -11478,12 +11478,12 @@  discard block
 block discarded – undo
11478 11478
 	}
11479 11479
 
11480 11480
 	/**
11481
-	* Gets the aircraft type from ModeS
11482
-	*
11483
-	* @param String $aircraft_modes the flight ModeS in hex
11484
-	* @return String the aircraft type
11485
-	*
11486
-	*/
11481
+	 * Gets the aircraft type from ModeS
11482
+	 *
11483
+	 * @param String $aircraft_modes the flight ModeS in hex
11484
+	 * @return String the aircraft type
11485
+	 *
11486
+	 */
11487 11487
 	public function getAircraftTypeBymodeS($aircraft_modes,$source_type = '')
11488 11488
 	{
11489 11489
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11509,12 +11509,12 @@  discard block
 block discarded – undo
11509 11509
 	}
11510 11510
 
11511 11511
 	/**
11512
-	* Gets Country from latitude/longitude
11513
-	*
11514
-	* @param Float $latitude latitute of the flight
11515
-	* @param Float $longitude longitute of the flight
11516
-	* @return String the countrie
11517
-	*/
11512
+	 * Gets Country from latitude/longitude
11513
+	 *
11514
+	 * @param Float $latitude latitute of the flight
11515
+	 * @param Float $longitude longitute of the flight
11516
+	 * @return String the countrie
11517
+	 */
11518 11518
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
11519 11519
 	{
11520 11520
 		global $globalDBdriver, $globalDebug;
@@ -11551,11 +11551,11 @@  discard block
 block discarded – undo
11551 11551
 	}
11552 11552
 
11553 11553
 	/**
11554
-	* Gets Country from iso2
11555
-	*
11556
-	* @param String $iso2 ISO2 country code
11557
-	* @return String the countrie
11558
-	*/
11554
+	 * Gets Country from iso2
11555
+	 *
11556
+	 * @param String $iso2 ISO2 country code
11557
+	 * @return String the countrie
11558
+	 */
11559 11559
 	public function getCountryFromISO2($iso2)
11560 11560
 	{
11561 11561
 		global $globalDBdriver, $globalDebug;
@@ -11583,12 +11583,12 @@  discard block
 block discarded – undo
11583 11583
 	}
11584 11584
 
11585 11585
 	/**
11586
-	* converts the registration code using the country prefix
11587
-	*
11588
-	* @param String $registration the aircraft registration
11589
-	* @return String the aircraft registration
11590
-	*
11591
-	*/
11586
+	 * converts the registration code using the country prefix
11587
+	 *
11588
+	 * @param String $registration the aircraft registration
11589
+	 * @return String the aircraft registration
11590
+	 *
11591
+	 */
11592 11592
 	public function convertAircraftRegistration($registration)
11593 11593
 	{
11594 11594
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11640,12 +11640,12 @@  discard block
 block discarded – undo
11640 11640
 	}
11641 11641
 
11642 11642
 	/**
11643
-	* Country from the registration code
11644
-	*
11645
-	* @param String $registration the aircraft registration
11646
-	* @return String the country
11647
-	*
11648
-	*/
11643
+	 * Country from the registration code
11644
+	 *
11645
+	 * @param String $registration the aircraft registration
11646
+	 * @return String the country
11647
+	 *
11648
+	 */
11649 11649
 	public function countryFromAircraftRegistration($registration)
11650 11650
 	{
11651 11651
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11664,8 +11664,8 @@  discard block
 block discarded – undo
11664 11664
 				$country = $row['country'];
11665 11665
 			}
11666 11666
 		} else {
11667
-    			$registration_1 = substr($registration, 0, 1);
11668
-		        $registration_2 = substr($registration, 0, 2);
11667
+				$registration_1 = substr($registration, 0, 1);
11668
+				$registration_2 = substr($registration, 0, 2);
11669 11669
 
11670 11670
 			$country = '';
11671 11671
 			//first get the prefix based on two characters
@@ -11701,12 +11701,12 @@  discard block
 block discarded – undo
11701 11701
 	}
11702 11702
 
11703 11703
 	/**
11704
-	* Registration prefix from the registration code
11705
-	*
11706
-	* @param String $registration the aircraft registration
11707
-	* @return String the registration prefix
11708
-	*
11709
-	*/
11704
+	 * Registration prefix from the registration code
11705
+	 *
11706
+	 * @param String $registration the aircraft registration
11707
+	 * @return String the registration prefix
11708
+	 *
11709
+	 */
11710 11710
 	public function registrationPrefixFromAircraftRegistration($registration)
11711 11711
 	{
11712 11712
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11725,8 +11725,8 @@  discard block
 block discarded – undo
11725 11725
 				//$country = $row['country'];
11726 11726
 			}
11727 11727
 		} else {
11728
-    			$registration_1 = substr($registration, 0, 1);
11729
-		        $registration_2 = substr($registration, 0, 2);
11728
+				$registration_1 = substr($registration, 0, 1);
11729
+				$registration_2 = substr($registration, 0, 2);
11730 11730
 
11731 11731
 			//first get the prefix based on two characters
11732 11732
 			$query  = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1";
@@ -11762,12 +11762,12 @@  discard block
 block discarded – undo
11762 11762
 
11763 11763
 
11764 11764
 	/**
11765
-	* Country from the registration code
11766
-	*
11767
-	* @param String $registration the aircraft registration
11768
-	* @return String the country
11769
-	*
11770
-	*/
11765
+	 * Country from the registration code
11766
+	 *
11767
+	 * @param String $registration the aircraft registration
11768
+	 * @return String the country
11769
+	 *
11770
+	 */
11771 11771
 	public function countryFromAircraftRegistrationCode($registration)
11772 11772
 	{
11773 11773
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11784,11 +11784,11 @@  discard block
 block discarded – undo
11784 11784
 	}
11785 11785
 	
11786 11786
 	/**
11787
-	* Set a new highlight value for a flight
11788
-	*
11789
-	* @param String $flightaware_id flightaware_id from spotter_output table
11790
-	* @param String $highlight New highlight value
11791
-	*/
11787
+	 * Set a new highlight value for a flight
11788
+	 *
11789
+	 * @param String $flightaware_id flightaware_id from spotter_output table
11790
+	 * @param String $highlight New highlight value
11791
+	 */
11792 11792
 	public function setHighlightFlight($flightaware_id,$highlight) {
11793 11793
 		
11794 11794
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -11797,12 +11797,12 @@  discard block
 block discarded – undo
11797 11797
 	}
11798 11798
 
11799 11799
 	/**
11800
-	* Set a new highlight value for a flight by Registration
11801
-	*
11802
-	* @param String $registration Registration of the aircraft
11803
-	* @param String $date Date of spotted aircraft
11804
-	* @param String $highlight New highlight value
11805
-	*/
11800
+	 * Set a new highlight value for a flight by Registration
11801
+	 *
11802
+	 * @param String $registration Registration of the aircraft
11803
+	 * @param String $date Date of spotted aircraft
11804
+	 * @param String $highlight New highlight value
11805
+	 */
11806 11806
 	public function setHighlightFlightByRegistration($registration,$highlight, $date = '') {
11807 11807
 		if ($date == '') {
11808 11808
 			$query  = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)";
@@ -11816,12 +11816,12 @@  discard block
 block discarded – undo
11816 11816
 	}
11817 11817
 	
11818 11818
 	/**
11819
-	* Gets the short url from bit.ly
11820
-	*
11821
-	* @param String $url the full url
11822
-	* @return String the bit.ly url
11823
-	*
11824
-	*/
11819
+	 * Gets the short url from bit.ly
11820
+	 *
11821
+	 * @param String $url the full url
11822
+	 * @return String the bit.ly url
11823
+	 *
11824
+	 */
11825 11825
 	public function getBitlyURL($url)
11826 11826
 	{
11827 11827
 		global $globalBitlyAccessToken;
@@ -12110,11 +12110,11 @@  discard block
 block discarded – undo
12110 12110
 			$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 
12111 12111
 	                      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)) 
12112 12112
 	                      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;";
12113
-                } else {
12113
+				} else {
12114 12114
 			$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 
12115 12115
 	                      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)) 
12116 12116
 	                      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;";
12117
-    		}
12117
+			}
12118 12118
 		$sth = $this->db->prepare($query);
12119 12119
 		$sth->execute();
12120 12120
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.