Completed
Push — master ( 553331...19ae00 )
by Yannick
07:35
created
install/header.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 <meta property="og:site_name" content="<?php print $globalName; ?>"/>
41 41
 
42 42
 <?php
43
-    if (!isset($_SESSION['install']) && !$globalInstalled) {
43
+	if (!isset($_SESSION['install']) && !$globalInstalled) {
44 44
 ?>
45 45
 <script language="JavaScript" type="text/javascript">
46 46
     function datasource_js() {
@@ -121,22 +121,22 @@  discard block
 block discarded – undo
121 121
     }
122 122
 </script>
123 123
 <?php
124
-    }
124
+	}
125 125
 ?>
126 126
 
127 127
 </head>
128 128
 
129 129
 <?php
130
-    if (!isset($_SESSION['install']) && !$globalInstalled) {
130
+	if (!isset($_SESSION['install']) && !$globalInstalled) {
131 131
 ?>
132 132
 
133 133
 <body class="page-<?php print strtolower($current_page); ?>" onload="datasource_js(); metarcycle_js(); create_database_js(); daemon_js(); schedule_js()">
134 134
 <?php
135
-    } else {
135
+	} else {
136 136
 ?>
137 137
     <body class="page-<?php print strtolower($current_page); ?>">
138 138
 <?php
139
-    }
139
+	}
140 140
 ?>
141 141
 <div class="navbar navbar-fixed-top" role="navigation">
142 142
     <div class="container">
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
 
188 188
 <?php
189 189
 if (isset($top_header)) {
190
-    if ($top_header != "")
191
-    {
190
+	if ($top_header != "")
191
+	{
192 192
 	print '<div class="top-header container clear" role="main">';
193 193
 		print '<img src="../images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />';
194 194
 	print '</div>';
195
-    }
195
+	}
196 196
 }
197 197
 ?>
198 198
 
Please login to merge, or discard this patch.
airport-statistics-registration.php 3 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airport');
8 8
         die();
9 9
 }
10
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
13 13
 $airport_array = $Spotter->getAllAirportInfo($airport);
14 14
 
