Completed
Push — master ( 259354...a4a45b )
by Yannick
05:33
created
statistics-airport-departure-country.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9 9
 if ($airline_icao == 'all') {
10
-    unset($_COOKIE['stats_airline_icao']);
11
-    setcookie('stats_airline_icao', '', time()-3600);
12
-    $airline_icao = '';
10
+	unset($_COOKIE['stats_airline_icao']);
11
+	setcookie('stats_airline_icao', '', time()-3600);
12
+	$airline_icao = '';
13 13
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
14
-    $airline_icao = $_COOKIE['stats_airline_icao'];
14
+	$airline_icao = $_COOKIE['stats_airline_icao'];
15 15
 } elseif ($airline_icao == '' && isset($globalFilter)) {
16
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
16
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
17 17
 }
18 18
 setcookie('stats_airline_icao',$airline_icao);
19 19
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Departure Airport by Country");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == 'all') {
11 11
     unset($_COOKIE['stats_airline_icao']);
12
-    setcookie('stats_airline_icao', '', time()-3600);
12
+    setcookie('stats_airline_icao', '', time() - 3600);
13 13
     $airline_icao = '';
14 14
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
15 15
     $airline_icao = $_COOKIE['stats_airline_icao'];
16 16
 } elseif ($airline_icao == '' && isset($globalFilter)) {
17 17
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
18 18
 }
19
-setcookie('stats_airline_icao',$airline_icao);
19
+setcookie('stats_airline_icao', $airline_icao);
20 20
 
21 21
 require_once('header.php');
22 22
 include('statistics-sub-menu.php'); 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	  </div>
28 28
 	<p>'._("Below are the <strong>Top 10</strong> most common countries of all the departure airports.").'</p>';
29 29
 
30
-$airport_country_array = $Stats->countAllDepartureCountries(true,$airline_icao,$filter_name);
30
+$airport_country_array = $Stats->countAllDepartureCountries(true, $airline_icao, $filter_name);
31 31
 print '<script>
32 32
     	google.load("visualization", "1", {packages:["geochart"]});
33 33
     	google.setOnLoadCallback(drawCharts);
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         	["'._("Country").'", "'._("# of times").'"],';
41 41
 
42 42
 $country_data = '';
43
-foreach($airport_country_array as $airport_item)
43
+foreach ($airport_country_array as $airport_item)
44 44
 {
45 45
 	$country_data .= '[ "'.$airport_item['airport_departure_country'].'",'.$airport_item['airport_departure_country_count'].'],';
46 46
 }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 print '</thead>';
76 76
 print '<tbody>';
77 77
 $i = 1;
78
-foreach($airport_country_array as $airport_item)
78
+foreach ($airport_country_array as $airport_item)
79 79
 {
80 80
 	print '<tr>';
81 81
 	print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Callsign");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == 'all') {
11 13
     unset($_COOKIE['stats_airline_icao']);
@@ -14,8 +16,10 @@  discard block
 block discarded – undo
14 16
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
15 17
     $airline_icao = $_COOKIE['stats_airline_icao'];
16 18
 } elseif ($airline_icao == '' && isset($globalFilter)) {
17
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
18
-}
19
+    if (isset($globalFilter['airline'])) {
20
+    	$airline_icao = $globalFilter['airline'][0];
21
+    }
22
+    }
19 23
 setcookie('stats_airline_icao',$airline_icao);
20 24
 
21 25
 require_once('header.php');
Please login to merge, or discard this patch.
statistics-airport-arrival-country.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9 9
 if ($airline_icao == 'all') {
10
-    unset($_COOKIE['stats_airline_icao']);
11
-    setcookie('stats_airline_icao', '', time()-3600);
12
-    $airline_icao = '';
10
+	unset($_COOKIE['stats_airline_icao']);
11
+	setcookie('stats_airline_icao', '', time()-3600);
12
+	$airline_icao = '';
13 13
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
14
-    $airline_icao = $_COOKIE['stats_airline_icao'];
14
+	$airline_icao = $_COOKIE['stats_airline_icao'];
15 15
 } elseif ($airline_icao == '' && isset($globalFilter)) {
16
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
16
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
17 17
 }
18 18
 setcookie('stats_airline_icao',$airline_icao);
19 19
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Arrival Airport by Country");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == 'all') {
11 11
     unset($_COOKIE['stats_airline_icao']);
12
-    setcookie('stats_airline_icao', '', time()-3600);
12
+    setcookie('stats_airline_icao', '', time() - 3600);
13 13
     $airline_icao = '';
14 14
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
15 15
     $airline_icao = $_COOKIE['stats_airline_icao'];
16 16
 } elseif ($airline_icao == '' && isset($globalFilter)) {
17 17
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
18 18
 }
19
-setcookie('stats_airline_icao',$airline_icao);
19
+setcookie('stats_airline_icao', $airline_icao);
20 20
 
21 21
 require_once('header.php');
22 22
 include('statistics-sub-menu.php'); 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	  </div>
28 28
     	 <p>'._("Below are the <strong>Top 10</strong> most common countries of all the arrival airports.").'</p>';
29 29
 
30
-$airport_country_array = $Stats->countAllArrivalCountries(true,$airline_icao,$filter_name);
30
+$airport_country_array = $Stats->countAllArrivalCountries(true, $airline_icao, $filter_name);
31 31
 
32 32
 print '<script>
