Completed
Push — master ( 46434e...ad133e )
by Yannick
32:08 queued 16:03
created
date-statistics-arrival-airport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
28 28
 	print '<br />';  
29 29
 	print '<div class="info column">';
30
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31 31
 	print '</div>';
32 32
 
33 33
 	include('date-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37 37
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date);
38 38
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
39 39
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	print '<script>';
43 43
 	print 'var series = [';
44 44
 	$airport_data = '';
45
-	foreach($airport_airport_array as $airport_item)
45
+	foreach ($airport_airport_array as $airport_item)
46 46
 	{
47 47
 		$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
48 48
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	print '</thead>';
98 98
 	print '<tbody>';
99 99
 	$i = 1;
100
-	foreach($airport_airport_array as $airport_item)
100
+	foreach ($airport_airport_array as $airport_item)
101 101
 	{
102 102
 		print '<tr>';
103 103
 		print '<td><strong>'.$i.'</strong></td>';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	$title = _("Unknown Date");
123 123
 	require_once('header.php');
124 124
 	print '<h1>'._("Error").'</h1>';
125
-	print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>';
125
+	print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>';
126 126
 }
127 127
 
128 128
 require_once('footer.php');
Please login to merge, or discard this patch.
js/map-tracker.3d.js.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
 } else {
178 178
 	var clockViewModel = new Cesium.ClockViewModel(viewer.clock);
179 179
 	var animationViewModel = new Cesium.AnimationViewModel(clockViewModel);
180
-	$(".archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>');
180
+	$(".archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>');
181 181
 }
182 182
 function TrackericonColor(color) {
183 183
 	document.cookie =  'TrackerIconColor='+color.substring(1)+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
Please login to merge, or discard this patch.
Braces   +12 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,12 @@  discard block
 block discarded – undo
90 90
 			<?php
91 91
 			    } else {
92 92
 			?>
93
-			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
93
+			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) {
94
+	print $globalMapRefresh*2000;
95
+} else {
96
+	print '60000';
97
+}
98
+?>)) {
94 99
 				viewer.dataSources.get(dsn).entities.remove(entity);
95 100
 				czmldstracker.entities.removeById(entityid);
96 101
 			}
@@ -173,7 +178,12 @@  discard block
 block discarded – undo
173 178
 		function(){
174 179
 			updateTrackerData();
175 180
 		}
176
-	,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
181
+	,<?php if (isset($globalMapRefresh)) {
182
+	print $globalMapRefresh*1000;
183
+} else {
184
+	print '30000';
185
+}
186
+?>);
177 187
 } else {
178 188
 	var clockViewModel = new Cesium.ClockViewModel(viewer.clock);
179 189
 	var animationViewModel = new Cesium.AnimationViewModel(clockViewModel);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,21 +98,21 @@  discard block
 block discarded – undo
98 98
 			var entityid = entity.id;
99 99
 			var lastupdateentity = entity.properties.valueOf('lastupdate')._lastupdate._value;
100 100
 			<?php 
101
-			    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
101
+				if (isset($globalMapUseBbox) && $globalMapUseBbox) {
102 102
 			?>
103 103
 			if (lastupdateentity != lastupdatetracker) {
104 104
 				viewer.dataSources.get(dsn).entities.remove(entity);
105 105
 				czmldstracker.entities.removeById(entityid);
106 106
 			}
107 107
 			<?php
108
-			    } else {
108
+				} else {
109 109
 			?>
110 110
 			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
111 111
 				viewer.dataSources.get(dsn).entities.remove(entity);
112 112
 				czmldstracker.entities.removeById(entityid);
113 113
 			}
114 114
 			<?php
115
-			    }
115
+				}
116 116
 			?>
117 117
 		}
118 118
 	}
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 function updateTrackerData() {
146 146
 	lastupdatetracker = Date.now();
147 147
 <?php
148
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
148
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
149 149
 ?>
150 150
 	var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&coord='+bbox()+'&update=' + lastupdatetracker);
151 151
 <?php
152
-    } else {
152
+	} else {
153 153
 ?>
154 154
 	var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&update=' + lastupdatetracker);
155 155
 <?php
156
-    }
156
+	}
157 157
 ?>  
158 158
 	livetrackerdata.then(function (data) { 
159 159
 		displayTrackerData(data);
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
 }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
210 210
 camera.moveEnd.addEventListener(function() {
211 211
 <?php
212
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
212
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
213 213
 ?>
214 214
 	if (typeof archive == 'undefined' || archive == false) {
215 215
 		updateTrackerData();
216 216
 	}
217 217
 <?php
218
-    }
218
+	}
219 219
 ?>
220 220
 });
221 221
 
Please login to merge, or discard this patch.
js/map-marine.3d.js.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 } else {
132 132
 	var clockViewModel = new Cesium.ClockViewModel(viewer.clock);
133 133
 	var animationViewModel = new Cesium.AnimationViewModel(clockViewModel);
134
-	$(".archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>');
134
+	$(".archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>');
135 135
 }
136 136
 function MarineiconColor(color) {
137 137
 	document.cookie =  'MarineIconColor='+color.substring(1)+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
Please login to merge, or discard this patch.
Braces   +12 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,12 @@  discard block
 block discarded – undo
47 47
 			<?php
48 48
 			    } else {
49 49
 			?>
50
-			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
50
+			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) {
51
+	print $globalMapRefresh*2000;
52
+} else {
53
+	print '60000';
54
+}
55
+?>)) {
51 56
 				viewer.dataSources.get(dsn).entities.remove(entity);
52 57
 			}
53 58
 			<?php
