Completed
Push — master ( 57ec45...7a0770 )
by Yannick
33:58
created
statistics-month.php 1 patch
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,11 +15,15 @@  discard block
 block discarded – undo
15 15
 	require_once('require/class.Tracker.php');
16 16
 	$Tracker = new Tracker();
17 17
 }
18
-if (!isset($filter_name)) $filter_name = '';
18
+if (!isset($filter_name)) {
19
+	$filter_name = '';
20
+}
19 21
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
20 22
 if ($airline_icao == '' && isset($globalFilter)) {
21
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
22
-}
23
+    if (isset($globalFilter['airline'])) {
24
+    	$airline_icao = $globalFilter['airline'][0];
25
+    }
26
+    }
23 27
 
24 28
 require_once('header.php');
25 29
 include('statistics-sub-menu.php'); 
@@ -32,9 +36,13 @@  discard block
 block discarded – undo
32 36
 	  </div>
33 37
       <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>';
34 38
 
35
-if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
36
-elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth();
37
-elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth();
39
+if ($type == 'aircraft') {
40
+	$date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
41
+} elseif ($type == 'marine') {
42
+	$date_array = $Marine->countAllDatesLastMonth();
43
+} elseif ($type == 'tracker') {
44
+	$date_array = $Tracker->countAllDatesLastMonth();
45
+}
38 46
 
39 47
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 48
 $month_data = '';
@@ -75,8 +83,11 @@  discard block
 block discarded – undo
75 83
 		print '<tr>';
76 84
 		print '<td><strong>'.$i.'</strong></td>';
77 85
 		print '<td>';
78
-		if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
79
-		else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
86
+		if ($type == 'aircraft') {
87
+			print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
88
+		} else {
89
+			print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
90
+		}
80 91
 		print '</td>';
81 92
 		print '<td>';
82 93
 		print $date_item['date_count'];
Please login to merge, or discard this patch.
statistics-year.php 1 patch
Braces   +21 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,11 +17,15 @@  discard block
 block discarded – undo
17 17
 $title = _("Statistics").' - '._("Busiest Month of Last Year");
18 18
 
19 19
 
20
-if (!isset($filter_name)) $filter_name = '';
20
+if (!isset($filter_name)) {
21
+	$filter_name = '';
22
+}
21 23
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
22 24
 if ($airline_icao == '' && isset($globalFilter)) {
23
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
24
-}
25
+    if (isset($globalFilter['airline'])) {
26
+    	$airline_icao = $globalFilter['airline'][0];
27
+    }
28
+    }
25 29
 
26 30
 require_once('header.php');
27 31
 include('statistics-sub-menu.php');
@@ -33,9 +37,13 @@  discard block
 block discarded – undo
33 37
 	</div>
34 38
       <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>';
35 39
 
36
-if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
37
-elseif ($type == 'marine') $date_array = $Marine->countAllMonthsLastYear(true);
38
-elseif ($type == 'tracker') $date_array = $Tracker->countAllMonthsLastYear(true);
40
+if ($type == 'aircraft') {
41
+	$date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
42
+} elseif ($type == 'marine') {
43
+	$date_array = $Marine->countAllMonthsLastYear(true);
44
+} elseif ($type == 'tracker') {
45
+	$date_array = $Tracker->countAllMonthsLastYear(true);
46
+}
39 47
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 48
 $year_data = '';
41 49
 $year_cnt = '';
@@ -53,9 +61,13 @@  discard block
 block discarded – undo
53 61
     axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m"}}, y: { label: "#"}},legend: { show: false }});';
54 62
 print '</script>';
55 63
 
56
-if ($type == 'aircraft') $date_array = $Stats->countAllMonths($airline_icao);
57
-elseif ($type == 'marine') $date_array = $Marine->countAllMonths();
58
-elseif ($type == 'tracker') $date_array = $Tracker->countAllMonths();
64
+if ($type == 'aircraft') {
65
+	$date_array = $Stats->countAllMonths($airline_icao);
66
+} elseif ($type == 'marine') {
67
+	$date_array = $Marine->countAllMonths();
68
+} elseif ($type == 'tracker') {
69
+	$date_array = $Tracker->countAllMonths();
70
+}
59 71
 
60 72
 if (!empty($date_array))
61 73
 {
Please login to merge, or discard this patch.
statistics-country.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 $Stats = new Stats();
6 6
 
7
-if (!isset($filter_name)) $filter_name = '';
7
+if (!isset($filter_name)) {
8
+	$filter_name = '';
9
+}
8 10
 $type = 'aircraft';
9 11
 if (isset($_GET['marine'])) {
10 12
 	$type = 'marine';
@@ -21,8 +23,10 @@  discard block
 block discarded – undo
21 23
 }
22 24
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
23 25
 if ($airline_icao == '' && isset($globalFilter)) {
24
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
25
-}
26
+    if (isset($globalFilter['airline'])) {
27
+    	$airline_icao = $globalFilter['airline'][0];
28
+    }
29
+    }
26 30
 
27 31
 require_once('header.php');
28 32
 include('statistics-sub-menu.php'); 