33 33
     	google.load("visualization", "1", {packages:["geochart"]});
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         	["'._("Country").'", "'._("# of times").'"],';
42 42
 
43 43
 $country_data = '';
44
-foreach($airport_country_array as $airport_item)
44
+foreach ($airport_country_array as $airport_item)
45 45
 {
46 46
 	$country_data .= '[ "'.$airport_item['airport_arrival_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
47 47
 }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 print '</thead>';
77 77
 print '<tbody>';
78 78
 $i = 1;
79
-foreach($airport_country_array as $airport_item)
79
+foreach ($airport_country_array as $airport_item)
80 80
 {
81 81
 	print '<tr>';
82 82
 	print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Callsign");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == 'all') {
11 13
     unset($_COOKIE['stats_airline_icao']);
@@ -14,8 +16,10 @@  discard block
 block discarded – undo
14 16
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
15 17
     $airline_icao = $_COOKIE['stats_airline_icao'];
16 18
 } elseif ($airline_icao == '' && isset($globalFilter)) {
17
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
18
-}
19
+    if (isset($globalFilter['airline'])) {
20
+    	$airline_icao = $globalFilter['airline'][0];
21
+    }
22
+    }
19 23
 setcookie('stats_airline_icao',$airline_icao);
20 24
 
21 25
 require_once('header.php');
Please login to merge, or discard this patch.
statistics-airline.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	  </div>
15 15
     	<p>'._("Below are the <strong>Top 10</strong> most common airlines.").'</p>';
16 16
 
17
-$airline_array = $Stats->countAllAirlines(true,$filter_name);
17
+$airline_array = $Stats->countAllAirlines(true, $filter_name);
18 18
 print '<div id="chart" class="chart" width="100%"></div>
19 19
       	<script> 
20 20
       		google.load("visualization", "1", {packages:["corechart"]});
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             var data = google.visualization.arrayToDataTable([
24 24
             	["'._("Airline").'", "'._("# of times").'"], ';
25 25
 $airline_data = '';
26
-foreach($airline_array as $airline_item)
26
+foreach ($airline_array as $airline_item)
27 27
 {
28 28
 	$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
29 29
 }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	print '</thead>';
59 59
 	print '<tbody>';
60 60
 	$i = 1;
61
-	foreach($airline_array as $airline_item)
61
+	foreach ($airline_array as $airline_item)
62 62
 	{
63 63
 		print '<tr>';
64 64
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 $title = _("Statistics").' - '._("Most common Route by Airport");
7 7
 require_once('header.php');
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 include('statistics-sub-menu.php'); 
10 12
 
11 13
 print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
Please login to merge, or discard this patch.
statistics.php 3 patches
Indentation   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
40 40
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
41 41
 	}
42
-    ?>
42
+	?>
43 43
     </div>
44 44
     <?php    
45 45
 	// print_r($Stats->getAllAirlineNames()); 
46
-    ?>
46
+	?>
47 47
     <?php include('statistics-sub-menu.php'); ?>
48 48
     <div class="row global-stats">
49 49
         <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span></div> 
@@ -51,23 +51,23 @@  discard block
 block discarded – undo
51 51
         <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span></div> 
52 52
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
53 53
 	<?php
54
-	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
54
+		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
55 55
 	?>
56 56
     	    <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span></div> 
57 57
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
58 58
         <?php
59
-    	    } else {
60
-    	?>
59
+			} else {
60
+		?>
61 61
     	    <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span></div> 
62 62
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
63 63
     	<?php
64
-    	    }
65
-    	?>
64
+			}
65
+		?>
66 66
         <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span></div> 
67 67
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
68 68
         <?php
69
-    		if ($airline_icao == '') {
70
-    	?>
69
+			if ($airline_icao == '') {
70
+		?>
71 71
         <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span></div>
72 72
 	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
73 73
 	<?php
@@ -88,25 +88,25 @@  discard block
 block discarded – undo
88 88
             <div class="col-md-6">
89 89
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
90 90
                  <?php
91
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
92
-		    if (count($aircraft_array) == 0) print _("No data available");
93
-		    else {
91
+				  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
92
+			if (count($aircraft_array) == 0) print _("No data available");
93
+			else {
94 94
 
95
-                    print '<div id="chart1" class="chart" width="100%"></div>
95
+					print '<div id="chart1" class="chart" width="100%"></div>
96 96
                     <script> 
97 97
                         google.load("visualization", "1", {packages:["corechart"]});
98 98
                       google.setOnLoadCallback(drawChart1);
99 99
                       function drawChart1() {
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
102
-                            $aircraft_data = '';
103
-                          foreach($aircraft_array as $aircraft_item)
104
-                                    {
105
-                                            $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
106
-                                    }
107
-                                    $aircraft_data = substr($aircraft_data, 0, -1);
108
-                                    print $aircraft_data;
109
-                        print ']);
102
+							$aircraft_data = '';
103
+						  foreach($aircraft_array as $aircraft_item)
104
+									{
105
+											$aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
106
+									}
107
+									$aircraft_data = substr($aircraft_data, 0, -1);
108
+									print $aircraft_data;
109
+						print ']);
110 110
 
111 111
                         var options = {
112 112
                             chartArea: {"width": "80%", "height": "60%"},
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
                               drawChart1();
122 122
                             });
123 123
                   </script>';
124
-                  }
125
-                  ?>
124
+				  }
125
+				  ?>
126 126
                 <div class="more">
127 127
                     <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
128 128
                 </div>
@@ -130,30 +130,30 @@  discard block
 block discarded – undo
130 130
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
131 131
 <?php
132 132
 //    echo $airline_icao;
133
-    if ($airline_icao == '' || $airline_icao == 'all') {
133
+	if ($airline_icao == '' || $airline_icao == 'all') {
134 134
 ?>
135 135
             <div class="col-md-6">
136 136
                 <h2><?php echo _("Top 10 Most Common Airline"); ?></h2>
137 137
                  <?php
138
-                  $airline_array = $Stats->countAllAirlines(true,$filter_name);
139
-		    if (count($airline_array) == 0) print _("No data available");
140
-		    else {
138
+				  $airline_array = $Stats->countAllAirlines(true,$filter_name);
139
+			if (count($airline_array) == 0) print _("No data available");
140
+			else {
141 141
 
142
-                  print '<div id="chart2" class="chart" width="100%"></div>
142
+				  print '<div id="chart2" class="chart" width="100%"></div>
143 143
                     <script> 
144 144
                         google.load("visualization", "1", {packages:["corechart"]});
145 145
                       google.setOnLoadCallback(drawChart2);
146 146
                       function drawChart2() {
147 147
                         var data = google.visualization.arrayToDataTable([
148 148
                             ["'._("Airline").'", "'._("# of times").'"], ';
149
-                            $airline_data = '';
150
-                          foreach($airline_array as $airline_item)
151
-                                    {
152
-                                            $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
153
-                                    }
154
-                                    $airline_data = substr($airline_data, 0, -1);
155
-                                    print $airline_data;
156
-                        print ']);
149
+							$airline_data = '';
150
+						  foreach($airline_array as $airline_item)
151
+									{
152
+											$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
153
+									}
154
+									$airline_data = substr($airline_data, 0, -1);
155
+									print $airline_data;
156
+						print ']);
157 157
 
158 158
                         var options = {
159 159
                             chartArea: {"width": "80%", "height": "60%"},
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
                               drawChart2();
169 169
                             });
170 170
                   </script>';
171
-                  }
172
-                  ?>
171
+				  }
172
+				  ?>
173 173
                 <div class="more">
174 174
                     <a href="<?php print $globalURL; ?>/statistics/airline" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
175 175
                 </div>
@@ -177,44 +177,44 @@  discard block
 block discarded – undo
177 177
         </div>
178 178
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
179 179
 <?php
180
-    }
180
+	}
181 181
 ?>
182 182
         <div class="row column">
183 183
 
184 184
 	    <?php
185
-                 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name);
185
+				 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name);
186 186
 		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
187
-		    if (empty($flightover_array)) {
188
-	    ?>
187
+			if (empty($flightover_array)) {
188
+		?>
189 189
             <div class="col-md-12">
190 190
             <?php
191
-        	    } else {
192
-            ?>
191
+				} else {
192
+			?>
193 193
             <div class="col-md-6">
194 194
             <?php
195
-            	    }
196
-            ?>
195
+					}
196
+			?>
197 197
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
198 198
                  <?php
199
-                  $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
200
-		    if (count($pilot_array) == 0) print _("No data available");
201
-		    else {
199
+				  $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
200
+			if (count($pilot_array) == 0) print _("No data available");
201
+			else {
202 202
 
203
-                  print '<div id="chart7" class="chart" width="100%"></div>
203
+				  print '<div id="chart7" class="chart" width="100%"></div>
204 204
                     <script> 
205 205
                         google.load("visualization", "1", {packages:["corechart"]});
206 206
                       google.setOnLoadCallback(drawChart7);
207 207
                       function drawChart7() {
208 208
                         var data = google.visualization.arrayToDataTable([
209 209
                             ["'._("Pilots").'", "'._("# of times").'"], ';
210
-                            $pilot_data = '';
211
-                          foreach($pilot_array as $pilot_item)
212
-                                    {
213
-                                            $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
214
-                                    }
215
-                                    $pilot_data = substr($pilot_data, 0, -1);
216
-                                    print $pilot_data;
217
-                        print ']);
210
+							$pilot_data = '';
211
+						  foreach($pilot_array as $pilot_item)
212
+									{
213
+											$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
214
+									}
215
+									$pilot_data = substr($pilot_data, 0, -1);
216
+									print $pilot_data;
217
+						print ']);
218 218
 
219 219
                         var options = {
220 220
                             chartArea: {"width": "80%", "height": "60%"},
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
                               drawChart7();
230 230
                             });
231 231
                   </script>';
232
-                  }
233
-                  ?>
232
+				  }
233
+				  ?>
234 234
                 <div class="more">
235 235
                     <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
236 236
                 </div>
@@ -238,30 +238,30 @@  discard block
 block discarded – undo
238 238
         
239 239
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
240 240
         <?php
241
-    	    } else {
242
-    	?>
241
+			} else {
242
+		?>
243 243
             <div class="col-md-6">
244 244
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
245 245
                  <?php
246
-                  $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
247
-		    if (count($owner_array) == 0) print _("No data available");
248
-		    else {
246
+				  $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
247
+			if (count($owner_array) == 0) print _("No data available");
248
+			else {
249 249
 
250
-                  print '<div id="chart7" class="chart" width="100%"></div>
250
+				  print '<div id="chart7" class="chart" width="100%"></div>
251 251
                     <script> 
252 252
                         google.load("visualization", "1", {packages:["corechart"]});
253 253
                       google.setOnLoadCallback(drawChart7);
254 254
                       function drawChart7() {
255 255
                         var data = google.visualization.arrayToDataTable([
256 256
                             ["'._("Owner").'", "'._("# of times").'"], ';
257
-                            $owner_data = '';
258
-                          foreach($owner_array as $owner_item)
259
-                                    {
260
-                                            $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
261
-                                    }
262
-                                    $owner_data = substr($owner_data, 0, -1);
263
-                                    print $owner_data;
264
-                        print ']);
257
+							$owner_data = '';
258
+						  foreach($owner_array as $owner_item)
259
+									{
260
+											$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
261
+									}
262
+									$owner_data = substr($owner_data, 0, -1);
263
+									print $owner_data;
264
+						print ']);
265 265
 
266 266
                         var options = {
267 267
                             chartArea: {"width": "80%", "height": "60%"},
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
                               drawChart7();
277 277
                             });
278 278
                   </script>';
279
-                  }
280
-                  ?>
279
+				  }
280
+				  ?>
281 281
                 <div class="more">
282 282
                     <a href="<?php print $globalURL; ?>/statistics/owner" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
283 283
                 </div>
@@ -285,32 +285,32 @@  discard block
 block discarded – undo
285 285
         
286 286
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
287 287
         <?php
288
-    	    }
289
-    	    if (!empty($flightover_array)) {
290
-    	?>
288
+			}
289
+			if (!empty($flightover_array)) {
290
+		?>
291 291
     	
292 292
             <div class="col-md-6">
293 293
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
294 294
                  <?php
295
-                  //$flightover_array = $Stats->countAllFlightOverCountries();
296
-		    if (count($flightover_array) == 0) print _("No data available");
297
-		    else {
295
+				  //$flightover_array = $Stats->countAllFlightOverCountries();
296
+			if (count($flightover_array) == 0) print _("No data available");
297
+			else {
298 298
 
299
-                  print '<div id="chart10" class="chart" width="100%"></div>
299
+				  print '<div id="chart10" class="chart" width="100%"></div>
300 300
                     <script> 
301 301
                         google.load("visualization", "1", {packages:["corechart"]});
302 302
                       google.setOnLoadCallback(drawChart10);
303 303
                       function drawChart10() {
304 304
                         var data = google.visualization.arrayToDataTable([
305 305
                             ["'._("Country").'", "'._("# of times").'"], ';
306
-                            $flightover_data = '';
307
-                          foreach($flightover_array as $flightover_item)
308
-                                    {
309
-                                            $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
310
-                                    }
311
-                                    $flightover_data = substr($flightover_data, 0, -1);
312
-                                    print $flightover_data;
313
-                        print ']);
306
+							$flightover_data = '';
307
+						  foreach($flightover_array as $flightover_item)
308
+									{
309
+											$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
310
+									}
311
+									$flightover_data = substr($flightover_data, 0, -1);
312
+									print $flightover_data;
313
+						print ']);
314 314
 
315 315
                         var options = {
316 316
                             chartArea: {"width": "80%", "height": "60%"},
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
                               drawChart10();
328 328
                             });
329 329
                   </script>';
330
-                  }
331
-                  ?>
330
+				  }
331
+				  ?>
332 332
                 <div class="more">
333 333
                     <a href="<?php print $globalURL; ?>/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
334 334
                 </div>
335 335
             </div>
336 336
         <?php
337
-            }
338
-        ?>
337
+			}
338
+		?>
339 339
         </div>
340 340
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
341 341
 
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
             <div class="col-md-6">
346 346
                 <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2>
347 347
                 <?php
348
-                $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name);
349
-		    if (count($airport_airport_array) == 0) print _("No data available");
350
-		    else {
348
+				$airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name);
349
+			if (count($airport_airport_array) == 0) print _("No data available");
350
+			else {
351 351
 
352
-                 print '<div id="chart3" class="chart" width="100%"></div>
352
+				 print '<div id="chart3" class="chart" width="100%"></div>
353 353
                 <script>
354 354
                 google.load("visualization", "1", {packages:["geochart"]});
355 355
                 google.setOnLoadCallback(drawCharts3);
@@ -360,17 +360,17 @@  discard block
 block discarded – undo
360 360
 
361 361
                 var data = google.visualization.arrayToDataTable([ 
362 362
                     ["'._("Airport").'", "'._("# of times").'"],';
363
-                    $airport_data = '';
364
-                  foreach($airport_airport_array as $airport_item)
365
-                        {
366
-                            $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
367
-                            $name = str_replace("'", "", $name);
368
-                            $name = str_replace('"', "", $name);
369
-                            $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
370
-                        }
371
-                        $airport_data = substr($airport_data, 0, -1);
372
-                        print $airport_data;
373
-                print ']);
363
+					$airport_data = '';
364
+				  foreach($airport_airport_array as $airport_item)
365
+						{
366
+							$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
367
+							$name = str_replace("'", "", $name);
368
+							$name = str_replace('"', "", $name);
369
+							$airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
370
+						}
371
+						$airport_data = substr($airport_data, 0, -1);
372
+						print $airport_data;
373
+				print ']);
374 374
 
375 375
                 var options = {
376 376
                     legend: {position: "none"},
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
                 chart.draw(data, options);
385 385
               }
386 386
                 </script>';
387
-                }
388
-              ?>
387
+				}
388
+			  ?>
389 389
               <div class="more">
390 390
                 <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
391 391
               </div>
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
             <div class="col-md-6">
396 396
                 <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2>
397 397
                 <?php
398
-                $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name);
399
-		    if (count($airport_airport_array2) == 0) print _("No data available");
400
-		    else {
398
+				$airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name);
399
+			if (count($airport_airport_array2) == 0) print _("No data available");
400
+			else {
401 401
 
402
-                print '<div id="chart4" class="chart" width="100%"></div>
402
+				print '<div id="chart4" class="chart" width="100%"></div>
403 403
                 <script>
404 404
                 google.load("visualization", "1", {packages:["geochart"]});
405 405
                 google.setOnLoadCallback(drawCharts4);
@@ -410,17 +410,17 @@  discard block
 block discarded – undo
410 410
 
411 411
                 var data = google.visualization.arrayToDataTable([ 
412 412
                     ["'._("Airport").'", "'._("# of times").'"],';
413
-                    $airport_data2 = '';
414
-                  foreach($airport_airport_array2 as $airport_item2)
415
-                        {
416
-                            $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
417
-                            $name2 = str_replace("'", "", $name2);
418
-                            $name2 = str_replace('"', "", $name2);
419
-                            $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
420
-                        }
421
-                        $airport_data2 = substr($airport_data2, 0, -1);
422
-                        print $airport_data2;
423
-                print ']);
413
+					$airport_data2 = '';
414
+				  foreach($airport_airport_array2 as $airport_item2)
415
+						{
416
+							$name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
417
+							$name2 = str_replace("'", "", $name2);
418
+							$name2 = str_replace('"', "", $name2);
419
+							$airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
420
+						}
421
+						$airport_data2 = substr($airport_data2, 0, -1);
422
+						print $airport_data2;
423
+				print ']);
424 424
 
425 425
                 var options = {
426 426
                     legend: {position: "none"},
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
                 chart.draw(data, options);
435 435
               }
436 436
                 </script>';
437
-                }
438
-              ?>
437
+				}
438
+			  ?>
439 439
               <div class="more">
440 440
                 <a href="<?php print $globalURL; ?>/statistics/airport-arrival" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
441 441
               </div>
@@ -447,24 +447,24 @@  discard block
 block discarded – undo
447 447
             <div class="col-md-6">
448 448
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
449 449
                 <?php
450
-                  $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name);
451
-		    if (count($year_array) == 0) print _("No data available");
452
-		    else {
453
-                  print '<div id="chart8" class="chart" width="100%"></div>
450
+				  $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name);
451
+			if (count($year_array) == 0) print _("No data available");
452
+			else {
453
+				  print '<div id="chart8" class="chart" width="100%"></div>
454 454
                     <script> 
455 455
                         google.load("visualization", "1", {packages:["corechart"]});
456 456
                       google.setOnLoadCallback(drawChart8);
457 457
                       function drawChart8() {
458 458
                         var data = google.visualization.arrayToDataTable([
459 459
                             ["'._("Month").'", "'._("# of Flights").'"], ';
460
-                            $year_data = '';
461
-                          foreach($year_array as $year_item)
462
-                                    {
463
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
464
-                                    }
465
-                                    $year_data = substr($year_data, 0, -1);
466
-                                    print $year_data;
467
-                        print ']);
460
+							$year_data = '';
461
+						  foreach($year_array as $year_item)
462
+									{
463
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
464
+									}
465
+									$year_data = substr($year_data, 0, -1);
466
+									print $year_data;
467
+						print ']);
468 468
 
469 469
                         var options = {
470 470
                             legend: {position: "none"},
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
                               drawChart8();
483 483
                             });
484 484
                   </script>';
485
-                  }
486
-                  ?>
485
+				  }
486
+				  ?>
487 487
                 <div class="more">
488 488
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
489 489
                 </div>
@@ -493,24 +493,24 @@  discard block
 block discarded – undo
493 493
             <div class="col-md-6">
494 494
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
495 495
                 <?php
496
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
497
-		    if (count($month_array) == 0) print _("No data available");
498
-		    else {
499
-                  print '<div id="chart9" class="chart" width="100%"></div>
496
+				  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
497
+			if (count($month_array) == 0) print _("No data available");
498
+			else {
499
+				  print '<div id="chart9" class="chart" width="100%"></div>
500 500
                     <script> 
501 501
                         google.load("visualization", "1", {packages:["corechart"]});
502 502
                       google.setOnLoadCallback(drawChart9);
503 503
                       function drawChart9() {
504 504
                         var data = google.visualization.arrayToDataTable([
505 505
                             ["'._("Day").'", "'._("# of Flights").'"], ';
506
-                            $month_data = '';
507
-                          foreach($month_array as $month_item)
508
-                                    {
509
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
510
-                                    }
511
-                                    $month_data = substr($month_data, 0, -1);
512
-                                    print $month_data;
513
-                        print ']);
506
+							$month_data = '';
507
+						  foreach($month_array as $month_item)
508
+									{
509
+										$month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
510
+									}
511
+									$month_data = substr($month_data, 0, -1);
512
+									print $month_data;
513
+						print ']);
514 514
 
515 515
                         var options = {
516 516
                             legend: {position: "none"},
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
                               drawChart9();
529 529
                             });
530 530
                   </script>';
531
-                  }
532
-                  ?>
531
+				  }
532
+				  ?>
533 533
                 <div class="more">
534 534
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
535 535
                 </div>
@@ -539,25 +539,25 @@  discard block
 block discarded – undo
539 539
             <div class="col-md-6">
540 540
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
541 541
                 <?php
542
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
543
-		    if (empty($date_array)) print _("No data available");
544
-		    else {
545
-                  print '<div id="chart5" class="chart" width="100%"></div>
542
+					$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
543
+			if (empty($date_array)) print _("No data available");
544
+			else {
545
+				  print '<div id="chart5" class="chart" width="100%"></div>
546 546
                     <script> 
547 547
                         google.load("visualization", "1", {packages:["corechart"]});
548 548
                       google.setOnLoadCallback(drawChart5);
549 549
                       function drawChart5() {
550 550
                         var data = google.visualization.arrayToDataTable([
551 551
                             ["'._("Date").'", "'._("# of Flights").'"], ';
552
-                            $date_data = '';
552
+							$date_data = '';
553 553
                         
554
-                          foreach($date_array as $date_item)
555
-                                    {
556
-                                        $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
557
-                                    }
558
-                                    $date_data = substr($date_data, 0, -1);
559
-                                    print $date_data;
560
-                        print ']);
554
+						  foreach($date_array as $date_item)
555
+									{
556
+										$date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
557
+									}
558
+									$date_data = substr($date_data, 0, -1);
559
+									print $date_data;
560
+						print ']);
561 561
 
562 562
                         var options = {
563 563
                             legend: {position: "none"},
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
                               drawChart5();
576 576
                             });
577 577
                   </script>';
578
-                  }
579
-                  ?>
578
+				  }
579
+				  ?>
580 580
                 <div class="more">
581 581
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
582 582
                 </div>
@@ -586,25 +586,25 @@  discard block
 block discarded – undo
586 586
             <div class="col-md-6">
587 587
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
588 588
                 <?php
589
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
590
-		    if (empty($hour_array)) print _("No data available");
591
-		    else {
589
+				  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
590
+			if (empty($hour_array)) print _("No data available");
591
+			else {
592 592
 
593
-                  print '<div id="chart6" class="chart" width="100%"></div>
593
+				  print '<div id="chart6" class="chart" width="100%"></div>
594 594
                     <script> 
595 595
                         google.load("visualization", "1", {packages:["corechart"]});
596 596
                       google.setOnLoadCallback(drawChart6);
597 597
                       function drawChart6() {
598 598
                         var data = google.visualization.arrayToDataTable([
599 599
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
600
-                            $hour_data = '';
601
-                          foreach($hour_array as $hour_item)
602
-                                    {
603
-                                        $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
604
-                                    }
605
-                                    $hour_data = substr($hour_data, 0, -1);
606
-                                    print $hour_data;
607
-                        print ']);
600
+							$hour_data = '';
601
+						  foreach($hour_array as $hour_item)
602
+									{
603
+										$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
604
+									}
605
+									$hour_data = substr($hour_data, 0, -1);
606
+									print $hour_data;
607
+						print ']);
608 608
 
609 609
                         var options = {
610 610
                             legend: {position: "none"},
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
                               drawChart6();
623 623
                             });
624 624
                   </script>';
625
-                  }
626
-                ?>
625
+				  }
626
+				?>
627 627
                 <div class="more">
628 628
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
629 629
                 </div>
@@ -631,21 +631,21 @@  discard block
 block discarded – undo
631 631
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
632 632
         </div>
633 633
 <?php
634
-    if ($airline_icao == '' && $filter_name == '') {
634
+	if ($airline_icao == '' && $filter_name == '') {
635 635
 ?>
636 636
         <div class="row column">
637 637
         	<?php
638
-        	    $polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
639
-        	    if (!empty($polar)) {
640
-            		print '<h2>'._("Coverage pattern").'</h2>';
641
-        		foreach ($polar as $eachpolar) {
642
-        		    unset($polar_data);
643
-	        	    $Spotter = new Spotter();
644
-        		    $data = json_decode($eachpolar['source_data']);
645
-        		    foreach($data as $value => $key) {
646
-        			$direction = $Spotter->parseDirection(($value*22.5));
647
-        			$distance = $key;
648
-        			$unit = 'km';
638
+				$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
639
+				if (!empty($polar)) {
640
+					print '<h2>'._("Coverage pattern").'</h2>';
641
+				foreach ($polar as $eachpolar) {
642
+					unset($polar_data);
643
+					$Spotter = new Spotter();
644
+					$data = json_decode($eachpolar['source_data']);
645
+					foreach($data as $value => $key) {
646
+					$direction = $Spotter->parseDirection(($value*22.5));
647
+					$distance = $key;
648
+					$unit = 'km';
649 649
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
650 650
 					$distance = round($distance*0.539957);
651 651
 					$unit = 'nm';
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
 					$distance = $distance;
657 657
 					$unit = 'km';
658 658
 				}
659
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
660
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
661
-        		    }
662
-        	?>
659
+					if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
660
+						else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
661
+					}
662
+			?>
663 663
             <div class="col-md-6">
664 664
                 <h4><?php print $eachpolar['source_name']; ?></h4>
665 665
         	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
@@ -691,22 +691,22 @@  discard block
 block discarded – undo
691 691
 		</script>
692 692
             </div>
693 693
             <?php
694
-        	    }
695
-        	}
696
-            ?>
694
+				}
695
+			}
696
+			?>
697 697
         </div>
698 698
         <div class="row column">
699 699
             <div class="col-md-6">
700 700
         	<?php
701
-        	    $msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
702
-        	    if (!empty($msg)) {
703
-            		print '<h2>'._("Messages received").'</h2>';
704
-        		foreach ($msg as $eachmsg) {
705
-        		    //$eachmsg = $msg[0];
706
-        		    $data = $eachmsg['source_data'];
707
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
708
-        		    else $max = 500;
709
-        	?>
701
+				$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
702
+				if (!empty($msg)) {
703
+					print '<h2>'._("Messages received").'</h2>';
704
+				foreach ($msg as $eachmsg) {
705
+					//$eachmsg = $msg[0];
706
+					$data = $eachmsg['source_data'];
707
+					if ($data > 500) $max = (round(($data+100)/100))*100;
708
+					else $max = 500;
709
+			?>
710 710
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
711 711
         	<script>
712 712
 		      var g = new JustGage({
@@ -722,9 +722,9 @@  discard block
 block discarded – undo
722 722
 			  });
723 723
 		</script>
724 724
             <?php
725
-        	   }
726
-        	}
727
-            ?>
725
+			   }
726
+			}
727
+			?>
728 728
             </div>
729 729
         </div>
730 730
         <div class="row column">
@@ -751,19 +751,19 @@  discard block
 block discarded – undo
751 751
 				$hist_data .= '[ "'.$distance.'",'.$nb.'],';
752 752
 			}
753 753
 			$hist_data = substr($hist_data, 0, -1);
754
-            ?>
754
+			?>
755 755
             <div class="col-md-6">
756 756
                 <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
757 757
                 <?php
758
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
758
+				  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
759 759
                     <script> 
760 760
                         google.load("visualization", "1", {packages:["corechart"]});
761 761
                       google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
762 762
                       function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
763 763
                         var data = google.visualization.arrayToDataTable([
764 764
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
765
-                            print $hist_data;
766
-                        print ']);
765
+							print $hist_data;
766
+						print ']);
767 767
 
768 768
                         var options = {
769 769
                             legend: {position: "none"},
@@ -781,15 +781,15 @@  discard block
 block discarded – undo
781 781
                               drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
782 782
                             });
783 783
                   </script>';
784
-        	?>
784
+			?>
785 785
     	    </div>
786 786
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
787 787
         	<?php
788
-                  }
789
-                ?>
788
+				  }
789
+				?>
790 790
         </div>
791 791
 <?php
792
-    }
792
+	}
793 793
 ?>
794 794
     </div>
795 795
 </div>  
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
 $title = _("Statistics");
8 8
 
9 9
 if (!isset($filter_name)) $filter_name = '';
10
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 if ($airline_icao == 'all') {
12 12
 	unset($_COOKIE['stats_airline_icao']);
13
-	setcookie('stats_airline_icao', '', time()-3600);
13
+	setcookie('stats_airline_icao', '', time() - 3600);
14 14
 	$airline_icao = '';
15 15
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
16 16
 	$airline_icao = $_COOKIE['stats_airline_icao'];
17 17
 } elseif ($airline_icao == '' && isset($globalFilter)) {
18 18
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
19 19
 }
20
-setcookie('stats_airline_icao',$airline_icao);
20
+setcookie('stats_airline_icao', $airline_icao);
21 21
 require_once('header.php');
22 22
 
23 23
 ?>
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		date_default_timezone_set('UTC');
38 38
 		$lastupdate = strtotime($last_update[0]['value']);
39 39
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
40
-		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
40
+		print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
41 41
 	}
42 42
     ?>
43 43
     </div>
@@ -46,30 +46,30 @@  discard block
 block discarded – undo
46 46
     ?>
47 47
     <?php include('statistics-sub-menu.php'); ?>
48 48
     <div class="row global-stats">
49
-        <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span></div> 
50
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
51
-        <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span></div> 
52
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
49
+        <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name)); ?></span></div> 
50
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
51
+        <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name)); ?></span></div> 
52
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
53 53
 	<?php
54 54
 	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
55 55
 	?>
56
-    	    <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span></div> 
57
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
56
+    	    <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name)); ?></span></div> 
57
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
58 58
         <?php
59 59
     	    } else {
60 60
     	?>
61
-    	    <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span></div> 
62
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
61
+    	    <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name)); ?></span></div> 
62
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
63 63
     	<?php
64 64
     	    }
65 65
     	?>
66
-        <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span></div> 
67
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
66
+        <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name)); ?></span></div> 
67
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
68 68
         <?php
69 69
     		if ($airline_icao == '') {
70 70
     	?>
71 71
         <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span></div>
72
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
72
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
73 73
 	<?php
74 74
 		}
75 75
 	?>
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
77 77
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
78 78
 	?>
79 79
         <div class="col-md-2"><span class="type"><?php echo _("Military"); ?></span><span><?php print number_format($Stats->countOverallMilitaryFlights($filter_name)); ?></span></div> 
80
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
80
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
81 81
 	<?php
82 82
 		}
83 83
 	?>
84 84
     </div>
85
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
85
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
86 86
     <div class="specific-stats">
87 87
         <div class="row column">
88 88
             <div class="col-md-6">
89 89
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
90 90
                  <?php
91
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
91
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name);
92 92
 		    if (count($aircraft_array) == 0) print _("No data available");
93 93
 		    else {
94 94
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
102 102
                             $aircraft_data = '';
103
-                          foreach($aircraft_array as $aircraft_item)
103
+                          foreach ($aircraft_array as $aircraft_item)
104 104
                                     {
105 105
                                             $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
106 106
                                     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                     <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
128 128
                 </div>
129 129
             </div>
130
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
130
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
131 131
 <?php
132 132
 //    echo $airline_icao;
133 133
     if ($airline_icao == '' || $airline_icao == 'all') {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             <div class="col-md-6">
136 136
                 <h2><?php echo _("Top 10 Most Common Airline"); ?></h2>
137 137
                  <?php
138
-                  $airline_array = $Stats->countAllAirlines(true,$filter_name);
138
+                  $airline_array = $Stats->countAllAirlines(true, $filter_name);
139 139
 		    if (count($airline_array) == 0) print _("No data available");
140 140
 		    else {
141 141
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         var data = google.visualization.arrayToDataTable([
148 148
                             ["'._("Airline").'", "'._("# of times").'"], ';
149 149
                             $airline_data = '';
150
-                          foreach($airline_array as $airline_item)
150
+                          foreach ($airline_array as $airline_item)
151 151
                                     {
152 152
                                             $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
153 153
                                     }
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
                 </div>
176 176
             </div>
177 177
         </div>
178
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
178
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
179 179
 <?php
180 180
     }
181 181
 ?>
182 182
         <div class="row column">
183 183
 
184 184
 	    <?php
185
-                 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name);
185
+                 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name);
186 186
 		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
187 187
 		    if (empty($flightover_array)) {
188 188
 	    ?>
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             ?>
197 197
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
198 198
                  <?php
199
-                  $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
199
+                  $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name);
200 200
 		    if (count($pilot_array) == 0) print _("No data available");
201 201
 		    else {
202 202
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                         var data = google.visualization.arrayToDataTable([
209 209
                             ["'._("Pilots").'", "'._("# of times").'"], ';
210 210
                             $pilot_data = '';
211
-                          foreach($pilot_array as $pilot_item)
211
+                          foreach ($pilot_array as $pilot_item)
212 212
                                     {
213 213
                                             $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
214 214
                                     }
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
                 </div>
237 237
             </div>
238 238
         
239
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
239
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
240 240
         <?php
241 241
     	    } else {
242 242
     	?>
243 243
             <div class="col-md-6">
244 244
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
245 245
                  <?php
246
-                  $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
246
+                  $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name);
247 247
 		    if (count($owner_array) == 0) print _("No data available");
248 248
 		    else {
249 249
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                         var data = google.visualization.arrayToDataTable([
256 256
                             ["'._("Owner").'", "'._("# of times").'"], ';
257 257
                             $owner_data = '';
258
-                          foreach($owner_array as $owner_item)
258
+                          foreach ($owner_array as $owner_item)
259 259
                                     {
260 260
                                             $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
261 261
                                     }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                 </div>
284 284
             </div>
285 285
         
286
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
286
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
287 287
         <?php
288 288
     	    }
289 289
     	    if (!empty($flightover_array)) {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                         var data = google.visualization.arrayToDataTable([
305 305
                             ["'._("Country").'", "'._("# of times").'"], ';
306 306
                             $flightover_data = '';
307
-                          foreach($flightover_array as $flightover_item)
307
+                          foreach ($flightover_array as $flightover_item)
308 308
                                     {
309 309
                                             $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
310 310
                                     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             }
338 338
         ?>
339 339
         </div>
340
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
340
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
341 341
 
342 342
     	
343 343
         </div>
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
             <div class="col-md-6">
346 346
                 <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2>
347 347
                 <?php
348
-                $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name);
348
+                $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao, $filter_name);
349 349
 		    if (count($airport_airport_array) == 0) print _("No data available");
350 350
 		    else {
351 351
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                 var data = google.visualization.arrayToDataTable([ 
362 362
                     ["'._("Airport").'", "'._("# of times").'"],';
363 363
                     $airport_data = '';
364
-                  foreach($airport_airport_array as $airport_item)
364
+                  foreach ($airport_airport_array as $airport_item)
365 365
                         {
366 366
                             $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
367 367
                             $name = str_replace("'", "", $name);
@@ -390,12 +390,12 @@  discard block
 block discarded – undo
390 390
                 <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
391 391
               </div>
392 392
             </div>
393
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
393
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
394 394
 
395 395
             <div class="col-md-6">
396 396
                 <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2>
397 397
                 <?php
398
-                $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name);
398
+                $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao, $filter_name);
399 399
 		    if (count($airport_airport_array2) == 0) print _("No data available");
400 400
 		    else {
401 401
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                 var data = google.visualization.arrayToDataTable([ 
412 412
                     ["'._("Airport").'", "'._("# of times").'"],';
413 413
                     $airport_data2 = '';
414
-                  foreach($airport_airport_array2 as $airport_item2)
414
+                  foreach ($airport_airport_array2 as $airport_item2)
415 415
                         {
416 416
                             $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
417 417
                             $name2 = str_replace("'", "", $name2);
@@ -441,13 +441,13 @@  discard block
 block discarded – undo
441 441
               </div>
442 442
             </div>
443 443
         </div>
444
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
444
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
445 445
 
446 446
         <div class="row column">
447 447
             <div class="col-md-6">
448 448
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
449 449
                 <?php
450
-                  $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name);
450
+                  $year_array = $Stats->countAllMonthsLastYear($airline_icao, $filter_name);
451 451
 		    if (count($year_array) == 0) print _("No data available");
452 452
 		    else {
453 453
                   print '<div id="chart8" class="chart" width="100%"></div>
@@ -458,9 +458,9 @@  discard block
 block discarded – undo
458 458
                         var data = google.visualization.arrayToDataTable([
459 459
                             ["'._("Month").'", "'._("# of Flights").'"], ';
460 460
                             $year_data = '';
461
-                          foreach($year_array as $year_item)
461
+                          foreach ($year_array as $year_item)
462 462
                                     {
463
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
463
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
464 464
                                     }
465 465
                                     $year_data = substr($year_data, 0, -1);
466 466
                                     print $year_data;
@@ -488,12 +488,12 @@  discard block
 block discarded – undo
488 488
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
489 489
                 </div>
490 490
             </div>
491
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
491
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
492 492
 
493 493
             <div class="col-md-6">
494 494
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
495 495
                 <?php
496
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
496
+                  $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
497 497
 		    if (count($month_array) == 0) print _("No data available");
498 498
 		    else {
499 499
                   print '<div id="chart9" class="chart" width="100%"></div>
@@ -504,9 +504,9 @@  discard block
 block discarded – undo
504 504
                         var data = google.visualization.arrayToDataTable([
505 505
                             ["'._("Day").'", "'._("# of Flights").'"], ';
506 506
                             $month_data = '';
507
-                          foreach($month_array as $month_item)
507
+                          foreach ($month_array as $month_item)
508 508
                                     {
509
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
509
+                                        $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
510 510
                                     }
511 511
                                     $month_data = substr($month_data, 0, -1);
512 512
                                     print $month_data;
@@ -534,12 +534,12 @@  discard block
 block discarded – undo
534 534
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
535 535
                 </div>
536 536
             </div>
537
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
537
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
538 538
 
539 539
             <div class="col-md-6">
540 540
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
541 541
                 <?php
542
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
542
+                    $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
543 543
 		    if (empty($date_array)) print _("No data available");
544 544
 		    else {
545 545
                   print '<div id="chart5" class="chart" width="100%"></div>
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                             ["'._("Date").'", "'._("# of Flights").'"], ';
552 552
                             $date_data = '';
553 553
                         
554
-                          foreach($date_array as $date_item)
554
+                          foreach ($date_array as $date_item)
555 555
                                     {
556 556
                                         $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
557 557
                                     }
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
582 582
                 </div>
583 583
             </div>
584
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
584
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
585 585
 
586 586
             <div class="col-md-6">
587 587
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
588 588
                 <?php
589
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
589
+                  $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
590 590
 		    if (empty($hour_array)) print _("No data available");
591 591
 		    else {
592 592
 
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                         var data = google.visualization.arrayToDataTable([
599 599
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
600 600
                             $hour_data = '';
601
-                          foreach($hour_array as $hour_item)
601
+                          foreach ($hour_array as $hour_item)
602 602
                                     {
603 603
                                         $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
604 604
                                     }
@@ -628,21 +628,21 @@  discard block
 block discarded – undo
628 628
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
629 629
                 </div>
630 630
             </div>
631
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
631
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
632 632
         </div>
633 633
 <?php
634 634
     if ($airline_icao == '' && $filter_name == '') {
635 635
 ?>
636 636
         <div class="row column">
637 637
         	<?php
638
-        	    $polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
638
+        	    $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar');
639 639
         	    if (!empty($polar)) {
640 640
             		print '<h2>'._("Coverage pattern").'</h2>';
641 641
         		foreach ($polar as $eachpolar) {
642 642
         		    unset($polar_data);
643 643
 	        	    $Spotter = new Spotter();
644 644
         		    $data = json_decode($eachpolar['source_data']);
645
-        		    foreach($data as $value => $key) {
645
+        		    foreach ($data as $value => $key) {
646 646
         			$direction = $Spotter->parseDirection(($value*22.5));
647 647
         			$distance = $key;
648 648
         			$unit = 'km';
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         	?>
663 663
             <div class="col-md-6">
664 664
                 <h4><?php print $eachpolar['source_name']; ?></h4>
665
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
665
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
666 666
         	<script>
667 667
         	    (function() {
668 668
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 		      color: color,
687 687
 		      unit: '<?php echo $unit; ?>'
688 688
 		    };
689
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
689
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
690 690
 		    })();
691 691
 		</script>
692 692
             </div>
@@ -698,19 +698,19 @@  discard block
 block discarded – undo
698 698
         <div class="row column">
699 699
             <div class="col-md-6">
700 700
         	<?php
701
-        	    $msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
701
+        	    $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg');
702 702
         	    if (!empty($msg)) {
703 703
             		print '<h2>'._("Messages received").'</h2>';
704 704
         		foreach ($msg as $eachmsg) {
705 705
         		    //$eachmsg = $msg[0];
706 706
         		    $data = $eachmsg['source_data'];
707
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
707
+        		    if ($data > 500) $max = (round(($data + 100)/100))*100;
708 708
         		    else $max = 500;
709 709
         	?>
710
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
710
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
711 711
         	<script>
712 712
 		      var g = new JustGage({
713
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
713
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
714 714
 			    value: <?php echo $data; ?>,
715 715
 			    min: 0,
716 716
 			    max: <?php print $max; ?>,
@@ -730,12 +730,12 @@  discard block
 block discarded – undo
730 730
         <div class="row column">
731 731
 
732 732
             <?php
733
-		$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
733
+		$hist = $Stats->getStatsSource(date('Y-m-d'), 'hist');
734 734
 		foreach ($hist as $hists) {
735 735
 			$hist_data = '';
736 736
 			$source = $hists['source_name'];
737 737
 			$hist_array = json_decode($hists['source_data']);
738
-			foreach($hist_array as $distance => $nb)
738
+			foreach ($hist_array as $distance => $nb)
739 739
 			{
740 740
 				$unit = 'km';
741 741
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -753,13 +753,13 @@  discard block
 block discarded – undo
753 753
 			$hist_data = substr($hist_data, 0, -1);
754 754
             ?>
755 755
             <div class="col-md-6">
756
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
756
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
757 757
                 <?php
758
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
758
+                  print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div>
759 759
                     <script> 
760 760
                         google.load("visualization", "1", {packages:["corechart"]});
761
-                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
762
-                      function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
761
+                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).');
762
+                      function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() {
763 763
                         var data = google.visualization.arrayToDataTable([
764 764
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
765 765
                             print $hist_data;
@@ -774,16 +774,16 @@  discard block
 block discarded – undo
774 774
                             colors: ["#1a3151"]
775 775
                         };
776 776
 
777
-                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'"));
777
+                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'"));
778 778
                         chart.draw(data, options);
779 779
                       }
780 780
                       $(window).resize(function(){
781
-                              drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
781
+                              drawCharthist_'.str_replace(' ', '_', strtolower($source)).'();
782 782
                             });
783 783
                   </script>';
784 784
         	?>
785 785
     	    </div>
786
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
786
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
787 787
         	<?php
788 788
                   }
789 789
                 ?>
Please login to merge, or discard this patch.
Braces   +53 added lines, -30 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
 $Stats = new Stats();
7 7
 $title = _("Statistics");
8 8
 
9
-if (!isset($filter_name)) $filter_name = '';
9
+if (!isset($filter_name)) {
10
+	$filter_name = '';
11
+}
10 12
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
11 13
 if ($airline_icao == 'all') {
12 14
 	unset($_COOKIE['stats_airline_icao']);
@@ -15,8 +17,10 @@  discard block
 block discarded – undo
15 17
 } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) {
16 18
 	$airline_icao = $_COOKIE['stats_airline_icao'];
17 19
 } elseif ($airline_icao == '' && isset($globalFilter)) {
18
-	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
19
-}
20
+	if (isset($globalFilter['airline'])) {
21
+		$airline_icao = $globalFilter['airline'][0];
22
+	}
23
+	}
20 24
 setcookie('stats_airline_icao',$airline_icao);
21 25
 require_once('header.php');
22 26
 
@@ -36,7 +40,9 @@  discard block
 block discarded – undo
36 40
 	if (isset($last_update[0]['value'])) {
37 41
 		date_default_timezone_set('UTC');
38 42
 		$lastupdate = strtotime($last_update[0]['value']);
39
-		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
43
+		if (isset($globalTimezone) && $globalTimezone != '') {
44
+			date_default_timezone_set($globalTimezone);
45
+		}
40 46
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
41 47
 	}
42 48
     ?>
@@ -89,8 +95,9 @@  discard block
 block discarded – undo
89 95
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
90 96
                  <?php
91 97
                   $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
92
-		    if (count($aircraft_array) == 0) print _("No data available");
93
-		    else {
98
+		    if (count($aircraft_array) == 0) {
99
+		    	print _("No data available");
100
+		    } else {
94 101
 
95 102
                     print '<div id="chart1" class="chart" width="100%"></div>
96 103
                     <script> 
@@ -136,8 +143,9 @@  discard block
 block discarded – undo
136 143
                 <h2><?php echo _("Top 10 Most Common Airline"); ?></h2>
137 144
                  <?php
138 145
                   $airline_array = $Stats->countAllAirlines(true,$filter_name);
139
-		    if (count($airline_array) == 0) print _("No data available");
140
-		    else {
146
+		    if (count($airline_array) == 0) {
147
+		    	print _("No data available");
148
+		    } else {
141 149
 
142 150
                   print '<div id="chart2" class="chart" width="100%"></div>
143 151
                     <script> 
@@ -197,8 +205,9 @@  discard block
 block discarded – undo
197 205
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
198 206
                  <?php
199 207
                   $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
200
-		    if (count($pilot_array) == 0) print _("No data available");
201
-		    else {
208
+		    if (count($pilot_array) == 0) {
209
+		    	print _("No data available");
210
+		    } else {
202 211
 
203 212
                   print '<div id="chart7" class="chart" width="100%"></div>
204 213
                     <script> 
@@ -244,8 +253,9 @@  discard block
 block discarded – undo
244 253
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
245 254
                  <?php
246 255
                   $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
247
-		    if (count($owner_array) == 0) print _("No data available");
248
-		    else {
256
+		    if (count($owner_array) == 0) {
257
+		    	print _("No data available");
258
+		    } else {
249 259
 
250 260
                   print '<div id="chart7" class="chart" width="100%"></div>
251 261
                     <script> 
@@ -293,8 +303,9 @@  discard block
 block discarded – undo
293 303
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
294 304
                  <?php
295 305
                   //$flightover_array = $Stats->countAllFlightOverCountries();
296
-		    if (count($flightover_array) == 0) print _("No data available");
297
-		    else {
306
+		    if (count($flightover_array) == 0) {
307
+		    	print _("No data available");
308
+		    } else {
298 309
 
299 310
                   print '<div id="chart10" class="chart" width="100%"></div>
300 311
                     <script> 
@@ -346,8 +357,9 @@  discard block
 block discarded – undo
346 357
                 <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2>
347 358
                 <?php
348 359
                 $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name);
349
-		    if (count($airport_airport_array) == 0) print _("No data available");
350
-		    else {
360
+		    if (count($airport_airport_array) == 0) {
361
+		    	print _("No data available");
362
+		    } else {
351 363
 
352 364
                  print '<div id="chart3" class="chart" width="100%"></div>
353 365
                 <script>
@@ -396,8 +408,9 @@  discard block
 block discarded – undo
396 408
                 <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2>
397 409
                 <?php
398 410
                 $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name);
399
-		    if (count($airport_airport_array2) == 0) print _("No data available");
400
-		    else {
411
+		    if (count($airport_airport_array2) == 0) {
412
+		    	print _("No data available");
413
+		    } else {
401 414
 
402 415
                 print '<div id="chart4" class="chart" width="100%"></div>
403 416
                 <script>
@@ -448,8 +461,9 @@  discard block
 block discarded – undo
448 461
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
449 462
                 <?php
450 463
                   $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name);
451
-		    if (count($year_array) == 0) print _("No data available");
452
-		    else {
464
+		    if (count($year_array) == 0) {
465
+		    	print _("No data available");
466
+		    } else {
453 467
                   print '<div id="chart8" class="chart" width="100%"></div>
454 468
                     <script> 
455 469
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -494,8 +508,9 @@  discard block
 block discarded – undo
494 508
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
495 509
                 <?php
496 510
                   $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
497
-		    if (count($month_array) == 0) print _("No data available");
498
-		    else {
511
+		    if (count($month_array) == 0) {
512
+		    	print _("No data available");
513
+		    } else {
499 514
                   print '<div id="chart9" class="chart" width="100%"></div>
500 515
                     <script> 
501 516
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -540,8 +555,9 @@  discard block
 block discarded – undo
540 555
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
541 556
                 <?php
542 557
                     $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
543
-		    if (empty($date_array)) print _("No data available");
544
-		    else {
558
+		    if (empty($date_array)) {
559
+		    	print _("No data available");
560
+		    } else {
545 561
                   print '<div id="chart5" class="chart" width="100%"></div>
546 562
                     <script> 
547 563
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -587,8 +603,9 @@  discard block
 block discarded – undo
587 603
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
588 604
                 <?php
589 605
                   $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
590
-		    if (empty($hour_array)) print _("No data available");
591
-		    else {
606
+		    if (empty($hour_array)) {
607
+		    	print _("No data available");
608
+		    } else {
592 609
 
593 610
                   print '<div id="chart6" class="chart" width="100%"></div>
594 611
                     <script> 
@@ -656,8 +673,11 @@  discard block
 block discarded – undo
656 673
 					$distance = $distance;
657 674
 					$unit = 'km';
658 675
 				}
659
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
660
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
676
+        			if (!isset($polar_data)) {
677
+        				$polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
678
+        			} else {
679
+        	    			$polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
680
+        	    		}
661 681
         		    }
662 682
         	?>
663 683
             <div class="col-md-6">
@@ -704,8 +724,11 @@  discard block
 block discarded – undo
704 724
         		foreach ($msg as $eachmsg) {
705 725
         		    //$eachmsg = $msg[0];
706 726
         		    $data = $eachmsg['source_data'];
707
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
708
-        		    else $max = 500;
727
+        		    if ($data > 500) {
728
+        		    	$max = (round(($data+100)/100))*100;
729
+        		    } else {
730
+        		    	$max = 500;
731
+        		    }
709 732
         	?>
710 733
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
711 734
         	<script>
Please login to merge, or discard this patch.
statistics-airline-country.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	  </div>
15 15
       <p>'._("Below are the <strong>Top 10</strong> countries that an airline belongs to.").'</p>';
16 16
 
17
-$airline_array = $Stats->countAllAirlineCountries(true,$filter_name);
17
+$airline_array = $Stats->countAllAirlineCountries(true, $filter_name);
18 18
 if (count($airline_array) > 0) {
19 19
 print '<div id="chartCountry" class="chart" width="100%"></div>
20 20
       	<script> 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             var data = google.visualization.arrayToDataTable([
25 25
             	["'._("Country").'", "'._("# of times").'"], ';
26 26
 $country_data = '';
27
-foreach($airline_array as $airline_item)
27
+foreach ($airline_array as $airline_item)
28 28
 {
29 29
 	$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
30 30
 }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	print '</thead>';
59 59
 	print '<tbody>';
60 60
 	$i = 1;
61
-	foreach($airline_array as $airline_item)
61
+	foreach ($airline_array as $airline_item)
62 62
 	{
63 63
 		print '<tr>';
64 64
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 $title = _("Statistics").' - '._("Most common Route by Airport");
7 7
 require_once('header.php');
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 include('statistics-sub-menu.php'); 
10 12
 
11 13
 print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
Please login to merge, or discard this patch.
index.php 3 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 <div id="showdetails" class="showdetails"></div>
37 37
 <div id="infobox" class="infobox"><h4><?php echo _("Aircrafts detected"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div>
38 38
 <?php
39
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
39
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
40 40
 
41 41
 ?>
42 42
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script>
43 43
 <?php
44
-    }
44
+	}
45 45
 ?>
46 46
 <div id="dialog" title="<?php echo _("Session has timed-out"); ?>">
47 47
   <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p>
@@ -55,34 +55,34 @@  discard block
 block discarded – undo
55 55
 	<li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
56 56
 	<li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
57 57
 <?php
58
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
58
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
59 59
 	if (isset($globalArchive) && $globalArchive == TRUE) {
60 60
 ?>
61 61
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
62 62
 <?php
63 63
 	}
64
-    }
64
+	}
65 65
 ?>
66 66
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
67 67
 	<li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li>
68 68
 	<li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li>
69 69
 <?php
70
-    if (isset($globalMap3D) && $globalMap3D) {
70
+	if (isset($globalMap3D) && $globalMap3D) {
71 71
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
72 72
 ?>
73 73
 	<li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
74 74
 <?php
75
-        } else {
76
-    	    if (isset($globalMapSatellites) && $globalMapSatellites) {
75
+		} else {
76
+			if (isset($globalMapSatellites) && $globalMapSatellites) {
77 77
 ?>
78 78
 	<li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li>
79 79
 <?php
80
-	    }
80
+		}
81 81
 ?>
82 82
 	<li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
83 83
 <?php
84 84
 	}
85
-    }
85
+	}
86 86
 ?>
87 87
     </ul>
88 88
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 ?>
157 157
         </div>
158 158
 <?php
159
-    if (isset($globalArchive) && $globalArchive == TRUE) {
159
+	if (isset($globalArchive) && $globalArchive == TRUE) {
160 160
 ?>
161 161
         <div class="sidebar-pane" id="archive">
162 162
 	    <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	    </form>
217 217
 	</div>
218 218
 <?php
219
-    }
219
+	}
220 220
 ?>
221 221
         <div class="sidebar-pane" id="settings">
222 222
 	    <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -227,56 +227,56 @@  discard block
 block discarded – undo
227 227
 			    <?php
228 228
 				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
229 229
 				else $MapType = $_COOKIE['MapType'];
230
-			    ?>
230
+				?>
231 231
 			    <?php
232 232
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
233
-			    ?>
233
+				?>
234 234
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
235 235
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
236 236
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
237 237
 			    <?php
238 238
 				}
239
-			    ?>
239
+				?>
240 240
 			    <?php
241
-			        if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
242
-			    ?>
241
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
242
+				?>
243 243
 			    <?php
244
-				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
245
-			    ?>
244
+					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
245
+				?>
246 246
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
247 247
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
248 248
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
249 249
 			    <?php
250
-				    }
251
-			    ?>
250
+					}
251
+				?>
252 252
 			    <?php
253
-				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
254
-			    ?>
253
+					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
254
+				?>
255 255
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
256 256
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
257 257
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
258 258
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
259 259
 			    <?php
260
-				    }
261
-			    ?>
260
+					}
261
+				?>
262 262
 			    <?php
263
-				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
264
-			    ?>
263
+					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
264
+				?>
265 265
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
266 266
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
267 267
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
268 268
 			    <?php
269
-				    }
270
-			    ?>
269
+					}
270
+				?>
271 271
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
272 272
 			    <?php
273 273
 				}
274
-			    ?>
274
+				?>
275 275
 			    <?php
276
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
276
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
277 277
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
278 278
 					else $MapBoxId = $_COOKIE['MapTypeId'];
279
-			    ?>
279
+				?>
280 280
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
281 281
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
282 282
 			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
291 291
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
292 292
 			    <?php
293
-				    }
294
-			    ?>
293
+					}
294
+				?>
295 295
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
296 296
 			</select>
297 297
 		    </li>
298 298
 <?php
299
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
299
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
300 300
 ?>
301 301
 		    <li><?php echo _("Type of Terrain:"); ?>
302 302
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
 			</select>
307 307
 		    </li>
308 308
 <?php
309
-    }
309
+	}
310 310
 ?>
311 311
 <?php
312
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
312
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
313 313
 ?>
314 314
 		    
315 315
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
@@ -317,54 +317,54 @@  discard block
 block discarded – undo
317 317
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
318 318
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
319 319
 <?php
320
-    }
320
+	}
321 321
 ?>
322 322
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
323 323
 <?php
324
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
324
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
325 325
 ?>
326 326
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
327 327
 <?php
328
-    }
328
+	}
329 329
 ?>
330 330
 
331 331
 		    <?php
332 332
 			if (function_exists('array_column')) {
333
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
334
-		    ?>
333
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
334
+			?>
335 335
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
336 336
 		    <?php
337
-			    }
337
+				}
338 338
 			} elseif (isset($globalSources)) {
339
-			    $dispolar = false;
340
-			    foreach ($globalSources as $testsource) {
341
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
342
-			    }
343
-			    if ($dispolar) {
344
-		    ?>
339
+				$dispolar = false;
340
+				foreach ($globalSources as $testsource) {
341
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
342
+				}
343
+				if ($dispolar) {
344
+			?>
345 345
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
346 346
 		    <?php
347
-			    }
348
-		        }
349
-		    ?>
347
+				}
348
+				}
349
+			?>
350 350
 <?php
351
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
351
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
352 352
 ?>
353 353
 
354 354
 		    <?php
355
-		        if (extension_loaded('gd') && function_exists('gd_info')) {
356
-		    ?>
355
+				if (extension_loaded('gd') && function_exists('gd_info')) {
356
+			?>
357 357
 		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
358 358
 		    <?php 
359 359
 			if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
360
-		    ?>
360
+			?>
361 361
 		    <li><?php echo _("Aircraft icon color:"); ?>
362 362
 			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
363 363
 		    </li>
364 364
 		    <?php
365
-			    }
366
-		        }
367
-		    ?>
365
+				}
366
+				}
367
+			?>
368 368
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
369 369
 			<div class="range">
370 370
 			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			</div>
373 373
 		    </li>
374 374
 <?php
375
-    }
375
+	}
376 376
 ?>
377 377
 		    <li><?php echo _("Distance unit:"); ?>
378 378
 			<select class="selectpicker" onchange="unitdistance(this);">
@@ -405,16 +405,16 @@  discard block
 block discarded – undo
405 405
 		    <ul>
406 406
 		    <?php
407 407
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
408
-		    ?>
408
+			?>
409 409
 			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
410 410
 			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
411 411
 			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
412 412
 		    <?php
413 413
 			}
414
-		    ?>
414
+			?>
415 415
 		    <?php
416 416
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
417
-		    ?>
417
+			?>
418 418
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
419 419
 			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
420 420
 			<?php } ?>
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			<?php } ?>
424 424
 		    <?php
425 425
 			}
426
-		    ?>
426
+			?>
427 427
 		    <li><?php echo _("Display airlines:"); ?>
428 428
 		    <br/>
429 429
 			<select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines">
@@ -438,12 +438,12 @@  discard block
 block discarded – undo
438 438
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
439 439
 					}
440 440
 				}
441
-			    ?>
441
+				?>
442 442
 			</select>
443 443
 		    </li>
444 444
 		    <?php
445 445
 			if (isset($globalAPRS) && $globalAPRS) {
446
-		    ?>
446
+			?>
447 447
 		    <li><?php echo _("Display APRS sources name:"); ?>
448 448
 			<select class="selectpicker" multiple onchange="sources(this);">
449 449
 			    <?php
@@ -455,15 +455,15 @@  discard block
 block discarded – undo
455 455
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
456 456
 					}
457 457
 				}
458
-			    ?>
458
+				?>
459 459
 			</select>
460 460
 		    </li>
461 461
 		    <?php
462 462
 			}
463
-		    ?>
463
+			?>
464 464
 		    <?php
465 465
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
466
-		    ?>
466
+			?>
467 467
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
468 468
 			<select class="selectpicker" onchange="airlinestype(this);">
469 469
 			    <option value="all"<?php if (!isset($_COOKIE['airlinestype']) || $_COOKIE['airlinestype'] == 'all' || $_COOKIE['airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 		    </li>
475 475
 		    <?php
476 476
 			}
477
-		    ?>
477
+			?>
478 478
 		    <li>
479 479
 			<?php echo _("Display flight with ident:"); ?>
480 480
 			<input type="text" name="identfilter" id="identfilter" value="<?php if (isset($_COOKIE['identfilter'])) print $_COOKIE['identfilter']; ?>" />
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 	    </form>
488 488
     	</div>
489 489
 <?php
490
-    if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
490
+	if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
491 491
 ?>
492 492
         <div class="sidebar-pane" id="satellites">
493 493
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -527,14 +527,14 @@  discard block
 block discarded – undo
527 527
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
528 528
 					}
529 529
 				}
530
-			    ?>
530
+				?>
531 531
 			</select>
532 532
 		    </li>
533 533
 		</ul>
534 534
 	    </form>
535 535
 	</div>
536 536
 <?php
537
-    }
537
+	}
538 538
 ?>
539 539
     </div>
540 540
 </div>
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 require_once('require/class.Satellite.php');
6 6
 
7
-$trackident = filter_input(INPUT_GET,'trackid',FILTER_SANITIZE_STRING);
7
+$trackident = filter_input(INPUT_GET, 'trackid', FILTER_SANITIZE_STRING);
8 8
 if ($trackident != '') {
9 9
 	require_once('require/class.SpotterLive.php');
10 10
 	$SpotterLive = new SpotterLive();
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 		$spotterid = $Spotter->getSpotterIDBasedOnFlightAwareID($trackident);
15 15
 		header('Location: '.$globalURL.'/flightid/'.$spotterid);
16 16
 	} else {
17
-		setcookie('MapTrack',$resulttrackident[0]['flightaware_id']);
17
+		setcookie('MapTrack', $resulttrackident[0]['flightaware_id']);
18 18
 	}
19 19
 } else {
20 20
 	unset($_COOKIE['MapTrack']);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		        <div class="form-group">
168 168
 			    <label>From (UTC):</label>
169 169
 		            <div class='input-group date' id='datetimepicker1'>
170
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("d/m/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
170
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("d/m/Y h:i a", $_COOKIE['archive_begin']); ?>" required />
171 171
 		                <span class="input-group-addon">
172 172
             			    <span class="glyphicon glyphicon-calendar"></span>
173 173
 		                </span>
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		        <div class="form-group">
177 177
 			    <label>To (UTC):</label>
178 178
 		            <div class='input-group date' id='datetimepicker2'>
179
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("d/m/Y h:i a",$_COOKIE['archive_end']); ?>" />
179
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("d/m/Y h:i a", $_COOKIE['archive_end']); ?>" />
180 180
             			<span class="input-group-addon">
181 181
 		                    <span class="glyphicon glyphicon-calendar"></span>
182 182
             			</span>
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 		    <li><?php echo _("Type of Terrain:"); ?>
302 302
 			<select  class="selectpicker" onchange="terrainType(this);">
303 303
 			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
304
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
305
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
304
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option>
305
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option>
306 306
 			</select>
307 307
 		    </li>
308 308
 <?php
@@ -429,10 +429,10 @@  discard block
 block discarded – undo
429 429
 			<select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines">
430 430
 			    <?php
431 431
 				$Spotter = new Spotter();
432
-				foreach($Spotter->getAllAirlineNames() as $airline) {
432
+				foreach ($Spotter->getAllAirlineNames() as $airline) {
433 433
 					$airline_name = $airline['airline_name'];
434
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
435
-					if (isset($_COOKIE['Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['Airlines']))) {
434
+					if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...';
435
+					if (isset($_COOKIE['Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['Airlines']))) {
436 436
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
437 437
 					} else {
438 438
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 			<select class="selectpicker" multiple onchange="sources(this);">
449 449
 			    <?php
450 450
 				$Spotter = new Spotter();
451
-				foreach($Spotter->getAllSourceName('aprs') as $source) {
452
-					if (isset($_COOKIE['Sources']) && in_array($source['source_name'],explode(',',$_COOKIE['Sources']))) {
451
+				foreach ($Spotter->getAllSourceName('aprs') as $source) {
452
+					if (isset($_COOKIE['Sources']) && in_array($source['source_name'], explode(',', $_COOKIE['Sources']))) {
453 453
 						echo '<option value="'.$source['source_name'].'" selected>'.$source['source_name'].'</option>';
454 454
 					} else {
455 455
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
522 522
 					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
523 523
 					
524
-					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
524
+					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) {
525 525
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
526 526
 					} else {
527 527
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
Please login to merge, or discard this patch.
Braces   +357 added lines, -95 removed lines patch added patch discarded remove patch
@@ -135,11 +135,26 @@  discard block
 block discarded – undo
135 135
 				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li>
136 136
 				<li><?php echo _("NOTAM scope:"); ?>
137 137
 					<select class="selectpicker" onchange="notamscope(this);">
138
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
139
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
140
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
141
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
142
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
138
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
139
+	print ' selected';
140
+}
141
+?>>All</option>
142
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
143
+	print ' selected';
144
+}
145
+?>>Airport/Enroute warning</option>
146
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
147
+	print ' selected';
148
+}
149
+?>>Airport warning</option>
150
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
151
+	print ' selected';
152
+}
153
+?>>Navigation warning</option>
154
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
155
+	print ' selected';
156
+}
157
+?>>Enroute warning</option>
143 158
 					</select
144 159
 				</li>
145 160
 			</ul>
@@ -167,7 +182,12 @@  discard block
 block discarded – undo
167 182
 		        <div class="form-group">
168 183
 			    <label>From (UTC):</label>
169 184
 		            <div class='input-group date' id='datetimepicker1'>
170
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("d/m/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
185
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) {
186
+	print $_POST['start_date'];
187
+} elseif (isset($_COOKIE['archive_begin'])) {
188
+	print date("d/m/Y h:i a",$_COOKIE['archive_begin']);
189
+}
190
+?>" required />
171 191
 		                <span class="input-group-addon">
172 192
             			    <span class="glyphicon glyphicon-calendar"></span>
173 193
 		                </span>
@@ -176,7 +196,12 @@  discard block
 block discarded – undo
176 196
 		        <div class="form-group">
177 197
 			    <label>To (UTC):</label>
178 198
 		            <div class='input-group date' id='datetimepicker2'>
179
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("d/m/Y h:i a",$_COOKIE['archive_end']); ?>" />
199
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) {
200
+	print $_POST['end_date'];
201
+} elseif (isset($_COOKIE['archive_end'])) {
202
+	print date("d/m/Y h:i a",$_COOKIE['archive_end']);
203
+}
204
+?>" />
180 205
             			<span class="input-group-addon">
181 206
 		                    <span class="glyphicon glyphicon-calendar"></span>
182 207
             			</span>
@@ -202,8 +227,20 @@  discard block
 block discarded – undo
202 227
 
203 228
 		    <li><?php echo _("Playback speed:"); ?>
204 229
 			<div class="range">
205
-			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>">
206
-			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
230
+			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
231
+	print $_POST['archivespeed'];
232
+} elseif (isset($_COOKIE['archive_speed'])) {
233
+	print $_COOKIE['archive_speed'];
234
+} else {
235
+	print '1';
236
+}
237
+?>">
238
+			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
239
+	print $_COOKIE['archive_speed'];
240
+} else {
241
+	print '1';
242
+}
243
+?></output>
207 244
 			</div>
208 245
 		    </li>
209 246
 		    <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li>
@@ -225,15 +262,27 @@  discard block
 block discarded – undo
225 262
 		    <li><?php echo _("Type of Map:"); ?>
226 263
 			<select  class="selectpicker" onchange="mapType(this);">
227 264
 			    <?php
228
-				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
229
-				else $MapType = $_COOKIE['MapType'];
265
+				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
266
+					$MapType = $globalMapProvider;
267
+				} else {
268
+					$MapType = $_COOKIE['MapType'];
269
+				}
230 270
 			    ?>
231 271
 			    <?php
232 272
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
233 273
 			    ?>
234
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
235
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
236
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
274
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
275
+	print ' selected';
276
+}
277
+?>>Bing-Aerial</option>
278
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
279
+	print ' selected';
280
+}
281
+?>>Bing-Hybrid</option>
282
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
283
+	print ' selected';
284
+}
285
+?>>Bing-Road</option>
237 286
 			    <?php
238 287
 				}
239 288
 			    ?>
@@ -243,56 +292,131 @@  discard block
 block discarded – undo
243 292
 			    <?php
244 293
 				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
245 294
 			    ?>
246
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
247
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
248
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
295
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
296
+	print ' selected';
297
+}
298
+?>>Here-Aerial</option>
299
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
300
+	print ' selected';
301
+}
302
+?>>Here-Hybrid</option>
303
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
304
+	print ' selected';
305
+}
306
+?>>Here-Road</option>
249 307
 			    <?php
250 308
 				    }
251 309
 			    ?>
252 310
 			    <?php
253 311
 				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
254 312
 			    ?>
255
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
256
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
257
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
258
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
313
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
314
+	print ' selected';
315
+}
316
+?>>Google Roadmap</option>
317
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
318
+	print ' selected';
319
+}
320
+?>>Google Satellite</option>
321
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
322
+	print ' selected';
323
+}
324
+?>>Google Hybrid</option>
325
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
326
+	print ' selected';
327
+}
328
+?>>Google Terrain</option>
259 329
 			    <?php
260 330
 				    }
261 331
 			    ?>
262 332
 			    <?php
263 333
 				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
264 334
 			    ?>
265
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
266
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
267
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
335
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
336
+	print ' selected';
337
+}
338
+?>>MapQuest-OSM</option>
339
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
340
+	print ' selected';
341
+}
342
+?>>MapQuest-Aerial</option>
343
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
344
+	print ' selected';
345
+}
346
+?>>MapQuest-Hybrid</option>
268 347
 			    <?php
269 348
 				    }
270 349
 			    ?>
271
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
350
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
351
+	print ' selected';
352
+}
353
+?>>Yandex</option>
272 354
 			    <?php
273 355
 				}
274 356
 			    ?>
275 357
 			    <?php
276 358
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
277
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
278
-					else $MapBoxId = $_COOKIE['MapTypeId'];
359
+					if (!isset($_COOKIE['MapTypeId'])) {
360
+						$MapBoxId = 'default';
361
+					} else {
362
+						$MapBoxId = $_COOKIE['MapTypeId'];
363
+					}
279 364
 			    ?>
280
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
281
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
282
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
283
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
284
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
285
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
286
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
287
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
288
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
289
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
290
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
291
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
365
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
366
+	print ' selected';
367
+}
368
+?>>Mapbox default</option>
369
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
370
+	print ' selected';
371
+}
372
+?>>Mapbox streets</option>
373
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
374
+	print ' selected';
375
+}
376
+?>>Mapbox light</option>
377
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
378
+	print ' selected';
379
+}
380
+?>>Mapbox dark</option>
381
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
382
+	print ' selected';
383
+}
384
+?>>Mapbox satellite</option>
385
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
386
+	print ' selected';
387
+}
388
+?>>Mapbox streets-satellite</option>
389
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
390
+	print ' selected';
391
+}
392
+?>>Mapbox streets-basic</option>
393
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
394
+	print ' selected';
395
+}
396
+?>>Mapbox comic</option>
397
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
398
+	print ' selected';
399
+}
400
+?>>Mapbox outdoors</option>
401
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
402
+	print ' selected';
403
+}
404
+?>>Mapbox pencil</option>
405
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
406
+	print ' selected';
407
+}
408
+?>>Mapbox pirates</option>
409
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
410
+	print ' selected';
411
+}
412
+?>>Mapbox emerald</option>
292 413
 			    <?php
293 414
 				    }
294 415
 			    ?>
295
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
416
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
417
+	print ' selected';
418
+}
419
+?>>OpenStreetMap</option>
296 420
 			</select>
297 421
 		    </li>
298 422
 <?php
@@ -300,9 +424,18 @@  discard block
 block discarded – undo
300 424
 ?>
301 425
 		    <li><?php echo _("Type of Terrain:"); ?>
302 426
 			<select  class="selectpicker" onchange="terrainType(this);">
303
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
304
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
305
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
427
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
428
+	print ' selected';
429
+}
430
+?>>stk terrain</option>
431
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
432
+	print ' selected';
433
+}
434
+?>>ellipsoid</option>
435
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
436
+	print ' selected';
437
+}
438
+?>>vr terrain</option>
306 439
 			</select>
