Completed
Push — master ( 3d8cb5...5a808c )
by Yannick
07:32
created
statistics-year.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Busiest Month of Last Year");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	</div>
20 20
       <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>';
21 21
 
22
-$date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
22
+$date_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
23 23
 print '<div id="chart" class="chart" width="100%"></div>
24 24
       	<script> 
25 25
       		google.load("visualization", "1", {packages:["corechart"]});
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             	["'._("Month").'", "'._("# of Flights").'"], ';
30 30
 
31 31
 $date_data = '';
32
-foreach($date_array as $date_item)
32
+foreach ($date_array as $date_item)
33 33
 {
34 34
 	$date_data .= '[ "'.date("F, Y", strtotime($date_item['year_name'].'-'.$date_item['month_name'].'-01')).'",'.$date_item['date_count'].'],';
35 35
 }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	print '</thead>';
67 67
 	print '<tbody>';
68 68
 	$i = 1;
69
-	foreach($date_array as $date_item)
69
+	foreach ($date_array as $date_item)
70 70
 	{
71 71
 		print '<tr>';
72 72
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-manufacturer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Aircraft Manufacturer");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 
14
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
14
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
15
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
16 16
 
17 17
 require_once('header.php');
18 18
 include('statistics-sub-menu.php'); 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 		 </div>
24 24
     	<p>'._("Below are the <strong>Top 10</strong> most common aircraft manufacturers.").'</p>';
25 25
  
26
-$manufacturers_array = $Stats->countAllAircraftManufacturers(true,$airline_icao,$filter_name,$year,$month);
26
+$manufacturers_array = $Stats->countAllAircraftManufacturers(true, $airline_icao, $filter_name, $year, $month);
27 27
 print '<div id="chart" class="chart" width="100%"></div>
28 28
       	<script> 
29 29
       		google.load("visualization", "1", {packages:["corechart"]});
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             var data = google.visualization.arrayToDataTable([
33 33
             	["'._("Aircraft Manufacturer").'", "'._("# of times").'"], ';
34 34
 $manufacturer_data = '';
35
-foreach($manufacturers_array as $manufacturer_item)
35
+foreach ($manufacturers_array as $manufacturer_item)
36 36
 {
37 37
 	$manufacturer_data .= '[ "'.$manufacturer_item['aircraft_manufacturer'].'",'.$manufacturer_item['aircraft_manufacturer_count'].'],';
38 38
 }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	print '</thead>';
66 66
 	print '<tbody>';
67 67
 	$i = 1;
68
-	foreach($manufacturers_array as $manufacturer_item)
68
+	foreach ($manufacturers_array as $manufacturer_item)
69 69
 	{
70 70
 		print '<tr>';
71 71
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-time.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Busiest Time of the Day");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	</div>
21 21
 	<p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>';
22 22
 
23
-$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
23
+$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
24 24
 print '<div id="chartHour" class="chart" width="100%"></div>
25 25
       	<script> 
26 26
       		google.load("visualization", "1", {packages:["corechart"]});
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	date_default_timezone_set('UTC');
37 37
 }
38 38
 //print_r($hour_array);
39
-foreach($hour_array as $hour_item)
39
+foreach ($hour_array as $hour_item)
40 40
 {
41 41
 	$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
42 42
 }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     			});
62 62
       </script>';
63 63
 
64
-$hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name);
64
+$hour_array = $Stats->countAllHours('count', true, $airline_icao, $filter_name);
65 65
 if (!empty($hour_array))
66 66
 {
67 67
 	print '<div class="table-responsive">';
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	print '</thead>';
74 74
 	print '<tbody>';
75 75
 	$i = 1;
76
-	foreach($hour_array as $hour_item)
76
+	foreach ($hour_array as $hour_item)
77 77
 	{
78 78
 		print '<tr>';
79 79
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-sub-menu.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 					} else {
21 21
 						print '<option value="all">All</option>';
22 22
 					}
23
-					foreach($airlines as $airline) {
23
+					foreach ($airlines as $airline) {
24 24
 						if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) {
25 25
 							print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>';
26 26
 						} else {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 <div class="sub-menu sub-menu-container">
38 38
 	<ul class="nav">
39 39
 		<li class="dropdown">
40
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" >
40
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" >
41 41
 		      <?php echo _("Aircraft"); ?> <span class="caret"></span>
42 42
 		    </a>
43 43
 		    <ul class="dropdown-menu">
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		    </ul>
49 49
 		</li>
50 50
 		<li class="dropdown">
51
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
51
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#">
52 52
 		      <?php echo _("Airline"); ?> <span class="caret"></span>
53 53
 		    </a>
54 54
 		    <ul class="dropdown-menu" role="menu">
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		    </ul>
59 59
 		</li>
60 60
 		<li class="dropdown">
61
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
61
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#">
62 62
 		      <?php echo _("Airport"); ?> <span class="caret"></span>
63 63
 		    </a>
64 64
 		    <ul class="dropdown-menu" role="menu">
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		    </ul>
70 70
 		</li>
71 71
 		<li class="dropdown">
72
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
72
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#">
73 73
 		      <?php echo _("Route"); ?> <span class="caret"></span>
74 74
 		    </a>
75 75
 		    <ul class="dropdown-menu" role="menu">
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		    </ul>
79 79
 		</li>
80 80
 		<li class="dropdown">
81
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
81
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#">
82 82
 		      <?php echo _("Date &amp; Time"); ?> <span class="caret"></span>
83 83
 		    </a>
84 84
 		    <ul class="dropdown-menu" role="menu">
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		    if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) {
91 91
 		?>
92 92
 		<li class="dropdown">
93
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
93
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#">
94 94
 		      <?php echo _("Fatalities"); ?> <span class="caret"></span>
95 95
 		    </a>
96 96
 		    <ul class="dropdown-menu" role="menu">
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 <div class="sub-menu sub-menu-container">
110 110
 	<ul class="nav">
111 111
 		<li class="dropdown">
112
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" >
112
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" >
113 113
 		      <?php echo _("Aircraft"); ?> <span class="caret"></span>
114 114
 		    </a>
115 115
 		    <ul class="dropdown-menu">
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		    </ul>
121 121
 		</li>
122 122
 		<li class="dropdown">
123
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
123
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#">
124 124
 		      <?php echo _("Airline"); ?> <span class="caret"></span>
125 125
 		    </a>
126 126
 		    <ul class="dropdown-menu" role="menu">
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		    </ul>
131 131
 		</li>
132 132
 		<li class="dropdown">
133
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
133
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#">
134 134
 		      <?php echo _("Airport"); ?> <span class="caret"></span>
135 135
 		    </a>
136 136
 		    <ul class="dropdown-menu" role="menu">
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		</li>
143 143
 		<!--
144 144
 		<li class="dropdown">
145
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
145
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#">
146 146
 		      <?php echo _("Route"); ?> <span class="caret"></span>
147 147
 		    </a>
148 148
 		    <ul class="dropdown-menu" role="menu">
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		-->
154 154
 		<!--
155 155
 		<li class="dropdown">
156
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
156
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#">
157 157
 		      <?php echo _("Date &amp; Time"); ?> <span class="caret"></span>
158 158
 		    </a>
159 159
 		    <ul class="dropdown-menu" role="menu">
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		?>
168 168
 		<!--
169 169
 		<li class="dropdown">
170
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
170
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#">
171 171
 		      <?php echo _("Fatalities"); ?> <span class="caret"></span>
172 172
 		    </a>
173 173
 		    <ul class="dropdown-menu" role="menu">
Please login to merge, or discard this patch.
statistics-pilot.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Pilots");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13
-setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
13
+setcookie('stats_airline_icao', $airline_icao, time() + 60*60*24, '/');
14
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
15
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
16 16
 require_once('header.php');
17 17
 include('statistics-sub-menu.php');
18 18
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	</div>
23 23
 	<p>'._("Below are the <strong>Top 10</strong> most common pilot.").'</p>';
24 24
 	  
25
-	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
25
+	$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
26 26
 	print '<div id="chart" class="chart" width="100%"></div>
27 27
       	<script> 
28 28
       		google.load("visualization", "1", {packages:["corechart"]});
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             var data = google.visualization.arrayToDataTable([
32 32
             	["'._("Pilot").'", "'._("# of times").'"], ';
33 33
             	$pilot_data = '';
34
-		foreach($pilot_array as $pilot_item)
34
+		foreach ($pilot_array as $pilot_item)
35 35
 		{
36 36
 			$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
37 37
 		}
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	print '</thead>';
65 65
 	print '<tbody>';
66 66
 	$i = 1;
67
-	foreach($pilot_array as $pilot_item)
67
+	foreach ($pilot_array as $pilot_item)
68 68
 	{
69 69
 		print '<tr>';
70 70
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
require/class.METAR.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                         $Connection = new Connection();
55 55
                         $sth = $Connection->db->prepare($query);
56 56
                         $sth->execute();
57
-                } catch(PDOException $e) {
57
+                } catch (PDOException $e) {
58 58
                         return "error : ".$e->getMessage();
59 59
                 }
60 60
                 $row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                         $Connection = new Connection();
71 71
                         $sth = $Connection->db->prepare($query);
72 72
                         $sth->execute();
73
-                } catch(PDOException $e) {
73
+                } catch (PDOException $e) {
74 74
                         return "error : ".$e->getMessage();
75 75
                 }
76 76
         }
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
         public function parse($data) {
81 81
     		//$data = str_replace(array('\n','\r','\r','\n'),'',$data);
82 82
     		$codes = implode('|', array_keys($this->texts));
83
-    		$regWeather = '#^(\+|\-|VC)?(' . $codes . ')(' . $codes . ')?$#';
83
+    		$regWeather = '#^(\+|\-|VC)?('.$codes.')('.$codes.')?$#';
84 84
     		//$pieces = explode(' ',$data);
85
-    		$pieces = preg_split('/\s/',$data);
85
+    		$pieces = preg_split('/\s/', $data);
86 86
     		$pos = 0;
87 87
     		if ($pieces[0] == 'METAR') $pos++;
88 88
     		elseif ($pieces[0] == 'SPECI') $pos++;
@@ -90,25 +90,25 @@  discard block
 block discarded – undo
90 90
     		$result = array();
91 91
     		$result['location'] = $pieces[$pos];
92 92
     		$pos++;
93
-    		$result['dayofmonth'] = substr($pieces[$pos],0,2);
94
-    		$result['time'] = substr($pieces[$pos],2,4);
93
+    		$result['dayofmonth'] = substr($pieces[$pos], 0, 2);
94
+    		$result['time'] = substr($pieces[$pos], 2, 4);
95 95
     		$c = count($pieces);
96
-    		for($pos++; $pos < $c; $pos++) {
96
+    		for ($pos++; $pos < $c; $pos++) {
97 97
     			$piece = $pieces[$pos];
98 98
     			if ($piece == 'RMK') break;
99 99
     			if ($piece == 'AUTO') $result['auto'] = true;
100 100
     			if ($piece == 'COR') $result['correction'] = true;
101 101
     			// Wind Speed
102 102
     			if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) {
103
-    				$result['wind']['direction'] = (float)$matches[1];
103
+    				$result['wind']['direction'] = (float) $matches[1];
104 104
 				$result['wind']['unit'] = $matches[4];
105
-    				if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2);
106
-    				elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2);
107
-    				elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2);
108
-				$result['wind']['gust'] = (float)$matches[3];
105
+    				if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float) $matches[2])*0.51444444444, 2);
106
+    				elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float) $matches[2])*1000, 2);
107
+    				elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float) $matches[2]), 2);
108
+				$result['wind']['gust'] = (float) $matches[3];
109 109
 				$result['wind']['unit'] = $matches[4];