Please login to merge, or discard this patch.
statistics-time.php 1 patch
Braces   +21 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,11 +16,15 @@  discard block
 block discarded – undo
16 16
 	$Tracker = new Tracker();
17 17
 }
18 18
 
19
-if (!isset($filter_name)) $filter_name = '';
19
+if (!isset($filter_name)) {
20
+	$filter_name = '';
21
+}
20 22
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
21 23
 if ($airline_icao == '' && isset($globalFilter)) {
22
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
23
-}
24
+    if (isset($globalFilter['airline'])) {
25
+    	$airline_icao = $globalFilter['airline'][0];
26
+    }
27
+    }
24 28
 
25 29
 require_once('header.php');
26 30
 include('statistics-sub-menu.php');
@@ -33,9 +37,13 @@  discard block
 block discarded – undo
33 37
 	</div>
34 38
 	<p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>';
35 39
 
36
-if ($type == 'aircraft') $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
37
-elseif ($type == 'marine') $hour_array = $Marine->countAllHours('hour',true);
38
-elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('hour',true);
40
+if ($type == 'aircraft') {
41
+	$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
42
+} elseif ($type == 'marine') {
43
+	$hour_array = $Marine->countAllHours('hour',true);
44
+} elseif ($type == 'tracker') {
45
+	$hour_array = $Tracker->countAllHours('hour',true);
46
+}
39 47
 print '<div id="chartHour" class="chart" width="100%"></div><script>';
40 48
 $hour_data = '';
41 49
 $hour_cnt = '';
@@ -53,9 +61,13 @@  discard block
 block discarded – undo
53 61
     axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});';
54 62
 print '</script>';
55 63
 
56
-if ($type == 'aircraft') $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name);
57
-elseif ($type == 'marine') $hour_array = $Marine->countAllHours('count',true);
58
-elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('count',true);
64
+if ($type == 'aircraft') {
65
+	$hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name);
66
+} elseif ($type == 'marine') {
67
+	$hour_array = $Marine->countAllHours('count',true);
68
+} elseif ($type == 'tracker') {
69
+	$hour_array = $Tracker->countAllHours('count',true);
70
+}
59 71
 if (!empty($hour_array))
60 72
 {
61 73
 	print '<div class="table-responsive">';
Please login to merge, or discard this patch.
statistics-aircraft.php 1 patch
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,11 +5,15 @@  discard block
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Aircraft");
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 == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12
-}
13
+    if (isset($globalFilter['airline'])) {
14
+    	$airline_icao = $globalFilter['airline'][0];
15
+    }
16
+    }
13 17
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 18
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
15 19
 
@@ -28,9 +32,12 @@  discard block
 block discarded – undo
28 32
 $aircraft_data = '';
29 33
 foreach($aircraft_array as $aircraft_item)
30 34
 {
31
-	if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
32
-	else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
33
-}
35
+	if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') {
36
+		$aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
37
+	} else {
38
+		$aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
39
+	}
40
+	}
34 41
 $aircraft_data = substr($aircraft_data, 0, -1);
35 42
 print 'var series = ['.$aircraft_data.'];';
36 43
 print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
Please login to merge, or discard this patch.
atc-data.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
 	$atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT);
9 9
 	$atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING);
10 10
 	$atc_data = $ATC->getById($atcid);
11
-	if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident);
11
+	if (!isset($atc_data[0])) {
12
+		$atc_data = $ATC->getByIdent($atcident);
13
+	}
12 14
  ?>
13 15
 <div class="alldetails">
14 16
 <button type="button" class="close">&times;</button>
Please login to merge, or discard this patch.
aircraft-data.php 1 patch
Braces   +51 added lines, -20 removed lines patch added patch discarded remove patch
@@ -57,7 +57,9 @@  discard block
 block discarded – undo
57 57
 {
58 58
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
59 59
 		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
60
-	} else $image = $spotter_item['image_thumbnail'];
60
+	} else {
61
+		$image = $spotter_item['image_thumbnail'];
62
+	}
61 63
 
62 64
 }