307 440
 		    </li>
308 441
 <?php
@@ -312,18 +445,36 @@  discard block
 block discarded – undo
312 445
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
313 446
 ?>
314 447
 		    
315
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
316
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || !isset($_COOKIE['flightpath'])) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
317
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
318
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
448
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
449
+	print 'checked';
450
+}
451
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
452
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') || !isset($_COOKIE['flightpath'])) {
453
+	print 'checked';
454
+}
455
+?> ><?php echo _("Display flight path"); ?></label></div></li>
456
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) {
457
+	print 'checked';
458
+}
459
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
460
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
461
+	print 'checked';
462
+}
463
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
319 464
 <?php
320 465
     }
321 466
 ?>
322
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
467
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') {
468
+	print 'checked';
469
+}
470
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
323 471
 <?php
324 472
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
325 473
 ?>
326
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
474
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) {
475
+	print 'checked';
476
+}
477
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
327 478
 <?php
328 479
     }
329 480
 ?>
@@ -332,17 +483,25 @@  discard block
 block discarded – undo
332 483
 			if (function_exists('array_column')) {
333 484
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
334 485
 		    ?>
335
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
486
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
487
+	print 'checked';
488
+}
489
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
336 490
 		    <?php
337 491
 			    }
338 492
 			} elseif (isset($globalSources)) {
339 493
 			    $dispolar = false;
340 494
 			    foreach ($globalSources as $testsource) {
341
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
495
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
496
+			        	$dispolar = true;
497
+			        }
342 498
 			    }