@@ -129,7 +134,12 @@  discard block
 block discarded – undo
129 134
 		function(){
130 135
 			updateMarineData();
131 136
 		}
132
-	,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
137
+	,<?php if (isset($globalMapRefresh)) {
138
+	print $globalMapRefresh*1000;
139
+} else {
140
+	print '30000';
141
+}
142
+?>);
133 143
 } else {
134 144
 	var clockViewModel = new Cesium.ClockViewModel(viewer.clock);
135 145
 	var animationViewModel = new Cesium.AnimationViewModel(clockViewModel);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
 			var entityid = entity.id;
42 42
 			var lastupdateentity = entity.properties.lastupdate;
43 43
 			<?php 
44
-			    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
44
+				if (isset($globalMapUseBbox) && $globalMapUseBbox) {
45 45
 			?>
46 46
 			if (lastupdateentity != lastupdatemarine) {
47 47
 				viewer.dataSources.get(dsn).entities.remove(entity);
48 48
 				czmldsmarine.entities.removeById(entityid);
49 49
 			}
50 50
 			<?php
51
-			    } else {
51
+				} else {
52 52
 			?>
53 53
 			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
54 54
 				viewer.dataSources.get(dsn).entities.remove(entity);
55 55
 			}
56 56
 			<?php
57
-			    }
57
+				}
58 58
 			?>
59 59
 		}
60 60
 	}
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
 function updateMarineData() {
77 77
 	lastupdatemarine = Date.now();
78 78
 <?php
79
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
79
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
80 80
 ?>
81 81
 	var livemarinedata = czmldsmarine.process('<?php print $globalURL; ?>/live-czml.php?marine&coord='+bbox()+'&update=' + lastupdatemarine);
82 82
 <?php
83
-    } else {
83
+	} else {
84 84
 ?>
85 85
 	var livemarinedata = czmldsmarine.process('<?php print $globalURL; ?>/live-czml.php?marine&update=' + lastupdatemarine);
86 86
 <?php
87
-    }
87
+	}
88 88
 ?>
89 89
 	livemarinedata.then(function (data) { 
90 90
 		displayMarineData(data);
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
132 132
 camera.moveEnd.addEventListener(function() {
133 133
 <?php
134
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
134
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
135 135
 ?>
136 136
 	updateMarineData();
137 137
 <?php
138
-    }
138
+	}
139 139
 ?>
140 140
 });
141 141
 
Please login to merge, or discard this patch.
require/class.Language.php 4 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 			);
69 69
 
70 70
 	/**
71
-	* Returns list of available locales
72
-	*
73
-	* @return array
74
-	*/
71
+	 * Returns list of available locales
72
+	 *
73
+	 * @return array
74
+	 */
75 75
 	public function listLocaleDir()
76 76
 	{
77 77
 		$result = array('en_GB');
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	/**
99
-	* Returns list of available languages
100
-	*
101
-	* @return array
99
+	 * Returns list of available languages
100
+	 *
101
+	 * @return array
102 102
 	 */
103 103
 	public function getLanguages()
104 104
 	{
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	/**
78 78
 	* Returns list of available locales
79 79
 	*
80
-	* @return array
80
+	* @return string[]
81 81
 	*/
82 82
 	public function listLocaleDir()
83 83
 	{
@@ -97,6 +97,9 @@  discard block
 block discarded – undo
97 97
 		return $result;
98 98
 	}
99 99
 
100
+	/**
101
+	 * @param string $locale
102
+	 */
100 103
 	public function getLocale($locale)
101 104
 	{
102 105
 		return array($locale,$this->all_languages[$locale][1],$this->all_languages[$locale][2],$locale.'.utf8',$locale.'.UTF8');
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@  discard block
 block discarded – undo
86 86
 			return $result;
87 87
 		}
88 88
 		$handle = @opendir(dirname(__FILE__).'/../locale');
89
-		if ($handle === false) return $result;
89
+		if ($handle === false) {
90
+			return $result;
91
+		}
90 92
 		while (false !== ($file = readdir($handle))) {
91 93
 			$path = dirname(__FILE__).'/../locale'.'/'.$file.'/LC_MESSAGES/fam.mo';
92 94
 			if ($file != "." && $file != ".." && @file_exists($path)) {
@@ -113,7 +115,9 @@  discard block
 block discarded – undo
113 115
 		$allAvailableLanguages = array();
114 116
 		$currentLocal = setlocale(LC_ALL, 0);
115 117
 		foreach ($available as $lang) {
116
-			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL,$this->getLocale($lang)) || $lang = 'en_GB')) $allAvailableLanguages[$lang] = $this->all_languages[$lang];
118
+			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL,$this->getLocale($lang)) || $lang = 'en_GB')) {
119
+				$allAvailableLanguages[$lang] = $this->all_languages[$lang];
120
+			}
117 121
 		}
118 122
 		setlocale(LC_ALL,$currentLocal);