15 15
 if (!empty($airport_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Aircraft by Registration to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Aircraft by Registration to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($_GET['airport'] == $airport_name['airport_icao'])
30
+		if ($_GET['airport'] == $airport_name['airport_icao'])
31 31
 		{
32 32
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
61
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 
63 63
 	$aircraft_array = $Spotter->countAllAircraftRegistrationByAirport($airport);
64 64
 	if (!empty($aircraft_array))
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		print '</thead>';
76 76
 		print '<tbody>';
77 77
 		$i = 1;
78
-		foreach($aircraft_array as $aircraft_item)
78
+		foreach ($aircraft_array as $aircraft_item)
79 79
 		{
80 80
 			print '<tr>';
81 81
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airport'])) {
7
-        header('Location: '.$globalURL.'/airport');
8
-        die();
7
+		header('Location: '.$globalURL.'/airport');
8
+		die();
9 9
 }
10 10
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<option></option>';
24 24
 	$Stats = new Stats();
25 25
 	$airport_names = $Stats->getAllAirportNames();
26
-	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26
+	if (empty($airport_names)) {
27
+		$airport_names = $Spotter->getAllAirportNames();
28
+	}
27 29
 	ksort($airport_names);
28 30
 	foreach($airport_names as $airport_name)
29 31
 	{
Please login to merge, or discard this patch.
airline-statistics-route.php 3 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airline');
8 8
         die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
16
+	$title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/airline" method="post">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24 24
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
25
-	foreach($airline_names as $airline_name)
25
+	foreach ($airline_names as $airline_name)
26 26
 	{
27
-		if($airline == $airline_name['airline_icao'])
27
+		if ($airline == $airline_name['airline_icao'])
28 28
 		{
29 29
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
30 30
 		} else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	include('airline-sub-menu.php');
63 63
 	 print '<div class="column">';
64 64
 	print '<h2>'._("Most Common Routes").'</h2>';
65
-	print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
65
+	print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
66 66
 	$route_array = $Spotter->countAllRoutesByAirline($airline);
67 67
 	if (!empty($route_array))
68 68
 	{
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		print '</thead>';
79 79
 		print '<tbody>';
80 80
 		$i = 1;
81
-		foreach($route_array as $route_item)
81
+		foreach ($route_array as $route_item)
82 82
 		{
83 83
 			print '<tr>';
84 84
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
24
+	if (empty($airline_names)) {
25
+		$airline_names = $Spotter->getAllAirlineNames();
26
+	}
25 27
 	foreach($airline_names as $airline_name)
26 28
 	{
27 29
 		if($airline == $airline_name['airline_icao'])
@@ -43,8 +45,7 @@  discard block
 block discarded – undo
43 45
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
44 46
 			{
45 47
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
46
-			}
47
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48 49
 			{
49 50
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
50 51
 			}
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airline'])) {
7
-        header('Location: '.$globalURL.'/airline');
8
-        die();
7
+		header('Location: '.$globalURL.'/airline');
8
+		die();
9 9
 }
10 10
 $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
Please login to merge, or discard this patch.
date-statistics-arrival-airport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
28 28
 	print '<br />';  
29 29
 	print '<div class="info column">';
30
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31 31
 	print '</div>';
32 32
 
33 33
 	include('date-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37 37
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date);
38 38
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
39 39
     	<script>
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         	["'._("Airport").'", "'._("# of times").'"],';
49 49
 
50 50
 	$airport_data = '';
51
-	foreach($airport_airport_array as $airport_item)
51
+	foreach ($airport_airport_array as $airport_item)
52 52
 	{
53 53
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
54 54
 		$name = str_replace("'", "", $name);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	print '</thead>';
88 88
 	print '<tbody>';
89 89
 	$i = 1;
90
-	foreach($airport_airport_array as $airport_item)
90
+	foreach ($airport_airport_array as $airport_item)
91 91
 	{
92 92
 		print '<tr>';
93 93
 		print '<td><strong>'.$i.'</strong></td>';
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	$title = _("Unknown Date");
113 113
 	require_once('header.php');
114 114
 	print '<h1>'._("Error").'</h1>';
115
-	print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>';
115
+	print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>';
116 116
 }
117 117
 
118 118
 require_once('footer.php');
Please login to merge, or discard this patch.
manufacturer-statistics-departure-airport.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Departure Airports from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Departure Airports from %s"), $manufacturer);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25 25
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
-	foreach($all_manufacturers as $all_manufacturer)
26
+	foreach ($all_manufacturers as $all_manufacturer)
27 27
 	{
28
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
28
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
29 29
 		{
30 30
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
31 31
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	include('manufacturer-sub-menu.php');
45 45
 	print '<div class="column">';
46 46
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
47
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$manufacturer).'</p>';
47
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $manufacturer).'</p>';
48 48
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByManufacturer($manufacturer);
49 49
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
50 50
     	<script>
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         	["'._("Airport").'", "'._("# of times").'"],';
60 60
 
61 61
 	$airport_data = '';
62
-	foreach($airport_airport_array as $airport_item)
62
+	foreach ($airport_airport_array as $airport_item)
63 63
 	{
64 64
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
65 65
 		$name = str_replace("'", "", $name);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	print '</thead>';
99 99
 	print '<tbody>';
100 100
 	$i = 1;
101
-	foreach($airport_airport_array as $airport_item)
101
+	foreach ($airport_airport_array as $airport_item)
102 102
 	{
103 103
 		print '<tr>';
104 104
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@
 block discarded – undo
22 22
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25
-	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
25
+	if (empty($all_manufacturers)) {
26
+		$all_manufacturers = $Spotter->getAllManufacturers();
27
+	}
26 28
 	foreach($all_manufacturers as $all_manufacturer)
27 29
 	{
28 30
 		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['aircraft_manufacturer'])) {
7
-        header('Location: '.$globalURL.'/manufacturer');
8
-        die();
7
+		header('Location: '.$globalURL.'/manufacturer');
8
+		die();
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.
aircraft.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes();
20 20
 	$previous = null;
21 21
 	print '<div class="alphabet-legend">';
22
-	foreach($aircraft_types as $value) {
22
+	foreach ($aircraft_types as $value) {
23 23
 		//$firstLetter = substr($value['aircraft_name'], 0, 1);
24 24
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
25
-		if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
25
+		if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
26 26
 		{
27 27
 			if ($previous !== null) print ' | ';
28 28
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 	print '</div>';
33 33
 	$previous = null;
34
-	foreach($aircraft_types as $value) {
34
+	foreach ($aircraft_types as $value) {
35 35
 		//$firstLetter = substr($value['aircraft_name'], 0, 1);
36 36
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
37 37
 		if ($firstLetter != "")
38 38
 		{
39
-			if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
39
+			if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
40 40
 			{
41 41
 				if ($previous !== null) print '</div>';
42 42
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 	print '<h1>'._("Aircrafts Types").'</h1>';
17 17
 
18 18
 	$aircraft_types = $Stats->getAllAircraftTypes();
19
-	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes();
19
+	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') {
20
+		$aircraft_types = $Spotter->getAllAircraftTypes();
21
+	}
20 22
 	$previous = null;
21 23
 	print '<div class="alphabet-legend">';
22 24
 	foreach($aircraft_types as $value) {
@@ -24,10 +26,14 @@  discard block
 block discarded – undo
24 26
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
25 27
 		if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
26 28
 		{
27
-			if ($previous !== null) print ' | ';
29
+			if ($previous !== null) {
30
+				print ' | ';
31
+			}
28 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
29 33
 		}
30
-		if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
34
+		if ($firstLetter != '(' && $firstLetter != ')') {
35
+			$previous = $firstLetter;
36
+		}
31 37
 	}
32 38
 	print '</div>';
33 39
 	$previous = null;
@@ -38,10 +44,14 @@  discard block
 block discarded – undo
38 44
 		{
39 45
 			if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
40 46
 			{
41
-				if ($previous !== null) print '</div>';
47
+				if ($previous !== null) {
48
+					print '</div>';
49
+				}
42 50
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
43 51
 			}
44
-			if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
52
+			if ($firstLetter != '(' && $firstLetter != ')') {
53
+				$previous = $firstLetter;
54
+			}
45 55
 			print '<div class="alphabet-item">';
46 56
 			print '<a href="'.$globalURL.'/aircraft/'.$value['aircraft_icao'].'">';
47 57
 			if ($value['aircraft_name'] == '') {
Please login to merge, or discard this patch.
require/class.Accident.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
23 23
 	}
24 24
 	
25 25
 	/**
26
-	* Get Accidents data from DB
27
-	* @param String $limit Limit
28
-	* @param String $type Set type accident or incident
29
-	* @param String $date get data for a date
30
-	* @return Array Return Accidents data in array
31
-	*/
26
+	 * Get Accidents data from DB
27
+	 * @param String $limit Limit
28
+	 * @param String $type Set type accident or incident
29
+	 * @param String $date get data for a date
30
+	 * @return Array Return Accidents data in array
31
+	 */
32 32
 	public function getAccidentData($limit = '',$type = '',$date = '') {
33 33
 		global $globalURL, $globalDBdriver;
34 34
 		$Image = new Image($this->db);
Please login to merge, or discard this patch.
Braces   +75 added lines, -27 removed lines patch added patch discarded remove patch
@@ -96,8 +96,11 @@  discard block
 block discarded – undo
96 96
 			$data = array();
97 97
 			if ($row['registration'] != '') {
98 98
 				$image_array = $Image->getSpotterImage($row['registration']);
99
-				if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website']));
100
-				else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
99
+				if (count($image_array) > 0) {
100
+					$data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website']));
101
+				} else {
102
+					$data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
103
+				}
101 104
 				$aircraft_type = $Spotter->getAllAircraftTypeByRegistration($row['registration']);
102 105
 				$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type);
103 106
 				if (!empty($aircraft_info)) {
@@ -113,17 +116,30 @@  discard block
 block discarded – undo
113 116
 					$data['aircraft_base'] = $owner_data['base'];
114 117
 					$data['aircraft_date_first_reg'] = $owner_data['date_first_reg'];
115 118
 				}
116
-			} else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
117
-			if ($row['registration'] == '') $row['registration'] = 'NA';
118
-			if ($row['ident'] == '') $row['ident'] = 'NA';
119
+			} else {
120
+				$data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
121
+			}
122
+			if ($row['registration'] == '') {
123
+				$row['registration'] = 'NA';
124
+			}
125
+			if ($row['ident'] == '') {
126
+				$row['ident'] = 'NA';
127
+			}
119 128
 			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,3));
120 129
 			if (isset($identicao[0])) {
121 130
 				if (substr($row['ident'],0,2) == 'AF') {
122
-					if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
123
-					else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0');
124
-				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0');
131
+					if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) {
132
+						$icao = $row['ident'];
133
+					} else {
134
+						$icao = 'AFR'.ltrim(substr($row['ident'],2),'0');
135
+					}
136
+				} else {
137
+					$icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0');
138
+				}
125 139
 				$data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name']));
126
-			} else $icao = $row['ident'];
140
+			} else {
141
+				$icao = $row['ident'];
142
+			}
127 143
 			$icao = $Translation->checkTranslation($icao,false);
128 144
 			//$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url']));
129 145
 			if ($row['airline_name'] != '' && !isset($data['airline_name'])) {
@@ -138,10 +154,14 @@  discard block
 block discarded – undo
138 154
 				//else echo 'No data...'."\n";
139 155
 			}
140 156
 			$data = array_merge($row,$data);
141
-			if ($data['ident'] == null) $data['ident'] = $icao;
157
+			if ($data['ident'] == null) {
158
+				$data['ident'] = $icao;
159
+			}
142 160
 			if ($data['title'] == null) {
143 161
 				$data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country'];
144
-			} else $data['message'] = strtolower($data['title']);
162
+			} else {
163
+				$data['message'] = strtolower($data['title']);
164
+			}
145 165
 			$ids = $Spotter->getAllIDByRegistration($data['registration']);
146 166
 			$date = $data['date'];
147 167
 			if (isset($ids[$date])) {
@@ -158,8 +178,9 @@  discard block
 block discarded – undo
158 178
 		if (isset($result)) {
159 179
 			$result[0]['query_number_rows'] = $i;
160 180
 			return $result;
181
+		} else {
182
+			return array();
161 183
 		}
162
-		else return array();
163 184
 	}
164 185
 	
165 186
 	/*
@@ -198,7 +219,9 @@  discard block
 block discarded – undo
198 219
 	*/
199 220
 	public function import($file) {
200 221
 		global $globalTransaction, $globalDebug;
201
-		if ($globalDebug) echo 'Import '.$file."\n";
222
+		if ($globalDebug) {
223
+			echo 'Import '.$file."\n";
224
+		}
202 225
 		$result = array();
203 226
 		if (file_exists($file)) {
204 227
 			if (($handle = fopen($file,'r')) !== FALSE) {
@@ -209,8 +232,11 @@  discard block
 block discarded – undo
209 232
 				}
210 233
 				fclose($handle);
211 234
 			}
212
-			if (!empty($result)) $this->add($result,true);
213
-			elseif ($globalDebug) echo 'Nothing to import';
235
+			if (!empty($result)) {
236
+				$this->add($result,true);
237
+			} elseif ($globalDebug) {
238
+				echo 'Nothing to import';
239
+			}
214 240
 		}
215 241
 	}
216 242
 
@@ -246,14 +272,23 @@  discard block
 block discarded – undo
246 272
 					}
247 273
 				}
248 274
 				fclose($handle);
249
-			} elseif ($globalDebug) echo "Can't open ".dirname(__FILE__).'/../install/tmp/cr-all.md5';
250
-		} elseif ($globalDebug) echo 'Download cr-all.md5 failed. '.dirname(__FILE__).'/../install/tmp/cr-all.md5 not here.';
275
+			} elseif ($globalDebug) {
276
+				echo "Can't open ".dirname(__FILE__).'/../install/tmp/cr-all.md5';
277
+			}
278
+		} elseif ($globalDebug) {
279
+			echo 'Download cr-all.md5 failed. '.dirname(__FILE__).'/../install/tmp/cr-all.md5 not here.';
280
+		}
251 281
 		$result = $Common->arr_diff($all_md5_new,$all_md5);
252
-		if (empty($result) && $globalDebug) echo 'Nothing to update';
282
+		if (empty($result) && $globalDebug) {
283
+			echo 'Nothing to update';
284
+		}
253 285
 		foreach ($result as $file => $md5) {
254 286
 			$Common->download('http://data.flightairmap.fr/data/cr/'.$file,dirname(__FILE__).'/../install/tmp/'.$file);
255
-			if (file_exists(dirname(__FILE__).'/../install/tmp/'.$file)) $this->import(dirname(__FILE__).'/../install/tmp/'.$file);
256
-			elseif ($globalDebug) echo 'Download '.$file.' failed';
287
+			if (file_exists(dirname(__FILE__).'/../install/tmp/'.$file)) {
288
+				$this->import(dirname(__FILE__).'/../install/tmp/'.$file);
289
+			} elseif ($globalDebug) {
290
+				echo 'Download '.$file.' failed';
291
+			}
257 292
 		}
258 293
 	}
259 294
 
@@ -270,13 +305,17 @@  discard block
 block discarded – undo
270 305
 		$Image = new Image();
271 306
 		$Spotter = new Spotter();
272 307
 
273
-		if (empty($crash)) return false;
308
+		if (empty($crash)) {
309
+			return false;
310
+		}
274 311
 		if (!$new) {
275 312
 			$query_delete = 'DELETE FROM accidents WHERE source = :source';
276 313
 			$sthd = $Connection->db->prepare($query_delete);
277 314
 			$sthd->execute(array(':source' => $crash[0]['source']));
278 315
 		}
279
-		if ($globalTransaction) $Connection->db->beginTransaction();
316
+		if ($globalTransaction) {
317
+			$Connection->db->beginTransaction();
318
+		}
280 319
 		$initial_array = array('ident' => null,'type' => 'accident','url' => null,'registration' => null, 'date' => null, 'place' => null,'country' => null, 'latitude' => null, 'longitude' => null, 'fatalities' => null, 'title' => '','source' => '','aircraft_manufacturer' => null,'aircraft_name' => null,'operator' => null);
281 320
 		$query_check = 'SELECT COUNT(*) as nb FROM accidents WHERE registration = :registration AND date = :date AND type = :type AND source = :source';
282 321
 		$sth_check = $Connection->db->prepare($query_check);
@@ -291,7 +330,9 @@  discard block
 block discarded – undo
291 330
 					return $value === "" ? NULL : $value;
292 331
 				}, $cr);
293 332
 				if ($cr['date'] != '' && $cr['registration'] != null && $cr['registration'] != '' && $cr['registration'] != '?' && $cr['registration'] != '-' && strtolower($cr['registration']) != 'unknown' && $cr['date'] < time() && !preg_match('/\s/',$cr['registration'])) {
294
-					if (strpos($cr['registration'],'-') === FALSE) $cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']);
333
+					if (strpos($cr['registration'],'-') === FALSE) {
334
+						$cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']);
335
+					}
295 336
 					$query_check_values = array(':registration' => $cr['registration'],':date' => date('Y-m-d',$cr['date']),':type' => $cr['type'],':source' => $cr['source']);
296 337
 					$sth_check->execute($query_check_values);
297 338
 					$result_check = $sth_check->fetch(PDO::FETCH_ASSOC);
@@ -313,9 +354,13 @@  discard block
 block discarded – undo
313 354
 					$Connection->db->beginTransaction();
314 355
 				}
315 356
 			}
316
-			if ($globalTransaction) $Connection->db->commit();
357
+			if ($globalTransaction) {
358
+				$Connection->db->commit();
359
+			}
317 360
 		} catch(PDOException $e) {
318
-			if ($globalTransaction) $Connection->db->rollBack();
361
+			if ($globalTransaction) {
362
+				$Connection->db->rollBack();
363
+			}
319 364
 			echo $e->getMessage();
320 365
 		}
321 366
 		$sth_check->closeCursor();
@@ -354,8 +399,11 @@  discard block
 block discarded – undo
354 399
 			return "error : ".$e->getMessage();
355 400
 		}