343 499
 			    if ($dispolar) {
344 500
 		    ?>
345
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
501
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
502
+	print 'checked';
503
+}
504
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
346 505
 		    <?php
347 506
 			    }
348 507
 		        }
@@ -354,12 +513,22 @@  discard block
 block discarded – undo
354 513
 		    <?php
355 514
 		        if (extension_loaded('gd') && function_exists('gd_info')) {
356 515
 		    ?>
357
-		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
516
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
517
+	print 'checked';
518
+}
519
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
358 520
 		    <?php 
359 521
 			if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
360 522
 		    ?>
361 523
 		    <li><?php echo _("Aircraft icon color:"); ?>
362
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
524
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
525
+	print $_COOKIE['IconColor'];
526
+} elseif (isset($globalAircraftIconColor)) {
527
+	print $globalAircraftIconColor;
528
+} else {
529
+	print '1a3151';
530
+}
531
+?>">
363 532
 		    </li>
364 533
 		    <?php
365 534
 			    }
@@ -367,8 +536,22 @@  discard block
 block discarded – undo
367 536
 		    ?>
368 537
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
369 538
 			<div class="range">
370
-			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
371
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
539
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
540
+	print $_COOKIE['AirportZoom'];
541
+} elseif (isset($globalAirportZoom)) {
542
+	print $globalAirportZoom;
543
+} else {
544
+	print '7';
545
+}
546
+?>">
547
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
548
+	print $_COOKIE['AirportZoom'];
549
+} elseif (isset($globalAirportZoom)) {
550
+	print $globalAirportZoom;
551
+} else {
552
+	print '7';
553
+}
554
+?></output>
372 555
 			</div>