110
-				$result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0;
111
-				$result['wind']['max_variation'] = array_key_exists(6,$matches) ? $matches[6] : 0;
110
+				$result['wind']['min_variation'] = array_key_exists(5, $matches) ? $matches[5] : 0;
111
+				$result['wind']['max_variation'] = array_key_exists(6, $matches) ? $matches[6] : 0;
112 112
     			}
113 113
 
114 114
 /*    			if (preg_match('#^([0-9]{3})([0-9]{2})(G([0-9]{2}))?(KT|MPS)$#', $piece, $matches)) {
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
     			*/
129 129
     			// Temperature
130 130
     			if (preg_match('#^(M?[0-9]{2,})/(M?[0-9]{2,})$#', $piece, $matches)) {
131
-    				$temp = (float)$matches[1];
131
+    				$temp = (float) $matches[1];
132 132
 				if ($matches[1]{0} == 'M') {
133
-					$temp = ((float)substr($matches[1], 1)) * -1;
133
+					$temp = ((float) substr($matches[1], 1))*-1;
134 134
 				}
135 135
     				$result['temperature'] = $temp;
136
-    				$dew = (float)$matches[2];
136
+    				$dew = (float) $matches[2];
137 137
 				if ($matches[2]{0} == 'M') {
138
-					$dew = ((float)substr($matches[2], 1)) * -1;
138
+					$dew = ((float) substr($matches[2], 1))*-1;
139 139
 				}
140 140
 				$result['dew'] = $dew;
141 141
     			}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     					$result['QNH'] = $matches[2];