63 65
 /* else {
@@ -70,8 +72,12 @@  discard block
 block discarded – undo
70 72
 }
71 73
 print '<div class="right">';
72 74
 print '<div class="callsign-details">';
73
-if ($spotter_item['ident'] != 'Not Available') print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>';
74
-if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
75
+if ($spotter_item['ident'] != 'Not Available') {
76
+	print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>';
77
+}
78
+if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') {
79
+	print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
80
+}
75 81
 print '</div>';
76 82
 if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') {
77 83
 	print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
@@ -103,10 +109,16 @@  discard block
 block discarded – undo
103 109
 print '</div>';
104 110
 print '<div id="aircraft">';
105 111
 print '<span>'._("Aircraft").'</span>';
106
-if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
107
-if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
108
-elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
109
-else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
112
+if (isset($spotter_item['aircraft_wiki'])) {
113
+	print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
114
+}
115
+if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') {
116
+	print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
117
+} elseif (isset($spotter_item['aircraft_type'])) {
118
+	print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
119
+} else {
120
+	print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
121
+}
110 122
 print '</div>';
111 123
 print '<div id ="altitude"><span>'._("Altitude").'</span>';
112 124
 if (isset($globalGroundAltitude) && $globalGroundAltitude) {
@@ -117,12 +129,18 @@  discard block
 block discarded – undo
117 129
 }
118 130
 
119 131
 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
120
-	if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')';
121
-	else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')';
122
-} else {
123
-	if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')';
124
-	else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')';
125
-}
132
+	if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
133
+		print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')';
134
+	} else {
135
+		print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')';
136
+	}
137
+	} else {
138
+	if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
139
+		print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')';
140
+	} else {
141
+		print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')';
142
+	}
143
+	}
126 144
 
127 145
 if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*30.48) {
128 146
 	print '<br>';
@@ -136,7 +154,9 @@  discard block
 block discarded – undo
136 154
 }
137 155
 
138 156
 print '</div>';
139
-if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
157
+if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') {
158
+	print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
159
+}
140 160
 print '<div id="speed"><span>'._("Speed").'</span>';
141 161
 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
142 162
 	print round($spotter_item['ground_speed']*1.15078).' mph';
@@ -150,8 +170,11 @@  discard block
 block discarded – undo
150 170
 print '<div id="heading"><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>';
151 171
 if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') {
152 172
 	print '<div id="pilot"><span>'._("Pilot").'</span>';
153
-	if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
154
-	else print $spotter_item['pilot_name'];
173
+	if (isset($spotter_item['pilot_id'])) {
174
+		print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
175
+	} else {
176
+		print $spotter_item['pilot_name'];
177
+	}
155 178
 	print '</div>';
156 179
 }
157 180
 
@@ -179,10 +202,18 @@  discard block
 block discarded – undo
179 202
 print '</div>';
180 203
 print '</div>';
181 204
 
182
-if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
183
-if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
184
-if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
185
-if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
205
+if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') {
206
+	print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
207
+}
208
+if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') {
209
+	print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
210
+}
211
+if (isset($spotter_item['acars']['message'])) {
212
+	print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
213
+}
214
+if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) {
215
+	print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
216
+}
186 217
 print '</div>';
187 218
 ?>
188 219
 </div>
189 220
\ No newline at end of file
Please login to merge, or discard this patch.
footer.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,10 @@  discard block
 block discarded – undo
1 1
 </section>
2 2
 <div class="pub onmap">
3 3
 <?php
4
-	if (isset($globalPub)) print $globalPub;
5
-?>
4
+	if (isset($globalPub)) {
5
+		print $globalPub;
6
+	}
7
+	?>
6 8
 </div>
7 9
 <footer class="container">
8 10
 	<?php
@@ -13,7 +15,10 @@  discard block
 block discarded – undo
13 15
 	<?php
14 16
 	    }
15 17
 	?>
16
-	<span>Developed in Barrie by <a href="http://mtru.nz/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source &amp; Credits</a></span> - <span><a href="https://www.flightairmap.fr/" target="_blank">Get source code</a></span>
18
+	<span>Developed in Barrie by <a href="http://mtru.nz/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) {
19
+	print $globalURL;
20
+}
21
+?>/about#source">Source &amp; Credits</a></span> - <span><a href="https://www.flightairmap.fr/" target="_blank">Get source code</a></span>
17 22
 </footer>
18 23
 
19 24
 <div class="notifications bottom-left"></div>
Please login to merge, or discard this patch.
require/class.Elevation.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 	private $openedFiles = [];
29 29
 
30 30
 	public function __construct($htgFilesDestination = '', $resolution = 3) {
31
-		if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/';
31
+		if ($htgFilesDestination == '') {
32
+			$htgFilesDestination = dirname(__FILE__).'/../data/';
33
+		}
32 34
 		$this->htgFilesDestination = $htgFilesDestination;
33 35
 		$this->resolution          = $resolution;
34 36
 		switch ($resolution) {
@@ -171,16 +173,26 @@  discard block
 block discarded – undo
171 173
 		$fileName  = "N{$N}E{$E}.hgt";
172 174
 		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
173 175
 			$Common = new Common();
174
-			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
176
+			if ($debug) {
177
+				echo 'Downloading '.$fileName.'.gz ...';
178
+			}
175 179
 			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176 180
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
177
-				if ($debug) echo "File '{$fileName}.gz' not exists.";
181
+				if ($debug) {
182
+					echo "File '{$fileName}.gz' not exists.";
183
+				}
178 184
 				return false;
179 185
 			}
180
-			if ($debug) echo 'Done'."\n";
181
-			if ($debug) echo 'Decompress '.$fileName.' ....';
186
+			if ($debug) {
187
+				echo 'Done'."\n";
188
+			}
189
+			if ($debug) {
190
+				echo 'Decompress '.$fileName.' ....';
191
+			}
182 192
 			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
183
-			if ($debug) echo 'Done'."\n";
193
+			if ($debug) {
194
+				echo 'Done'."\n";
195
+			}
184 196
 			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
185 197
 		}
186 198
 		return true;
Please login to merge, or discard this patch.