373 556
 		    </li>
374 557
 <?php
@@ -376,22 +559,46 @@  discard block
 block discarded – undo
376 559
 ?>
377 560
 		    <li><?php echo _("Distance unit:"); ?>
378 561
 			<select class="selectpicker" onchange="unitdistance(this);">
379
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
380
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
381
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
562
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
563
+	echo ' selected';
564
+}
565
+?>>km</option>
566
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
567
+	echo ' selected';
568
+}
569
+?>>nm</option>
570
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
571
+	echo ' selected';
572
+}
573
+?>>mi</option>
382 574
 		        </select>
383 575
 		    </li>
384 576
 		    <li><?php echo _("Altitude unit:"); ?>
385 577
 			<select class="selectpicker" onchange="unitaltitude(this);">
386
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
387
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
578
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
579
+	echo ' selected';
580
+}
581
+?>>m</option>
582
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
583
+	echo ' selected';
584
+}
585
+?>>feet</option>
388 586
 		        </select>
389 587
 		    </li>
390 588
 		    <li><?php echo _("Speed unit:"); ?>
391 589
 			<select class="selectpicker" onchange="unitspeed(this);">
392
-			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option>
393
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
394
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
590
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
591
+	echo ' selected';
592
+}
593
+?>>km/h</option>
594
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
595
+	echo ' selected';
596
+}
597
+?>>mph</option>
598
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
599
+	echo ' selected';
600
+}
601
+?>>knots</option>
395 602
 		        </select>
