Completed
Push — master ( 56826b...44a8cc )
by Yannick
26:44
created
airport-statistics-aircraft.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 
12
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
14 14
 $airport_array = $Spotter->getAllAirportInfo($airport);
15 15
 
16 16
 if (!empty($airport_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Aircraft to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
18
+	$title = sprintf(_("Most Common Aircraft to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
21 21
 	print '<form action="'.$globalURL.'/airport" method="post">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($airport == $airport_name['airport_icao'])
30
+		if ($airport == $airport_name['airport_icao'])
31 31
 		{
32 32
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Aircraft").'</h2>';
61
- 	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+ 	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 	
63 63
 	$aircraft_array = $Spotter->countAllAircraftTypesByAirport($airport);
64 64
 	if (!empty($aircraft_array))
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		print '</thead>';
74 74
 		print '<tbody>';
75 75
 		$i = 1;
76
-		foreach($aircraft_array as $aircraft_item)
76
+		foreach ($aircraft_array as $aircraft_item)
77 77
 		{
78 78
 			print '<tr>';
79 79
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-aircraft.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
10
+$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 //	$spotter_array = $Spotter->getSpotterDataByAirline('',"0,1","",array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline))));
15 15
 	$alliance = true;
16 16
 } else {
17
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
17
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
18 18
 }
19 19
 
20 20
 if (!empty($spotter_array) || $alliance === true)
21 21
 {
22 22
 	if ($alliance) {
23
-		$title = sprintf(_("Most Common Aircraft from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
23
+		$title = sprintf(_("Most Common Aircraft from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
24 24
 	} else {
25
-		$title = sprintf(_("Most Common Aircraft from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
25
+		$title = sprintf(_("Most Common Aircraft from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
26 26
 	}
27 27
 	require_once('header.php');
28 28
 	print '<div class="select-item">';
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	$alliances = $Spotter->getAllAllianceNames();
33 33
 	if (!empty($alliances)) {
34 34
 		foreach ($alliances as $al) {
35
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
36
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
35
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
36
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
37 37
 			} else {
38
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
38
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
39 39
 			}
40 40
 		}
41 41
 		print '<option disabled>────────────────</option>';
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	$Stats = new Stats();
44 44
 	$airline_names = $Stats->getAllAirlineNames();
45 45
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
46
-	foreach($airline_names as $airline_name)
46
+	foreach ($airline_names as $airline_name)
47 47
 	{
48
-		if($airline == $airline_name['airline_icao'])
48
+		if ($airline == $airline_name['airline_icao'])
49 49
 		{
50 50
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
51 51
 		} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			print '</div>';
80 80
 		} else {
81 81
 			print '<div class="info column">';
82
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
83
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
82
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
83
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
84 84
 			{
85
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
85
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
86 86
 			}
87
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
87
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
88 88
 			print '</div>';
89 89
 		}
90 90
 	} else {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	print '<div class="column">';
96 96
 	print '<h2>'._("Most Common Aircraft").'</h2>';
97 97
 	if ($alliance === false) {
98
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
98
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
99 99
 	} else {
100
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
100
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
101 101
 	}
102 102
 
103 103
 	/*
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$aircraft_array = $Spotter->countAllAircraftTypesByAirline($airline);
108 108
 	}
109 109
 	*/
110
-	$aircraft_array = $Stats->countAllAircraftTypes(true,$airline);
110
+	$aircraft_array = $Stats->countAllAircraftTypes(true, $airline);
111 111
 	if (!empty($aircraft_array))
112 112
 	{
113 113
 		print '<div class="table-responsive">';
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		print '</thead>';
121 121
 		print '<tbody>';
122 122
 		$i = 1;
123
-		foreach($aircraft_array as $aircraft_item)
123
+		foreach ($aircraft_array as $aircraft_item)
124 124
 		{
125 125
 			print '<tr>';
126 126
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics.php 1 patch
Spacing   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 if (!isset($filter_name)) $filter_name = '';
26
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
26
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
27 27
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
28 28
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
29 29
 }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
33 33
 	if (isset($airline_info[0]['name'])) {
34 34
 		$airline_name = $airline_info[0]['name'];
35
-	} elseif (strpos($airline_icao,'alliance_') !== FALSE) {
35
+	} elseif (strpos($airline_icao, 'alliance_') !== FALSE) {
36 36
 		$alliance_name = $airline_icao;
37 37
 	}
38 38
 }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	$title = _("Statistics");
43 43
 }
44 44
 
45
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
45
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
46
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
47 47
 
48 48
 require_once('header.php');
49 49
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	date_default_timezone_set('UTC');
75 75
 	$lastupdate = strtotime($last_update[0]['value']);
76 76
 	if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
77
-	print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
77
+	print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
78 78
 }
79 79
 
80 80
 ?>
@@ -86,31 +86,31 @@  discard block
 block discarded – undo
86 86
 <?php
87 87
 if ($type == 'aircraft') {
88 88
 ?>
89
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
90
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
89
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
90
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
91
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
93 93
 <?php
94 94
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
95 95
 ?>
96
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
97
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
96
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
97
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
98 98
 <?php
99 99
 	}
100 100
 	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
101 101
 ?>
102
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
103
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
102
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
103
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
104 104
 <?php
105 105
 	}
106 106
 ?>
107
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
107
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
109 109
 <?php
110 110
 	if ($airline_icao == '') {
111 111
 ?>
112
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
113
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
112
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
113
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
114 114
 <?php
115 115
 	}
116 116
 ?>
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	if (!(isset($globalVA) && $globalVA) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS) && !(isset($globalVAM) && $globalVAM)) {
119 119
 		if ($airline_icao == '' || $airline_icao == 'all') {
120 120
 ?>
121
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
122
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
121
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
122
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
123 123
 <?php
124 124
 		}
125 125
 	}
@@ -127,22 +127,22 @@  discard block
 block discarded – undo
127 127
 <?php
128 128
 } elseif ($type == 'marine') {
129 129
 ?>
130
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name,$year,$month)); ?></span> <?php echo _("Vessels"); ?></span>
131
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
132
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name,$year,$month)); ?></span> <?php echo _("Types"); ?></span>
133
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
130
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name, $year, $month)); ?></span> <?php echo _("Vessels"); ?></span>
131
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
132
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name, $year, $month)); ?></span> <?php echo _("Types"); ?></span>
133
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
134 134
 <?php
135 135
 } elseif ($type == 'tracker') {
136 136
 ?>
137
-	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name,$year,$month)); ?></span> <?php echo _("Trackers"); ?></span>
138
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
139
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span>
140
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
137
+	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name, $year, $month)); ?></span> <?php echo _("Trackers"); ?></span>
138
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
139
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span>
140
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
141 141
 <?php