148 148
     				} else {
149 149
     					// inHg
150
-    					$result['QNH'] = round(($matches[2] / 100)*33.86389,2);
150
+    					$result['QNH'] = round(($matches[2]/100)*33.86389, 2);
151 151
 				}
152 152
     				/*
153 153
     				$result['QNH'] = $matches[1] == 'Q' ? $matches[2] : ($matches[2] / 100);
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
     			// Visibility
169 169
     			if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) {
170 170
     				if (isset($matches[3]) && strlen($matches[3]) > 0) {
171
-					$result['visibility'] = (float)$matches[3] * 1609.34;
171
+					$result['visibility'] = (float) $matches[3]*1609.34;
172 172
 				} else {
173 173
 					if ($matches[1] == '9999') {
174 174
 						$result['visibility'] = '> 10000';
175 175
 					} else {
176
-						$result['visibility'] = (float)$matches[1];
176
+						$result['visibility'] = (float) $matches[1];
177 177
 					}
178 178
 				}
179 179
 				if (preg_match('#^CAVOK$#', $piece, $matches)) {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     				elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage';
196 196
     				elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility';
197 197
     				$cloud['type_code'] = $type;
198
-    				$cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048);
198
+    				$cloud['level'] = round(((float) $matches[2])*100*0.3048);
199 199
     				$cloud['significant'] = isset($matches[3]) ? $matches[3] : '';
200 200
     				$result['cloud'][] = $cloud;
201 201
     			}
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 				$rvr['runway'] = $matches[1];
206 206
 				$rvr['assessment'] = $matches[2];
207 207
 				$rvr['rvr'] = $matches[3];
208
-				$rvr['rvr_max'] = array_key_exists(4,$matches) ? $matches[4] : 0;
209
-				$rvr['unit'] = array_key_exists(5,$matches) ? $matches[5] : '';
208
+				$rvr['rvr_max'] = array_key_exists(4, $matches) ? $matches[4] : 0;
209
+				$rvr['unit'] = array_key_exists(5, $matches) ? $matches[5] : '';
210 210
 				$result['RVR'] = $rvr;
211 211
 			}
212 212
     			
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
     			if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) {
224 224
     				//echo $piece;
225 225
     				//print_r($matches);
226
-    				if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M');
227
-    				else $range = array('exact' => (float)$matches[2], 'unit' => 'M');
226
+    				if (isset($matches[5])) $range = array('exact' => (float) $matches[2], 'unit' => $matches[5] ? 'FT' : 'M');
227
+    				else $range = array('exact' => (float) $matches[2], 'unit' => 'M');
228 228
 				if (isset($matches[3])) {
229 229
 					$range = Array(
230
-					    'from' => (float)$matches[2],
231
-					    'to'   => (float)$matches[4],
230
+					    'from' => (float) $matches[2],
231
+					    'to'   => (float) $matches[4],
232 232
 					    'unit' => $matches[5] ? 'FT' : 'M'
233 233
 					);
234 234
 				}
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                  try {
278 278
                         $sth = $this->db->prepare($query);
279 279
                         $sth->execute($query_values);
280
-                } catch(PDOException $e) {
280
+                } catch (PDOException $e) {
281 281
                         return "error : ".$e->getMessage();
282 282
                 }
283 283
                 $all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -287,19 +287,19 @@  discard block
 block discarded – undo
287 287
                 return $all;
288 288
         }
289 289
 
290
-       public function addMETAR($location,$metar,$date) {
290
+       public function addMETAR($location, $metar, $date) {
291 291
 		global $globalDBdriver;
292
-		$date = date('Y-m-d H:i:s',strtotime($date));
292
+		$date = date('Y-m-d H:i:s', strtotime($date));
293 293
 		if ($globalDBdriver == 'mysql') {
294 294
 			$query = "INSERT INTO metar (metar_location,metar_date,metar) VALUES (:location,:date,:metar) ON DUPLICATE KEY UPDATE metar_date = :date, metar = :metar";
295 295
 		} else {
296 296
 			$query = "UPDATE metar SET metar_date = :date, metar = metar WHERE metar_location = :location;INSERT INTO metar (metar_location,metar_date,metar) SELECT :location,:date,:metar WHERE NOT EXISTS (SELECT 1 FROM metar WHERE metar_location = :location);";
297 297
 		}
298
-                $query_values = array(':location' => $location,':date' => $date,':metar' => utf8_encode($metar));
298
+                $query_values = array(':location' => $location, ':date' => $date, ':metar' => utf8_encode($metar));
299 299
                  try {
300 300
                         $sth = $this->db->prepare($query);
301 301
                         $sth->execute($query_values);
302
-                } catch(PDOException $e) {
302
+                } catch (PDOException $e) {
303 303
                         return "error : ".$e->getMessage();
304 304
                 }
305 305
         }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                  try {
311 311
                         $sth = $this->db->prepare($query);
312 312
                         $sth->execute($query_values);
313
-                } catch(PDOException $e) {
313
+                } catch (PDOException $e) {
314 314
                         return "error : ".$e->getMessage();
315 315
                 }
316 316
         }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                  try {
320 320
                         $sth = $this->db->prepare($query);
321 321
                         $sth->execute();
322
-                } catch(PDOException $e) {
322
+                } catch (PDOException $e) {
323 323
                         return "error : ".$e->getMessage();
324 324
                 }
325 325
         }
@@ -331,30 +331,30 @@  discard block
 block discarded – undo
331 331
     		$Common = new Common();
332 332
     		if (isset($globalIVAO) && $globalIVAO) {
333 333
         		//$cycle = $Common->getData('http://wx.ivao.aero/metar.php');
334
-			$Common->download('http://wx.ivao.aero/metar.php',dirname(__FILE__).'/../install/tmp/ivaometar.txt');
335
-    			$handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt',"r");
334
+			$Common->download('http://wx.ivao.aero/metar.php', dirname(__FILE__).'/../install/tmp/ivaometar.txt');
335
+    			$handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt', "r");
336 336
     		} else {
337 337
 			//$cycle = $Common->getData('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT');
338
-			$Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT',dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT');
339
-    			$handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r");
338
+			$Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT', dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT');
339
+    			$handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT', "r");
340 340
     		}
341 341
     		if ($handle) {
342 342
 			if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB...";
343 343
 			$date = '';
344 344
     			//foreach(explode("\n",$cycle) as $line) {
345 345
     			if ($globalTransaction) $this->db->beginTransaction();
346
-	    		while(($line = fgets($handle,4096)) !== false) {
347
-				if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) {
346
+	    		while (($line = fgets($handle, 4096)) !== false) {
347
+				if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) {
348 348
 					$date = $line;
349 349
     				} elseif ($line != '') {
350 350
     				    //$this->parse($line);
351 351
     				    if ($date == '') $date = date('Y/m/d H:m');
352 352
         			    $pos = 0;
353
-        			    $pieces = preg_split('/\s/',$line);
353
+        			    $pieces = preg_split('/\s/', $line);
354 354
         			    if ($pieces[0] == 'METAR') $pos++;
355 355
         			    if (strlen($pieces[$pos]) != 4) $pos++;
356 356
 		        	    $location = $pieces[$pos];
357
-        	        	    echo $this->addMETAR($location,$line,$date);
357
+        	        	    echo $this->addMETAR($location, $line, $date);
358 358
     				}
359 359
     			}
360 360
     			fclose($handle);
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
     		if ($globalMETARurl == '') return array();
369 369
     		date_default_timezone_set("UTC");
370 370
     		$Common = new Common();
371
-    		$url = str_replace('{icao}',$icao,$globalMETARurl);
371
+    		$url = str_replace('{icao}', $icao, $globalMETARurl);
372 372
     		$cycle = $Common->getData($url);
373 373
     		$date = '';
374
-    		foreach(explode("\n",$cycle) as $line) {
375
-    			if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) {
374
+    		foreach (explode("\n", $cycle) as $line) {
375
+    			if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) {
376 376
     				//echo "date : ".$line."\n";
377 377
     				$date = $line;
378 378
     			} 
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
     			    //echo $line;
382 382
     			    if ($date == '') $date = date('Y/m/d H:m');
383 383
     			    $pos = 0;
384
-    			    $pieces = preg_split('/\s/',$line);
384
+    			    $pieces = preg_split('/\s/', $line);
385 385
     			    if ($pieces[0] == 'METAR') $pos++;
386 386
     			    if (strlen($pieces[$pos]) != 4) $pos++;
387 387
 	        	    $location = $pieces[$pos];
388 388
 	        	    if (strlen($location == 4)) {
389
-	        		$this->addMETAR($location,$line,$date);
389
+	        		$this->addMETAR($location, $line, $date);
390 390
 	        		return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line));
391 391
 	        	    } else return array();
392 392
     			}
Please login to merge, or discard this patch.
accident-detailed.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 {
11 11
 	$date = date('Y-m-d');
12 12
 } else {
13
-	$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
13
+	$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
14 14
 }
15 15
 
16
-if(!isset($_GET['limit']))
16
+if (!isset($_GET['limit']))
17 17
 {
18 18
 	$limit_start = 0;
19 19
 	$limit_end = 25;
@@ -48,25 +48,25 @@  discard block
 block discarded – undo
48 48
 print '<br />';
49 49
 
50 50
 print '<div class="info column">';
51
-if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) {
52
-	print '<h1>'.sprintf(_("Accidents from %s"),date("l F j, Y",strtotime($date))).'</h1>';
53
-} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) {
54
-	print '<h1>'.sprintf(_("Accidents from %s"),date("F, Y",strtotime($date))).'</h1>';
55
-} elseif (preg_match('/^[0-9]{4}$/',$date)) {
56
-	print '<h1>'.sprintf(_("Accidents from %s"),$date).'</h1>';
51
+if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) {
52
+	print '<h1>'.sprintf(_("Accidents from %s"), date("l F j, Y", strtotime($date))).'</h1>';
53
+} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) {
54
+	print '<h1>'.sprintf(_("Accidents from %s"), date("F, Y", strtotime($date))).'</h1>';
55
+} elseif (preg_match('/^[0-9]{4}$/', $date)) {
56
+	print '<h1>'.sprintf(_("Accidents from %s"), $date).'</h1>';
57 57
 }
58 58
 print '</div>';
59 59
 
60 60
 print '<div class="table column">';
61 61
 
62
-if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) {
63
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>';
64
-} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) {
65
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("M, Y",strtotime($date))).'</p>';
66
-} elseif (preg_match('/^[0-9]{4}$/',$date)) {
67
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),$date).'</p>';
62
+if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) {
63
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>';
64
+} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) {
65
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("M, Y", strtotime($date))).'</p>';
66
+} elseif (preg_match('/^[0-9]{4}$/', $date)) {
67
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), $date).'</p>';
68 68
 }
69
-$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'accident',$date);
69
+$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'accident', $date);
70 70
 //print_r($spotter_array);
71 71
 if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) {
72 72
 	include('table-output.php');
Please login to merge, or discard this patch.
statistics.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 $Stats = new Stats();
8 8
 
9 9
 if (!isset($filter_name)) $filter_name = '';
10
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 if ($airline_icao == '' && isset($globalFilter)) {
12 12
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
13 13
 }
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	$title = _("Statistics");
23 23
 }
24 24
 
25
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
26
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
25
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
26
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
27 27
 
28 28
 require_once('header.php');
29 29
 
@@ -44,36 +44,36 @@  discard block
 block discarded – undo
44 44
 		date_default_timezone_set('UTC');
45 45
 		$lastupdate = strtotime($last_update[0]['value']);
46 46
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
47
-		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
47
+		print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
48 48
 	}
49 49
     ?>
50 50
     </div>
51 51
     <?php include('statistics-sub-menu.php'); ?>
52 52
     <p class="global-stats">
53
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
54
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
55
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
53
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
54
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
55
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
57 57
 	<?php
58 58
 	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
59 59
 	?>
60
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
61
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
60
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
61
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
62 62
         <?php
63 63
     	    } else {
64 64
     	?>
65
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
66
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
65
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
66
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
67 67
     	<?php
68 68
     	    }
69 69
     	?>
70
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
70
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
72 72
         <?php
73 73
     		if ($airline_icao == '') {
74 74
     	?>
75
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
76
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
75
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
76
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
77 77
 	<?php
78 78
 		}
79 79
 	?>
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
82 82
 			if ($airline_icao == '' || $airline_icao == 'all') {
83 83
 	?>
84
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
85
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
84
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
85
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
86 86
 	<?php
87 87
 			}
88 88
 		}
89 89
 	?>
90 90
     </p>
91
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
92 92
     <div class="specific-stats">
93 93
         <div class="row column">
94 94
             <div class="col-md-6">
95 95
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 96
                  <?php
97
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
97
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
98 98
 		    if (count($aircraft_array) == 0) print _("No data available");
99 99
 		    else {
100 100
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                         var data = google.visualization.arrayToDataTable([
107 107
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
108 108
                             $aircraft_data = '';
109
-                          foreach($aircraft_array as $aircraft_item)
109
+                          foreach ($aircraft_array as $aircraft_item)
110 110
                                     {
111 111
                                             $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
112 112
                                     }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
             	    ?>
144 144
                 </div>
145 145
             </div>
146
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
146
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
147 147
 <?php
148 148
 //    echo $airline_icao;
149 149
     if ($airline_icao == '' || $airline_icao == 'all') {
150
-	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
150
+	$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
151 151
 	if (count($airline_array) > 0) {
152 152
             print '<div class="col-md-6">';
153 153
 	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                         var data = google.visualization.arrayToDataTable([
160 160
                             ["'._("Airline").'", "'._("# of times").'"], ';
161 161
 	    $airline_data = '';
162
-	    foreach($airline_array as $airline_item)
162
+	    foreach ($airline_array as $airline_item)
163 163
 	    {
164 164
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
165 165
 	    }
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 ?>
195 195
         </div>
196
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
196
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
197 197
 <?php
198 198
     }
199 199
 ?>
200 200
         <div class="row column">
201 201
 <?php
202
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
202
+    $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
203 203
     if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
204 204
 	if (empty($flightover_array)) {
205 205
 	    print '<div class="col-md-12">';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 ?>
210 210
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
211 211
 <?php
212
-	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
212
+	$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
213 213
 	if (count($pilot_array) == 0) print _("No data available");
214 214
 	else {
215 215
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                         var data = google.visualization.arrayToDataTable([
221 221
                             ["'._("Pilots").'", "'._("# of times").'"], ';
222 222
 	    $pilot_data = '';
223
-	    foreach($pilot_array as $pilot_item)
223
+	    foreach ($pilot_array as $pilot_item)
224 224
 	    {
225 225
 		$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
226 226
 	    }
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
 ?>
251 251
             </div>
252 252
         
253
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
253
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
254 254
 <?php
255 255
     } else {
256 256
 ?>
257 257
             <div class="col-md-6">
258 258
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
259 259
 <?php
260
-	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
260
+	$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
261 261
 	if (count($owner_array) == 0) print _("No data available");
262 262
 	else {
263 263
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                         var data = google.visualization.arrayToDataTable([
269 269
                             ["'._("Owner").'", "'._("# of times").'"], ';
270 270
                             $owner_data = '';
271
-	    foreach($owner_array as $owner_item)
271
+	    foreach ($owner_array as $owner_item)
272 272
 	    {
273 273
 		$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
274 274
 	    }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                 </div>
297 297
             </div>
298 298
         
299
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
299
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
300 300
 <?php
301 301
     }
302 302
     if (!empty($flightover_array)) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                         var data = google.visualization.arrayToDataTable([
316 316
                             ["'._("Country").'", "'._("# of times").'"], ';
317 317
                             $flightover_data = '';
318
-	    foreach($flightover_array as $flightover_item)
318
+	    foreach ($flightover_array as $flightover_item)
319 319
 	    {
320 320
 		$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
321 321
 	    }
@@ -348,14 +348,14 @@  discard block
 block discarded – undo
348 348
     }
349 349
 ?>
350 350
         </div>
351
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
351
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
352 352
 
353 353
     	
354 354
         </div>
355 355
         <div class="row column">
356 356
             <div class="col-md-6">
357 357
 <?php
358
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
358
+    $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
359 359
     if (count($airport_airport_array) > 0) {
360 360
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
361 361
 	print '<div id="chart3" class="chart" width="100%"></div>
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 var data = google.visualization.arrayToDataTable([ 
371 371
                     ["'._("Airport").'", "'._("# of times").'"],';
372 372
                     $airport_data = '';
373
-	foreach($airport_airport_array as $airport_item)
373
+	foreach ($airport_airport_array as $airport_item)
374 374
 	{
375 375
 	    $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
376 376
 	    $name = str_replace("'", "", $name);
@@ -399,11 +399,11 @@  discard block
 block discarded – undo
399 399
     }
400 400
 ?>
401 401
             </div>
402
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
402
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
403 403
 
404 404
             <div class="col-md-6">
405 405
 <?php
406
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
406
+    $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
407 407
     if (count($airport_airport_array2) > 0) {
408 408
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
409 409
 	print '<div id="chart4" class="chart" width="100%"></div>
@@ -418,10 +418,10 @@  discard block
 block discarded – undo
418 418
                 var data = google.visualization.arrayToDataTable([ 
419 419
                     ["'._("Airport").'", "'._("# of times").'"],';
420 420
 	$airport_data2 = '';
421
-	foreach($airport_airport_array2 as $airport_item2)
421
+	foreach ($airport_airport_array2 as $airport_item2)
422 422
 	{
423 423
 	    $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
424
-	    $name2 = str_replace(array("'",'"'), '', $name2);
424
+	    $name2 = str_replace(array("'", '"'), '', $name2);
425 425
 	    $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
426 426
 	}
427 427
 	$airport_data2 = substr($airport_data2, 0, -1);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 ?>
448 448
             </div>
449 449
         </div>
450
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
450
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
451 451
 <?php
452 452
     if ($year == '' && $month == '') {
453 453
 ?>
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             <div class="col-md-6">
456 456
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
457 457
                 <?php
458
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
458
+                  $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
459 459
 		    if (count($year_array) == 0) print _("No data available");
460 460
 		    else {
461 461
                   print '<div id="chart8" class="chart" width="100%"></div>
@@ -466,9 +466,9 @@  discard block
 block discarded – undo
466 466
                         var data = google.visualization.arrayToDataTable([
467 467
                             ["'._("Month").'", "'._("# of Flights").'"], ';
468 468
                             $year_data = '';
469
-                          foreach($year_array as $year_item)
469
+                          foreach ($year_array as $year_item)
470 470
                                     {
471
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
471
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
472 472
                                     }
473 473
                                     $year_data = substr($year_data, 0, -1);
474 474
                                     print $year_data;
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                     <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>
497 497
                 </div>
498 498
             </div>
499
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
499
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
500 500
             <div class="col-md-6">
501 501
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
502 502
                 <?php
503
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
503
+                  $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
504 504
 		    if (count($month_array) == 0) print _("No data available");
505 505
 		    else {
506 506
                   print '<div id="chart9" class="chart" width="100%"></div>
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
                         var data = google.visualization.arrayToDataTable([
512 512
                             ["'._("Day").'", "'._("# of Flights").'"], ';
513 513
                             $month_data = '';
514
-                          foreach($month_array as $month_item)
514
+                          foreach ($month_array as $month_item)
515 515
                                     {
516
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
516
+                                        $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
517 517
                                     }
518 518
                                     $month_data = substr($month_data, 0, -1);
519 519
                                     print $month_data;
@@ -541,12 +541,12 @@  discard block
 block discarded – undo
541 541
                     <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>
542 542
                 </div>
543 543
             </div>
544
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
544
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
545 545
 
546 546
             <div class="col-md-6">
547 547
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
548 548
                 <?php
549
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
549
+                    $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
550 550
 		    if (empty($date_array)) print _("No data available");
551 551
 		    else {
552 552
                   print '<div id="chart5" class="chart" width="100%"></div>
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                             ["'._("Date").'", "'._("# of Flights").'"], ';
559 559
                             $date_data = '';
560 560
                         
561
-                          foreach($date_array as $date_item)
561
+                          foreach ($date_array as $date_item)
562 562
                                     {
563 563
                                         $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
564 564
                                     }
@@ -588,11 +588,11 @@  discard block
 block discarded – undo
588 588
                     <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>
589 589
                 </div>
590 590
             </div>
591
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
591
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
592 592
             <div class="col-md-6">
593 593
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
594 594
                 <?php
595
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
595
+                  $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
596 596
 		    if (empty($hour_array)) print _("No data available");
597 597
 		    else {
598 598
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
                         var data = google.visualization.arrayToDataTable([
605 605
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
606 606
                             $hour_data = '';
607
-                          foreach($hour_array as $hour_item)
607
+                          foreach ($hour_array as $hour_item)
608 608
                                     {
609 609
                                         $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
610 610
                                     }
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
                     <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>
635 635
                 </div>
636 636
             </div>
637
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
637
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
638 638
         </div>
639 639
 <?php
640 640
     }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
                         var data = google.visualization.arrayToDataTable([
661 661
                             ["'._("Year").'", "'._("# of Fatalities").'"], ';
662 662
                             $year_data = '';
663
-                          foreach($year_array as $year_item)
663
+                          foreach ($year_array as $year_item)
664 664
                                     {
665 665
                                         $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
666 666
                                     }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
691 691
                 </div>
692 692
             </div>
693
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
693
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
694 694
 
695 695
         <div class="row column">
696 696
             <div class="col-md-6">
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
                         var data = google.visualization.arrayToDataTable([
710 710
                             ["'._("Month").'", "'._("# of Fatalities").'"], ';
711 711
                             $year_data = '';
712
-                          foreach($year_array as $year_item)
712
+                          foreach ($year_array as $year_item)
713 713
                                     {
714
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
714
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
715 715
                                     }
716 716
                                     $year_data = substr($year_data, 0, -1);
717 717
                                     print $year_data;
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
740 740
                 </div>
741 741
             </div>
742
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
742
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
743 743
 <br/>
744 744
 <?php
745 745
     }
@@ -752,9 +752,9 @@  discard block
 block discarded – undo
752 752
         	<?php
753 753
         	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
754 754
         	    if ($year == '' && $month == '') {
755
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
755
+		        $polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
756 756
 		    } else {
757
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
757
+        		$polar = $Stats->getStatsSource('polar', $year, $month);
758 758
         	    }
759 759
         	    if (!empty($polar)) {
760 760
             		print '<h2>'._("Coverage pattern").'</h2>';
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
         		    unset($polar_data);
763 763
 	        	    $Spotter = new Spotter();
764 764
         		    $data = json_decode($eachpolar['source_data']);
765
-        		    foreach($data as $value => $key) {
765
+        		    foreach ($data as $value => $key) {
766 766
         			$direction = $Spotter->parseDirection(($value*22.5));
767 767
         			$distance = $key;
768 768
         			$unit = 'km';
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         	?>
783 783
             <div class="col-md-6">
784 784
                 <h4><?php print $eachpolar['source_name']; ?></h4>
785
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
785
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
786 786
         	<script>
787 787
         	    (function() {
788 788
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 		      color: color,
807 807
 		      unit: '<?php echo $unit; ?>'
808 808
 		    };
809
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
809
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
810 810
 		    })();
811 811
 		</script>
812 812
             </div>
@@ -820,22 +820,22 @@  discard block
 block discarded – undo
820 820
         	<?php
821 821
         	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
822 822
         	    if ($year == '' && $month == '') {
823
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
823
+        		$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
824 824
         	    } else {
825
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
825
+        		$msg = $Stats->getStatsSource('msg', $year, $month);
826 826
         	    }
827 827
         	    if (!empty($msg)) {
828 828
             		print '<h2>'._("Messages received").'</h2>';
829 829
         		foreach ($msg as $eachmsg) {
830 830
         		    //$eachmsg = $msg[0];
831 831
         		    $data = $eachmsg['source_data'];
832
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
832
+        		    if ($data > 500) $max = (round(($data + 100)/100))*100;
833 833
         		    else $max = 500;
834 834
         	?>
835
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
835
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
836 836
         	<script>
837 837
 		      var g = new JustGage({
838
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
838
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
839 839
 			    value: <?php echo $data; ?>,
840 840
 			    min: 0,
841 841
 			    max: <?php print $max; ?>,
@@ -857,15 +857,15 @@  discard block
 block discarded – undo
857 857
             <?php
858 858
 		//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
859 859
 		if ($year == '' && $month == '') {
860
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
860
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
861 861
 		} else {
862
-			$hist = $Stats->getStatsSource('hist',$year,$month);
862
+			$hist = $Stats->getStatsSource('hist', $year, $month);
863 863
 		}
864 864
 		foreach ($hist as $hists) {
865 865
 			$hist_data = '';
866 866
 			$source = $hists['source_name'];
867 867
 			$hist_array = json_decode($hists['source_data']);
868
-			foreach($hist_array as $distance => $nb)
868
+			foreach ($hist_array as $distance => $nb)
869 869
 			{
870 870
 				$unit = 'km';
871 871
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -883,13 +883,13 @@  discard block
 block discarded – undo
883 883
 			$hist_data = substr($hist_data, 0, -1);
884 884
             ?>
885 885
             <div class="col-md-6">
886
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
886
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
887 887
                 <?php
888
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
888
+                  print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div>
889 889
                     <script> 
890 890
                         google.load("visualization", "1", {packages:["corechart"]});
891
-                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
892
-                      function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
891
+                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).');
892
+                      function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() {
893 893
                         var data = google.visualization.arrayToDataTable([
894 894
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
895 895
                             print $hist_data;
@@ -904,16 +904,16 @@  discard block
 block discarded – undo
904 904
                             colors: ["#1a3151"]
905 905
                         };
906 906
 
907
-                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'"));
907
+                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'"));
908 908
                         chart.draw(data, options);
909 909
                       }
910 910
                       $(window).resize(function(){
911
-                              drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
911
+                              drawCharthist_'.str_replace(' ', '_', strtolower($source)).'();
912 912
                             });
913 913
                   </script>';
914 914
         	?>
915 915
     	    </div>
916
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
916
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
917 917
         	<?php
918 918
                   }
919 919
                 ?>
Please login to merge, or discard this patch.
table-output.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 require_once(dirname(__FILE__).'/require/class.Common.php');
6 6
 $Common = new Common();
7
-$showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop');
8
-$showDuration = $Common->multiKeyExists($spotter_array,'duration');
7
+$showRouteStop = $Common->multiKeyExists($spotter_array, 'route_stop');
8
+$showDuration = $Common->multiKeyExists($spotter_array, 'duration');
9 9
 
10 10
 if (!isset($_GET['sort'])) 
11 11
 {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	}
100 100
 	print '<th class="more"></th>';
101 101
 	print '</thead>';
102
-} else if (strtolower($current_page) == "upcoming"){
102
+} else if (strtolower($current_page) == "upcoming") {
103 103
 	print '<thead>';
104 104
 	if ($_GET['sort'] == "airline_name_asc")
105 105
 	{
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	}
150 150
 	*/