356 401
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
357
-		if ($row['nb'] > 0) return false;
358
-		else return true;
402
+		if ($row['nb'] > 0) {
403
+			return false;
404
+		} else {
405
+			return true;
406
+		}
359 407
 	}
360 408
 
361 409
 	public static function insert_last_accidents_update() {
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
 	* @param String $date get data for a date
30 30
 	* @return Array Return Accidents data in array
31 31
 	*/
32
-	public function getAccidentData($limit = '',$type = '',$date = '') {
32
+	public function getAccidentData($limit = '', $type = '', $date = '') {
33 33
 		global $globalURL, $globalDBdriver;
34 34
 		$Image = new Image($this->db);
35 35
 		$Spotter = new Spotter($this->db);
36 36
 		$Translation = new Translation($this->db);
37
-		$date = filter_var($date,FILTER_SANITIZE_STRING);
37
+		$date = filter_var($date, FILTER_SANITIZE_STRING);
38 38
 		date_default_timezone_set('UTC');
39 39
 		$result = array();
40 40
 		$limit_query = '';
41 41
 		if ($limit != "")
42 42
 		{
43 43
 			$limit_array = explode(",", $limit);
44
-			$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
45
-			$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
44
+			$limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT);
45
+			$limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT);
46 46
 			if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
47 47
 			{
48 48
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
@@ -51,29 +51,29 @@  discard block
 block discarded – undo
51 51
 
52 52
 		if ($type != '') {
53 53
 			if ($date != '') {
54
-				if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/",$date)) {
54
+				if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $date)) {
55 55
 					$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
56 56
 					//$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
57
-					$query_values = array(':type' => $type,':date' => $date);
58
-				} elseif (preg_match("/^[0-9]{4}-[0-9]{2}$/",$date)) {
57
+					$query_values = array(':type' => $type, ':date' => $date);
58
+				} elseif (preg_match("/^[0-9]{4}-[0-9]{2}$/", $date)) {
59 59
 					$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND date BETWEEN :dated AND :datef GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
60
-					$query_values = array(':type' => $type,':dated' => $date.'-01', ':datef' => $date.'-31');
61
-				} elseif (preg_match("/^[0-9]{4}$/",$date)) {
60
+					$query_values = array(':type' => $type, ':dated' => $date.'-01', ':datef' => $date.'-31');
61
+				} elseif (preg_match("/^[0-9]{4}$/", $date)) {
62 62
 					if ($globalDBdriver == 'mysql') {
63 63
 						$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND YEAR(date) = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
64 64
 					} else {
65 65
 						$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND EXTRACT(YEAR FROM date) = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
66 66
 					}
67
-					$query_values = array(':type' => $type,':date' => $date);
67
+					$query_values = array(':type' => $type, ':date' => $date);
68 68
 				} else {
69 69
 					$date = $date.'%';
70 70
 					if ($globalDBdriver == 'mysql') {
71 71
 						$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND DATE_FORMAT(date,'%Y-%m-%d') LIKE :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
72
-						$query_values = array(':type' => $type,':date' => $date);
72
+						$query_values = array(':type' => $type, ':date' => $date);
73 73
 					} else {
74 74
 						$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND to_char(date,'YYYY-MM-DD') LIKE :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
75 75
 						//$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND to_char(date,'YYYY-MM-DD') LIKE :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
76
-						$query_values = array(':type' => $type,':date' => $date);
76
+						$query_values = array(':type' => $type, ':date' => $date);
77 77
 					}
78 78
 				}
79 79
 			} else {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			}
84 84
 		} else {
85 85
 			if ($date != '') {
86
-				if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/",$date)) {
86
+				if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $date)) {
87 87
 					$query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
88 88
 					//$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query;
89 89
 				} else {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		try {
103 103
 			$sth = $this->db->prepare($query);
104 104
 			$sth->execute($query_values);
105
-		} catch(PDOException $e) {
105
+		} catch (PDOException $e) {
106 106
 			echo "error : ".$e->getMessage();
107 107
 		}
108 108
 		$i = 0;
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 			$data = array();
113 113
 			if ($row['registration'] != '') {
114 114
 				$image_array = $Image->getSpotterImage($row['registration']);
115
-				if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website']));
116
-				else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
115
+				if (count($image_array) > 0) $data = array_merge($data, array('image' => $image_array[0]['image'], 'image_thumbnail' => $image_array[0]['image_thumbnail'], 'image_copyright' => $image_array[0]['image_copyright'], 'image_source' => $image_array[0]['image_source'], 'image_source_website' => $image_array[0]['image_source_website']));
116
+				else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
117 117
 				$aircraft_type = $Spotter->getAllAircraftTypeByRegistration($row['registration']);
118 118
 				$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type);
119 119
 				if (!empty($aircraft_info)) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 					$data['aircraft_name'] = $aircraft_info[0]['type'];
122 122
 					$data['aircraft_manufacturer'] = $aircraft_info[0]['manufacturer'];
123 123
 				} else {
124
-					$data = array_merge($data,array('aircraft_type' => 'NA'));
124
+					$data = array_merge($data, array('aircraft_type' => 'NA'));
125 125
 				}
126 126
 				$owner_data = $Spotter->getAircraftOwnerByRegistration($row['registration']);
127 127
 				if (!empty($owner_data)) {
@@ -129,18 +129,18 @@  discard block
 block discarded – undo
129 129
 					$data['aircraft_base'] = $owner_data['base'];
130 130
 					$data['aircraft_date_first_reg'] = $owner_data['date_first_reg'];
131 131
 				}
132
-			} else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
132
+			} else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
133 133
 			if ($row['registration'] == '') $row['registration'] = 'NA';
