Completed
Push — master ( 83aaff...7b298e )
by Yannick
32:28
created
statistics-month.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	$Tracker = new Tracker();
17 17
 }
18 18
 if (!isset($filter_name)) $filter_name = '';
19
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
19
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
20 20
 if ($airline_icao == '' && isset($globalFilter)) {
21 21
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
22 22
 }
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 	  </div>
33 33
       <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>';
34 34
 
35
-if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
35
+if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
36 36
 elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth();
37 37
 elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth();
38 38
 
39 39
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 40
 $month_data = '';
41 41
 $month_cnt = '';
42
-foreach($date_array as $month_item)
42
+foreach ($date_array as $month_item)
43 43
 {
44 44
 	$month_data .= '"'.$month_item['date_name'].'",';
45 45
 	$month_cnt .= $month_item['date_count'].',';
46 46
 }
47 47
 $month_data = "['x',".substr($month_data, 0, -1)."]";
48
-$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
48
+$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
49 49
 print 'c3.generate({
50 50
     bindto: "#chart",
51 51
     data: { x: "x",
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 //$date_array = $Stats->countAllDates();
57 57
 if (!empty($date_array))
58 58
 {
59
-	foreach($date_array as $key => $row) {
59
+	foreach ($date_array as $key => $row) {
60 60
 		$years[$key] = $row['date_name'];
61 61
 		$counts[$key] = $row['date_count'];
62 62
 	}
63
-	array_multisort($counts,SORT_DESC,$date_array);
63
+	array_multisort($counts, SORT_DESC, $date_array);
64 64
 	print '<div class="table-responsive">';
65 65
 	print '<table class="common-date table-striped">';
66 66
 	print '<thead>';
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	print '</thead>';
71 71
 	print '<tbody>';
72 72
 	$i = 1;
73
-	foreach($date_array as $date_item)
73
+	foreach ($date_array as $date_item)
74 74
 	{
75 75
 		print '<tr>';
76 76
 		print '<td><strong>'.$i.'</strong></td>';
77 77
 		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>';
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>';
80 80
 		print '</td>';
81 81
 		print '<td>';
82 82
 		print $date_item['date_count'];
Please login to merge, or discard this patch.
statistics-country.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 } else {
20 20
 	$title = _("Statistics").' - '._("Most common Country a flight was over");
21 21
 }
22
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
22
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
23 23
 if ($airline_icao == '' && isset($globalFilter)) {
24 24
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
25 25
 }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 if ($type == 'aircraft') {
51
-	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name);
51
+	$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name);
52 52
 } elseif ($type == 'marine') {
53 53
 	$flightover_array = $Marine->countAllMarineOverCountries();
54 54
 } elseif ($type == 'tracker') {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 print '<div id="chart" class="chart" width="100%"></div><script>';
63 63
 print 'var series = [';
64 64
 $flightover_data = '';
65
-foreach($flightover_array as $flightover_item)
65
+foreach ($flightover_array as $flightover_item)
66 66
 {
67 67
 	$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
68 68
 }
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	print '</thead>';
112 112
 	print '<tbody>';
113 113
 	$i = 1;
114
-	array_splice($flightover_array,10);
115
-	foreach($flightover_array as $flightover_item)
114
+	array_splice($flightover_array, 10);
115
+	foreach ($flightover_array as $flightover_item)
116 116
 	{
117 117
 		print '<tr>';
118 118
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-time.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 }
18 18
 
19 19
 if (!isset($filter_name)) $filter_name = '';
20
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
20
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
21 21
 if ($airline_icao == '' && isset($globalFilter)) {
22 22
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
23 23
 }
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 	</div>
34 34
 	<p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>';
35 35
 
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);
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);
39 39
 print '<div id="chartHour" class="chart" width="100%"></div><script>';
40 40
 $hour_data = '';
41 41
 $hour_cnt = '';
42
-foreach($hour_array as $hour_item)
42
+foreach ($hour_array as $hour_item)
43 43
 {
44 44
 	$hour_data .= '"'.$hour_item['hour_name'].':00",';
45 45
 	$hour_cnt .= $hour_item['hour_count'].',';
46 46
 }