151 151
 	print '</thead>';
152
-} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){
152
+} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
153 153
 	print '<thead>';
154 154
 	print '<th class="aircraft_thumbnail"></th>';
155 155
 	print '<th class="logo">'._("Airline").'</th>';
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	print '</thead>';
187 187
 } else {
188 188
 
189
-	if ($hide_th_links === true){
189
+	if ($hide_th_links === true) {
190 190
 		print '<thead>';
191 191
 		print '<th class="aircraft_thumbnail"></th>';
192 192
 		if ($_GET['sort'] == "airline_name_asc")
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 }
378 378
 
379 379
 print '<tbody>'."\n";
380
-foreach($spotter_array as $spotter_item)
380
+foreach ($spotter_array as $spotter_item)
381 381
 {
382 382
 	if (isset($globalTimezone))
383 383
 	{
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
409 409
 				}
410 410
 				if (isset($spotter_item['airline_name'])) {
411
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
411
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
412 412
 				} else {
413
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
413
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
414 414
 				}
415 415
                         } else {
416 416
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
417
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
417
+                    		$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
418 418
                     		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
419 419
 				if (isset($spotter_item['airline_name'])) {
420 420
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 			print '<img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" />'."\n";
429 429
 			print '</td>'."\n";
430 430
 		}
431
-	} elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){
431
+	} elseif (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed") {
432 432
 		if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
433 433
 		    $spotter_item['squawk'] = '-';
434 434
 		}
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
445 445
 				}