134 134
 			if ($row['ident'] == '') $row['ident'] = 'NA';
135
-			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,3));
135
+			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 3));
136 136
 			if (isset($identicao[0])) {
137
-				if (substr($row['ident'],0,2) == 'AF') {
138
-					if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
139
-					else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0');
140
-				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0');
141
-				$data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name']));
137
+				if (substr($row['ident'], 0, 2) == 'AF') {
138
+					if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
139
+					else $icao = 'AFR'.ltrim(substr($row['ident'], 2), '0');
140
+				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'], 2), '0');
141
+				$data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name']));
142 142
 			} else $icao = $row['ident'];
143
-			$icao = $Translation->checkTranslation($icao,false);
143
+			$icao = $Translation->checkTranslation($icao, false);
144 144
 			//$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url']));
145 145
 			if ($row['airline_name'] != '' && !isset($data['airline_name'])) {
146 146
 				//echo 'Check airline info... for '.$row['airline_name'].' ';
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 				if (!empty($airline_info)) {
150 150
 					//echo 'data found !'."\n";
151 151
 					//print_r($airline_info);
152
-					$data = array_merge($data,$airline_info);
152
+					$data = array_merge($data, $airline_info);
153 153
 				} 
154 154
 				//else echo 'No data...'."\n";
155 155
 			}
156
-			$data = array_merge($row,$data);
156
+			$data = array_merge($row, $data);
157 157
 			if ($data['ident'] == null) $data['ident'] = $icao;
158 158
 			if ($data['title'] == null) {
159 159
 				$data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country'];
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		try {
188 188
 			$sth = $this->db->prepare($query);
189 189
 			$sth->execute();
190
-		} catch(PDOException $e) {
190
+		} catch (PDOException $e) {
191 191
 			echo "Error : ".$e->getMessage();
192 192
 		}
193 193
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		try {
208 208
 			$sth = $this->db->prepare($query);
209 209
 			$sth->execute();
210
-		} catch(PDOException $e) {
210
+		} catch (PDOException $e) {
211 211
 			echo "Error : ".$e->getMessage();
212 212
 		}
213 213
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -222,15 +222,15 @@  discard block
 block discarded – undo
222 222
 		if ($globalDebug) echo 'Import '.$file."\n";
223 223
 		$result = array();
224 224
 		if (file_exists($file)) {
225
-			if (($handle = fopen($file,'r')) !== FALSE) {
226
-				while (($data = fgetcsv($handle,2000,",")) !== FALSE) {
225
+			if (($handle = fopen($file, 'r')) !== FALSE) {
226
+				while (($data = fgetcsv($handle, 2000, ",")) !== FALSE) {
227 227
 					if (isset($data[1]) && $data[1] != '0000-00-00 00:00:00') {
228
-						$result[] = array('registration' => $data[0],'date' => strtotime($data[1]),'url' => $data[2],'country' => $data[3],'place' => $data[4],'title' => $data[5],'fatalities' => $data[6],'latitude' => $data[7],'longitude' => $data[8],'type' => $data[9],'ident' => $data[10],'aircraft_manufacturer' => $data[11],'aircraft_name' => $data[12],'operator' => $data[13],'source' => 'website_fam');
228
+						$result[] = array('registration' => $data[0], 'date' => strtotime($data[1]), 'url' => $data[2], 'country' => $data[3], 'place' => $data[4], 'title' => $data[5], 'fatalities' => $data[6], 'latitude' => $data[7], 'longitude' => $data[8], 'type' => $data[9], 'ident' => $data[10], 'aircraft_manufacturer' => $data[11], 'aircraft_name' => $data[12], 'operator' => $data[13], 'source' => 'website_fam');
229 229
 					}
230 230
 				}
231 231
 				fclose($handle);
232 232
 			}
233
-			if (!empty($result)) $this->add($result,true);
233
+			if (!empty($result)) $this->add($result, true);
234 234
 			elseif ($globalDebug) echo 'Nothing to import';
235 235
 		}
236 236
 	}
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 		$all_md5_new = array();
247 247
 		if (file_exists(dirname(__FILE__).'/../install/tmp/cr-all.md5')) {
248 248
 			if ($this->check_accidents_nb() > 0) {
249
-				if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5','r')) !== FALSE) {
250
-					while (($data = fgetcsv($handle,2000,"\t")) !== FALSE) {
249
+				if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5', 'r')) !== FALSE) {
250
+					while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) {
251 251
 						if (isset($data[1])) {
252 252
 							$year = $data[0];
253 253
 							$all_md5[$year] = $data[1];
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 				}
258 258
 			}
259 259
 		}
260
-		$Common->download('http://data.flightairmap.fr/data/cr/cr-all.md5',dirname(__FILE__).'/../install/tmp/cr-all.md5');
260
+		$Common->download('http://data.flightairmap.fr/data/cr/cr-all.md5', dirname(__FILE__).'/../install/tmp/cr-all.md5');
261 261
 		if (file_exists(dirname(__FILE__).'/../install/tmp/cr-all.md5')) {
262
-			if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5','r')) !== FALSE) {
263
-				while (($data = fgetcsv($handle,2000,"\t")) !== FALSE) {
262
+			if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5', 'r')) !== FALSE) {
263
+				while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) {
264 264
 					if (isset($data[1])) {
265 265
 						$year = $data[0];
266 266
 						$all_md5_new[$year] = $data[1];
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 				fclose($handle);
270 270
 			} elseif ($globalDebug) echo "Can't open ".dirname(__FILE__).'/../install/tmp/cr-all.md5';
271 271
 		} elseif ($globalDebug) echo 'Download cr-all.md5 failed. '.dirname(__FILE__).'/../install/tmp/cr-all.md5 not here.';
272
-		$result = $Common->arr_diff($all_md5_new,$all_md5);
272
+		$result = $Common->arr_diff($all_md5_new, $all_md5);
273 273
 		if (empty($result) && $globalDebug) echo 'Nothing to update';
274 274
 		foreach ($result as $file => $md5) {
275
-			$Common->download('http://data.flightairmap.fr/data/cr/'.$file,dirname(__FILE__).'/../install/tmp/'.$file);
275
+			$Common->download('http://data.flightairmap.fr/data/cr/'.$file, dirname(__FILE__).'/../install/tmp/'.$file);
276 276
 			if (file_exists(dirname(__FILE__).'/../install/tmp/'.$file)) $this->import(dirname(__FILE__).'/../install/tmp/'.$file);
277 277
 			elseif ($globalDebug) echo 'Download '.$file.' failed';
278 278
 		}
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	* Add data to DB
283 283
 	* @param Array $crash An array with accidents/incidents data
284 284
 	*/
285
-	public function add($crash,$new = false) {
285
+	public function add($crash, $new = false) {
286 286
 		global $globalTransaction, $globalDebug;
287 287
 		require_once('class.Connection.php');
288 288
 		require_once('class.Image.php');
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 			$sthd->execute(array(':source' => $crash[0]['source']));
299 299
 		}
300 300
 		if ($globalTransaction) $Connection->db->beginTransaction();
301
-		$initial_array = array('ident' => null,'type' => 'accident','url' => null,'registration' => null, 'date' => null, 'place' => null,'country' => null, 'latitude' => null, 'longitude' => null, 'fatalities' => null, 'title' => '','source' => '','aircraft_manufacturer' => null,'aircraft_name' => null,'operator' => null);
301
+		$initial_array = array('ident' => null, 'type' => 'accident', 'url' => null, 'registration' => null, 'date' => null, 'place' => null, 'country' => null, 'latitude' => null, 'longitude' => null, 'fatalities' => null, 'title' => '', 'source' => '', 'aircraft_manufacturer' => null, 'aircraft_name' => null, 'operator' => null);
302 302
 		$query_check = 'SELECT COUNT(*) as nb FROM accidents WHERE registration = :registration AND date = :date AND type = :type AND source = :source';
303 303
 		$sth_check = $Connection->db->prepare($query_check);
304 304
 		$query = 'INSERT INTO accidents (aircraft_manufacturer,aircraft_name,ident,registration,date,url,country,place,title,fatalities,latitude,longitude,type,airline_name,source) VALUES (:aircraft_manufacturer,:aircraft_name,:ident,:registration,:date,:url,:country,:place,:title,:fatalities,:latitude,:longitude,:type,:airline_name,:source)';
@@ -311,31 +311,31 @@  discard block
 block discarded – undo
311 311
 				$cr = array_map(function($value) {
312 312
 					return $value === "" ? NULL : $value;
313 313
 				}, $cr);
314
-				if ($cr['date'] != '' && $cr['registration'] != null && $cr['registration'] != '' && $cr['registration'] != '?' && $cr['registration'] != '-' && strtolower($cr['registration']) != 'unknown' && $cr['date'] < time() && !preg_match('/\s/',$cr['registration'])) {
315
-					if (strpos($cr['registration'],'-') === FALSE) $cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']);
316
-					$query_check_values = array(':registration' => $cr['registration'],':date' => date('Y-m-d',$cr['date']),':type' => $cr['type'],':source' => $cr['source']);
314
+				if ($cr['date'] != '' && $cr['registration'] != null && $cr['registration'] != '' && $cr['registration'] != '?' && $cr['registration'] != '-' && strtolower($cr['registration']) != 'unknown' && $cr['date'] < time() && !preg_match('/\s/', $cr['registration'])) {
315
+					if (strpos($cr['registration'], '-') === FALSE) $cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']);
316
+					$query_check_values = array(':registration' => $cr['registration'], ':date' => date('Y-m-d', $cr['date']), ':type' => $cr['type'], ':source' => $cr['source']);
317 317
 					$sth_check->execute($query_check_values);
318 318
 					$result_check = $sth_check->fetch(PDO::FETCH_ASSOC);
319 319
 					if ($result_check['nb'] == 0) {
320
-						$query_values = array(':registration' => trim($cr['registration']),':date' => date('Y-m-d',$cr['date']),':url' => $cr['url'],':country' => $cr['country'],':place' => $cr['place'],':title' => $cr['title'],':fatalities' => $cr['fatalities'],':latitude' => $cr['latitude'],':longitude' => $cr['longitude'],':type' => $cr['type'],':source' => $cr['source'],':ident' => $cr['ident'],':aircraft_manufacturer' => $cr['aircraft_manufacturer'],':aircraft_name' => $cr['aircraft_name'],':airline_name' => $cr['operator']);
320
+						$query_values = array(':registration' => trim($cr['registration']), ':date' => date('Y-m-d', $cr['date']), ':url' => $cr['url'], ':country' => $cr['country'], ':place' => $cr['place'], ':title' => $cr['title'], ':fatalities' => $cr['fatalities'], ':latitude' => $cr['latitude'], ':longitude' => $cr['longitude'], ':type' => $cr['type'], ':source' => $cr['source'], ':ident' => $cr['ident'], ':aircraft_manufacturer' => $cr['aircraft_manufacturer'], ':aircraft_name' => $cr['aircraft_name'], ':airline_name' => $cr['operator']);
321 321
 						$sth->execute($query_values);
322
-						if ($cr['date'] > time()-(30*86400)) {
322
+						if ($cr['date'] > time() - (30*86400)) {
323 323
 							if (empty($Image->getSpotterImage($cr['registration']))) {
324 324
 								//if ($globalDebug) echo 'Get image...'."\n";
325 325
 								$Image->addSpotterImage($cr['registration']);
326 326
 							}
327 327
 							// elseif ($globalDebug) echo 'Image already in DB'."\n";
328 328
 						}
329
-						$Spotter->setHighlightFlightByRegistration($cr['registration'],$cr['title'],date('Y-m-d',$cr['date']));
329
+						$Spotter->setHighlightFlightByRegistration($cr['registration'], $cr['title'], date('Y-m-d', $cr['date']));
330 330
 					}
331 331
 				}
332
-				if ($globalTransaction && $j % 1000 == 0) {
332
+				if ($globalTransaction && $j%1000 == 0) {
333 333
 					$Connection->db->commit();
334 334
 					$Connection->db->beginTransaction();
335 335
 				}
336 336
 			}
337 337
 			if ($globalTransaction) $Connection->db->commit();
338
-		} catch(PDOException $e) {
338
+		} catch (PDOException $e) {
339 339
 			if ($globalTransaction) $Connection->db->rollBack();
340 340
 			echo $e->getMessage();
341 341
 		}
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			$Connection = new Connection();
354 354
 			$sth = $Connection->db->prepare($query);
355 355
 			$sth->execute();
356
-		} catch(PDOException $e) {
356
+		} catch (PDOException $e) {
357 357
 			return "error : ".$e->getMessage();
358 358
 		}
359 359
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			$Connection = new Connection();
372 372
 			$sth = $Connection->db->prepare($query);
373 373
 			$sth->execute();
374
-		} catch(PDOException $e) {
374
+		} catch (PDOException $e) {
375 375
 			return "error : ".$e->getMessage();
376 376
 		}
377 377
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			$Connection = new Connection();
387 387
 			$sth = $Connection->db->prepare($query);
388 388
 			$sth->execute();
389
-		} catch(PDOException $e) {
389
+		} catch (PDOException $e) {
390 390
 			return "error : ".$e->getMessage();
391 391
 		}
392 392
 	}
Please login to merge, or discard this patch.
statistics-fatalities-year.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             	["'._("Year").'", "'._("# of Fatalities").'"], ';
24 24
 
25 25
 $date_data = '';
26
-foreach($date_array as $date_item)
26
+foreach ($date_array as $date_item)
27 27
 {
28 28
 	$date_data .= '[ "'.$date_item['year'].'",'.$date_item['count'].'],';
29 29
 }
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 
51 51
 if (!empty($date_array))
52 52
 {
53
-	foreach($date_array as $key => $row) {
53
+	foreach ($date_array as $key => $row) {
54 54
 		$years[$key] = $row['year'];
55 55
 		$counts[$key] = $row['count'];
56 56
 	}
57 57
 	//array_multisort($years,SORT_DESC,$date_array);
58
-	array_multisort($counts,SORT_DESC,$date_array);
58
+	array_multisort($counts, SORT_DESC, $date_array);
59 59
 	print '<div class="table-responsive">';
60 60
 	print '<table class="common-date table-striped">';
61 61
 	print '<thead>';
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	print '</thead>';
66 66
 	print '<tbody>';
67 67
 	$i = 1;
68
-	foreach($date_array as $date_item)
68
+	foreach ($date_array as $date_item)
69 69
 	{
70 70
 		print '<tr>';
71 71
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
table-output.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
 				else {
391 391
 					$planespotter_url_array = explode("_", $spotter_item['image']);
392 392
 					$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
393
-                                        $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
393
+										$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
394 394
 				}
395 395
 				if (isset($spotter_item['airline_name'])) {
396 396
 					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>';
397 397
 				} else {
398 398
 					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>';
399 399
 				}
400
-                        } else {
401
-                    		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
402
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
403
-                    		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
400
+						} else {
401
+							if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
402
+							$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
403
+							} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
404 404
 				if (isset($spotter_item['airline_name'])) {
405 405
 					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>';
406 406
 				} else {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		}
416 416
 	} 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"){
417 417
 		if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
418
-		    $spotter_item['squawk'] = '-';
418
+			$spotter_item['squawk'] = '-';
419 419
 		}
420 420
 		if ($spotter_item['image_thumbnail'] != "")
421 421
 		{
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 				else {
427 427
 					$planespotter_url_array = explode("_", $spotter_array[0]['image']);
428 428
 					$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
429
-                                        $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
429
+										$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
430 430
 				}
431 431
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
432 432
 					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>';
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
 					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>';
439 439
 				}
440 440
 			} else {
441
-                    		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
442
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
443
-                    		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
441
+							if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
442
+							$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
443
+							} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
444 444
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
445 445
 					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>';
446 446
 				} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 			print '</td>'."\n";
455 455
 		} else {
456 456
 			print '<td class="aircraft_thumbnail">'."\n";
457
-       //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
457
+	   //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
458 458
 	//}
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="'.$globalURL.'/images/placeholder_thumb.png" 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:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n";
@@ -559,13 +559,13 @@  discard block
 block discarded – undo
559 559
 				$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
560 560
 			} else $distance = '';
561 561
 			if ($distance != '') {
562
-			    if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
563
-				    echo '<br/><i>'.round($distance*0.539957).' nm</i>';
564
-			    } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
565
-				    echo '<br/><i>'.round($distance*0.621371).' mi</i>';
566
-			    } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
567
-				    echo '<br/><i>'.$distance.' km</i>';
568
-			    }
562
+				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
563
+					echo '<br/><i>'.round($distance*0.539957).' nm</i>';
564
+				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
565
+					echo '<br/><i>'.round($distance*0.621371).' mi</i>';
566
+				} elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
567
+					echo '<br/><i>'.$distance.' km</i>';
568
+				}
569 569
 			}