119 123
 		return $allAvailableLanguages;
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -24,54 +24,54 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 class Language {
27
-	public $all_languages = array('ar_SA' => array('العَرَبِيَّةُ',	'ar',	'arabic'),
28
-				'bg_BG' => array('Български',		'bg',	'bulgarian'),
29
-				'id_ID' => array('Bahasa Indonesia',	'id',	'indonesian'),
30
-				'ms_MY' => array('Bahasa Melayu',	'ms',	'malay'),
31
-				'ca_ES' => array('Català',		'ca',	'catalan'), // ca_CA
32
-				'cs_CZ' => array('Čeština',		'cs',	'czech'),
33
-				'de_DE' => array('Deutsch',		'de',	'german'),
34
-				'da_DK' => array('Dansk',		'da',	'danish')     , // dk_DK
35
-				'et_EE' => array('Eesti',		'et',	'estonian'), // ee_ET
36
-				'en_GB' => array('English',		'en',	'english'),
37
-				'en_US' => array('English (US)',	'en',	'english'),
38
-				'es_AR' => array('Español (Argentina)',	'es',	'spanish'),
39
-				'es_CO' => array('Español (Colombia)',	'es',	'spanish'),
40
-				'es_ES' => array('Español',	'es',	'spanish'),
41
-				'es_419' => array('Español (América Latina)',	'es',	'spanish'),
42
-				'es_MX' => array('Español (Mexico)',	'es',	'spanish'),
43
-				'es_VE' => array('Español (Venezuela)',	'es',	'spanish'),
44
-				'eu_ES' => array('Euskara',		'en',	'basque'),
45
-				'fr_FR' => array('Français',		'fr',	'french'),
46
-				'gl_ES' => array('Galego',		'gl',	'galician'),
47
-				'el_GR' => array('Ελληνικά',		'el',	'greek'), // el_EL
48
-				'he_IL' => array('עברית',		'he',	'hebrew'), // he_HE
49
-				'hr_HR' => array('Hrvatski',		'hr',	'croatian'),
50
-				'hu_HU' => array('Magyar',		'hu',	'hungarian'),
51
-				'it_IT' => array('Italiano',		'it',	'italian'),
52
-				'lv_LV' => array('Latviešu',		'lv',	'latvian'),
53
-				'lt_LT' => array('Lietuvių',		'lt',	'lithuanian'),
54
-				'nl_NL' => array('Nederlands',		'nl',	'dutch'),
55
-				'nb_NO' => array('Norsk (Bokmål)',	'nb',	'norwegian'), // no_NB
56
-				'nn_NO' => array('Norsk (Nynorsk)',	'nn',	'norwegian'), // no_NN
57
-				'fa_IR' => array('فارسی',		'fa',	'persian'),
58
-				'pl_PL' => array('Polski',		'pl',	'polish'),
59
-				'pt_PT' => array('Português',		'pt',	'portuguese'),
60
-				'pt_BR' => array('Português do Brasil',	'pt',	'brazilian portuguese'),
61
-				'ro_RO' => array('Română',		'en',	'romanian'),
62
-				'ru_RU' => array('Pусский',		'ru',	'russian'),
63
-				'sk_SK' => array('Slovenčina',		'sk',	'slovak'),
64
-				'sl_SI' => array('Slovenščina',		'sl',	'slovenian slovene'),
65
-				'sr_RS' => array('Srpski',		'sr',	'serbian'),
66
-				'fi_FI' => array('Suomi',		'fi',	'finish'),
67
-				'sv_SE' => array('Svenska',		'sv',	'swedish'),
68
-				'vi_VN' => array('Tiếng Việt',		'vi',	'vietnamese'),
69
-				'th_TH' => array('ภาษาไทย',		'th',	'thai'),
70
-				'tr_TR' => array('Türkçe',		'tr',	'turkish'),
71
-				'uk_UA' => array('Українська',		'en',	'ukrainian'), // ua_UA
72
-				'ja_JP' => array('日本語',		'ja',	'japanese'),
73
-				'zh_CN' => array('简体中文',		'zh',	'chinese'),
74
-				'zh_TW' => array('繁體中文',		'zh',	'chinese')
27
+	public $all_languages = array('ar_SA' => array('العَرَبِيَّةُ', 'ar', 'arabic'),
28
+				'bg_BG' => array('Български', 'bg', 'bulgarian'),
29
+				'id_ID' => array('Bahasa Indonesia', 'id', 'indonesian'),
30
+				'ms_MY' => array('Bahasa Melayu', 'ms', 'malay'),
31
+				'ca_ES' => array('Català', 'ca', 'catalan'), // ca_CA
32
+				'cs_CZ' => array('Čeština', 'cs', 'czech'),
33
+				'de_DE' => array('Deutsch', 'de', 'german'),
34
+				'da_DK' => array('Dansk', 'da', 'danish'), // dk_DK
35
+				'et_EE' => array('Eesti', 'et', 'estonian'), // ee_ET
36
+				'en_GB' => array('English', 'en', 'english'),
37
+				'en_US' => array('English (US)', 'en', 'english'),
38
+				'es_AR' => array('Español (Argentina)', 'es', 'spanish'),
39
+				'es_CO' => array('Español (Colombia)', 'es', 'spanish'),
40
+				'es_ES' => array('Español', 'es', 'spanish'),
41
+				'es_419' => array('Español (América Latina)', 'es', 'spanish'),
42
+				'es_MX' => array('Español (Mexico)', 'es', 'spanish'),
43
+				'es_VE' => array('Español (Venezuela)', 'es', 'spanish'),
44
+				'eu_ES' => array('Euskara', 'en', 'basque'),
45
+				'fr_FR' => array('Français', 'fr', 'french'),
46
+				'gl_ES' => array('Galego', 'gl', 'galician'),
47
+				'el_GR' => array('Ελληνικά', 'el', 'greek'), // el_EL
48
+				'he_IL' => array('עברית', 'he', 'hebrew'), // he_HE
49
+				'hr_HR' => array('Hrvatski', 'hr', 'croatian'),
50
+				'hu_HU' => array('Magyar', 'hu', 'hungarian'),
51
+				'it_IT' => array('Italiano', 'it', 'italian'),
52
+				'lv_LV' => array('Latviešu', 'lv', 'latvian'),
53
+				'lt_LT' => array('Lietuvių', 'lt', 'lithuanian'),
54
+				'nl_NL' => array('Nederlands', 'nl', 'dutch'),
55
+				'nb_NO' => array('Norsk (Bokmål)', 'nb', 'norwegian'), // no_NB
56
+				'nn_NO' => array('Norsk (Nynorsk)', 'nn', 'norwegian'), // no_NN
57
+				'fa_IR' => array('فارسی', 'fa', 'persian'),
58
+				'pl_PL' => array('Polski', 'pl', 'polish'),
59
+				'pt_PT' => array('Português', 'pt', 'portuguese'),
60
+				'pt_BR' => array('Português do Brasil', 'pt', 'brazilian portuguese'),
61
+				'ro_RO' => array('Română', 'en', 'romanian'),
62
+				'ru_RU' => array('Pусский', 'ru', 'russian'),
63
+				'sk_SK' => array('Slovenčina', 'sk', 'slovak'),
64
+				'sl_SI' => array('Slovenščina', 'sl', 'slovenian slovene'),
65
+				'sr_RS' => array('Srpski', 'sr', 'serbian'),
66
+				'fi_FI' => array('Suomi', 'fi', 'finish'),
67
+				'sv_SE' => array('Svenska', 'sv', 'swedish'),
68
+				'vi_VN' => array('Tiếng Việt', 'vi', 'vietnamese'),
69
+				'th_TH' => array('ภาษาไทย', 'th', 'thai'),
70
+				'tr_TR' => array('Türkçe', 'tr', 'turkish'),
71
+				'uk_UA' => array('Українська', 'en', 'ukrainian'), // ua_UA
72
+				'ja_JP' => array('日本語', 'ja', 'japanese'),
73
+				'zh_CN' => array('简体中文', 'zh', 'chinese'),
74
+				'zh_TW' => array('繁體中文', 'zh', 'chinese')
75 75
 			);
76 76
 
77 77
 	/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 	public function getLocale($locale)
101 101
 	{
102
-		return array($locale,$this->all_languages[$locale][1],$this->all_languages[$locale][2],$locale.'.utf8',$locale.'.UTF8');
102
+		return array($locale, $this->all_languages[$locale][1], $this->all_languages[$locale][2], $locale.'.utf8', $locale.'.UTF8');
103 103
 	}
104 104
 
105 105
 	/**
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 		$allAvailableLanguages = array();
114 114
 		$currentLocal = setlocale(LC_ALL, 0);
115 115
 		foreach ($available as $lang) {
116
-			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL,$this->getLocale($lang)) || $lang = 'en_GB')) $allAvailableLanguages[$lang] = $this->all_languages[$lang];
116
+			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL, $this->getLocale($lang)) || $lang = 'en_GB')) $allAvailableLanguages[$lang] = $this->all_languages[$lang];
117 117
 		}
118
-		setlocale(LC_ALL,$currentLocal);
118
+		setlocale(LC_ALL, $currentLocal);
119 119
 		return $allAvailableLanguages;
120 120
 	}
121 121
 }
Please login to merge, or discard this patch.
require/class.SpotterServer.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 	function __construct($dbs = null) {
13 13
 		if ($dbs === null) {
14
-			$Connection = new Connection(null,'server');
14
+			$Connection = new Connection(null, 'server');
15 15
 			$this->dbs = $Connection->dbs;
16 16
 			$query = "CREATE TABLE IF NOT EXISTS `spotter_temp` ( `id_data` INT NOT NULL AUTO_INCREMENT , `id_user` INT NOT NULL , `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `hex` VARCHAR(20) NOT NULL , `ident` VARCHAR(20) NULL , `latitude` FLOAT NULL , `longitude` FLOAT NULL , `verticalrate` INT NULL , `speed` INT NULL , `squawk` INT NULL , `altitude` INT NULL , `heading` INT NULL , `registration` VARCHAR(10) NULL , `aircraft_icao` VARCHAR(10) NULL , `waypoints` VARCHAR(255) NULL , `noarchive` BOOLEAN NOT NULL DEFAULT FALSE, `id_source` INT NOT NULL DEFAULT '1', `format_source` VARCHAR(25) NULL, `source_name` VARCHAR(25) NULL, `over_country` VARCHAR(255) NULL, PRIMARY KEY (`id_data`) ) ENGINE = MEMORY;";
17 17
 			try {
18 18
 				$sth = $this->dbs['server']->exec($query);
19
-			} catch(PDOException $e) {
19
+			} catch (PDOException $e) {
20 20
 				return "error : ".$e->getMessage();
21 21
 			}
22 22
 		}
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 		date_default_timezone_set('UTC');
32 32
 		//if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'aprs')) {
33 33
 		if (isset($line['format_source'])) {
34
-			if(is_array($line) && isset($line['hex'])) {
34
+			if (is_array($line) && isset($line['hex'])) {
35 35
 				if ($line['hex'] != '' && $line['hex'] != '00000' && $line['hex'] != '000000' && $line['hex'] != '111111' && ctype_xdigit($line['hex']) && strlen($line['hex']) === 6) {
36 36
 					$data['hex'] = trim($line['hex']);
37
-					if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) {
37
+					if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/', $line['datetime'])) {
38 38
 						$data['datetime'] = $line['datetime'];
39 39
 					} else $data['datetime'] = date('Y-m-d H:i:s');
40 40
 					if (!isset($line['aircraft_icao'])) {
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
 					if ($id_user == NULL) $id_user = 1;
111 111
 					if (!isset($id_source)) $id_source = 1;
112 112
 					$query = 'INSERT INTO spotter_temp (id_user,datetime,hex,ident,latitude,longitude,verticalrate,speed,squawk,altitude,heading,registration,aircraft_icao,waypoints,id_source,noarchive,format_source,source_name,over_country) VALUES (:id_user,:datetime,:hex,:ident,:latitude,:longitude,:verticalrate,:speed,:squawk,:altitude,:heading,:registration,:aircraft_icao,:waypoints,:id_source,:noarchive, :format_source, :source_name, :over_country)';
113
-					$query_values = array(':id_user' => $id_user,':datetime' => $data['datetime'],':hex' => $data['hex'],':ident' => $data['ident'],':latitude' => $data['latitude'],':longitude' => $data['longitude'],':verticalrate' => $data['verticalrate'],':speed' => $data['speed'],':squawk' => $data['squawk'],':altitude' => $data['altitude'],':heading' => $data['heading'],':registration' => $data['registration'],':aircraft_icao' => $data['aircraft_icao'],':waypoints' => $data['waypoints'],':id_source' => $id_source,':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'],':over_country' => $data['over_country']);
113
+					$query_values = array(':id_user' => $id_user, ':datetime' => $data['datetime'], ':hex' => $data['hex'], ':ident' => $data['ident'], ':latitude' => $data['latitude'], ':longitude' => $data['longitude'], ':verticalrate' => $data['verticalrate'], ':speed' => $data['speed'], ':squawk' => $data['squawk'], ':altitude' => $data['altitude'], ':heading' => $data['heading'], ':registration' => $data['registration'], ':aircraft_icao' => $data['aircraft_icao'], ':waypoints' => $data['waypoints'], ':id_source' => $id_source, ':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'], ':over_country' => $data['over_country']);
114 114
 					try {
115 115
 						$sth = $this->dbs['server']->prepare($query);
116 116
 						$sth->execute($query_values);
117
-					} catch(PDOException $e) {
117
+					} catch (PDOException $e) {
118 118
 						return "error : ".$e->getMessage();
119 119
 					}
120 120
 				}
Please login to merge, or discard this patch.
Braces   +72 added lines, -25 removed lines patch added patch discarded remove patch
@@ -36,79 +36,126 @@
 block discarded – undo
36 36
 					$data['hex'] = trim($line['hex']);
37 37
 					if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) {
38 38
 						$data['datetime'] = $line['datetime'];
39
-					} else $data['datetime'] = date('Y-m-d H:i:s');
39
+					} else {
40
+						$data['datetime'] = date('Y-m-d H:i:s');
41
+					}
40 42
 					if (!isset($line['aircraft_icao'])) {
41 43
 						$Spotter = new Spotter();
42 44
 						$aircraft_icao = $Spotter->getAllAircraftType($data['hex']);
43 45
 						$Spotter->db = null;
44 46
 						if ($aircraft_icao == '' && isset($line['aircraft_type'])) {
45
-							if ($line['aircraft_type'] == 'PARA_GLIDER') $aircraft_icao = 'GLID';
46
-							elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') $aircraft_icao = 'UHEL';
47
-							elseif ($line['aircraft_type'] == 'TOW_PLANE') $aircraft_icao = 'TOWPLANE';
48
-							elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') $aircraft_icao = 'POWAIRC';
47
+							if ($line['aircraft_type'] == 'PARA_GLIDER') {
48
+								$aircraft_icao = 'GLID';
49
+							} elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') {
50
+								$aircraft_icao = 'UHEL';
51
+							} elseif ($line['aircraft_type'] == 'TOW_PLANE') {
52
+								$aircraft_icao = 'TOWPLANE';
53
+							} elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') {
54
+								$aircraft_icao = 'POWAIRC';
55
+							}
49 56
 						}
50 57
 						$data['aircraft_icao'] = $aircraft_icao;
51
-					} else $data['aircraft_icao'] = $line['aircraft_icao'];
58
+					} else {
59
+						$data['aircraft_icao'] = $line['aircraft_icao'];
60
+					}
52 61
 					//if ($globalDebug) echo "*********** New aircraft hex : ".$data['hex']." ***********\n";
53 62
 				}
54 63
 				if (isset($line['registration']) && $line['registration'] != '') {
55 64
 					$data['registration'] = $line['registration'];
56
-				} else $data['registration'] = null;
65
+				} else {
66
+					$data['registration'] = null;
67
+				}
57 68
 				if (isset($line['waypoints']) && $line['waypoints'] != '') {
58 69
 					$data['waypoints'] = $line['waypoints'];
59
-				} else $data['waypoints'] = null;
70
+				} else {
71
+					$data['waypoints'] = null;
72
+				}
60 73
 				if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && preg_match('/^[a-zA-Z0-9]+$/', $line['ident'])) {
61 74
 					$data['ident'] = trim($line['ident']);
62
-				} else $data['ident'] = null;
75
+				} else {
76
+					$data['ident'] = null;
77
+				}
63 78
 				if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '') {
64 79
 					if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) {
65 80
 						$data['latitude'] = $line['latitude'];
66
-					} else $data['latitude'] = null;
81
+					} else {
82
+						$data['latitude'] = null;
83
+					}
67 84
 					if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) {
68
-						if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360;
85
+						if ($line['longitude'] > 180) {
86
+							$line['longitude'] = $line['longitude'] - 360;
87
+						}
69 88
 						$data['longitude'] = $line['longitude'];
70
-					} else $data['longitude'] = null;
89
+					} else {
90
+						$data['longitude'] = null;
91
+					}
71 92
 				} else {
72 93
 					$data['latitude'] = null;
73 94
 					$data['longitude'] = null;
74 95
 				}
75 96
 				if (isset($line['verticalrate']) && $line['verticalrate'] != '') {
76 97
 					$data['verticalrate'] = $line['verticalrate'];
77
-				} else $data['verticalrate'] = null;
98
+				} else {
99
+					$data['verticalrate'] = null;
100
+				}
78 101
 				if (isset($line['emergency']) && $line['emergency'] != '') {
79 102
 					$data['emergency'] = $line['emergency'];
80
-				} else $data['emergency'] = null;
103
+				} else {
104
+					$data['emergency'] = null;
105
+				}
81 106
 				if (isset($line['ground']) && $line['ground'] != '') {
82 107
 					$data['ground'] = $line['ground'];
83
-				} else $data['ground'] = null;
108
+				} else {
109
+					$data['ground'] = null;
110
+				}
84 111
 				if (isset($line['speed']) && $line['speed'] != '') {
85 112
 					$data['speed'] = round($line['speed']);
86
-				} else $data['speed'] = null;
113
+				} else {
114
+					$data['speed'] = null;
115
+				}
87 116
 				if (isset($line['squawk']) && $line['squawk'] != '') {
88 117
 					$data['squawk'] = $line['squawk'];
89
-				} else $data['squawk'] = null;
118
+				} else {
119
+					$data['squawk'] = null;
120
+				}
90 121
 				if (isset($line['altitude']) && $line['altitude'] != '') {
91 122
 					$data['altitude'] = round($line['altitude']);
92
-		  		} else $data['altitude'] = null;
123
+		  		} else {
124
+		  			$data['altitude'] = null;
125
+		  		}
93 126
 				if (isset($line['heading']) && $line['heading'] != '') {
94 127
 					$data['heading'] = round($line['heading']);
95
-		 		} else $data['heading'] = null;
128
+		 		} else {
129
+		 			$data['heading'] = null;
130
+		 		}
96 131
 				if (isset($line['source_name']) && $line['source_name'] != '') {
97 132
 					$data['source_name'] = $line['source_name'];
98
-				} else $data['source_name'] = null;
133
+				} else {
134
+					$data['source_name'] = null;
135
+				}
99 136
 				if (isset($line['over_country']) && $line['over_country'] != '') {
100 137
 					$data['over_country'] = $line['over_country'];
101
-		 		} else $data['over_country'] = null;
138
+		 		} else {
139
+		 			$data['over_country'] = null;
140
+		 		}
102 141
 				if (isset($line['noarchive']) && $line['noarchive']) {
103 142
 					$data['noarchive'] = true;
104
-				} else $data['noarchive'] = false;
143
+				} else {
144
+					$data['noarchive'] = false;
145
+				}
105 146
 				$data['format_source'] = $line['format_source'];
106
-				if (isset($line['id_source'])) $id_source = $line['id_source'];
147
+				if (isset($line['id_source'])) {
148
+					$id_source = $line['id_source'];
149
+				}
107 150
 				if (isset($data['hex'])) {
108 151
 					echo '.';
109 152
 					$id_user = $globalServerUserID;
110
-					if ($id_user == NULL) $id_user = 1;
111
-					if (!isset($id_source)) $id_source = 1;
153
+					if ($id_user == NULL) {
154
+						$id_user = 1;
155
+					}
156
+					if (!isset($id_source)) {
157
+						$id_source = 1;
158
+					}
112 159
 					$query = 'INSERT INTO spotter_temp (id_user,datetime,hex,ident,latitude,longitude,verticalrate,speed,squawk,altitude,heading,registration,aircraft_icao,waypoints,id_source,noarchive,format_source,source_name,over_country) VALUES (:id_user,:datetime,:hex,:ident,:latitude,:longitude,:verticalrate,:speed,:squawk,:altitude,:heading,:registration,:aircraft_icao,:waypoints,:id_source,:noarchive, :format_source, :source_name, :over_country)';
113 160
 					$query_values = array(':id_user' => $id_user,':datetime' => $data['datetime'],':hex' => $data['hex'],':ident' => $data['ident'],':latitude' => $data['latitude'],':longitude' => $data['longitude'],':verticalrate' => $data['verticalrate'],':speed' => $data['speed'],':squawk' => $data['squawk'],':altitude' => $data['altitude'],':heading' => $data['heading'],':registration' => $data['registration'],':aircraft_icao' => $data['aircraft_icao'],':waypoints' => $data['waypoints'],':id_source' => $id_source,':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'],':over_country' => $data['over_country']);
114 161
 					try {
Please login to merge, or discard this patch.
ident-statistics-time.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
 	die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Time of Day of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Time of Day of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Time of Day").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$hour_array = $Spotter->countAllHoursByIdent($ident);
29 29
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
30 30
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	$hour_data = '';
34 34
 	$hour_cnt = '';
35 35
 	$last = 0;
36
-	foreach($hour_array as $hour_item)
36
+	foreach ($hour_array as $hour_item)
37 37
 	{
38
-		while($last != $hour_item['hour_name']) {
38
+		while ($last != $hour_item['hour_name']) {
39 39
 			$hour_data .= '"'.$last.':00",';
40 40
 			$hour_cnt .= '0,';
41 41
 			$last++;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$hour_cnt .= $hour_item['hour_count'].',';
46 46
 	}
47 47
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
48
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
48
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
49 49
 	print 'c3.generate({
50 50
 	    bindto: "#chartHour",
51 51
 	    data: {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		print '</thead>';
71 71
 		print '<tbody>';
72 72
 		$i = 1;
73
-		foreach($hour_array as $hour_item)
73
+		foreach ($hour_array as $hour_item)
74 74
 		{
75 75
 			print '<tr>';
76 76
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
search-php.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -90,40 +90,40 @@
 block discarded – undo
90 90
 if (!empty($spotter_array)) {
91 91
 	foreach($spotter_array as $spotter_item) {
92 92
 		array_push($flights, array(
93
-		    "id" => $spotter_item['spotter_id'], 
94
-		    "ident" => $spotter_item['ident'], 
95
-		    "registration" => $spotter_item['registration'], 
96
-		    "aircraft_icao" => $spotter_item['aircraft_type'], 
97
-		    "aircraft_name" => $spotter_item['aircraft_name'], 
98
-		    "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'],
99
-		    "airline_name" => $spotter_item['airline_name'], 
100
-		    "airline_icao" => $spotter_item['airline_icao'], 
101
-		    "airline_iata" => $spotter_item['airline_iata'], 
102
-		    "airline_country" => $spotter_item['airline_country'], 
103
-		    "airline_callsign" => $spotter_item['airline_callsign'], 
104
-		    "airline_type" => $spotter_item['airline_type'],
105
-		    "departure_airport_city" => $spotter_item['departure_airport_city'], 
106
-		    "departure_airport_country" => $spotter_item['departure_airport_country'], 
107
-		    "departure_airport_iata" => $spotter_item['departure_airport_iata'], 
108
-		    "departure_airport_icao" => $spotter_item['departure_airport_icao'], 
109
-		    "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], 
110
-		    "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], 
111
-		    "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], 
112
-		    "arrival_airport_city" => $spotter_item['arrival_airport_city'], 
113
-		    "arrival_airport_country" => $spotter_item['arrival_airport_country'], 
114
-		    "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], 
115
-		    "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], 
116
-		    "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], 
117
-		    "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], 
118
-		    "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'],
119
-		    "latitude" => $spotter_item['latitude'], 
120
-		    "longitude" => $spotter_item['longitude'], 
121
-		    "altitude" => $spotter_item['altitude'], 
122
-		    "ground_speed" => $spotter_item['ground_speed'], 
123
-		    "heading" => $spotter_item['heading'], 
124
-		    "heading_name" => $spotter_item['heading_name'], 
125
-		    "waypoints" => $spotter_item['waypoints'],
126
-		    "date" => date("c", strtotime($spotter_item['date_iso_8601']))
93
+			"id" => $spotter_item['spotter_id'], 
94
+			"ident" => $spotter_item['ident'], 
95
+			"registration" => $spotter_item['registration'], 
96
+			"aircraft_icao" => $spotter_item['aircraft_type'], 
97
+			"aircraft_name" => $spotter_item['aircraft_name'], 
98
+			"aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'],
99
+			"airline_name" => $spotter_item['airline_name'], 
100
+			"airline_icao" => $spotter_item['airline_icao'], 
101
+			"airline_iata" => $spotter_item['airline_iata'], 
102
+			"airline_country" => $spotter_item['airline_country'], 
103
+			"airline_callsign" => $spotter_item['airline_callsign'], 
104
+			"airline_type" => $spotter_item['airline_type'],
105
+			"departure_airport_city" => $spotter_item['departure_airport_city'], 
106
+			"departure_airport_country" => $spotter_item['departure_airport_country'], 
107
+			"departure_airport_iata" => $spotter_item['departure_airport_iata'], 
108
+			"departure_airport_icao" => $spotter_item['departure_airport_icao'], 
109
+			"departure_airport_latitude" => $spotter_item['departure_airport_latitude'], 
110
+			"departure_airport_longitude" => $spotter_item['departure_airport_longitude'], 
111
+			"departure_airport_altitude" => $spotter_item['departure_airport_altitude'], 
112
+			"arrival_airport_city" => $spotter_item['arrival_airport_city'], 
113
+			"arrival_airport_country" => $spotter_item['arrival_airport_country'], 
114
+			"arrival_airport_iata" => $spotter_item['arrival_airport_iata'], 
115
+			"arrival_airport_icao" => $spotter_item['arrival_airport_icao'], 
116
+			"arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], 
117
+			"arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], 
118
+			"arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'],
119
+			"latitude" => $spotter_item['latitude'], 
120
+			"longitude" => $spotter_item['longitude'], 
121
+			"altitude" => $spotter_item['altitude'], 
122
+			"ground_speed" => $spotter_item['ground_speed'], 
123
+			"heading" => $spotter_item['heading'], 
124
+			"heading_name" => $spotter_item['heading_name'], 
125
+			"waypoints" => $spotter_item['waypoints'],
126
+			"date" => date("c", strtotime($spotter_item['date_iso_8601']))
127 127
 		));
128 128
 	}
129 129
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -5,53 +5,53 @@  discard block
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
 	//for the date manipulation into the query
8
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
-		$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
8
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9
+		$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
10 10
 		$end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
11 11
 		$sql_date = $start_date.",".$end_date;
12
-	} else if($_GET['start_date'] != ""){
13
-		$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
12
+	} else if ($_GET['start_date'] != "") {
13
+		$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
14 14
 		$sql_date = $start_date;
15
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
-		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
15
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16
+		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
17 17
 		$sql_date = $end_date;
18 18
 	} else $sql_date = '';
19 19
 } else $sql_date = '';
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
 	//for altitude manipulation
23
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000";
32 32
 		$sql_altitude = $start_altitude;
33 33
 	} else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
 	if (!isset($_GET['number_results'])) {
40 40
 		$limit_start = 0;
41 41
 		$limit_end = 25;
42 42
 		$absolute_difference = 25;
43 43
 	} else {
44
-		if ($_GET['number_results'] > 1000){
44
+		if ($_GET['number_results'] > 1000) {
45 45
 			$_GET['number_results'] = 1000;
46 46
 		}
47 47
 		$limit_start = 0;
48
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50 50
 	}
51
-}  else {
51
+} else {
52 52
 	$limit_explode = explode(",", $_GET['limit']);
53
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
55 55
 }
56 56
 
57 57
 $absolute_difference = abs($limit_start - $limit_end);
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 
69 69
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
70 70
 else $sort = '';
71
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72
-$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
84
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
85
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
71
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
72
+$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
84
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
85
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88 88
 if ($id != '') {
89 89
 	$spotter_array = $Spotter->getSpotterDataByID($id);
90 90
 } else {
91
-	$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
91
+	$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
92 92
 }
93 93
 
94 94
 $flights = array();
95 95
 if (!empty($spotter_array)) {
96
-	foreach($spotter_array as $spotter_item) {
96
+	foreach ($spotter_array as $spotter_item) {
97 97
 		array_push($flights, array(
98 98
 		    "id" => $spotter_item['spotter_id'], 
99 99
 		    "ident" => $spotter_item['ident'], 
Please login to merge, or discard this patch.
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,8 +15,12 @@  discard block
 block discarded – undo
15 15
 	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16 16
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
17 17
 		$sql_date = $end_date;
18
-	} else $sql_date = '';
19
-} else $sql_date = '';
18
+	} else {
19
+		$sql_date = '';
20
+	}
21
+	} else {
22
+	$sql_date = '';
23
+}
20 24
 
21 25
 if (isset($_GET['highest_altitude'])) {
22 26
 	//for altitude manipulation
@@ -30,8 +34,12 @@  discard block
 block discarded – undo
30 34
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31 35
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
32 36
 		$sql_altitude = $start_altitude;
33
-	} else $sql_altitude = '';
34
-} else $sql_altitude = '';
37
+	} else {
38
+		$sql_altitude = '';
39
+	}
40
+	} else {
41
+	$sql_altitude = '';
42
+}
35 43
 
36 44
 //calculuation for the pagination
37 45
 if(!isset($_GET['limit']))
@@ -48,7 +56,7 @@  discard block
 block discarded – undo
48 56
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50 58
 	}
51
-}  else {
59
+} else {
52 60
 	$limit_explode = explode(",", $_GET['limit']);
53 61
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54 62
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -66,8 +74,11 @@  discard block
 block discarded – undo
66 74
 
67 75
 header("Content-type: text/plain");
68 76
 
69
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
70
-else $sort = '';
77
+if (isset($_GET['sort'])) {
78
+	$sort = $_GET['sort'];
79
+} else {
80
+	$sort = '';
81
+}
71 82
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72 83
 $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT);
73 84
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
ident-statistics-airline.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
 	die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Airlines of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Airlines of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Airlines").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$airline_array = $Spotter->countAllAirlinesByIdent($ident);
30 30
 	if (!empty($airline_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($airline_array as $airline_item)
44
+		foreach ($airline_array as $airline_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-arrival-airport-country.php 3 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
44
+	if (empty($airline_names)) {
45
+		$airline_names = $Spotter->getAllAirlineNames();
46
+	}
45 47
 	foreach($airline_names as $airline_name)
46 48
 	{
47 49
 		if($_GET['airline'] == $airline_name['airline_icao'])
@@ -64,8 +66,7 @@  discard block
 block discarded – undo
64 66
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
65 67
 			{
66 68
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
67
-			}
68
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
69
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
69 70
 			{
70 71
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
71 72
 			}
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airline'])) {
7
-        header('Location: '.$globalURL.'/airline');
8
-        die();
7
+		header('Location: '.$globalURL.'/airline');
8
+		die();
9 9
 }
10 10
 $airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airline');
8 8
         die();
9 9
 }
10
-$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
10
+$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Arrival Airports by Country from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Arrival Airports by Country from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="alliance_'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="alliance_'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="alliance_'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="alliance_'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>─────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($_GET['airline'] == $airline_name['airline_icao'])
47
+		if ($_GET['airline'] == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			print '</div>';
80 80
 		} else {
81 81
 			print '<div class="info column">';
82
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
83
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
82
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
83
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
84 84
 			{
85
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
85
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
86 86
 			}
87
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
87
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
88 88
 			print '</div>';
89 89
 		}
90 90
 	} else {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	print '<div class="column">';
96 96
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
97 97
 	if ($alliance) {
98
-		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
98
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
99 99
 	} else {
100
-		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
100
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
101 101
 	}
102 102
 	/*
103 103
 	if ($alliance) {
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 		$airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirline($airline);
107 107
 	}
108 108
 	*/
109
-	$airport_country_array = $Stats->countAllArrivalCountries(true,$airline);
109
+	$airport_country_array = $Stats->countAllArrivalCountries(true, $airline);
110 110
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
111 111
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
112 112
 	print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';
113 113
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
114 114
 	print 'var series = [';
115 115
 	$country_data = '';
116
-	foreach($airport_country_array as $airport_item)
116
+	foreach ($airport_country_array as $airport_item)
117 117
 	{
118 118
 		$country_data .= '[ "'.$airport_item['airport_arrival_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],';
119 119
 	}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		print '</thead>';
162 162
 		print '<tbody>';
163 163
 		$i = 1;
164
-		foreach($airport_country_array as $airport_item)
164
+		foreach ($airport_country_array as $airport_item)
165 165
 		{
166 166
 			print '<tr>';
167 167
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.