47 47
 $hour_data = "[".substr($hour_data, 0, -1)."]";
48
-$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
48
+$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
49 49
 print 'c3.generate({
50 50
     bindto: "#chartHour",
51 51
     data: {
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});';
54 54
 print '</script>';
55 55
 
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);
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);
59 59
 if (!empty($hour_array))
60 60
 {
61 61
 	print '<div class="table-responsive">';
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	print '</thead>';
68 68
 	print '<tbody>';
69 69
 	$i = 1;
70
-	foreach($hour_array as $hour_item)
70
+	foreach ($hour_array as $hour_item)
71 71
 	{
72 72
 		print '<tr>';
73 73
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-year.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 if (!isset($filter_name)) $filter_name = '';
21
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
21
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
22 22
 if ($airline_icao == '' && isset($globalFilter)) {
23 23
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
24 24
 }
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 	</div>
34 34
       <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>';
35 35
 
36
-if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
36
+if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
37 37
 elseif ($type == 'marine') $date_array = $Marine->countAllMonthsLastYear(true);
38 38
 elseif ($type == 'tracker') $date_array = $Tracker->countAllMonthsLastYear(true);
39 39
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 40
 $year_data = '';
41 41
 $year_cnt = '';
42
-foreach($date_array as $year_item)
42
+foreach ($date_array as $year_item)
43 43
 {
44 44
 	$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
45 45
 	$year_cnt .= $year_item['date_count'].',';
46 46
 }
47 47
 $year_data = "['x',".substr($year_data, 0, -1)."]";
48
-$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
48
+$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
49 49
 print 'c3.generate({
50 50
     bindto: "#chart",
51 51
     data: { x: "x",
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	print '</thead>';
69 69
 	print '<tbody>';
70 70
 	$i = 1;
71
-	foreach($date_array as $date_item)
71
+	foreach ($date_array as $date_item)
72 72
 	{
73 73
 		print '<tr>';
74 74
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics.php 1 patch
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 }
20 20
 
21 21
 if (!isset($filter_name)) $filter_name = '';
22
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
22
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
23 23
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
24 24
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
25 25
 }
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	$title = _("Statistics");
35 35
 }
36 36
 
37
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
37
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
38
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
39 39
 
40 40
 require_once('header.php');
41 41
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			date_default_timezone_set('UTC');
63 63
 			$lastupdate = strtotime($last_update[0]['value']);
64 64
 			if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
65
-			print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
65
+			print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
66 66
 		}
67 67
 	}
68 68
 ?>
@@ -76,30 +76,30 @@  discard block
 block discarded – undo
76 76
 <?php
77 77
 	if ($type == 'aircraft') {
78 78
 ?>
79
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
80
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
81
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
82
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
79
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
80
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
81
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
82
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
83 83
 	<?php
84
-	    if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
84
+	    if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
85 85
 	?>
86
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
87
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
86
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
87
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
88 88
         <?php
89 89
     	    } else {
90 90
     	?>
91
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
92
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
92
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
93 93
     	<?php
94 94
     	    }
95 95
     	?>
96
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
97
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
96
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
97
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
98 98
         <?php
99 99
     		if ($airline_icao == '') {
100 100
     	?>
101
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
102
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
101
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
102
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
103 103
 	<?php
104 104
 		}
105 105
 	?>
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
108 108
 			if ($airline_icao == '' || $airline_icao == 'all') {
109 109
 	?>
110
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
111
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
110
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
111
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
112 112
 	<?php
113 113
 			}
114 114
 		}
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
 <?php
117 117
 	} elseif ($type == 'marine') {
118 118
 ?>
119
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarine($filter_name,$year,$month)); ?></span> <?php echo _("Vessels"); ?></span>
120
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
119
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarine($filter_name, $year, $month)); ?></span> <?php echo _("Vessels"); ?></span>
120
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
121 121
 <?php