142 142
 }
143 143
 ?>
144 144
     </p>
145
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
145
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
146 146
     <div class="specific-stats">
147 147
 <?php
148 148
 if ($type == 'aircraft') {
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
             <div class="col-md-6">
152 152
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
153 153
 <?php
154
-	$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
154
+	$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
155 155
 	if (count($aircraft_array) == 0) {
156 156
 		print _("No data available");
157 157
 	} else {
158 158
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
159 159
 		$aircraft_data = '';
160
-		foreach($aircraft_array as $aircraft_item) {
160
+		foreach ($aircraft_array as $aircraft_item) {
161 161
 			if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
162 162
 			else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
163 163
 		}
@@ -186,16 +186,16 @@  discard block
 block discarded – undo
186 186
 ?>
187 187
                 </div>
188 188
             </div>
189
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
189
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
190 190
 <?php
191 191
 	if ($airline_icao == '' || $airline_icao == 'all') {
192
-		$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
192
+		$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
193 193
 		if (count($airline_array) > 0) {
194 194
 			print '<div class="col-md-6">';
195 195
 			print '<h2>'._("Top 10 Most Common Airline").'</h2>';
196 196
 			print '<div id="chart2" class="chart" width="100%"></div><script>';
197 197
 			$airline_data = '';
198
-			foreach($airline_array as $airline_item) {
198
+			foreach ($airline_array as $airline_item) {
199 199
 				$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
200 200
 			}
201 201
 			$airline_data = substr($airline_data, 0, -1);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		}
221 221
 ?>
222 222
         </div>
223
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
223
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
224 224
 <?php
225 225
 	}
226 226
 }
@@ -232,12 +232,12 @@  discard block
 block discarded – undo
232 232
             <div class="col-md-6">
233 233
                 <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2>
234 234
 <?php
235
-	$marine_array = $Stats->countAllMarineTypes(true,$filter_name,$year,$month);
235
+	$marine_array = $Stats->countAllMarineTypes(true, $filter_name, $year, $month);
236 236
 	if (count($marine_array) == 0) print _("No data available");
237 237
 	else {
238 238
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
239 239
 		$marine_data = '';
240
-		foreach($marine_array as $marine_item) {
240
+		foreach ($marine_array as $marine_item) {
241 241
 			$marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],';
242 242
 		}
243 243
 		$marine_data = substr($marine_data, 0, -1);
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
             	    ?>
267 267
                 </div>
268 268
             </div>
269
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
269
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
270 270
 <!--	</div>-->
271 271
 <?php
272 272
 }
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
             <div class="col-md-6">
277 277
                 <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2>
278 278
 <?php
279
-	$tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month);
279
+	$tracker_array = $Tracker->countAllTrackerTypes(true, 0, '', array(), $year, $month);
280 280
 	if (count($tracker_array) == 0) print _("No data available");
281 281
 	else {
282 282
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
283 283
 		$tracker_data = '';
284
-		foreach($tracker_array as $tracker_item) {
284
+		foreach ($tracker_array as $tracker_item) {
285 285
 			$tracker_data .= '["'.$tracker_item['tracker_type'].'",'.$tracker_item['tracker_type_count'].'],';
286 286
 		}
287 287
 		$tracker_data = substr($tracker_data, 0, -1);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             	    ?>
312 312
                 </div>
313 313
             </div>
314
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
314
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
315 315
 <!--	</div>-->
316 316
 <?php
317 317
 }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		else {
327 327
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
328 328
 			$owner_data = '';
329
-			foreach($owner_array as $owner_item) {
329
+			foreach ($owner_array as $owner_item) {
330 330
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
331 331
 			}
332 332
 			$owner_data = substr($owner_data, 0, -1);
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 </div>
347 347
                 -->
348 348
             </div>
349
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
349
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
350 350
             <div class="col-md-6">
351 351
                 <h2><?php echo _("Top 10 Most Common Countries Owners"); ?></h2>
352 352
 <?php
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 		else {
356 356
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
357 357
 			$owner_data = '';
358
-			foreach($countries_array as $owner_item) {
358
+			foreach ($countries_array as $owner_item) {
359 359
 				$owner_data .= '["'.$owner_item['country_name'].'",'.$owner_item['country_count'].'],';
360 360
 			}
361 361
 			$owner_data = substr($owner_data, 0, -1);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                 -->
377 377
             </div>
378 378
             
379
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
379
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
380 380
 ²	</div>
381 381
         <div class="row column">
382 382
             <div class="col-md-6">
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		else {
388 388
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
389 389
 			$launch_site_data = '';
390
-			foreach($launch_site_array as $launch_site_item) {
390
+			foreach ($launch_site_array as $launch_site_item) {
391 391
 				$launch_site_data .= '["'.$launch_site_item['launch_site'].'",'.$launch_site_item['launch_site_count'].'],';
392 392
 			}
393 393
 			$launch_site_data = substr($launch_site_data, 0, -1);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 ?>
415 415
         <div class="row column">
416 416
 <?php
417
-	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
417
+	$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
418 418
 	//if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
419 419
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
420 420
 		if (empty($flightover_array)) {
@@ -425,12 +425,12 @@  discard block
 block discarded – undo
425 425
 ?>
426 426
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
427 427
 <?php
428
-		$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
428
+		$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
429 429
 		if (count($pilot_array) == 0) print _("No data available");
430 430
 		else {
431 431
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
432 432
 			$pilot_data = '';
433
-			foreach($pilot_array as $pilot_item) {
433
+			foreach ($pilot_array as $pilot_item) {
434 434
 				$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
435 435
 			}
436 436
 			$pilot_data = substr($pilot_data, 0, -1);
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 ?>
452 452
             </div>
453 453
 
454
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
454
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
455 455
 <?php
456 456
 	}
457 457
 	// else {
@@ -460,12 +460,12 @@  discard block
 block discarded – undo
460 460
             <div class="col-md-6">
461 461
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
462 462
 <?php
463
-		$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
463
+		$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
464 464
 		if (count($owner_array) == 0) print _("No data available");
465 465
 		else {
466 466
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
467 467
 			$owner_data = '';
468
-			foreach($owner_array as $owner_item) {
468
+			foreach ($owner_array as $owner_item) {
469 469
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
470 470
 			}
471 471
 			$owner_data = substr($owner_data, 0, -1);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                 </div>
485 485
             </div>
486 486
         
487
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
487
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
488 488
 <?php
489 489
 	}
490 490
 	if (!empty($flightover_array)) {
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
499 499
 			print 'var series = [';
500 500
 			$flightover_data = '';
501
-			foreach($flightover_array as $flightover_item) {
501
+			foreach ($flightover_array as $flightover_item) {
502 502
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
503 503
 			}
504 504
 			$flightover_data = substr($flightover_data, 0, -1);
@@ -543,12 +543,12 @@  discard block
 block discarded – undo
543 543
 	}
544 544
 ?>
545 545
         </div>
546
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
546
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
547 547
         </div>
548 548
 <?php
549 549
 }
550 550
 if ($type == 'marine') {
551
-	$flightover_array = $Stats->countAllMarineOverCountries(true,$filter_name,$year,$month);
551
+	$flightover_array = $Stats->countAllMarineOverCountries(true, $filter_name, $year, $month);
552 552
 ?>
553 553
 <!--    <div class="row column">-->
554 554
 	<div class="col-md-6">
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
560 560
 		print 'var series = [';
561 561
 		$flightover_data = '';
562
-		foreach($flightover_array as $flightover_item) {
562
+		foreach ($flightover_array as $flightover_item) {
563 563
 			$flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],';
564 564
 		}
565 565
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
                 <div class="more">
600 600
                     <a href="<?php print $globalURL; ?>/marine/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
601 601
                 </div>
602
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
602
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
603 603
             </div>
604 604
         </div>
605 605
 
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
618 618
 		print 'var series = [';
619 619
 		$flightover_data = '';
620
-		foreach($flightover_array as $flightover_item) {
620
+		foreach ($flightover_array as $flightover_item) {
621 621
 			$flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],';
622 622
 		}
623 623
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -667,14 +667,14 @@  discard block
 block discarded – undo
667 667
         <div class="row column">
668 668
             <div class="col-md-6">
669 669
 <?php
670
-	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
670
+	$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
671 671
 	if (count($airport_airport_array) > 0) {
672 672
 		print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
673 673
 		print '<div id="chart3" class="chart" width="100%"></div><script>';
674 674
 		print "\n";
675 675
 		print 'var series = [';
676 676
 		$airport_data = '';
677
-		foreach($airport_airport_array as $airport_item) {
677
+		foreach ($airport_airport_array as $airport_item) {
678 678
 			$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
679 679
 		}
680 680
 		$airport_data = substr($airport_data, 0, -1);
@@ -724,18 +724,18 @@  discard block
 block discarded – undo
724 724
 	}
725 725
 ?>
726 726
             </div>
727
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
727
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
728 728
 
729 729
             <div class="col-md-6">
730 730
 <?php
731
-	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
731
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
732 732
 	if (count($airport_airport_array2) > 0) {
733 733
 		print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
734 734
 		print '<div id="chart4" class="chart" width="100%"></div><script>';
735 735
 		print "\n";
736 736
 		print 'var series = [';
737 737
 		$airport_data = '';
738
-		foreach($airport_airport_array2 as $airport_item)
738
+		foreach ($airport_airport_array2 as $airport_item)
739 739
 		{
740 740
 			if (isset($airport_item['airport_arrival_longitude']) && isset($airport_item['airport_arrival_latitude'])) {
741 741
 				$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 ?>
790 790
             </div>
791 791
         </div>
792
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
792
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
793 793
 <?php 
794 794
 }
795 795
 if ($type == 'aircraft') {
@@ -801,18 +801,18 @@  discard block
 block discarded – undo
801 801
             <div class="col-md-6">
802 802
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
803 803
 <?php
804
-		$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
804
+		$year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
805 805
 		if (count($year_array) == 0) print _("No data available");
806 806
 		else {
807 807
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
808 808
 			$year_data = '';
809 809
 			$year_cnt = '';
810
-			foreach($year_array as $year_item) {
810
+			foreach ($year_array as $year_item) {
811 811
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
812 812
 				$year_cnt .= $year_item['date_count'].',';
813 813
 			}
814 814
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
815
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
815
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
816 816
 			print 'c3.generate({
817 817
 			    bindto: "#chart8",
818 818
 			    data: { x: "x",
@@ -825,22 +825,22 @@  discard block
 block discarded – undo
825 825
                     <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
826 826
                 </div>
827 827
             </div>
828
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
828
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
829 829
             <div class="col-md-6">
830 830
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
831 831
 <?php
832
-		$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
832
+		$month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
833 833
 		if (count($month_array) == 0) print _("No data available");
834 834
 		else {
835 835
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
836 836
 			$month_data = '';
837 837
 			$month_cnt = '';
838
-			foreach($month_array as $month_item) {
838
+			foreach ($month_array as $month_item) {
839 839
 				$month_data .= '"'.$month_item['date_name'].'",';
840 840
 				$month_cnt .= $month_item['date_count'].',';
841 841
 			}
842 842
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
843
-			$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
843
+			$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
844 844
 			print 'c3.generate({
845 845
 			    bindto: "#chart9",
846 846
 			    data: { x: "x",
@@ -853,23 +853,23 @@  discard block
 block discarded – undo
853 853
                     <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
854 854
                 </div>
855 855
             </div>
856
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
856
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
857 857
 
858 858
             <div class="col-md-6">
859 859
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
860 860
 <?php
861
-		$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
861
+		$date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
862 862
 		if (empty($date_array)) print _("No data available");
863 863
 		else {
864 864
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
865 865
 			$date_data = '';
866 866
 			$date_cnt = '';
867
-			foreach($date_array as $date_item) {
867
+			foreach ($date_array as $date_item) {
868 868
 				$date_data .= '"'.$date_item['date_name'].'",';
869 869
 				$date_cnt .= $date_item['date_count'].',';
870 870
 			}
871 871
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
872
-			$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
872
+			$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]";
873 873
 			print 'c3.generate({
874 874
 			    bindto: "#chart5",
875 875
 			    data: { x: "x",
@@ -882,22 +882,22 @@  discard block
 block discarded – undo
882 882
                     <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
883 883
                 </div>
884 884
             </div>
885
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
885
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
886 886
             <div class="col-md-6">
887 887
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
888 888
 <?php
889
-		$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
889
+		$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
890 890
 		if (empty($hour_array)) print _("No data available");
891 891
 		else {
892 892
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
893 893
 			$hour_data = '';
894 894
 			$hour_cnt = '';
895
-			foreach($hour_array as $hour_item) {
895
+			foreach ($hour_array as $hour_item) {
896 896
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
897 897
 				$hour_cnt .= $hour_item['hour_count'].',';
898 898
 			}
899 899
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
900
-			$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
900
+			$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
901 901
 			print 'c3.generate({
902 902
 			    bindto: "#chart6",
903 903
 			    data: {
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
                     <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
911 911
                 </div>
912 912
             </div>
913
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
913
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
914 914
         </div>
915 915
 <?php
916 916
 	}
@@ -926,18 +926,18 @@  discard block
 block discarded – undo
926 926
             <div class="col-md-6">
927 927
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
928 928
 <?php
929
-		$year_array = $Stats->countAllMarineMonthsLastYear(true,$filter_name);
929
+		$year_array = $Stats->countAllMarineMonthsLastYear(true, $filter_name);
930 930
 		if (count($year_array) == 0) print _("No data available");
931 931
 		else {
932 932
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
933 933
 			$year_data = '';
934 934
 			$year_cnt = '';
935
-			foreach($year_array as $year_item) {
935
+			foreach ($year_array as $year_item) {
936 936
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
937 937
 				$year_cnt .= $year_item['date_count'].',';
938 938
 			}
939 939
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
940
-			$year_cnt = "['vessels',".substr($year_cnt,0,-1)."]";
940
+			$year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]";
941 941
 			print 'c3.generate({
942 942
 			    bindto: "#chart8",
943 943
 			    data: { x: "x",
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
                 </div>
952 952
             </div>
953 953
             
954
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
954
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
955 955
             <div class="col-md-6">
956 956
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
957 957
 <?php
@@ -961,12 +961,12 @@  discard block
 block discarded – undo
961 961
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
962 962
 			$month_data = '';
963 963
 			$month_cnt = '';
964
-			foreach($month_array as $month_item) {
964
+			foreach ($month_array as $month_item) {
965 965
 				$month_data .= '"'.$month_item['date_name'].'",';
966 966
 				$month_cnt .= $month_item['date_count'].',';
967 967
 			}
968 968
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
969
-			$month_cnt = "['vessels',".substr($month_cnt,0,-1)."]";
969
+			$month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]";
970 970
 			print 'c3.generate({
971 971
 			    bindto: "#chart9",
972 972
 			    data: { x: "x",
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
                     <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
980 980
                 </div>
981 981
             </div>
982
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
982
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
983 983
 
984 984
             <div class="col-md-6">
985 985
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -990,12 +990,12 @@  discard block
 block discarded – undo
990 990
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
991 991
 			$date_data = '';
992 992
 			$date_cnt = '';
993
-			foreach($date_array as $date_item) {
993
+			foreach ($date_array as $date_item) {
994 994
 				$date_data .= '"'.$date_item['date_name'].'",';
995 995
 				$date_cnt .= $date_item['date_count'].',';
996 996
 			}
997 997
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
998
-			$date_cnt = "['vessels',".substr($date_cnt,0,-1)."]";
998
+			$date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]";
999 999
 			print 'c3.generate({
1000 1000
 			    bindto: "#chart5",
1001 1001
 			    data: { x: "x",
@@ -1008,22 +1008,22 @@  discard block
 block discarded – undo
1008 1008
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1009 1009
                 </div>
1010 1010
             </div>
1011
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1011
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1012 1012
             <div class="col-md-6">
1013 1013
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1014 1014
 <?php
1015
-		$hour_array = $Stats->countAllMarineHours('hour',true,$filter_name);
1015
+		$hour_array = $Stats->countAllMarineHours('hour', true, $filter_name);
1016 1016
 		if (empty($hour_array)) print _("No data available");
1017 1017
 		else {
1018 1018
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1019 1019
 			$hour_data = '';
1020 1020
 			$hour_cnt = '';
1021
-			foreach($hour_array as $hour_item) {
1021
+			foreach ($hour_array as $hour_item) {
1022 1022
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1023 1023
 				$hour_cnt .= $hour_item['hour_count'].',';
1024 1024
 			}
1025 1025
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1026
-			$hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]";
1026
+			$hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]";
1027 1027
 			print 'c3.generate({
1028 1028
 			    bindto: "#chart6",
1029 1029
 			    data: {
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
                     <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1037 1037
                 </div>
1038 1038
             </div>
1039
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1039
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1040 1040
         </div>
1041 1041
 <?php
1042 1042
 	}
@@ -1058,12 +1058,12 @@  discard block
 block discarded – undo
1058 1058
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
1059 1059
 			$year_data = '';
1060 1060
 			$year_cnt = '';
1061
-			foreach($year_array as $year_item) {
1061
+			foreach ($year_array as $year_item) {
1062 1062
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1063 1063
 				$year_cnt .= $year_item['date_count'].',';
1064 1064
 			}
1065 1065
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1066
-			$year_cnt = "['trackers',".substr($year_cnt,0,-1)."]";
1066
+			$year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]";
1067 1067
 			print 'c3.generate({
1068 1068
 			    bindto: "#chart8",
1069 1069
 			    data: { x: "x",
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
                 </div>
1078 1078
             </div>
1079 1079
             
1080
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1080
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1081 1081
             <div class="col-md-6">
1082 1082
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1083 1083
 <?php
@@ -1087,12 +1087,12 @@  discard block
 block discarded – undo
1087 1087
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1088 1088
 			$month_data = '';
1089 1089
 			$month_cnt = '';
1090
-			foreach($month_array as $month_item) {
1090
+			foreach ($month_array as $month_item) {
1091 1091
 				$month_data .= '"'.$month_item['date_name'].'",';
1092 1092
 				$month_cnt .= $month_item['date_count'].',';
1093 1093
 			}
1094 1094
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
1095
-			$month_cnt = "['trackers',".substr($month_cnt,0,-1)."]";
1095
+			$month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]";
1096 1096
 			print 'c3.generate({
1097 1097
 			    bindto: "#chart9",
1098 1098
 			    data: { x: "x",
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
                     <a href="<?php print $globalURL; ?>/tracker/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1106 1106
                 </div>
1107 1107
             </div>
1108
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1108
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1109 1109
 
1110 1110
             <div class="col-md-6">
1111 1111
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1116,12 +1116,12 @@  discard block
 block discarded – undo
1116 1116
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1117 1117
 			$date_data = '';
1118 1118
 			$date_cnt = '';
1119
-			foreach($date_array as $date_item) {
1119
+			foreach ($date_array as $date_item) {
1120 1120
 				$date_data .= '"'.$date_item['date_name'].'",';
1121 1121
 				$date_cnt .= $date_item['date_count'].',';
1122 1122
 			}
1123 1123
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
1124
-			$date_cnt = "['trackers',".substr($date_cnt,0,-1)."]";
1124
+			$date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]";
1125 1125
 			print 'c3.generate({
1126 1126
 			    bindto: "#chart5",
1127 1127
 			    data: { x: "x",
@@ -1134,22 +1134,22 @@  discard block
 block discarded – undo
1134 1134
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1135 1135
                 </div>
1136 1136
             </div>
1137
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1137
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1138 1138
             <div class="col-md-6">
1139 1139
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1140 1140
 <?php
1141
-		$hour_array = $Stats->countAllTrackerHours('hour',true);
1141
+		$hour_array = $Stats->countAllTrackerHours('hour', true);
1142 1142
 		if (empty($hour_array)) print _("No data available");
1143 1143
 		else {
1144 1144
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1145 1145
 			$hour_data = '';
1146 1146
 			$hour_cnt = '';
1147
-			foreach($hour_array as $hour_item) {
1147
+			foreach ($hour_array as $hour_item) {
1148 1148
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1149 1149
 				$hour_cnt .= $hour_item['hour_count'].',';
1150 1150
 			}
1151 1151
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1152
-			$hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]";
1152
+			$hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]";
1153 1153
 			print 'c3.generate({
1154 1154
 			    bindto: "#chart6",
1155 1155
 			    data: {
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
                     <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1163 1163
                 </div>
1164 1164
             </div>
1165
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1165
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1166 1166
         </div>
1167 1167
 <?php
1168 1168
 	}
@@ -1184,12 +1184,12 @@  discard block
 block discarded – undo
1184 1184
 			print '<div id="chart21" class="chart" width="100%"></div><script>';
1185 1185
 			$year_data = '';
1186 1186
 			$year_cnt = '';
1187
-			foreach($year_array as $year_item) {
1187
+			foreach ($year_array as $year_item) {
1188 1188
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1189 1189
 				$year_cnt .= $year_item['date_count'].',';
1190 1190
 			}
1191 1191
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1192
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1192
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1193 1193
 			print 'c3.generate({
1194 1194
 			    bindto: "#chart21",
1195 1195
 			    data: { x: "x",
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
             -->
1206 1206
             </div>
1207 1207
             
1208
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1208
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1209 1209
             <div class="col-md-6">
1210 1210
                 <h2><?php echo _("Busiest Launch Years of the last 10 Years"); ?></h2>
1211 1211
 <?php
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
 			print '<div id="chart22" class="chart" width="100%"></div><script>';
1216 1216
 			$year_data = '';
1217 1217
 			$year_cnt = '';
1218
-			foreach($year_array as $year_item) {
1218
+			foreach ($year_array as $year_item) {
1219 1219
 				$year_data .= '"'.$year_item['year_name'].'-01-01'.'",';
1220 1220
 				$year_cnt .= $year_item['date_count'].',';
1221 1221
 			}
1222 1222
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1223
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1223
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1224 1224
 			print 'c3.generate({
1225 1225
 			    bindto: "#chart22",
1226 1226
 			    data: { x: "x",
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
             -->
1237 1237
             </div>
1238 1238
             
1239
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1239
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1240 1240
         </div>
1241 1241
 <?php
1242 1242
 	}
@@ -1258,12 +1258,12 @@  discard block
 block discarded – undo
1258 1258
 			print '<div id="chart32" class="chart" width="100%"></div><script>';
1259 1259
 			$year_data = '';
1260 1260
 			$year_cnt = '';
1261
-			foreach($year_array as $year_item) {
1261
+			foreach ($year_array as $year_item) {
1262 1262
 				$year_data .= '"'.$year_item['year'].'-01-01",';
1263 1263
 				$year_cnt .= $year_item['count'].',';
1264 1264
 			}
1265 1265
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1266
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1266
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1267 1267
 			print 'c3.generate({
1268 1268
 			    bindto: "#chart32",
1269 1269
 			    data: { x: "x",
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1277 1277
                 </div>
1278 1278
             </div>
1279
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1279
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1280 1280
 
1281 1281
         <div class="row column">
1282 1282
             <div class="col-md-6">
@@ -1288,12 +1288,12 @@  discard block
 block discarded – undo
1288 1288
 			print '<div id="chart33" class="chart" width="100%"></div><script>';
1289 1289
 			$year_data = '';
1290 1290
 			$year_cnt = '';
1291
-			foreach($year_array as $year_item) {
1291
+			foreach ($year_array as $year_item) {
1292 1292
 				$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
1293 1293
 				$year_cnt .= $year_item['count'].',';
1294 1294
 			}
1295 1295
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1296
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1296
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1297 1297
 			print 'c3.generate({
1298 1298
 			    bindto: "#chart33",
1299 1299
 			    data: { x: "x",
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1307 1307
                 </div>
1308 1308
             </div>
1309
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1309
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1310 1310
 <br/>
1311 1311
 <?php
1312 1312
 	}
@@ -1320,19 +1320,19 @@  discard block
 block discarded – undo
1320 1320
 	//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
1321 1321
 	if ($year == '' && $month == '') {
1322 1322
 		if ($type == 'aircraft') {
1323
-			$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
1323
+			$polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
1324 1324
 		} elseif ($type == 'marine') {
1325
-			$polar = $Stats->getStatsSource('polar_marine',date('Y'),date('m'),date('d'));
1325
+			$polar = $Stats->getStatsSource('polar_marine', date('Y'), date('m'), date('d'));
1326 1326
 		} elseif ($type == 'tracker') {
1327
-			$polar = $Stats->getStatsSource('polar_tracker',date('Y'),date('m'),date('d'));
1327
+			$polar = $Stats->getStatsSource('polar_tracker', date('Y'), date('m'), date('d'));
1328 1328
 		}
1329 1329
 	} else {
1330 1330
 		if ($type == 'aircraft') {
1331
-			$polar = $Stats->getStatsSource('polar',$year,$month);
1331
+			$polar = $Stats->getStatsSource('polar', $year, $month);
1332 1332
 		} elseif ($type == 'marine') {
1333
-			$polar = $Stats->getStatsSource('polar_marine',$year,$month);
1333
+			$polar = $Stats->getStatsSource('polar_marine', $year, $month);
1334 1334
 		} elseif ($type == 'tracker') {
1335
-			$polar = $Stats->getStatsSource('polar_tracker',$year,$month);
1335
+			$polar = $Stats->getStatsSource('polar_tracker', $year, $month);
1336 1336
 		}
1337 1337
 	}
1338 1338
 	if (!empty($polar)) {
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 			unset($polar_data);
1342 1342
 			$Spotter = new Spotter();
1343 1343
 			$data = json_decode($eachpolar['source_data']);
1344
-			foreach($data as $value => $key) {
1344
+			foreach ($data as $value => $key) {
1345 1345
 				$direction = $Spotter->parseDirection(($value*22.5));
1346 1346
 				$distance = $key;
1347 1347
 				$unit = 'km';
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 ?>
1362 1362
             <div class="col-md-6">
1363 1363
                 <h4><?php print $eachpolar['source_name']; ?></h4>
1364
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1364
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1365 1365
         	<script>
1366 1366
         	    (function() {
1367 1367
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 		      color: color,
1386 1386
 		      unit: '<?php echo $unit; ?>'
1387 1387
 		    };
1388
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1388
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1389 1389
 		    })();
1390 1390
 		</script>
1391 1391
             </div>
@@ -1400,19 +1400,19 @@  discard block
 block discarded – undo
1400 1400
 	//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
1401 1401
 	if ($year == '' && $month == '') {
1402 1402
 		if ($type == 'aircraft') {
1403
-			$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
1403
+			$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
1404 1404
 		} elseif ($type == 'marine') {
1405
-			$msg = $Stats->getStatsSource('msg_marine',date('Y'),date('m'),date('d'));
1405
+			$msg = $Stats->getStatsSource('msg_marine', date('Y'), date('m'), date('d'));
1406 1406
 		} elseif ($type == 'tracker') {
1407
-			$msg = $Stats->getStatsSource('msg_tracker',date('Y'),date('m'),date('d'));
1407
+			$msg = $Stats->getStatsSource('msg_tracker', date('Y'), date('m'), date('d'));
1408 1408
 		}
1409 1409
 	} else {
1410 1410
 		if ($type == 'aircraft') {
1411
-			$msg = $Stats->getStatsSource('msg',$year,$month);
1411
+			$msg = $Stats->getStatsSource('msg', $year, $month);
1412 1412
 		} elseif ($type == 'marine') {
1413
-			$msg = $Stats->getStatsSource('msg_marine',$year,$month);
1413
+			$msg = $Stats->getStatsSource('msg_marine', $year, $month);
1414 1414
 		} elseif ($type == 'tracker') {
1415
-			$msg = $Stats->getStatsSource('msg_tracker',$year,$month);
1415
+			$msg = $Stats->getStatsSource('msg_tracker', $year, $month);
1416 1416
 		}
1417 1417
 	}
1418 1418
 	if (!empty($msg)) {
@@ -1420,13 +1420,13 @@  discard block
 block discarded – undo
1420 1420
 		foreach ($msg as $eachmsg) {
1421 1421
 			//$eachmsg = $msg[0];
1422 1422
 			$data = $eachmsg['source_data'];
1423
-			if ($data > 500) $max = (round(($data+100)/100))*100;
1423
+			if ($data > 500) $max = (round(($data + 100)/100))*100;
1424 1424
 			else $max = 500;
1425 1425
 ?>
1426
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1426
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1427 1427
         	<script>
1428 1428
 		      var g = new JustGage({
1429
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
1429
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
1430 1430
 			    value: <?php echo $data; ?>,
1431 1431
 			    min: 0,
1432 1432
 			    max: <?php print $max; ?>,
@@ -1448,19 +1448,19 @@  discard block
 block discarded – undo
1448 1448
 	//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
1449 1449
 	if ($year == '' && $month == '') {
1450 1450
 		if ($type == 'aircraft') {
1451
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
1451
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
1452 1452
 		} elseif ($type == 'marine') {
1453
-			$hist = $Stats->getStatsSource('hist_marine',date('Y'),date('m'),date('d'));
1453
+			$hist = $Stats->getStatsSource('hist_marine', date('Y'), date('m'), date('d'));
1454 1454
 		} elseif ($type == 'tracker') {
1455
-			$hist = $Stats->getStatsSource('hist_tracker',date('Y'),date('m'),date('d'));
1455
+			$hist = $Stats->getStatsSource('hist_tracker', date('Y'), date('m'), date('d'));
1456 1456
 		}
1457 1457
 	} else {
1458 1458
 		if ($type == 'aircraft') {
1459
-			$hist = $Stats->getStatsSource('hist',$year,$month);
1459
+			$hist = $Stats->getStatsSource('hist', $year, $month);
1460 1460
 		} elseif ($type == 'marine') {
1461
-			$hist = $Stats->getStatsSource('hist_marine',$year,$month);
1461
+			$hist = $Stats->getStatsSource('hist_marine', $year, $month);
1462 1462
 		} elseif ($type == 'tracker') {
1463
-			$hist = $Stats->getStatsSource('hist_tracker',$year,$month);
1463
+			$hist = $Stats->getStatsSource('hist_tracker', $year, $month);
1464 1464
 		}
1465 1465
 	}
1466 1466
 	foreach ($hist as $hists) {
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 		$source = $hists['source_name'];
1471 1471
 		$hist_array = json_decode($hists['source_data']);
1472 1472
 		$unit = 'km';
1473
-		foreach($hist_array as $distance => $nb) {
1473
+		foreach ($hist_array as $distance => $nb) {
1474 1474
 			if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1475 1475
 				$distance = round($distance*0.539957);
1476 1476
 				$unit = 'nm';
@@ -1490,18 +1490,18 @@  discard block
 block discarded – undo
1490 1490
 		$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
1491 1491
 ?>
1492 1492
             <div class="col-md-6">
1493
-                <h2><?php echo sprintf(_("Distance for %s"),$source); ?></h2>
1493
+                <h2><?php echo sprintf(_("Distance for %s"), $source); ?></h2>
1494 1494
 <?php
1495
-		print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
1495
+		print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>';
1496 1496
 		print 'c3.generate({
1497
-		    bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
1497
+		    bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'",
1498 1498
 		    data: { x: "x",
1499 1499
 		    columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}},
1500 1500
 		    axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
1501 1501
 		print '</script>';
1502 1502
 ?>
1503 1503
     	    </div>
1504
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1504
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1505 1505
 <?php
1506 1506
 	}
1507 1507
 ?>
Please login to merge, or discard this patch.
route-statistics-aircraft.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 require_once('require/class.Connection.php');
8 8
 require_once('require/class.Spotter.php');
9 9
 require_once('require/class.Language.php');
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING);
12
-$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING);
12
+$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING);
13 13
 $Spotter = new Spotter();
14 14
 $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
15 15
   
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Aircraft between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
18
+	$title = sprintf(_("Most Common Aircraft between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
19 19
 	require_once('header.php');
20 20
 	print '<div class="info column">';
21 21
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	include('route-sub-menu.php');
27 27
 	print '<div class="column">';
28 28
 	print '<h2>'._("Most Common Aircraft").'</h2>';
29
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
30 30
 
31 31
 	$aircraft_array = $Spotter->countAllAircraftTypesByRoute($departure_airport, $arrival_airport);
32 32
 	if (!empty($aircraft_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($aircraft_array as $aircraft_item)
44
+		foreach ($aircraft_array as $aircraft_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
owner-statistics-aircraft.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
12
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
13
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
12
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
13
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
14 14
 $filter = array();
15
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
16
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
15
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
16
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
17 17
 if ($sort != '') {
18
-	$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
18
+	$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
19 19
 } else {
20
-	$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", '',$filter);
20
+	$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", '', $filter);
21 21
 }
22 22
 
23 23
 if (!empty($spotter_array))
24 24
 {
25
-	$title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['aircraft_owner']);
25
+	$title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['aircraft_owner']);
26 26
 	require_once('header.php');
27 27
 	print '<div class="info column">';
28 28
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	include('owner-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Aircraft").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
37 37
 
38
-	$aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner,$filter);
38
+	$aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner, $filter);
39 39
 	if (!empty($aircraft_array))
40 40
 	{
41 41
 		print '<div class="table-responsive">';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		print '</thead>';
48 48
 		print '<tbody>';
49 49
 		$i = 1;
50
-		foreach($aircraft_array as $aircraft_item)
50
+		foreach ($aircraft_array as $aircraft_item)
51 51
 		{
52 52
 			print '<tr>';
53 53
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
aircraft.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 	print '<h1>'._("Aircraft Types").'</h1>';
17 17
 
18 18
 	$aircraft_types = $Stats->getAllAircraftTypes();
19
-	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes();
19
+	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') {
20
+		$aircraft_types = $Spotter->getAllAircraftTypes();
21
+	}
20 22
 	$previous = null;
21 23
 	print '<div class="alphabet-legend">';
22 24
 	foreach($aircraft_types as $value) {
@@ -24,10 +26,14 @@  discard block
 block discarded – undo
24 26
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
25 27
 		if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
26 28
 		{
27
-			if ($previous !== null) print ' | ';
29
+			if ($previous !== null) {
30
+				print ' | ';
31
+			}
28 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
29 33
 		}
30
-		if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
34
+		if ($firstLetter != '(' && $firstLetter != ')') {
35
+			$previous = $firstLetter;
36
+		}
31 37
 	}
32 38
 	print '</div>';
33 39
 	$previous = null;
@@ -38,10 +44,14 @@  discard block
 block discarded – undo
38 44
 		{
39 45
 			if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
40 46
 			{
41
-				if ($previous !== null) print '</div>';
47
+				if ($previous !== null) {
48
+					print '</div>';
49
+				}
42 50
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
43 51
 			}
44
-			if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
52
+			if ($firstLetter != '(' && $firstLetter != ')') {
53
+				$previous = $firstLetter;
54
+			}
45 55
 			print '<div class="alphabet-item">';
46 56
 			print '<a href="'.$globalURL.'/aircraft/'.$value['aircraft_icao'].'">';
47 57
 			if ($value['aircraft_name'] == '') {
Please login to merge, or discard this patch.
owner-detailed.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
 //require_once('require/class.SpotterLive.php');
8 8
 require_once('require/class.SpotterArchive.php');
9 9
 
10
-if (!isset($_GET['owner'])){
10
+if (!isset($_GET['owner'])) {
11 11
 	header('Location: '.$globalURL.'');
12 12
 } else {
13 13
 	$Spotter = new Spotter();
14 14
 	$SpotterArchive = new SpotterArchive();
15 15
 	//$Translation = new Translation();
16 16
 	//calculuation for the pagination
17
-	if(!isset($_GET['limit']))
17
+	if (!isset($_GET['limit']))
18 18
 	{
19 19
 		$limit_start = 0;
20 20
 		$limit_end = 25;
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	} else {
23 23
 		$limit_explode = explode(",", $_GET['limit']);
24 24
 		if (isset($limit_explode[1])) {
25
-			$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
26
-			$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
25
+			$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
26
+			$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
27 27
 		} else {
28 28
 			$limit_start = 0;
29 29
 			$limit_end = 25;
@@ -40,29 +40,29 @@  discard block
 block discarded – undo
40 40
 	
41 41
 	$page_url = $globalURL.'/owner/'.$_GET['owner'];
42 42
 	
43
-	$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
44
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
45
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
43
+	$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
44
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
45
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
46
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
47 47
 	$filter = array();
48
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
49
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
48
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
49
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
50 50
 	if ($sort != '') 
51 51
 	{
52
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
52
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter);
53 53
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
54
-			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
54
+			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter);
55 55
 		}
56 56
 	} else {
57
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter);
57
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, '', $filter);
58 58
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
59
-			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter);
59
+			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, '', $filter);
60 60
 		}
61 61
 	}
62 62
 
63 63
 	if (!empty($spotter_array))
64 64
 	{
65
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
65
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['aircraft_owner']);
66 66
 		//$ident = $spotter_array[0]['ident'];
67 67
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
68 68
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -122,23 +122,23 @@  discard block
 block discarded – undo
122 122
 		$Stats = new Stats();
123 123
 		if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner);
124 124
 		else $flights = 0;
125
-		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter);
125
+		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner, $filter);
126 126
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
127
-		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter));
127
+		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner, $filter));
128 128
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
129
-		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner,$filter));
129
+		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner, $filter));
130 130
 		print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>';
131
-		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner,$filter));
131
+		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner, $filter));
132 132
 		print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
133
-		$airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter));
133
+		$airlines = count($Spotter->countAllAirlinesByOwner($owner, $filter));
134 134
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
135
-		$duration = $Spotter->getFlightDurationByOwner($owner,$filter);
135
+		$duration = $Spotter->getFlightDurationByOwner($owner, $filter);
136 136
 		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
137 137
 		print '</div>';
138 138
 	
139 139
 		include('owner-sub-menu.php');
140 140
 		print '<div class="table column">';
141
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
141
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
142 142
 
143 143
 		include('table-output.php'); 
144 144
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,8 +45,12 @@  discard block
 block discarded – undo
45 45
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46 46
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
47 47
 	$filter = array();
48
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
49
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
48
+	if ($year != '') {
49
+		$filter = array_merge($filter,array('year' => $year));
50
+	}
51
+	if ($month != '') {
52
+		$filter = array_merge($filter,array('month' => $month));
53
+	}
50 54
 	if ($sort != '') 
51 55
 	{
52 56
 		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -64,8 +68,12 @@  discard block
 block discarded – undo
64 68
 	{
65 69
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
66 70
 		//$ident = $spotter_array[0]['ident'];
67
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
68
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
71
+		if (isset($spotter_array[0]['latitude'])) {
72
+			$latitude = $spotter_array[0]['latitude'];
73
+		}
74
+		if (isset($spotter_array[0]['longitude'])) {
75
+			$longitude = $spotter_array[0]['longitude'];
76
+		}
69 77
 		require_once('header.php');
70 78
 		/*
71 79
 		if (isset($globalArchive) && $globalArchive) {
@@ -120,9 +128,14 @@  discard block
 block discarded – undo
120 128
 		print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
121 129
 		//print '<div><span class="label">'._("Owner").'</span>'.$spotter_array[0]['aircraft_owner'].'</div>';
122 130
 		$Stats = new Stats();
123
-		if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner);
124
-		else $flights = 0;
125
-		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter);
131
+		if ($year == '' && $month == '') {
132
+			$flights = $Stats->getStatsOwner($owner);
133
+		} else {
134
+			$flights = 0;
135
+		}
136
+		if ($flights == 0) {
137
+			$flights = $Spotter->countFlightsByOwner($owner,$filter);
138
+		}
126 139
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
127 140
 		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter));
128 141
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -133,7 +146,9 @@  discard block
 block discarded – undo
133 146
 		$airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter));
134 147
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
135 148
 		$duration = $Spotter->getFlightDurationByOwner($owner,$filter);
136
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
149
+		if ($duration != '0') {
150
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
151
+		}
137 152
 		print '</div>';
138 153
 	
139 154
 		include('owner-sub-menu.php');
Please login to merge, or discard this patch.