570 570
 		}
571 571
 		print '</td>'."\n";
Please login to merge, or discard this 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.
Braces   +48 added lines, -18 removed lines patch added patch discarded remove patch
@@ -382,7 +382,9 @@  discard block
 block discarded – undo
382 382
 	if (isset($globalTimezone))
383 383
 	{
384 384
 		date_default_timezone_set($globalTimezone);
385
-	} else date_default_timezone_set('UTC');
385
+	} else {
386
+		date_default_timezone_set('UTC');
387
+	}
386 388
 	if ($showSpecial === true)
387 389
 	{
388 390
 		print '<tr class="special">'."\n";
@@ -397,7 +399,9 @@  discard block
 block discarded – undo
397 399
 			print '<tr class="active">';
398 400
 		} elseif (isset($spotter_item['spotted_registration'])) {
399 401
 			print '<tr class="info">';
400
-		} else print '<tr>';
402
+		} else {
403
+			print '<tr>';
404
+		}
401 405
 	}
402 406
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") {
403 407
 		if ($spotter_item['image_thumbnail'] != "")
@@ -405,8 +409,9 @@  discard block
 block discarded – undo
405 409
 			print '<td class="aircraft_thumbnail">'."\n";
406 410
 			
407 411
 			if ($spotter_item['image_source'] == 'planespotters') {
408
-				if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
409
-				else {
412
+				if ($spotter_item['image_source_website'] != '') {
413
+					$image_src = $spotter_item['image_source_website'];
414
+				} else {
410 415
 					$planespotter_url_array = explode("_", $spotter_item['image']);
411 416
 					$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
412 417
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -419,7 +424,9 @@  discard block
 block discarded – undo
419 424
                         } else {
420 425
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
421 426
                     		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
422
-                    		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
427
+                    		} else {
428
+                    			$image_thumbnail = $spotter_item['image_thumbnail'];
429
+                    		}
423 430
 				if (isset($spotter_item['airline_name'])) {
424 431
 					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>';
425 432
 				} else {
@@ -441,8 +448,9 @@  discard block
 block discarded – undo
441 448
 			print '<td class="aircraft_thumbnail">'."\n";
442 449
 			//print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
443 450
 			if ($spotter_item['image_source'] == 'planespotters') {
444
-				if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
445
-				else {
451
+				if ($spotter_item['image_source_website'] != '') {
452
+					$image_src = $spotter_item['image_source_website'];
453
+				} else {
446 454
 					$planespotter_url_array = explode("_", $spotter_array[0]['image']);
447 455
 					$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
448 456
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -459,7 +467,9 @@  discard block
 block discarded – undo
459 467
 			} else {
460 468
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
461 469
                     		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
462
-                    		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
470
+                    		} else {
471
+                    			$image_thumbnail = $spotter_item['image_thumbnail'];
472
+                    		}
463 473
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
464 474
 					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>';
465 475
 				} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
@@ -546,15 +556,21 @@  discard block
 block discarded – undo
546 556
 		if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
547 557
 			if ($spotter_item['departure_airport_time'] > 2460) {
548 558
 				$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
549
-			} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
559
+			} else {
560
+				$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
561
+			}
550 562
 			if ($spotter_item['real_departure_airport_time'] > 2460) {
551 563
 				$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
552
-			} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
564
+			} else {
565
+				$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
566
+			}
553 567
 			print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
554 568
 		} elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
555 569
 			if ($spotter_item['real_departure_airport_time'] > 2460) {
556 570
 				$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
557
-			} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
571
+			} else {
572
+				$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
573
+			}
558 574
 			print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