122 122
 	} elseif ($type == 'tracker') {
123 123
 ?>
124
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTracker($filter_name,$year,$month)); ?></span> <?php echo _("Trackers"); ?></span>
125
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
124
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTracker($filter_name, $year, $month)); ?></span> <?php echo _("Trackers"); ?></span>
125
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
126 126
 <?php
127 127
 	}
128 128
 ?>
129 129
     </p>
130
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
130
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
131 131
     <div class="specific-stats">
132 132
 <?php
133 133
 	if ($type == 'aircraft') {
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
             <div class="col-md-6">
137 137
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
138 138
                  <?php
139
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
139
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
140 140
 		    if (count($aircraft_array) == 0) print _("No data available");
141 141
 		    else {
142 142
                     print '<div id="chart1" class="chart" width="100%"></div><script>';
143 143
                     $aircraft_data = '';
144
-                    foreach($aircraft_array as $aircraft_item)
144
+                    foreach ($aircraft_array as $aircraft_item)
145 145
                     {
146 146
                         $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
147 147
                     }
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
             	    ?>
171 171
                 </div>
172 172
             </div>
173
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
173
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
174 174
 <?php
175 175
 //    echo $airline_icao;
176 176
 		if ($airline_icao == '' || $airline_icao == 'all') {
177
-			$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
177
+			$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
178 178
 			if (count($airline_array) > 0) {
179 179
 				print '<div class="col-md-6">';
180 180
 				print '<h2>'._("Top 10 Most Common Airline").'</h2>';
181 181
 				print '<div id="chart2" class="chart" width="100%"></div><script>';
182 182
 				$airline_data = '';
183
-				foreach($airline_array as $airline_item)
183
+				foreach ($airline_array as $airline_item)
184 184
 				{
185 185
 					$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
186 186
 				}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			}
207 207
 ?>
208 208
         </div>
209
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
209
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
210 210
 <?php
211 211
 		}
212 212
 ?>
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		    else {
226 226
                     print '<div id="chart1" class="chart" width="100%"></div><script>';
227 227
                     $marine_data = '';
228
-                    foreach($marine_array as $marine_item)
228
+                    foreach ($marine_array as $marine_item)
229 229
                     {
230 230
                         $marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],';
231 231
                     }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             	    ?>
257 257
                 </div>
258 258
             </div>
259
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
259
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
260 260
 	</div>
261 261
 <?php
262 262
 	}
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
 ?>
267 267
         <div class="row column">
268 268
 <?php
269
-		$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
270
-		if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
269
+		$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
270
+		if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
271 271
 			if (empty($flightover_array)) {
272 272
 				print '<div class="col-md-12">';
273 273
 			} else {
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
 ?>
277 277
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
278 278
 <?php
279
-			$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
279
+			$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
280 280
 			if (count($pilot_array) == 0) print _("No data available");
281 281
 			else {
282 282
 				print '<div id="chart7" class="chart" width="100%"></div><script>';
283 283
 				$pilot_data = '';
284
-				foreach($pilot_array as $pilot_item)
284
+				foreach ($pilot_array as $pilot_item)
285 285
 				{
286 286
 					$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
287 287
 				}
@@ -303,19 +303,19 @@  discard block
 block discarded – undo
303 303
 ?>
304 304
             </div>
305 305
         
306
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
306
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
307 307
 <?php
308 308
 		} else {
309 309
 ?>
310 310
             <div class="col-md-6">
311 311
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
312 312
 <?php
313
-			$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
313
+			$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
314 314
 			if (count($owner_array) == 0) print _("No data available");
315 315
 			else {
316 316
 				print '<div id="chart7" class="chart" width="100%"></div><script>';
317 317
 				$owner_data = '';
318
-				foreach($owner_array as $owner_item)
318
+				foreach ($owner_array as $owner_item)
319 319
 				{
320 320
 					$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
321 321
 				}
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
                 </div>
336 336
             </div>
337 337
         
338
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
338
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
339 339
 <?php
340 340
 		}
341 341
 		if (!empty($flightover_array)) {
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 				print '<div id="chart10" class="chart" width="100%"></div><script>';
350 350
 				print 'var series = [';
351 351
 				$flightover_data = '';
352
-				foreach($flightover_array as $flightover_item)
352
+				foreach ($flightover_array as $flightover_item)
353 353
 				{
354 354
 					$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
355 355
 				}
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 		}
396 396
 ?>
397 397
         </div>
398
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
398
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
399 399
 
400 400
     	
401 401
         </div>
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
416 416
 			print 'var series = [';
417 417
 			$flightover_data = '';
418
-			foreach($flightover_array as $flightover_item)
418
+			foreach ($flightover_array as $flightover_item)
419 419
 			{
420 420
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
421 421
 			}
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
476 476
 			print 'var series = [';
477 477
 			$flightover_data = '';
478
-			foreach($flightover_array as $flightover_item)
478
+			foreach ($flightover_array as $flightover_item)
479 479
 			{
480 480
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
481 481
 			}
@@ -528,14 +528,14 @@  discard block
 block discarded – undo
528 528
         <div class="row column">
529 529
             <div class="col-md-6">
530 530
 <?php
531
-		$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
531
+		$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
532 532
 		if (count($airport_airport_array) > 0) {
533 533
 			print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
534 534
 			print '<div id="chart3" class="chart" width="100%"></div><script>';
535 535
 			print "\n";
536 536
 			print 'var series = [';
537 537
 			$airport_data = '';
538
-			foreach($airport_airport_array as $airport_item)
538
+			foreach ($airport_airport_array as $airport_item)
539 539
 			{
540 540
 				$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
541 541
 			}
@@ -586,18 +586,18 @@  discard block
 block discarded – undo
586 586
 		}
587 587
 ?>
588 588
             </div>
589
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
589
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
590 590
 
591 591
             <div class="col-md-6">
592 592
 <?php
593
-		$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
593
+		$airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
594 594
 		if (count($airport_airport_array2) > 0) {
595 595
 			print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
596 596
 			print '<div id="chart4" class="chart" width="100%"></div><script>';
597 597
 			print "\n";
598 598
 			print 'var series = [';
599 599
 			$airport_data = '';
600
-			foreach($airport_airport_array2 as $airport_item)
600
+			foreach ($airport_airport_array2 as $airport_item)
601 601
 			{
602 602
 				$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
603 603
 			}
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 ?>
650 650
             </div>
651 651
         </div>
652
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
652
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
653 653
 <?php 
654 654
 	}
655 655
 ?>
@@ -663,19 +663,19 @@  discard block
 block discarded – undo
663 663
             <div class="col-md-6">
664 664
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
665 665
 <?php
666
-			$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
666
+			$year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
667 667
 			if (count($year_array) == 0) print _("No data available");
668 668
 			else {
669 669
 				print '<div id="chart8" class="chart" width="100%"></div><script>';
670 670
 				$year_data = '';
671 671
 				$year_cnt = '';
672
-				foreach($year_array as $year_item)
672
+				foreach ($year_array as $year_item)
673 673
 				{
674 674
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
675 675
 					$year_cnt .= $year_item['date_count'].',';
676 676
 				}
677 677
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
678
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
678
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
679 679
 				print 'c3.generate({
680 680
 				    bindto: "#chart8",
681 681
 				    data: { x: "x",
@@ -688,23 +688,23 @@  discard block
 block discarded – undo
688 688
                     <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>
689 689
                 </div>
690 690
             </div>
691
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
691
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
692 692
             <div class="col-md-6">
693 693
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
694 694
 <?php
695
-			$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
695
+			$month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
696 696
 			if (count($month_array) == 0) print _("No data available");
697 697
 			else {
698 698
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
699 699
 				$month_data = '';
700 700
 				$month_cnt = '';
701
-				foreach($month_array as $month_item)
701
+				foreach ($month_array as $month_item)
702 702
 				{
703 703
 					$month_data .= '"'.$month_item['date_name'].'",';
704 704
 					$month_cnt .= $month_item['date_count'].',';
705 705
 				}
706 706
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
707
-				$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
707
+				$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
708 708
 				print 'c3.generate({
709 709
 				    bindto: "#chart9",
710 710
 				    data: { x: "x",
@@ -717,24 +717,24 @@  discard block
 block discarded – undo
717 717
                     <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>
718 718
                 </div>
719 719
             </div>
720
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
720
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
721 721
 
722 722
             <div class="col-md-6">
723 723
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
724 724
 <?php
725
-			$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
725
+			$date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
726 726
 			if (empty($date_array)) print _("No data available");
727 727
 			else {
728 728
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
729 729
 				$date_data = '';
730 730
 				$date_cnt = '';
731
-				foreach($date_array as $date_item)
731
+				foreach ($date_array as $date_item)
732 732
 				{
733 733
 					$date_data .= '"'.$date_item['date_name'].'",';
734 734
 					$date_cnt .= $date_item['date_count'].',';
735 735
 				}
736 736
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
737
-				$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
737
+				$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]";
738 738
 				print 'c3.generate({
739 739
 				    bindto: "#chart5",
740 740
 				    data: { x: "x",
@@ -747,23 +747,23 @@  discard block
 block discarded – undo
747 747
                     <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>
748 748
                 </div>
749 749
             </div>
750
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
750
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
751 751
             <div class="col-md-6">
752 752
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
753 753
 <?php
754
-			$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
754
+			$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
755 755
 			if (empty($hour_array)) print _("No data available");
756 756
 			else {
757 757
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
758 758
 				$hour_data = '';
759 759
 				$hour_cnt = '';
760
-				foreach($hour_array as $hour_item)
760
+				foreach ($hour_array as $hour_item)
761 761
 				{
762 762
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
763 763
 					$hour_cnt .= $hour_item['hour_count'].',';
764 764
 				}
765 765
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
766
-				$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
766
+				$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
767 767
 				print 'c3.generate({
768 768
 				    bindto: "#chart6",
769 769
 				    data: {
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
                     <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>
777 777
                 </div>
778 778
             </div>
779
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
779
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
780 780
         </div>
781 781
 <?php
782 782
 		}
@@ -794,19 +794,19 @@  discard block
 block discarded – undo
794 794
             <div class="col-md-6">
795 795
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
796 796
 <?php
797
-			$year_array = $Marine->countAllMonthsLastYear(true,$airline_icao,$filter_name);
797
+			$year_array = $Marine->countAllMonthsLastYear(true, $airline_icao, $filter_name);
798 798
 			if (count($year_array) == 0) print _("No data available");
799 799
 			else {
800 800
 				print '<div id="chart8" class="chart" width="100%"></div><script>';
801 801
 				$year_data = '';
802 802
 				$year_cnt = '';
803
-				foreach($year_array as $year_item)
803
+				foreach ($year_array as $year_item)
804 804
 				{
805 805
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
806 806
 					$year_cnt .= $year_item['date_count'].',';
807 807
 				}
808 808
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
809
-				$year_cnt = "['vessels',".substr($year_cnt,0,-1)."]";
809
+				$year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]";
810 810
 				print 'c3.generate({
811 811
 				    bindto: "#chart8",
812 812
 				    data: { x: "x",
@@ -820,23 +820,23 @@  discard block
 block discarded – undo
820 820
                 </div>
821 821
             </div>
822 822
             
823
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
823
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
824 824
             <div class="col-md-6">
825 825
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
826 826
 <?php
827
-			$month_array = $Marine->countAllDatesLastMonth($airline_icao,$filter_name);
827
+			$month_array = $Marine->countAllDatesLastMonth($airline_icao, $filter_name);
828 828
 			if (count($month_array) == 0) print _("No data available");
829 829
 			else {
830 830
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
831 831
 				$month_data = '';
832 832
 				$month_cnt = '';
833
-				foreach($month_array as $month_item)
833
+				foreach ($month_array as $month_item)
834 834
 				{
835 835
 					$month_data .= '"'.$month_item['date_name'].'",';
836 836
 					$month_cnt .= $month_item['date_count'].',';
837 837
 				}
838 838
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
839
-				$month_cnt = "['vessels',".substr($month_cnt,0,-1)."]";
839
+				$month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]";
840 840
 				print 'c3.generate({
841 841
 				    bindto: "#chart9",
842 842
 				    data: { x: "x",
@@ -849,24 +849,24 @@  discard block
 block discarded – undo
849 849
                     <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
850 850
                 </div>
851 851
             </div>
852
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
852
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
853 853
 
854 854
             <div class="col-md-6">
855 855
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
856 856
 <?php
857
-			$date_array = $Marine->countAllDatesLast7Days($airline_icao,$filter_name);
857
+			$date_array = $Marine->countAllDatesLast7Days($airline_icao, $filter_name);
858 858
 			if (empty($date_array)) print _("No data available");
859 859
 			else {
860 860
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
861 861
 				$date_data = '';
862 862
 				$date_cnt = '';
863
-				foreach($date_array as $date_item)
863
+				foreach ($date_array as $date_item)
864 864
 				{
865 865
 					$date_data .= '"'.$date_item['date_name'].'",';
866 866
 					$date_cnt .= $date_item['date_count'].',';
867 867
 				}
868 868
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
869
-				$date_cnt = "['vessels',".substr($date_cnt,0,-1)."]";
869
+				$date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]";
870 870
 				print 'c3.generate({
871 871
 				    bindto: "#chart5",
872 872
 				    data: { x: "x",
@@ -879,23 +879,23 @@  discard block
 block discarded – undo
879 879
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
880 880
                 </div>
881 881
             </div>
882
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
882
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
883 883
             <div class="col-md-6">
884 884
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
885 885
 <?php
886
-			$hour_array = $Marine->countAllHours('hour',true,$airline_icao,$filter_name);
886
+			$hour_array = $Marine->countAllHours('hour', true, $airline_icao, $filter_name);
887 887
 			if (empty($hour_array)) print _("No data available");
888 888
 			else {
889 889
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
890 890
 				$hour_data = '';
891 891
 				$hour_cnt = '';
892
-				foreach($hour_array as $hour_item)
892
+				foreach ($hour_array as $hour_item)
893 893
 				{
894 894
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
895 895
 					$hour_cnt .= $hour_item['hour_count'].',';
896 896
 				}
897 897
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
898
-				$hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]";
898
+				$hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]";
899 899
 				print 'c3.generate({
900 900
 				    bindto: "#chart6",
901 901
 				    data: {
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
                     <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
909 909
                 </div>
910 910
             </div>
911
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
911
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
912 912
         </div>
913 913
 <?php
914 914
 		}
@@ -932,13 +932,13 @@  discard block
 block discarded – undo
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
 				{
937 937
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
938 938
 					$year_cnt .= $year_item['date_count'].',';
939 939
 				}
940 940
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
941
-				$year_cnt = "['trackers',".substr($year_cnt,0,-1)."]";
941
+				$year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]";
942 942
 				print 'c3.generate({
943 943
 				    bindto: "#chart8",
944 944
 				    data: { x: "x",
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
                 </div>
953 953
             </div>
954 954
             
955
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
955
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
956 956
             <div class="col-md-6">
957 957
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
958 958
 <?php
@@ -962,13 +962,13 @@  discard block
 block discarded – undo
962 962
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
963 963
 				$month_data = '';
964 964
 				$month_cnt = '';
965
-				foreach($month_array as $month_item)
965
+				foreach ($month_array as $month_item)
966 966
 				{
967 967
 					$month_data .= '"'.$month_item['date_name'].'",';
968 968
 					$month_cnt .= $month_item['date_count'].',';
969 969
 				}
970 970
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
971
-				$month_cnt = "['trackers',".substr($month_cnt,0,-1)."]";
971
+				$month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]";
972 972
 				print 'c3.generate({
973 973
 				    bindto: "#chart9",
974 974
 				    data: { x: "x",
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
                     <a href="<?php print $globalURL; ?>/tracker/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
982 982
                 </div>
983 983
             </div>
984
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
984
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
985 985
 
986 986
             <div class="col-md-6">
987 987
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -992,13 +992,13 @@  discard block
 block discarded – undo
992 992
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
993 993
 				$date_data = '';
994 994
 				$date_cnt = '';
995
-				foreach($date_array as $date_item)
995
+				foreach ($date_array as $date_item)
996 996
 				{
997 997
 					$date_data .= '"'.$date_item['date_name'].'",';
998 998
 					$date_cnt .= $date_item['date_count'].',';
999 999
 				}
1000 1000
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
1001
-				$date_cnt = "['trackers',".substr($date_cnt,0,-1)."]";
1001
+				$date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]";
1002 1002
 				print 'c3.generate({
1003 1003
 				    bindto: "#chart5",
1004 1004
 				    data: { x: "x",
@@ -1011,23 +1011,23 @@  discard block
 block discarded – undo
1011 1011
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1012 1012
                 </div>
1013 1013
             </div>
1014
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1014
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1015 1015
             <div class="col-md-6">
1016 1016
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1017 1017
 <?php
1018
-			$hour_array = $Tracker->countAllHours('hour',true);
1018
+			$hour_array = $Tracker->countAllHours('hour', true);
1019 1019
 			if (empty($hour_array)) print _("No data available");
1020 1020
 			else {
1021 1021
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
1022 1022
 				$hour_data = '';
1023 1023
 				$hour_cnt = '';
1024
-				foreach($hour_array as $hour_item)
1024
+				foreach ($hour_array as $hour_item)
1025 1025
 				{
1026 1026
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
1027 1027
 					$hour_cnt .= $hour_item['hour_count'].',';
1028 1028
 				}
1029 1029
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
1030
-				$hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]";
1030
+				$hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]";
1031 1031
 				print 'c3.generate({
1032 1032
 				    bindto: "#chart6",
1033 1033
 				    data: {
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
                     <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1041 1041
                 </div>
1042 1042
             </div>
1043
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1043
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1044 1044
         </div>
1045 1045
 <?php
1046 1046
 		}
@@ -1064,13 +1064,13 @@  discard block
 block discarded – undo
1064 1064
 				print '<div id="chart32" class="chart" width="100%"></div><script>';
1065 1065
 				$year_data = '';
1066 1066
 				$year_cnt = '';
1067
-				foreach($year_array as $year_item)
1067
+				foreach ($year_array as $year_item)
1068 1068
 				{
1069 1069
 					$year_data .= '"'.$year_item['year'].'-01-01",';
1070 1070
 					$year_cnt .= $year_item['count'].',';
1071 1071
 				}
1072 1072
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
1073
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1073
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1074 1074
 				print 'c3.generate({
1075 1075
 				    bindto: "#chart32",
1076 1076
 				    data: { x: "x",
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1084 1084
                 </div>
1085 1085
             </div>
1086
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1086
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1087 1087
 
1088 1088
         <div class="row column">
1089 1089
             <div class="col-md-6">
@@ -1095,13 +1095,13 @@  discard block
 block discarded – undo
1095 1095
 				print '<div id="chart33" class="chart" width="100%"></div><script>';
1096 1096
 				$year_data = '';
1097 1097
 				$year_cnt = '';
1098
-				foreach($year_array as $year_item)
1098
+				foreach ($year_array as $year_item)
1099 1099
 				{
1100 1100
 					$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
1101 1101
 					$year_cnt .= $year_item['count'].',';
1102 1102
 				}
1103 1103
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
1104
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1104
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1105 1105
 				print 'c3.generate({
1106 1106
 				    bindto: "#chart33",
1107 1107
 				    data: { x: "x",
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1115 1115
                 </div>
1116 1116
             </div>
1117
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1117
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1118 1118
 <br/>
1119 1119
 <?php
1120 1120
 		}
@@ -1132,9 +1132,9 @@  discard block
 block discarded – undo
1132 1132
 <?php
1133 1133
 			//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
1134 1134
 			if ($year == '' && $month == '') {
1135
-				$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
1135
+				$polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
1136 1136
 			} else {
1137
-				$polar = $Stats->getStatsSource('polar',$year,$month);
1137
+				$polar = $Stats->getStatsSource('polar', $year, $month);
1138 1138
 			}
1139 1139
 			if (!empty($polar)) {
1140 1140
 				print '<h2>'._("Coverage pattern").'</h2>';
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 					unset($polar_data);
1143 1143
 					$Spotter = new Spotter();
1144 1144
 					$data = json_decode($eachpolar['source_data']);
1145
-					foreach($data as $value => $key) {
1145
+					foreach ($data as $value => $key) {
1146 1146
 						$direction = $Spotter->parseDirection(($value*22.5));
1147 1147
 						$distance = $key;
1148 1148
 						$unit = 'km';
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 ?>
1163 1163
             <div class="col-md-6">
1164 1164
                 <h4><?php print $eachpolar['source_name']; ?></h4>
1165
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1165
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1166 1166
         	<script>
1167 1167
         	    (function() {
1168 1168
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 		      color: color,
1187 1187
 		      unit: '<?php echo $unit; ?>'
1188 1188
 		    };
1189
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1189
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1190 1190
 		    })();
1191 1191
 		</script>
1192 1192
             </div>
@@ -1200,22 +1200,22 @@  discard block
 block discarded – undo
1200 1200
 <?php
1201 1201
 			//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
1202 1202
 			if ($year == '' && $month == '') {
1203
-				$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
1203
+				$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
1204 1204
 			} else {
1205
-				$msg = $Stats->getStatsSource('msg',$year,$month);
1205
+				$msg = $Stats->getStatsSource('msg', $year, $month);
1206 1206
 			}
1207 1207
 			if (!empty($msg)) {
1208 1208
 				print '<h2>'._("Messages received").'</h2>';
1209 1209
 				foreach ($msg as $eachmsg) {
1210 1210
 					//$eachmsg = $msg[0];
1211 1211
 					$data = $eachmsg['source_data'];
1212
-					if ($data > 500) $max = (round(($data+100)/100))*100;
1212
+					if ($data > 500) $max = (round(($data + 100)/100))*100;
1213 1213
 					else $max = 500;
1214 1214
 ?>
1215
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1215
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1216 1216
         	<script>
1217 1217
 		      var g = new JustGage({
1218
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
1218
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
1219 1219
 			    value: <?php echo $data; ?>,
1220 1220
 			    min: 0,
1221 1221
 			    max: <?php print $max; ?>,
@@ -1236,9 +1236,9 @@  discard block
 block discarded – undo
1236 1236
 <?php
1237 1237
 		//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
1238 1238
 			if ($year == '' && $month == '') {
1239
-				$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
1239
+				$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
1240 1240
 			} else {
1241
-				$hist = $Stats->getStatsSource('hist',$year,$month);
1241
+				$hist = $Stats->getStatsSource('hist', $year, $month);
1242 1242
 			}
1243 1243
 			foreach ($hist as $hists) {
1244 1244
 				//$hist_data = '';
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 				$source = $hists['source_name'];
1248 1248
 				$hist_array = json_decode($hists['source_data']);
1249 1249
 				$unit = 'km';
1250
-				foreach($hist_array as $distance => $nb)
1250
+				foreach ($hist_array as $distance => $nb)
1251 1251
 				{
1252 1252
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1253 1253
 						$distance = round($distance*0.539957);
@@ -1268,18 +1268,18 @@  discard block
 block discarded – undo
1268 1268
 				$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
1269 1269
 ?>
1270 1270
             <div class="col-md-6">
1271
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
1271
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
1272 1272
 <?php
1273
-				print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
1273
+				print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>';
1274 1274
 				print 'c3.generate({
1275
-				    bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
1275
+				    bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'",
1276 1276
 				    data: { x: "x",
1277 1277
 				    columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}},
1278 1278
 				    axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
1279 1279
 				print '</script>';
1280 1280
 ?>
1281 1281
     	    </div>
1282
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1282
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1283 1283
 <?php
1284 1284
 			}
1285 1285
 ?>
Please login to merge, or discard this patch.