396 603
 		    </li>
397 604
 
@@ -406,9 +613,18 @@  discard block
 block discarded – undo
406 613
 		    <?php
407 614
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
408 615
 		    ?>
409
-			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
410
-			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
411
-			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
616
+			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) {
617
+	print 'checked';
618
+}
619
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
620
+			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) {
621
+	print 'checked';
622
+}
623
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
624
+			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) {
625
+	print 'checked';
626
+}
627
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
412 628
 		    <?php
413 629
 			}
414 630
 		    ?>
@@ -416,10 +632,16 @@  discard block
 block discarded – undo
416 632
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
417 633
 		    ?>
418 634
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
419
-			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
635
+			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) {
636
+	print 'checked';
637
+}
638
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
420 639
 			<?php } ?>
421 640
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
422
-			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li>
641
+			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) {
642
+	print 'checked';
643
+}
644
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
423 645
 			<?php } ?>
424 646
 		    <?php
425 647
 			}
@@ -431,7 +653,9 @@  discard block
 block discarded – undo
431 653
 				$Spotter = new Spotter();
432 654
 				foreach($Spotter->getAllAirlineNames() as $airline) {
433 655
 					$airline_name = $airline['airline_name'];
434
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
656
+					if (strlen($airline_name) > 30) {
657
+						$airline_name = substr($airline_name,0,30).'...';
658
+					}
435 659
 					if (isset($_COOKIE['Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['Airlines']))) {
436 660
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
437 661
 					} else {
@@ -466,10 +690,22 @@  discard block
 block discarded – undo
466 690
 		    ?>
467 691
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
468 692
 			<select class="selectpicker" onchange="airlinestype(this);">
469
-			    <option value="all"<?php if (!isset($_COOKIE['airlinestype']) || $_COOKIE['airlinestype'] == 'all' || $_COOKIE['airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
470
-			    <option value="passenger"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
471
-			    <option value="cargo"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
472
-			    <option value="military"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
693
+			    <option value="all"<?php if (!isset($_COOKIE['airlinestype']) || $_COOKIE['airlinestype'] == 'all' || $_COOKIE['airlinestype'] == '') {
694
+	echo ' selected';
695
+}
696
+?>><?php echo _("All"); ?></option>
697
+			    <option value="passenger"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'passenger') {
698
+	echo ' selected';
699
+}
700
+?>><?php echo _("Passenger"); ?></option>
701
+			    <option value="cargo"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'cargo') {
702
+	echo ' selected';
703
+}
704
+?>><?php echo _("Cargo"); ?></option>
705
+			    <option value="military"<?php if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] == 'military') {
706
+	echo ' selected';
707
+}
708
+?>><?php echo _("Military"); ?></option>
473 709
 			</select>
474 710
 		    </li>
475 711
 		    <?php
@@ -477,7 +713,10 @@  discard block
 block discarded – undo
477 713
 		    ?>
478 714
 		    <li>
479 715
 			<?php echo _("Display flight with ident:"); ?>
480
-			<input type="text" name="identfilter" id="identfilter" value="<?php if (isset($_COOKIE['identfilter'])) print $_COOKIE['identfilter']; ?>" />
716
+			<input type="text" name="identfilter" id="identfilter" value="<?php if (isset($_COOKIE['identfilter'])) {
717
+	print $_COOKIE['identfilter'];
718
+}
719
+?>" />
481 720
 		    </li>
482 721
 		</ul>
483 722
 	    </form>
@@ -493,7 +732,10 @@  discard block
 block discarded – undo
493 732
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
494 733
 	    <form>
495 734
 		<ul>
496
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
735
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') {
736
+	print 'checked';
737
+}
738
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
497 739
 		    <li><?php echo _("Type:"); ?>