446 446
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
447
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
447
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
448 448
 				} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
449
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
449
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
450 450
 				} elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) {
451
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
451
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
452 452
 				} else {
453
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
453
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
454 454
 				}
455 455
 			} else {
456 456
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
457
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
457
+                    		$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
458 458
                     		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
459 459
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
460 460
 					print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	}
518 518
 	print '</td>'."\n";
519 519
 	// Aircraft type
520
-	if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){
520
+	if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") {
521 521
 		print '<td class="type">'."\n";
522 522
 		if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) {
523 523
 			print '<span class="nomobile">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</span>'."\n";
@@ -541,22 +541,22 @@  discard block
 block discarded – undo
541 541
 		}
542 542
 		if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
543 543
 			if ($spotter_item['departure_airport_time'] > 2460) {
544
-				$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
545
-			} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
544
+				$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
545
+			} else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
546 546
 			if ($spotter_item['real_departure_airport_time'] > 2460) {
547
-				$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
547
+				$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
548 548
 			} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
549 549
 			print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
550 550
 		} elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
551 551
 			if ($spotter_item['real_departure_airport_time'] > 2460) {
552
-				$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
552
+				$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
553 553
 			} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
554 554
 			print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
555 555
 		} elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
556 556
 			if ($spotter_item['departure_airport_time'] > 2460) {
557
-				$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
557
+				$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
558 558
 			} else {
559
-				$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
559
+				$departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
560 560
 			}