559 575
 		} elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
560 576
 			if ($spotter_item['departure_airport_time'] > 2460) {
@@ -576,7 +592,9 @@  discard block
 block discarded – undo
576 592
 					$longitude = $spotter_item['longitude'];
577 593
 				}
578 594
 				$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
579
-			} else $distance = '';
595
+			} else {
596
+				$distance = '';
597
+			}
580 598
 			if ($distance != '') {
581 599
 			    if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
582 600
 				    echo '<br/><i>'.round($distance*0.539957).' nm</i>';
@@ -601,7 +619,9 @@  discard block
 block discarded – undo
601 619
 		} else {
602 620
 			if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) {
603 621
 				print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n";
604
-				if (!isset($Spotter)) $Spotter = new Spotter();
622
+				if (!isset($Spotter)) {
623
+					$Spotter = new Spotter();
624
+				}
605 625
 				$arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']);
606 626
 				print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n";
607 627
 				print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
@@ -617,20 +637,28 @@  discard block
 block discarded – undo
617 637
 		if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
618 638
 			if ($spotter_item['arrival_airport_time'] > 2460) {
619 639
 				$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
620
-			} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
640
+			} else {
641
+				$arrival_airport_time = $spotter_item['arrival_airport_time'];
642
+			}
621 643
 			if ($spotter_item['real_arrival_airport_time'] > 2460) {
622 644
 				$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
623
-			} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
645
+			} else {
646
+				$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
647
+			}
624 648
 			print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
625 649
 		} elseif (isset($spotter_item['real_arrival_airport_time'])) {
626 650
 			if ($spotter_item['real_arrival_airport_time'] > 2460) {
627 651
 				$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
628
-			} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
652
+			} else {
653
+				$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
654
+			}
629 655
 			print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
630 656
 		} elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
631 657
 			if ($spotter_item['arrival_airport_time'] > 2460) {
632 658
 				$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
633
-			} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
659
+			} else {
660
+				$arrival_airport_time = $spotter_item['arrival_airport_time'];
661
+			}
634 662
 			print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
635 663
 		}
636 664
 		if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
@@ -643,7 +671,9 @@  discard block
 block discarded – undo
643 671
 					$longitude = $spotter_item['longitude'];
644 672
 				}
645 673
 				$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
646
-			} else $distance = '';
674
+			} else {
675
+				$distance = '';
676
+			}
647 677
 			if ($distance != '') {
648 678
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
649 679
 					echo '<br/><i>'.round($distance*0.539957).' nm</i>';
Please login to merge, or discard this patch.