498 740
 			<select class="selectpicker" multiple onchange="sattypes(this);">
499 741
 			    <?php
@@ -501,25 +743,45 @@  discard block
 block discarded – undo
501 743
 				$types = $Satellite->get_tle_types();
502 744
 				foreach ($types as $type) {
503 745
 					$type_name = $type['tle_type'];
504
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
505
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
506
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
507
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
508
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
509
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
510
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
511
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
512
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
513
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
514
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
515
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
516
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
517
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
518
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
519
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
520
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
521
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
522
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
746
+					if ($type_name == 'musson') {
747
+						$type_name = 'Russian LEO Navigation';
748
+					} else if ($type_name == 'nnss') {
749
+						$type_name = 'Navi Navigation Satellite System';
750
+					} else if ($type_name == 'sbas') {
751
+						$type_name = 'Satellite-Based Augmentation System';
752
+					} else if ($type_name == 'glo-ops') {
753
+						$type_name = 'Glonass Operational';
754
+					} else if ($type_name == 'gps-ops') {
755
+						$type_name = 'GPS Operational';
756
+					} else if ($type_name == 'argos') {
757
+						$type_name = 'ARGOS Data Collection System';
758
+					} else if ($type_name == 'tdrss') {
759
+						$type_name = 'Tracking and Data Relay Satellite System';
760
+					} else if ($type_name == 'sarsat') {
761
+						$type_name = 'Search & Rescue';
762
+					} else if ($type_name == 'dmc') {
763
+						$type_name = 'Disaster Monitoring';
764
+					} else if ($type_name == 'resource') {
765
+						$type_name = 'Earth Resources';
766
+					} else if ($type_name == 'stations') {
767
+						$type_name = 'Space Stations';
768
+					} else if ($type_name == 'geo') {
769
+						$type_name = 'Geostationary';
770
+					} else if ($type_name == 'amateur') {
771
+						$type_name = 'Amateur Radio';
772
+					} else if ($type_name == 'x-comm') {
773
+						$type_name = 'Experimental';
774
+					} else if ($type_name == 'other-comm') {
775
+						$type_name = 'Other Comm';
776
+					} else if ($type_name == 'science') {
777
+						$type_name = 'Space & Earth Science';
778
+					} else if ($type_name == 'military') {
779
+						$type_name = 'Miscellaneous Military';
780
+					} else if ($type_name == 'radar') {
781
+						$type_name = 'Radar Calibration';
782
+					} else if ($type_name == 'tle-new') {
783
+						$type_name = 'Last 30 days launches';
784
+					}
523 785
 					
524 786
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
525 787
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.