561 561
 			print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n";
562 562
 		}
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 					$latitude = $spotter_item['latitude'];
572 572
 					$longitude = $spotter_item['longitude'];
573 573
 				}
574
-				$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
574
+				$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude);
575 575
 			} else $distance = '';
576 576
 			if ($distance != '') {
577 577
 			    if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -612,20 +612,20 @@  discard block
 block discarded – undo
612 612
 		}
613 613
 		if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
614 614
 			if ($spotter_item['arrival_airport_time'] > 2460) {
615
-				$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
615
+				$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
616 616
 			} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
617 617
 			if ($spotter_item['real_arrival_airport_time'] > 2460) {
618
-				$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
618
+				$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
619 619
 			} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
620 620
 			print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
621 621
 		} elseif (isset($spotter_item['real_arrival_airport_time'])) {
622 622
 			if ($spotter_item['real_arrival_airport_time'] > 2460) {
623
-				$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
623
+				$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
624 624
 			} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
625 625
 			print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
626 626
 		} elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
627 627
 			if ($spotter_item['arrival_airport_time'] > 2460) {
628
-				$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
628
+				$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
629 629
 			} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
630 630
 			print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
631 631
 		}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 					$latitude = $spotter_item['latitude'];
639 639
 					$longitude = $spotter_item['longitude'];
640 640
 				}
641
-				$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
641
+				$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude);
642 642
 			} else $distance = '';
643 643
 			if ($distance != '') {
644 644
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -659,21 +659,21 @@  discard block
 block discarded – undo
659 659
 			} else {
660 660
 				//if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') {
661 661
 				if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
662
-					print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n";
663
-					print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n";
662
+					print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n";
663
+					print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n";
664 664
 				//} elseif ($globalUnitDistance == 'mi') {
665 665
 				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
666
-					print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n";
667
-					print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n";
666
+					print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n";
667
+					print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n";
668 668
 				//} elseif ($globalUnitDistance == 'nm') {
669 669
 				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
670
-					print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n";
671
-					print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n";
670
+					print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n";
671
+					print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n";
672 672
 				}
673 673
 			}
674 674
 			print '</td>'."\n";
675 675
 		}
676
-		if(strtolower($current_page) != "upcoming"){
676
+		if (strtolower($current_page) != "upcoming") {
677 677
 			if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
678 678
 				print '<td class="pilot">'."\n";
679 679
 				if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) {
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 		//if ((isset($globalIvAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)) {
709 709
 		if ($showRouteStop) {
710 710
 		// Route stop
711
-			if(strtolower($current_page) != "upcoming"){
711
+			if (strtolower($current_page) != "upcoming") {
712 712
 				print '<td class="route_stop">'."\n";
713 713
 				if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') {
714 714
 					print '<span class="nomobile">-</span>'."\n";
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
 		}
728 728
 		if ($showDuration) {
729 729
 		// Duration
730
-			if(strtolower($current_page) != "upcoming"){
730
+			if (strtolower($current_page) != "upcoming") {
731 731
 				print '<td class="duration">'."\n";
732 732
 				if (isset($spotter_item['duration'])) {
733
-					print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
734
-					print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
733
+					print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n";
734
+					print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n";
735 735
 				} else {
736 736
 					print '<span class="nomobile">-</span>'."\n";
737 737
 					print '<span class="mobile">-</span>'."\n";
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
745 745
 		if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') {
746 746
 			print '<td class="message"><p>'."\n";
747
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
747
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
748 748
 			print '</p><p class="decode">';
749 749
 			$decode_array = json_decode($spotter_item['decode']);
750 750
 			foreach ($decode_array as $key => $value) {
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 			print '</td>'."\n";
755 755
 		} else {
756 756
 			print '<td class="message">'."\n";
757
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
757
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
758 758
 			print '</td>'."\n";
759 759
 		}
760 760
 	}
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 		}
780 780
 		print '</td>'."\n";
781 781
 		print '<td class="message">'."\n";
782
-		print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
782
+		print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
783 783
 		print '</td>'."\n";
784 784
 	}
785 785
 	if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") {
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		print '</td>'."\n";
806 806
 		*/
807 807
 		print '<td class="message">'."\n";
808
-		print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
808
+		print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
809 809
 		print '</td>'."\n";
810 810
 	}
811 811
 
Please login to merge, or discard this patch.