Completed
Push — master ( b8bf1c...02faf6 )
by Yannick
10:43
created
pilot-statistics-departure-airport.php 2 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
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['pilot_name']);
16
+	$title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['pilot_name']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('pilot-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByPilot($pilot);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
30 30
     	<script>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         	["'._("Airport").'", "'._("# of times").'"],';
40 40
 
41 41
 	$airport_data = '';
42
-	foreach($airport_airport_array as $airport_item)
42
+	foreach ($airport_airport_array as $airport_item)
43 43
 	{
44 44
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
45 45
 		$name = str_replace("'", "", $name);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	print '</thead>';
79 79
 	print '<tbody>';
80 80
 	$i = 1;
81
-	foreach($airport_airport_array as $airport_item)
81
+	foreach ($airport_airport_array as $airport_item)
82 82
 	{
83 83
 		print '<tr>';
84 84
 		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
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['pilot'])) {
6
-        header('Location: '.$globalURL.'/pilot');
7
-        die();
6
+		header('Location: '.$globalURL.'/pilot');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-arrival-airport-country.php 2 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
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['aircraft_owner']);
16
+	$title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['aircraft_owner']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('owner-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
28 28
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByOwner($owner);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
30 30
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             var data = google.visualization.arrayToDataTable([
36 36
             	["'._("Country").'", "'._("# of times").'"], ';
37 37
 	$country_data = '';
38
-	foreach($airport_country_array as $airport_item)
38
+	foreach ($airport_country_array as $airport_item)
39 39
 	{
40 40
 		$country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
41 41
 	}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		print '</thead>';
70 70
 		print '<tbody>';
71 71
 		$i = 1;
72
-		foreach($airport_country_array as $airport_item)
72
+		foreach ($airport_country_array as $airport_item)
73 73
 		{
74 74
 			print '<tr>';
75 75
 			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
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
pilot-statistics-aircraft.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
12 12
 if ($sort != '') {
13
-	$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort);
13
+	$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort);
14 14
 } else {
15
-	$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", '');
15
+	$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", '');
16 16
 }
17 17
 
18 18
 if (!empty($spotter_array))
19 19
 {
20
-	$title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['pilot_name']);
20
+	$title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['pilot_name']);
21 21
 	require_once('header.php');
22 22
 	print '<div class="info column">';
23 23
 	print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	include('pilot-sub-menu.php');
29 29
 	print '<div class="column">';
30 30
 	print '<h2>'._("Most Common Aircraft").'</h2>';
31
-	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
31
+	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
32 32
 
33 33
 	$aircraft_array = $Spotter->countAllAircraftTypesByPilot($pilot);
34 34
 	if (!empty($aircraft_array))
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		print '</thead>';
43 43
 		print '<tbody>';
44 44
 		$i = 1;
45
-		foreach($aircraft_array as $aircraft_item)
45
+		foreach ($aircraft_array as $aircraft_item)
46 46
 		{
47 47
 			print '<tr>';
48 48
 			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
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-airline.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Airlines of %s"),$spotter_array[0]['aircraft_owner']);
16
+	$title = sprintf(_("Most Common Airlines of %s"), $spotter_array[0]['aircraft_owner']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('owner-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Airlines").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
28 28
 
29 29
 	$airline_array = $Spotter->countAllAirlinesByOwner($owner);
30 30
 	if (!empty($airline_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($airline_array as $airline_item)
44
+		foreach ($airline_array as $airline_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			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
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
pilot.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	header('Location: '.$globalURL.'/pilot/'.$_POST['pilot']);
10 10
 //} else if (isset($_GET['airport'])){
11 11
 } else {
12
-	$Spotter= new Spotter();
12
+	$Spotter = new Spotter();
13 13
 	$Stats = new Stats();
14 14
 	$title = _("Pilots");
15 15
 	require_once('header.php');
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 	//ksort($pilot_names);
23 23
 	$previous = null;
24 24
 	print '<div class="alphabet-legend">';
25
-	foreach($pilot_names as $value) {
25
+	foreach ($pilot_names as $value) {
26 26
 		$firstLetter = mb_strtoupper(mb_substr($value['pilot_name'], 0, 1));
27
-		if($previous !== $firstLetter && $firstLetter != "'")
27
+		if ($previous !== $firstLetter && $firstLetter != "'")
28 28
 		{
29
-			if ($previous !== null){
29
+			if ($previous !== null) {
30 30
 				print ' | ';
31 31
 			}
32 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 	print '</div>';
37 37
 	$previous = null;
38
-	foreach($pilot_names as $value) {
38
+	foreach ($pilot_names as $value) {
39 39
 		$firstLetter = mb_strtoupper(mb_substr($value['pilot_name'], 0, 1));
40 40
 		if ($firstLetter != "")
41 41
 		{
42
-			if($previous !== $firstLetter && $firstLetter != "'")
42
+			if ($previous !== $firstLetter && $firstLetter != "'")
43 43
 			{
44
-				if ($previous !== null){
44
+				if ($previous !== null) {
45 45
 					print '</div>';
46 46
 				}
47 47
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@  discard block
 block discarded – undo
31 31
 			}
32 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
33 33
 		}
34
-		if ($firstLetter != "'") $previous = $firstLetter;
34
+		if ($firstLetter != "'") {
35
+			$previous = $firstLetter;
36
+		}
35 37
 	}
36 38
 	print '</div>';
37 39
 	$previous = null;
@@ -46,10 +48,15 @@  discard block
 block discarded – undo
46 48
 				}
47 49
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
48 50
 			}
49
-			if ($firstLetter != "'") $previous = $firstLetter;
51
+			if ($firstLetter != "'") {
52
+				$previous = $firstLetter;
53
+			}
50 54
 			print '<div class="alphabet-item">';
51
-			if (isset($value['pilot_id']) && $value['pilot_id'] != '') print '<a href="'.$globalURL.'/pilot/'.$value['pilot_id'].'">'.$value['pilot_name'].' ('.$value['pilot_id'].')';
52
-			else print '<a href="'.$globalURL.'/pilot/'.$value['pilot_name'].'">'.$value['pilot_name'];
55
+			if (isset($value['pilot_id']) && $value['pilot_id'] != '') {
56
+				print '<a href="'.$globalURL.'/pilot/'.$value['pilot_id'].'">'.$value['pilot_name'].' ('.$value['pilot_id'].')';
57
+			} else {
58
+				print '<a href="'.$globalURL.'/pilot/'.$value['pilot_name'].'">'.$value['pilot_name'];
59
+			}
53 60
 			print '</a>';
54 61
 			print '</div>';
55 62
 		}
Please login to merge, or discard this patch.
owner-detailed.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
 //require_once('require/class.SpotterLive.php');
7 7
 require_once('require/class.SpotterArchive.php');
8 8
 
9
-if (!isset($_GET['owner'])){
9
+if (!isset($_GET['owner'])) {
10 10
 	header('Location: '.$globalURL.'');
11 11
 } else {
12 12
 	$Spotter = new Spotter();
13 13
 	$SpotterArchive = new SpotterArchive();
14 14
 	$Translation = new Translation();
15 15
 	//calculuation for the pagination
16
-	if(!isset($_GET['limit']))
16
+	if (!isset($_GET['limit']))
17 17
 	{
18 18
 		$limit_start = 0;
19 19
 		$limit_end = 25;
@@ -34,24 +34,24 @@  discard block
 block discarded – undo
34 34
 	
35 35
 	$page_url = $globalURL.'/owner/'.$_GET['owner'];
36 36
 	
37
-	$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
38
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
38
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
39 39
 	if ($sort != '') 
40 40
 	{
41
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort);
41
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort);
42 42
 		if (empty($spotter_array)) {
43
-			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort);
43
+			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort);
44 44
 		}
45 45
 	} else {
46
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference);
46
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference);
47 47
 		if (empty($spotter_array)) {
48
-			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference);
48
+			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference);
49 49
 		}
50 50
 	}
51 51
 
52 52
 	if (!empty($spotter_array))
53 53
 	{
54
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
54
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['aircraft_owner']);
55 55
 		//$ident = $spotter_array[0]['ident'];
56 56
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
57 57
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	
113 113
 		include('owner-sub-menu.php');
114 114
 		print '<div class="table column">';
115
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
115
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
116 116
 
117 117
 		include('table-output.php'); 
118 118
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,12 @@
 block discarded – undo
53 53
 	{
54 54
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
55 55
 		//$ident = $spotter_array[0]['ident'];
56
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
57
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
56
+		if (isset($spotter_array[0]['latitude'])) {
57
+			$latitude = $spotter_array[0]['latitude'];
58
+		}
59
+		if (isset($spotter_array[0]['longitude'])) {
60
+			$longitude = $spotter_array[0]['longitude'];
61
+		}
58 62
 		require_once('header.php');
59 63
 		/*
60 64
 		if (isset($globalArchive) && $globalArchive) {
Please login to merge, or discard this patch.
owner.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 	header('Location: '.$globalURL.'/owner/'.$_POST['owner']);
11 11
 //} else if (isset($_GET['airport'])){
12 12
 } else {
13
-	$Spotter= new Spotter();
13
+	$Spotter = new Spotter();
14 14
 	$Stats = new Stats();
15 15
 	$Common = new Common();
16 16
 	$title = _("Owners");
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	ksort($owner_names);
25 25
 	$previous = null;
26 26
 	print '<div class="alphabet-legend">';
27
-	foreach($owner_names as $value) {
27
+	foreach ($owner_names as $value) {
28 28
 		$firstLetter = $Common->remove_accents(mb_strtoupper(mb_substr($value['owner_name'], 0, 1)));
29
-		if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
29
+		if ($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
30 30
 		{
31
-			if ($previous !== null){
31
+			if ($previous !== null) {
32 32
 				print ' | ';
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 	print '</div>';
39 39
 	$previous = null;
40
-	foreach($owner_names as $value) {
40
+	foreach ($owner_names as $value) {
41 41
 		$firstLetter = $Common->remove_accents(mb_strtoupper(mb_substr($value['owner_name'], 0, 1)));
42 42
 		if ($firstLetter != "")
43 43
 		{
44
-			if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
44
+			if ($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
45 45
 			{
46
-				if ($previous !== null){
46
+				if ($previous !== null) {
47 47
 					print '</div>';
48 48
 				}
49 49
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
35 35
 		}
36
-		if ($firstLetter != "'" && $firstLetter != '"') $previous = $firstLetter;
36
+		if ($firstLetter != "'" && $firstLetter != '"') {
37
+			$previous = $firstLetter;
38
+		}
37 39
 	}
38 40
 	print '</div>';
39 41
 	$previous = null;
@@ -48,7 +50,9 @@  discard block
 block discarded – undo
48 50
 				}
49 51
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
50 52
 			}
51
-			if ($firstLetter != "'" && $firstLetter != '"') $previous = $firstLetter;
53
+			if ($firstLetter != "'" && $firstLetter != '"') {
54
+				$previous = $firstLetter;
55
+			}
52 56
 			print '<div class="alphabet-item">';
53 57
 			print '<a href="'.$globalURL.'/owner/'.$value['owner_name'].'">';
54 58
 			print $value['owner_name'];
Please login to merge, or discard this patch.
statistics.php 3 patches
Indentation   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
54 54
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
55 55
 	}
56
-    ?>
56
+	?>
57 57
     </div>
58 58
     <?php include('statistics-sub-menu.php'); ?>
59 59
     <p class="global-stats">
@@ -62,23 +62,23 @@  discard block
 block discarded – undo
62 62
         <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
63 63
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
64 64
 	<?php
65
-	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
65
+		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
66 66
 	?>
67 67
     	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
68 68
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
69 69
         <?php
70
-    	    } else {
71
-    	?>
70
+			} else {
71
+		?>
72 72
     	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
73 73
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
74 74
     	<?php
75
-    	    }
76
-    	?>
75
+			}
76
+		?>
77 77
         <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
78 78
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
79 79
         <?php
80
-    		if ($airline_icao == '') {
81
-    	?>
80
+			if ($airline_icao == '') {
81
+		?>
82 82
         <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
83 83
 	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
84 84
 	<?php
@@ -101,25 +101,25 @@  discard block
 block discarded – undo
101 101
             <div class="col-md-6">
102 102
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
103 103
                  <?php
104
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
105
-		    if (count($aircraft_array) == 0) print _("No data available");
106
-		    else {
104
+				  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
105
+			if (count($aircraft_array) == 0) print _("No data available");
106
+			else {
107 107
 
108
-                    print '<div id="chart1" class="chart" width="100%"></div>
108
+					print '<div id="chart1" class="chart" width="100%"></div>
109 109
                     <script> 
110 110
                         google.load("visualization", "1", {packages:["corechart"]});
111 111
                       google.setOnLoadCallback(drawChart1);
112 112
                       function drawChart1() {
113 113
                         var data = google.visualization.arrayToDataTable([
114 114
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
115
-                            $aircraft_data = '';
116
-                          foreach($aircraft_array as $aircraft_item)
117
-                                    {
118
-                                            $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
119
-                                    }
120
-                                    $aircraft_data = substr($aircraft_data, 0, -1);
121
-                                    print $aircraft_data;
122
-                        print ']);
115
+							$aircraft_data = '';
116
+						  foreach($aircraft_array as $aircraft_item)
117
+									{
118
+											$aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
119
+									}
120
+									$aircraft_data = substr($aircraft_data, 0, -1);
121
+									print $aircraft_data;
122
+						print ']);
123 123
 
124 124
                         var options = {
125 125
                             chartArea: {"width": "80%", "height": "60%"},
@@ -134,45 +134,45 @@  discard block
 block discarded – undo
134 134
                               drawChart1();
135 135
                             });
136 136
                   </script>';
137
-                  }
138
-                  ?>
137
+				  }
138
+				  ?>
139 139
                 <div class="more">
140 140
             	    <?php
141
-            		if ($year != '' && $month != '') {
142
-            	    ?>
141
+					if ($year != '' && $month != '') {
142
+					?>
143 143
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
144 144
             	    <?php
145
-            		} else {
146
-            	    ?>
145
+					} else {
146
+					?>
147 147
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
148 148
             	    <?php
149
-            		}
150
-            	    ?>
149
+					}
150
+					?>
151 151
                 </div>
152 152
             </div>
153 153
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
154 154
 <?php
155 155
 //    echo $airline_icao;
156
-    if ($airline_icao == '' || $airline_icao == 'all') {
156
+	if ($airline_icao == '' || $airline_icao == 'all') {
157 157
 	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
158 158
 	if (count($airline_array) > 0) {
159
-            print '<div class="col-md-6">';
160
-	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
161
-	    print '<div id="chart2" class="chart" width="100%"></div>
159
+			print '<div class="col-md-6">';
160
+		print '<h2>'._("Top 10 Most Common Airline").'</h2>';
161
+		print '<div id="chart2" class="chart" width="100%"></div>
162 162
                     <script> 
163 163
                         google.load("visualization", "1", {packages:["corechart"]});
164 164
                       google.setOnLoadCallback(drawChart2);
165 165
                       function drawChart2() {
166 166
                         var data = google.visualization.arrayToDataTable([
167 167
                             ["'._("Airline").'", "'._("# of times").'"], ';
168
-	    $airline_data = '';
169
-	    foreach($airline_array as $airline_item)
170
-	    {
168
+		$airline_data = '';
169
+		foreach($airline_array as $airline_item)
170
+		{
171 171
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
172
-	    }
173
-	    $airline_data = substr($airline_data, 0, -1);
174
-	    print $airline_data;
175
-	    print ']);
172
+		}
173
+		$airline_data = substr($airline_data, 0, -1);
174
+		print $airline_data;
175
+		print ']);
176 176
 
177 177
                         var options = {
178 178
                             chartArea: {"width": "80%", "height": "60%"},
@@ -187,27 +187,27 @@  discard block
 block discarded – undo
187 187
                               drawChart2();
188 188
                             });
189 189
                   </script>';
190
-	    if ($year != '' && $month != '') {
190
+		if ($year != '' && $month != '') {
191 191
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
192
-	    } else {
192
+		} else {
193 193
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
194
-	    }
195
-    	    print '</div>';
194
+		}
195
+			print '</div>';
196 196
 	}
197 197
 ?>
198 198
         </div>
199 199
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
200 200
 <?php
201
-    }
201
+	}
202 202
 ?>
203 203
         <div class="row column">
204 204
 <?php
205
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
206
-    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
205
+	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
206
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
207 207
 	if (empty($flightover_array)) {
208
-	    print '<div class="col-md-12">';
208
+		print '<div class="col-md-12">';
209 209
 	} else {
210
-            print '<div class="col-md-6">';
210
+			print '<div class="col-md-6">';
211 211
 	}
212 212
 ?>
213 213
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
@@ -215,21 +215,21 @@  discard block
 block discarded – undo
215 215
 	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
216 216
 	if (count($pilot_array) == 0) print _("No data available");
217 217
 	else {
218
-	    print '<div id="chart7" class="chart" width="100%"></div>
218
+		print '<div id="chart7" class="chart" width="100%"></div>
219 219
                     <script> 
220 220
                         google.load("visualization", "1", {packages:["corechart"]});
221 221
                       google.setOnLoadCallback(drawChart7);
222 222
                       function drawChart7() {
223 223
                         var data = google.visualization.arrayToDataTable([
224 224
                             ["'._("Pilots").'", "'._("# of times").'"], ';
225
-	    $pilot_data = '';
226
-	    foreach($pilot_array as $pilot_item)
227
-	    {
225
+		$pilot_data = '';
226
+		foreach($pilot_array as $pilot_item)
227
+		{
228 228
 		$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
229
-	    }
230
-	    $pilot_data = substr($pilot_data, 0, -1);
231
-	    print $pilot_data;
232
-	    print ']);
229
+		}
230
+		$pilot_data = substr($pilot_data, 0, -1);
231
+		print $pilot_data;
232
+		print ']);
233 233
 
234 234
                         var options = {
235 235
                             chartArea: {"width": "80%", "height": "60%"},
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
                               drawChart7();
245 245
                             });
246 246
                   </script>';
247
-        }
248
-        print '<div class="more">';
247
+		}
248
+		print '<div class="more">';
249 249
 	print '<a href="'.$globalURL.'/statistics/pilot" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a>';
250 250
 	print '</div>';
251 251
 ?>
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         
254 254
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
255 255
 <?php
256
-    } else {
256
+	} else {
257 257
 ?>
258 258
             <div class="col-md-6">
259 259
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
@@ -261,21 +261,21 @@  discard block
 block discarded – undo
261 261
 	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
262 262
 	if (count($owner_array) == 0) print _("No data available");
263 263
 	else {
264
-	    print '<div id="chart7" class="chart" width="100%"></div>
264
+		print '<div id="chart7" class="chart" width="100%"></div>
265 265
                     <script> 
266 266
                         google.load("visualization", "1", {packages:["corechart"]});
267 267
                       google.setOnLoadCallback(drawChart7);
268 268
                       function drawChart7() {
269 269
                         var data = google.visualization.arrayToDataTable([
270 270
                             ["'._("Owner").'", "'._("# of times").'"], ';
271
-                            $owner_data = '';
272
-	    foreach($owner_array as $owner_item)
273
-	    {
271
+							$owner_data = '';
272
+		foreach($owner_array as $owner_item)
273
+		{
274 274
 		$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
275
-	    }
276
-	    $owner_data = substr($owner_data, 0, -1);
277
-	    print $owner_data;
278
-	    print ']);
275
+		}
276
+		$owner_data = substr($owner_data, 0, -1);
277
+		print $owner_data;
278
+		print ']);
279 279
 
280 280
                         var options = {
281 281
                             chartArea: {"width": "80%", "height": "60%"},
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         
300 300
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
301 301
 <?php
302
-    }
303
-    if (!empty($flightover_array)) {
302
+	}
303
+	if (!empty($flightover_array)) {
304 304
 ?>
305 305
             <div class="col-md-6">
306 306
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
@@ -308,21 +308,21 @@  discard block
 block discarded – undo
308 308
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
309 309
 	if (count($flightover_array) == 0) print _("No data available");
310 310
 	else {
311
-	    print '<div id="chart10" class="chart" width="100%"></div>
311
+		print '<div id="chart10" class="chart" width="100%"></div>
312 312
                     <script> 
313 313
                         google.load("visualization", "1", {packages:["corechart"]});
314 314
                       google.setOnLoadCallback(drawChart10);
315 315
                       function drawChart10() {
316 316
                         var data = google.visualization.arrayToDataTable([
317 317
                             ["'._("Country").'", "'._("# of times").'"], ';
318
-                            $flightover_data = '';
319
-	    foreach($flightover_array as $flightover_item)
320
-	    {
318
+							$flightover_data = '';
319
+		foreach($flightover_array as $flightover_item)
320
+		{
321 321
 		$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
322
-	    }
323
-	    $flightover_data = substr($flightover_data, 0, -1);
324
-	    print $flightover_data;
325
-	    print ']);
322
+		}
323
+		$flightover_data = substr($flightover_data, 0, -1);
324
+		print $flightover_data;
325
+		print ']);
326 326
 
327 327
                         var options = {
328 328
                             chartArea: {"width": "80%", "height": "60%"},
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 </div>
347 347
             </div>
348 348
 <?php
349
-    }
349
+	}
350 350
 ?>
351 351
         </div>
352 352
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -356,8 +356,8 @@  discard block
 block discarded – undo
356 356
         <div class="row column">
357 357
             <div class="col-md-6">
358 358
 <?php
359
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
360
-    if (count($airport_airport_array) > 0) {
359
+	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
360
+	if (count($airport_airport_array) > 0) {
361 361
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
362 362
 	print '<div id="chart3" class="chart" width="100%"></div>
363 363
                 <script>
@@ -370,13 +370,13 @@  discard block
 block discarded – undo
370 370
 
371 371
                 var data = google.visualization.arrayToDataTable([ 
372 372
                     ["'._("Airport").'", "'._("# of times").'"],';
373
-                    $airport_data = '';
373
+					$airport_data = '';
374 374
 	foreach($airport_airport_array as $airport_item)
375 375
 	{
376
-	    $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
377
-	    $name = str_replace("'", "", $name);
378
-	    $name = str_replace('"', "", $name);
379
-	    $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
376
+		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
377
+		$name = str_replace("'", "", $name);
378
+		$name = str_replace('"', "", $name);
379
+		$airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
380 380
 	}
381 381
 	$airport_data = substr($airport_data, 0, -1);
382 382
 	print $airport_data;
@@ -395,15 +395,15 @@  discard block
 block discarded – undo
395 395
               }
396 396
                 </script>';
397 397
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
398
-    }
398
+	}
399 399
 ?>
400 400
             </div>
401 401
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
402 402
 
403 403
             <div class="col-md-6">
404 404
 <?php
405
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
406
-    if (count($airport_airport_array2) > 0) {
405
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
406
+	if (count($airport_airport_array2) > 0) {
407 407
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
408 408
 	print '<div id="chart4" class="chart" width="100%"></div>
409 409
                 <script>
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
 	$airport_data2 = '';
420 420
 	foreach($airport_airport_array2 as $airport_item2)
421 421
 	{
422
-	    $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
423
-	    $name2 = str_replace(array("'",'"'), '', $name2);
424
-	    $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
422
+		$name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
423
+		$name2 = str_replace(array("'",'"'), '', $name2);
424
+		$airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
425 425
 	}
426 426
 	$airport_data2 = substr($airport_data2, 0, -1);
427 427
 	print $airport_data2;
@@ -440,36 +440,36 @@  discard block
 block discarded – undo
440 440
               }
441 441
                 </script>';
442 442
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
443
-    }
443
+	}
444 444
 ?>
445 445
             </div>
446 446
         </div>
447 447
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
448 448
 <?php
449
-    if ($year == '' && $month == '') {
449
+	if ($year == '' && $month == '') {
450 450
 ?>
451 451
         <div class="row column">
452 452
             <div class="col-md-6">
453 453
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
454 454
                 <?php
455
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
456
-		    if (count($year_array) == 0) print _("No data available");
457
-		    else {
458
-                  print '<div id="chart8" class="chart" width="100%"></div>
455
+				  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
456
+			if (count($year_array) == 0) print _("No data available");
457
+			else {
458
+				  print '<div id="chart8" class="chart" width="100%"></div>
459 459
                     <script> 
460 460
                         google.load("visualization", "1", {packages:["corechart"]});
461 461
                       google.setOnLoadCallback(drawChart8);
462 462
                       function drawChart8() {
463 463
                         var data = google.visualization.arrayToDataTable([
464 464
                             ["'._("Month").'", "'._("# of Flights").'"], ';
465
-                            $year_data = '';
466
-                          foreach($year_array as $year_item)
467
-                                    {
468
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
469
-                                    }
470
-                                    $year_data = substr($year_data, 0, -1);
471
-                                    print $year_data;
472
-                        print ']);
465
+							$year_data = '';
466
+						  foreach($year_array as $year_item)
467
+									{
468
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
469
+									}
470
+									$year_data = substr($year_data, 0, -1);
471
+									print $year_data;
472
+						print ']);
473 473
 
474 474
                         var options = {
475 475
                             legend: {position: "none"},
@@ -487,8 +487,8 @@  discard block
 block discarded – undo
487 487
                               drawChart8();
488 488
                             });
489 489
                   </script>';
490
-                  }
491
-                  ?>
490
+				  }
491
+				  ?>
492 492
                 <div class="more">
493 493
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
494 494
                 </div>
@@ -497,24 +497,24 @@  discard block
 block discarded – undo
497 497
             <div class="col-md-6">
498 498
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
499 499
                 <?php
500
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
501
-		    if (count($month_array) == 0) print _("No data available");
502
-		    else {
503
-                  print '<div id="chart9" class="chart" width="100%"></div>
500
+				  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
501
+			if (count($month_array) == 0) print _("No data available");
502
+			else {
503
+				  print '<div id="chart9" class="chart" width="100%"></div>
504 504
                     <script> 
505 505
                         google.load("visualization", "1", {packages:["corechart"]});
506 506
                       google.setOnLoadCallback(drawChart9);
507 507
                       function drawChart9() {
508 508
                         var data = google.visualization.arrayToDataTable([
509 509
                             ["'._("Day").'", "'._("# of Flights").'"], ';
510
-                            $month_data = '';
511
-                          foreach($month_array as $month_item)
512
-                                    {
513
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
514
-                                    }
515
-                                    $month_data = substr($month_data, 0, -1);
516
-                                    print $month_data;
517
-                        print ']);
510
+							$month_data = '';
511
+						  foreach($month_array as $month_item)
512
+									{
513
+										$month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
514
+									}
515
+									$month_data = substr($month_data, 0, -1);
516
+									print $month_data;
517
+						print ']);
518 518
 
519 519
                         var options = {
520 520
                             legend: {position: "none"},
@@ -532,8 +532,8 @@  discard block
 block discarded – undo
532 532
                               drawChart9();
533 533
                             });
534 534
                   </script>';
535
-                  }
536
-                  ?>
535
+				  }
536
+				  ?>
537 537
                 <div class="more">
538 538
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
539 539
                 </div>
@@ -543,25 +543,25 @@  discard block
 block discarded – undo
543 543
             <div class="col-md-6">
544 544
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
545 545
                 <?php
546
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
547
-		    if (empty($date_array)) print _("No data available");
548
-		    else {
549
-                  print '<div id="chart5" class="chart" width="100%"></div>
546
+					$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
547
+			if (empty($date_array)) print _("No data available");
548
+			else {
549
+				  print '<div id="chart5" class="chart" width="100%"></div>
550 550
                     <script> 
551 551
                         google.load("visualization", "1", {packages:["corechart"]});
552 552
                       google.setOnLoadCallback(drawChart5);
553 553
                       function drawChart5() {
554 554
                         var data = google.visualization.arrayToDataTable([
555 555
                             ["'._("Date").'", "'._("# of Flights").'"], ';
556
-                            $date_data = '';
556
+							$date_data = '';
557 557
                         
558
-                          foreach($date_array as $date_item)
559
-                                    {
560
-                                        $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
561
-                                    }
562
-                                    $date_data = substr($date_data, 0, -1);
563
-                                    print $date_data;
564
-                        print ']);
558
+						  foreach($date_array as $date_item)
559
+									{
560
+										$date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
561
+									}
562
+									$date_data = substr($date_data, 0, -1);
563
+									print $date_data;
564
+						print ']);
565 565
 
566 566
                         var options = {
567 567
                             legend: {position: "none"},
@@ -579,8 +579,8 @@  discard block
 block discarded – undo
579 579
                               drawChart5();
580 580
                             });
581 581
                   </script>';
582
-                  }
583
-                  ?>
582
+				  }
583
+				  ?>
584 584
                 <div class="more">
585 585
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
586 586
                 </div>
@@ -589,25 +589,25 @@  discard block
 block discarded – undo
589 589
             <div class="col-md-6">
590 590
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
591 591
                 <?php
592
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
593
-		    if (empty($hour_array)) print _("No data available");
594
-		    else {
592
+				  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
593
+			if (empty($hour_array)) print _("No data available");
594
+			else {
595 595
 
596
-                  print '<div id="chart6" class="chart" width="100%"></div>
596
+				  print '<div id="chart6" class="chart" width="100%"></div>
597 597
                     <script> 
598 598
                         google.load("visualization", "1", {packages:["corechart"]});
599 599
                       google.setOnLoadCallback(drawChart6);
600 600
                       function drawChart6() {
601 601
                         var data = google.visualization.arrayToDataTable([
602 602
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
603
-                            $hour_data = '';
604
-                          foreach($hour_array as $hour_item)
605
-                                    {
606
-                                        $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
607
-                                    }
608
-                                    $hour_data = substr($hour_data, 0, -1);
609
-                                    print $hour_data;
610
-                        print ']);
603
+							$hour_data = '';
604
+						  foreach($hour_array as $hour_item)
605
+									{
606
+										$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
607
+									}
608
+									$hour_data = substr($hour_data, 0, -1);
609
+									print $hour_data;
610
+						print ']);
611 611
 
612 612
                         var options = {
613 613
                             legend: {position: "none"},
@@ -625,8 +625,8 @@  discard block
 block discarded – undo
625 625
                               drawChart6();
626 626
                             });
627 627
                   </script>';
628
-                  }
629
-                ?>
628
+				  }
629
+				?>
630 630
                 <div class="more">
631 631
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
632 632
                 </div>
@@ -634,36 +634,36 @@  discard block
 block discarded – undo
634 634
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
635 635
         </div>
636 636
 <?php
637
-    }
637
+	}
638 638
 ?>
639 639
 
640 640
 <?php
641
-    if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
641
+	if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
642 642
 ?>
643 643
         <div class="row column">
644 644
             <div class="col-md-6">
645 645
                 <h2><?php echo _("Fatalities by Years"); ?></h2>
646 646
                 <?php
647
-		    require_once('require/class.Accident.php');
648
-            	    $Accident = new Accident();
649
-                  $year_array = $Accident->countFatalitiesByYear($filter_name);
650
-		    if (count($year_array) == 0) print _("No data available");
651
-		    else {
652
-                  print '<div id="chart32" class="chart" width="100%"></div>
647
+			require_once('require/class.Accident.php');
648
+					$Accident = new Accident();
649
+				  $year_array = $Accident->countFatalitiesByYear($filter_name);
650
+			if (count($year_array) == 0) print _("No data available");
651
+			else {
652
+				  print '<div id="chart32" class="chart" width="100%"></div>
653 653
                     <script> 
654 654
                         google.load("visualization", "1", {packages:["corechart"]});
655 655
                       google.setOnLoadCallback(drawChart32);
656 656
                       function drawChart32() {
657 657
                         var data = google.visualization.arrayToDataTable([
658 658
                             ["'._("Year").'", "'._("# of Fatalities").'"], ';
659
-                            $year_data = '';
660
-                          foreach($year_array as $year_item)
661
-                                    {
662
-                                        $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
663
-                                    }
664
-                                    $year_data = substr($year_data, 0, -1);
665
-                                    print $year_data;
666
-                        print ']);
659
+							$year_data = '';
660
+						  foreach($year_array as $year_item)
661
+									{
662
+										$year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
663
+									}
664
+									$year_data = substr($year_data, 0, -1);
665
+									print $year_data;
666
+						print ']);
667 667
 
668 668
                         var options = {
669 669
                             legend: {position: "none"},
@@ -681,8 +681,8 @@  discard block
 block discarded – undo
681 681
                               drawChart32();
682 682
                             });
683 683
                   </script>';
684
-                  }
685
-                  ?>
684
+				  }
685
+				  ?>
686 686
                 <div class="more">
687 687
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
688 688
                 </div>
@@ -693,26 +693,26 @@  discard block
 block discarded – undo
693 693
             <div class="col-md-6">
694 694
                 <h2><?php echo _("Fatalities last 12 Months"); ?></h2>
695 695
                 <?php
696
-		    require_once('require/class.Accident.php');
697
-            	    $Accident = new Accident();
698
-                  $year_array = $Accident->countFatalitiesLast12Months($filter_name);
699
-		    if (count($year_array) == 0) print _("No data available");
700
-		    else {
701
-                  print '<div id="chart33" class="chart" width="100%"></div>
696
+			require_once('require/class.Accident.php');
697
+					$Accident = new Accident();
698
+				  $year_array = $Accident->countFatalitiesLast12Months($filter_name);
699
+			if (count($year_array) == 0) print _("No data available");
700
+			else {
701
+				  print '<div id="chart33" class="chart" width="100%"></div>
702 702
                     <script> 
703 703
                         google.load("visualization", "1", {packages:["corechart"]});
704 704
                       google.setOnLoadCallback(drawChart33);
705 705
                       function drawChart33() {
706 706
                         var data = google.visualization.arrayToDataTable([
707 707
                             ["'._("Month").'", "'._("# of Fatalities").'"], ';
708
-                            $year_data = '';
709
-                          foreach($year_array as $year_item)
710
-                                    {
711
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
712
-                                    }
713
-                                    $year_data = substr($year_data, 0, -1);
714
-                                    print $year_data;
715
-                        print ']);
708
+							$year_data = '';
709
+						  foreach($year_array as $year_item)
710
+									{
711
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
712
+									}
713
+									$year_data = substr($year_data, 0, -1);
714
+									print $year_data;
715
+						print ']);
716 716
 
717 717
                         var options = {
718 718
                             legend: {position: "none"},
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
                               drawChart33();
731 731
                             });
732 732
                   </script>';
733
-                  }
734
-                  ?>
733
+				  }
734
+				  ?>
735 735
                 <div class="more">
736 736
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
737 737
                 </div>
@@ -739,30 +739,30 @@  discard block
 block discarded – undo
739 739
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
740 740
 <br/>
741 741
 <?php
742
-    }
742
+	}
743 743
 ?>
744 744
 
745 745
 <?php
746
-    if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
746
+	if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
747 747
 ?>
748 748
         <div class="row column">
749 749
         	<?php
750
-        	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
751
-        	    if ($year == '' && $month == '') {
752
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
753
-		    } else {
754
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
755
-        	    }
756
-        	    if (!empty($polar)) {
757
-            		print '<h2>'._("Coverage pattern").'</h2>';
758
-        		foreach ($polar as $eachpolar) {
759
-        		    unset($polar_data);
760
-	        	    $Spotter = new Spotter();
761
-        		    $data = json_decode($eachpolar['source_data']);
762
-        		    foreach($data as $value => $key) {
763
-        			$direction = $Spotter->parseDirection(($value*22.5));
764
-        			$distance = $key;
765
-        			$unit = 'km';
750
+				//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
751
+				if ($year == '' && $month == '') {
752
+				$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
753
+			} else {
754
+				$polar = $Stats->getStatsSource('polar',$year,$month);
755
+				}
756
+				if (!empty($polar)) {
757
+					print '<h2>'._("Coverage pattern").'</h2>';
758
+				foreach ($polar as $eachpolar) {
759
+					unset($polar_data);
760
+					$Spotter = new Spotter();
761
+					$data = json_decode($eachpolar['source_data']);
762
+					foreach($data as $value => $key) {
763
+					$direction = $Spotter->parseDirection(($value*22.5));
764
+					$distance = $key;
765
+					$unit = 'km';
766 766
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
767 767
 					$distance = round($distance*0.539957);
768 768
 					$unit = 'nm';
@@ -773,10 +773,10 @@  discard block
 block discarded – undo
773 773
 					$distance = $distance;
774 774
 					$unit = 'km';
775 775
 				}
776
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
777
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
778
-        		    }
779
-        	?>
776
+					if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
777
+						else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
778
+					}
779
+			?>
780 780
             <div class="col-md-6">
781 781
                 <h4><?php print $eachpolar['source_name']; ?></h4>
782 782
         	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
@@ -808,27 +808,27 @@  discard block
 block discarded – undo
808 808
 		</script>
809 809
             </div>
810 810
             <?php
811
-        	    }
812
-        	}
813
-            ?>
811
+				}
812
+			}
813
+			?>
814 814
         </div>
815 815
         <div class="row column">
816 816
             <div class="col-md-6">
817 817
         	<?php
818
-        	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
819
-        	    if ($year == '' && $month == '') {
820
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
821
-        	    } else {
822
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
823
-        	    }
824
-        	    if (!empty($msg)) {
825
-            		print '<h2>'._("Messages received").'</h2>';
826
-        		foreach ($msg as $eachmsg) {
827
-        		    //$eachmsg = $msg[0];
828
-        		    $data = $eachmsg['source_data'];
829
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
830
-        		    else $max = 500;
831
-        	?>
818
+				//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
819
+				if ($year == '' && $month == '') {
820
+				$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
821
+				} else {
822
+				$msg = $Stats->getStatsSource('msg',$year,$month);
823
+				}
824
+				if (!empty($msg)) {
825
+					print '<h2>'._("Messages received").'</h2>';
826
+				foreach ($msg as $eachmsg) {
827
+					//$eachmsg = $msg[0];
828
+					$data = $eachmsg['source_data'];
829
+					if ($data > 500) $max = (round(($data+100)/100))*100;
830
+					else $max = 500;
831
+			?>
832 832
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
833 833
         	<script>
834 834
 		      var g = new JustGage({
@@ -844,9 +844,9 @@  discard block
 block discarded – undo
844 844
 			  });
845 845
 		</script>
846 846
             <?php
847
-        	   }
848
-        	}
849
-            ?>
847
+			   }
848
+			}
849
+			?>
850 850
             </div>
851 851
         </div>
852 852
         <div class="row column">
@@ -878,19 +878,19 @@  discard block
 block discarded – undo
878 878
 				$hist_data .= '[ "'.$distance.'",'.$nb.'],';
879 879
 			}
880 880
 			$hist_data = substr($hist_data, 0, -1);
881
-            ?>
881
+			?>
882 882
             <div class="col-md-6">
883 883
                 <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
884 884
                 <?php
885
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
885
+				  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
886 886
                     <script> 
887 887
                         google.load("visualization", "1", {packages:["corechart"]});
888 888
                       google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
889 889
                       function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
890 890
                         var data = google.visualization.arrayToDataTable([
891 891
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
892
-                            print $hist_data;
893
-                        print ']);
892
+							print $hist_data;
893
+						print ']);
894 894
 
895 895
                         var options = {
896 896
                             legend: {position: "none"},
@@ -908,15 +908,15 @@  discard block
 block discarded – undo
908 908
                               drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
909 909
                             });
910 910
                   </script>';
911
-        	?>
911
+			?>
912 912
     	    </div>
913 913
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
914 914
         	<?php
915
-                  }
916
-                ?>
915
+				  }
916
+				?>
917 917
         </div>
918 918
 <?php
919
-    }
919
+	}
920 920
 ?>
921 921
     </div>
922 922
 </div>  
Please login to merge, or discard this patch.
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 $Stats = new Stats();
8 8
 
9 9
 if (!isset($filter_name)) $filter_name = '';
10
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 if ($airline_icao == '' && isset($globalFilter)) {
12 12
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
13 13
 }
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	$title = _("Statistics");
23 23
 }
24 24
 
25
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
26
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
25
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
26
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
27 27
 
28 28
 require_once('header.php');
29 29
 
@@ -44,36 +44,36 @@  discard block
 block discarded – undo
44 44
 		date_default_timezone_set('UTC');
45 45
 		$lastupdate = strtotime($last_update[0]['value']);
46 46
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
47
-		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
47
+		print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
48 48
 	}
49 49
     ?>
50 50
     </div>
51 51
     <?php include('statistics-sub-menu.php'); ?>
52 52
     <p class="global-stats">
53
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
54
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
55
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
53
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
54
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
55
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
57 57
 	<?php
58 58
 	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
59 59
 	?>
60
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
61
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
60
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
61
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
62 62
         <?php
63 63
     	    } else {
64 64
     	?>
65
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
66
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
65
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
66
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
67 67
     	<?php
68 68
     	    }
69 69
     	?>
70
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
70
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
72 72
         <?php
73 73
     		if ($airline_icao == '') {
74 74
     	?>
75
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
76
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
75
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
76
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
77 77
 	<?php
78 78
 		}
79 79
 	?>
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
82 82
 			if ($airline_icao == '' || $airline_icao == 'all') {
83 83
 	?>
84
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
85
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
84
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
85
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
86 86
 	<?php
87 87
 			}
88 88
 		}
89 89
 	?>
90 90
     </p>
91
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
92 92
     <div class="specific-stats">
93 93
         <div class="row column">
94 94
             <div class="col-md-6">
95 95
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 96
                  <?php
97
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
97
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
98 98
 		    if (count($aircraft_array) == 0) print _("No data available");
99 99
 		    else {
100 100
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                         var data = google.visualization.arrayToDataTable([
107 107
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
108 108
                             $aircraft_data = '';
109
-                          foreach($aircraft_array as $aircraft_item)
109
+                          foreach ($aircraft_array as $aircraft_item)
110 110
                                     {
111 111
                                             $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
112 112
                                     }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
             	    ?>
144 144
                 </div>
145 145
             </div>
146
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
146
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
147 147
 <?php
148 148
 //    echo $airline_icao;
149 149
     if ($airline_icao == '' || $airline_icao == 'all') {
150
-	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
150
+	$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
151 151
 	if (count($airline_array) > 0) {
152 152
             print '<div class="col-md-6">';
153 153
 	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                         var data = google.visualization.arrayToDataTable([
160 160
                             ["'._("Airline").'", "'._("# of times").'"], ';
161 161
 	    $airline_data = '';
162
-	    foreach($airline_array as $airline_item)
162
+	    foreach ($airline_array as $airline_item)
163 163
 	    {
164 164
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
165 165
 	    }
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 ?>
191 191
         </div>
192
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
192
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
193 193
 <?php
194 194
     }
195 195
 ?>
196 196
         <div class="row column">
197 197
 <?php
198
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
198
+    $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
199 199
     if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
200 200
 	if (empty($flightover_array)) {
201 201
 	    print '<div class="col-md-12">';
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 ?>
206 206
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
207 207
 <?php
208
-	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
208
+	$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
209 209
 	if (count($pilot_array) == 0) print _("No data available");
210 210
 	else {
211 211
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                         var data = google.visualization.arrayToDataTable([
217 217
                             ["'._("Pilots").'", "'._("# of times").'"], ';
218 218
 	    $pilot_data = '';
219
-	    foreach($pilot_array as $pilot_item)
219
+	    foreach ($pilot_array as $pilot_item)
220 220
 	    {
221 221
 		$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
222 222
 	    }
@@ -244,14 +244,14 @@  discard block
 block discarded – undo
244 244
 ?>
245 245
             </div>
246 246
         
247
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
247
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
248 248
 <?php
249 249
     } else {
250 250
 ?>
251 251
             <div class="col-md-6">
252 252
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
253 253
 <?php
254
-	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
254
+	$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
255 255
 	if (count($owner_array) == 0) print _("No data available");
256 256
 	else {
257 257
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                         var data = google.visualization.arrayToDataTable([
263 263
                             ["'._("Owner").'", "'._("# of times").'"], ';
264 264
                             $owner_data = '';
265
-	    foreach($owner_array as $owner_item)
265
+	    foreach ($owner_array as $owner_item)
266 266
 	    {
267 267
 		$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
268 268
 	    }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 </div>
291 291
             </div>
292 292
         
293
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
293
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
294 294
 <?php
295 295
     }
296 296
     if (!empty($flightover_array)) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                         var data = google.visualization.arrayToDataTable([
310 310
                             ["'._("Country").'", "'._("# of times").'"], ';
311 311
                             $flightover_data = '';
312
-	    foreach($flightover_array as $flightover_item)
312
+	    foreach ($flightover_array as $flightover_item)
313 313
 	    {
314 314
 		$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
315 315
 	    }
@@ -342,14 +342,14 @@  discard block
 block discarded – undo
342 342
     }
343 343
 ?>
344 344
         </div>
345
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
345
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
346 346
 
347 347
     	
348 348
         </div>
349 349
         <div class="row column">
350 350
             <div class="col-md-6">
351 351
 <?php
352
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
352
+    $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
353 353
     if (count($airport_airport_array) > 0) {
354 354
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
355 355
 	print '<div id="chart3" class="chart" width="100%"></div>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                 var data = google.visualization.arrayToDataTable([ 
365 365
                     ["'._("Airport").'", "'._("# of times").'"],';
366 366
                     $airport_data = '';
367
-	foreach($airport_airport_array as $airport_item)
367
+	foreach ($airport_airport_array as $airport_item)
368 368
 	{
369 369
 	    $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
370 370
 	    $name = str_replace("'", "", $name);
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
     }
392 392
 ?>
393 393
             </div>
394
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
394
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
395 395
 
396 396
             <div class="col-md-6">
397 397
 <?php
398
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
398
+    $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
399 399
     if (count($airport_airport_array2) > 0) {
400 400
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
401 401
 	print '<div id="chart4" class="chart" width="100%"></div>
@@ -410,10 +410,10 @@  discard block
 block discarded – undo
410 410
                 var data = google.visualization.arrayToDataTable([ 
411 411
                     ["'._("Airport").'", "'._("# of times").'"],';
412 412
 	$airport_data2 = '';
413
-	foreach($airport_airport_array2 as $airport_item2)
413
+	foreach ($airport_airport_array2 as $airport_item2)
414 414
 	{
415 415
 	    $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
416
-	    $name2 = str_replace(array("'",'"'), '', $name2);
416
+	    $name2 = str_replace(array("'", '"'), '', $name2);
417 417
 	    $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
418 418
 	}
419 419
 	$airport_data2 = substr($airport_data2, 0, -1);
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 ?>
438 438
             </div>
439 439
         </div>
440
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
440
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
441 441
 <?php
442 442
     if ($year == '' && $month == '') {
443 443
 ?>
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             <div class="col-md-6">
446 446
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
447 447
                 <?php
448
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
448
+                  $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
449 449
 		    if (count($year_array) == 0) print _("No data available");
450 450
 		    else {
451 451
                   print '<div id="chart8" class="chart" width="100%"></div>
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
                         var data = google.visualization.arrayToDataTable([
457 457
                             ["'._("Month").'", "'._("# of Flights").'"], ';
458 458
                             $year_data = '';
459
-                          foreach($year_array as $year_item)
459
+                          foreach ($year_array as $year_item)
460 460
                                     {
461
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
461
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
462 462
                                     }
463 463
                                     $year_data = substr($year_data, 0, -1);
464 464
                                     print $year_data;
@@ -486,11 +486,11 @@  discard block
 block discarded – undo
486 486
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
487 487
                 </div>
488 488
             </div>
489
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
489
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
490 490
             <div class="col-md-6">
491 491
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
492 492
                 <?php
493
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
493
+                  $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
494 494
 		    if (count($month_array) == 0) print _("No data available");
495 495
 		    else {
496 496
                   print '<div id="chart9" class="chart" width="100%"></div>
@@ -501,9 +501,9 @@  discard block
 block discarded – undo
501 501
                         var data = google.visualization.arrayToDataTable([
502 502
                             ["'._("Day").'", "'._("# of Flights").'"], ';
503 503
                             $month_data = '';
504
-                          foreach($month_array as $month_item)
504
+                          foreach ($month_array as $month_item)
505 505
                                     {
506
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
506
+                                        $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
507 507
                                     }
508 508
                                     $month_data = substr($month_data, 0, -1);
509 509
                                     print $month_data;
@@ -531,12 +531,12 @@  discard block
 block discarded – undo
531 531
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
532 532
                 </div>
533 533
             </div>
534
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
534
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
535 535
 
536 536
             <div class="col-md-6">
537 537
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
538 538
                 <?php
539
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
539
+                    $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
540 540
 		    if (empty($date_array)) print _("No data available");
541 541
 		    else {
542 542
                   print '<div id="chart5" class="chart" width="100%"></div>
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
                             ["'._("Date").'", "'._("# of Flights").'"], ';
549 549
                             $date_data = '';
550 550
                         
551
-                          foreach($date_array as $date_item)
551
+                          foreach ($date_array as $date_item)
552 552
                                     {
553 553
                                         $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
554 554
                                     }
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
579 579
                 </div>
580 580
             </div>
581
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
581
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
582 582
             <div class="col-md-6">
583 583
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
584 584
                 <?php
585
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
585
+                  $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
586 586
 		    if (empty($hour_array)) print _("No data available");
587 587
 		    else {
588 588
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                         var data = google.visualization.arrayToDataTable([
595 595
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
596 596
                             $hour_data = '';
597
-                          foreach($hour_array as $hour_item)
597
+                          foreach ($hour_array as $hour_item)
598 598
                                     {
599 599
                                         $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
600 600
                                     }
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
625 625
                 </div>
626 626
             </div>
627
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
627
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
628 628
         </div>
629 629
 <?php
630 630
     }
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
                         var data = google.visualization.arrayToDataTable([
651 651
                             ["'._("Year").'", "'._("# of Fatalities").'"], ';
652 652
                             $year_data = '';
653
-                          foreach($year_array as $year_item)
653
+                          foreach ($year_array as $year_item)
654 654
                                     {
655 655
                                         $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
656 656
                                     }
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
681 681
                 </div>
682 682
             </div>
683
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
683
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
684 684
 
685 685
         <div class="row column">
686 686
             <div class="col-md-6">
@@ -699,9 +699,9 @@  discard block
 block discarded – undo
699 699
                         var data = google.visualization.arrayToDataTable([
700 700
                             ["'._("Month").'", "'._("# of Fatalities").'"], ';
701 701
                             $year_data = '';
702
-                          foreach($year_array as $year_item)
702
+                          foreach ($year_array as $year_item)
703 703
                                     {
704
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
704
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
705 705
                                     }
706 706
                                     $year_data = substr($year_data, 0, -1);
707 707
                                     print $year_data;
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
730 730
                 </div>
731 731
             </div>
732
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
732
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
733 733
 <br/>
734 734
 <?php
735 735
     }
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
         	<?php
743 743
         	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
744 744
         	    if ($year == '' && $month == '') {
745
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
745
+		        $polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
746 746
 		    } else {
747
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
747
+        		$polar = $Stats->getStatsSource('polar', $year, $month);
748 748
         	    }
749 749
         	    if (!empty($polar)) {
750 750
             		print '<h2>'._("Coverage pattern").'</h2>';
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
         		    unset($polar_data);
753 753
 	        	    $Spotter = new Spotter();
754 754
         		    $data = json_decode($eachpolar['source_data']);
755
-        		    foreach($data as $value => $key) {
755
+        		    foreach ($data as $value => $key) {
756 756
         			$direction = $Spotter->parseDirection(($value*22.5));
757 757
         			$distance = $key;
758 758
         			$unit = 'km';
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
         	?>
773 773
             <div class="col-md-6">
774 774
                 <h4><?php print $eachpolar['source_name']; ?></h4>
775
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
775
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
776 776
         	<script>
777 777
         	    (function() {
778 778
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 		      color: color,
797 797
 		      unit: '<?php echo $unit; ?>'
798 798
 		    };
799
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
799
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
800 800
 		    })();
801 801
 		</script>
802 802
             </div>
@@ -810,22 +810,22 @@  discard block
 block discarded – undo
810 810
         	<?php
811 811
         	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
812 812
         	    if ($year == '' && $month == '') {
813
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
813
+        		$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
814 814
         	    } else {
815
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
815
+        		$msg = $Stats->getStatsSource('msg', $year, $month);
816 816
         	    }
817 817
         	    if (!empty($msg)) {
818 818
             		print '<h2>'._("Messages received").'</h2>';
819 819
         		foreach ($msg as $eachmsg) {
820 820
         		    //$eachmsg = $msg[0];
821 821
         		    $data = $eachmsg['source_data'];
822
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
822
+        		    if ($data > 500) $max = (round(($data + 100)/100))*100;
823 823
         		    else $max = 500;
824 824
         	?>
825
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
825
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
826 826
         	<script>
827 827
 		      var g = new JustGage({
828
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
828
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
829 829
 			    value: <?php echo $data; ?>,
830 830
 			    min: 0,
831 831
 			    max: <?php print $max; ?>,
@@ -847,15 +847,15 @@  discard block
 block discarded – undo
847 847
             <?php
848 848
 		//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
849 849
 		if ($year == '' && $month == '') {
850
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
850
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
851 851
 		} else {
852
-			$hist = $Stats->getStatsSource('hist',$year,$month);
852
+			$hist = $Stats->getStatsSource('hist', $year, $month);
853 853
 		}
854 854
 		foreach ($hist as $hists) {
855 855
 			$hist_data = '';
856 856
 			$source = $hists['source_name'];
857 857
 			$hist_array = json_decode($hists['source_data']);
858
-			foreach($hist_array as $distance => $nb)
858
+			foreach ($hist_array as $distance => $nb)
859 859
 			{
860 860
 				$unit = 'km';
861 861
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -873,13 +873,13 @@  discard block
 block discarded – undo
873 873
 			$hist_data = substr($hist_data, 0, -1);
874 874
             ?>
875 875
             <div class="col-md-6">
876
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
876
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
877 877
                 <?php
878
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
878
+                  print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div>
879 879
                     <script> 
880 880
                         google.load("visualization", "1", {packages:["corechart"]});
881
-                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
882
-                      function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
881
+                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).');
882
+                      function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() {
883 883
                         var data = google.visualization.arrayToDataTable([
884 884
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
885 885
                             print $hist_data;
@@ -894,16 +894,16 @@  discard block
 block discarded – undo
894 894
                             colors: ["#1a3151"]
895 895
                         };
896 896
 
897
-                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'"));
897
+                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'"));
898 898
                         chart.draw(data, options);
899 899
                       }
900 900
                       $(window).resize(function(){
901
-                              drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
901
+                              drawCharthist_'.str_replace(' ', '_', strtolower($source)).'();
902 902
                             });
903 903
                   </script>';
904 904
         	?>
905 905
     	    </div>
906
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
906
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
907 907
         	<?php
908 908
                   }
909 909
                 ?>
Please login to merge, or discard this patch.
Braces   +56 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,11 +6,15 @@  discard block
 block discarded – undo
6 6
 $beginpage = microtime(true);
7 7
 $Stats = new Stats();
8 8
 
9
-if (!isset($filter_name)) $filter_name = '';
9
+if (!isset($filter_name)) {
10
+	$filter_name = '';
11
+}
10 12
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
11 13
 if ($airline_icao == '' && isset($globalFilter)) {
12
-	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
13
-}
14
+	if (isset($globalFilter['airline'])) {
15
+		$airline_icao = $globalFilter['airline'][0];
16
+	}
17
+	}
14 18
 if ($airline_icao != '' && $airline_icao != 'all') {
15 19
 	$Spotter = new Spotter();
16 20
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
@@ -36,14 +40,21 @@  discard block
 block discarded – undo
36 40
 <script type="text/javascript" src="<?php echo $globalURL; ?>/js/justgage.js"></script>
37 41
 <div class="column">
38 42
     <div class="info">
39
-            <h1><?php if (isset($airline_name)) echo _("Statistics for ").$airline_name; else echo _("Statistics"); ?></h1>
43
+            <h1><?php if (isset($airline_name)) {
44
+	echo _("Statistics for ").$airline_name;
45
+} else {
46
+	echo _("Statistics");
47
+}
48
+?></h1>
40 49
     <?php 
41 50
 	$last_update = $Stats->getLastStatsUpdate();
42 51
 	//if (isset($last_update[0]['value'])) print '<!-- Last update : '.$last_update[0]['value'].' -->';
43 52
 	if (isset($last_update[0]['value'])) {
44 53
 		date_default_timezone_set('UTC');
45 54
 		$lastupdate = strtotime($last_update[0]['value']);
46
-		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
55
+		if (isset($globalTimezone) && $globalTimezone != '') {
56
+			date_default_timezone_set($globalTimezone);
57
+		}
47 58
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
48 59
 	}
49 60
     ?>
@@ -95,8 +106,9 @@  discard block
 block discarded – undo
95 106
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 107
                  <?php
97 108
                   $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
98
-		    if (count($aircraft_array) == 0) print _("No data available");
99
-		    else {
109
+		    if (count($aircraft_array) == 0) {
110
+		    	print _("No data available");
111
+		    } else {
100 112
 
101 113
                     print '<div id="chart1" class="chart" width="100%"></div>
102 114
                     <script> 
@@ -206,8 +218,9 @@  discard block
 block discarded – undo
206 218
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
207 219
 <?php
208 220
 	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
209
-	if (count($pilot_array) == 0) print _("No data available");
210
-	else {
221
+	if (count($pilot_array) == 0) {
222
+		print _("No data available");
223
+	} else {
211 224
 	    print '<div id="chart7" class="chart" width="100%"></div>
212 225
                     <script> 
213 226
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -252,8 +265,9 @@  discard block
 block discarded – undo
252 265
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
253 266
 <?php
254 267
 	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
255
-	if (count($owner_array) == 0) print _("No data available");
256
-	else {
268
+	if (count($owner_array) == 0) {
269
+		print _("No data available");
270
+	} else {
257 271
 	    print '<div id="chart7" class="chart" width="100%"></div>
258 272
                     <script> 
259 273
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -299,8 +313,9 @@  discard block
 block discarded – undo
299 313
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
300 314
 <?php
301 315
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
302
-	if (count($flightover_array) == 0) print _("No data available");
303
-	else {
316
+	if (count($flightover_array) == 0) {
317
+		print _("No data available");
318
+	} else {
304 319
 	    print '<div id="chart10" class="chart" width="100%"></div>
305 320
                     <script> 
306 321
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -446,8 +461,9 @@  discard block
 block discarded – undo
446 461
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
447 462
                 <?php
448 463
                   $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
449
-		    if (count($year_array) == 0) print _("No data available");
450
-		    else {
464
+		    if (count($year_array) == 0) {
465
+		    	print _("No data available");
466
+		    } else {
451 467
                   print '<div id="chart8" class="chart" width="100%"></div>
452 468
                     <script> 
453 469
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -491,8 +507,9 @@  discard block
 block discarded – undo
491 507
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
492 508
                 <?php
493 509
                   $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
494
-		    if (count($month_array) == 0) print _("No data available");
495
-		    else {
510
+		    if (count($month_array) == 0) {
511
+		    	print _("No data available");
512
+		    } else {
496 513
                   print '<div id="chart9" class="chart" width="100%"></div>
497 514
                     <script> 
498 515
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -537,8 +554,9 @@  discard block
 block discarded – undo
537 554
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
538 555
                 <?php
539 556
                     $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
540
-		    if (empty($date_array)) print _("No data available");
541
-		    else {
557
+		    if (empty($date_array)) {
558
+		    	print _("No data available");
559
+		    } else {
542 560
                   print '<div id="chart5" class="chart" width="100%"></div>
543 561
                     <script> 
544 562
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -583,8 +601,9 @@  discard block
 block discarded – undo
583 601
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
584 602
                 <?php
585 603
                   $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
586
-		    if (empty($hour_array)) print _("No data available");
587
-		    else {
604
+		    if (empty($hour_array)) {
605
+		    	print _("No data available");
606
+		    } else {
588 607
 
589 608
                   print '<div id="chart6" class="chart" width="100%"></div>
590 609
                     <script> 
@@ -640,8 +659,9 @@  discard block
 block discarded – undo
640 659
 		    require_once('require/class.Accident.php');
641 660
             	    $Accident = new Accident();
642 661
                   $year_array = $Accident->countFatalitiesByYear($filter_name);
643
-		    if (count($year_array) == 0) print _("No data available");
644
-		    else {
662
+		    if (count($year_array) == 0) {
663
+		    	print _("No data available");
664
+		    } else {
645 665
                   print '<div id="chart32" class="chart" width="100%"></div>
646 666
                     <script> 
647 667
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -689,8 +709,9 @@  discard block
 block discarded – undo
689 709
 		    require_once('require/class.Accident.php');
690 710
             	    $Accident = new Accident();
691 711
                   $year_array = $Accident->countFatalitiesLast12Months($filter_name);
692
-		    if (count($year_array) == 0) print _("No data available");
693
-		    else {
712
+		    if (count($year_array) == 0) {
713
+		    	print _("No data available");
714
+		    } else {
694 715
                   print '<div id="chart33" class="chart" width="100%"></div>
695 716
                     <script> 
696 717
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -766,8 +787,11 @@  discard block
 block discarded – undo
766 787
 					$distance = $distance;
767 788
 					$unit = 'km';
768 789
 				}
769
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
770
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
790
+        			if (!isset($polar_data)) {
791
+        				$polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
792
+        			} else {
793
+        	    			$polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
794
+        	    		}
771 795
         		    }
772 796
         	?>
773 797
             <div class="col-md-6">
@@ -819,8 +843,11 @@  discard block
 block discarded – undo
819 843
         		foreach ($msg as $eachmsg) {
820 844
         		    //$eachmsg = $msg[0];
821 845
         		    $data = $eachmsg['source_data'];
822
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
823
-        		    else $max = 500;
846
+        		    if ($data > 500) {
847
+        		    	$max = (round(($data+100)/100))*100;
848
+        		    } else {
849
+        		    	$max = 500;
850
+        		    }
824 851
         	?>
825 852
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
826 853
         	<script>
Please login to merge, or discard this patch.
statistics-fatalities-month.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
             	["'._("Month").'", "'._("# 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
-	$date_data .= '[ "'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'",'.$date_item['count'].'],';
28
+	$date_data .= '[ "'.date('F, Y', strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'",'.$date_item['count'].'],';
29 29
 }
30 30
 $date_data = substr($date_data, 0, -1);
31 31
 print $date_data;
@@ -50,13 +50,13 @@  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
 		$months[$key] = $row['month'];
56 56
 		$counts[$key] = $row['count'];
57 57
 	}
58 58
 //	array_multisort($years,SORT_DESC,$months,SORT_DESC,$date_array);
59
-	array_multisort($counts,SORT_DESC,$date_array);
59
+	array_multisort($counts, SORT_DESC, $date_array);
60 60
 	print '<div class="table-responsive">';
61 61
 	print '<table class="common-date table-striped">';
62 62
 	print '<thead>';
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
 	print '</thead>';
67 67
 	print '<tbody>';
68 68
 	$i = 1;
69
-	foreach($date_array as $date_item)
69
+	foreach ($date_array as $date_item)
70 70
 	{
71 71
 		print '<tr>';
72 72
 		print '<td><strong>'.$i.'</strong></td>';
73 73
 		print '<td>';
74 74
 		if ($date_item['month'] < 10) $month = '0'.$date_item['month'];
75 75
 		else $month = $date_item['month'];
76
-		print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$month.'">'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>';
76
+		print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$month.'">'.date('F, Y', strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>';
77 77
 		print '</td>';
78 78
 		print '<td>';
79 79
 		print $date_item['count'];
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,11 @@
 block discarded – undo
71 71
 		print '<tr>';
72 72
 		print '<td><strong>'.$i.'</strong></td>';
73 73
 		print '<td>';
74
-		if ($date_item['month'] < 10) $month = '0'.$date_item['month'];
75
-		else $month = $date_item['month'];
74
+		if ($date_item['month'] < 10) {
75
+			$month = '0'.$date_item['month'];
76
+		} else {
77
+			$month = $date_item['month'];
78
+		}
76 79
 		print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$month.'">'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>';
77 80
 		print '</td>';
78 81
 		print '<td>';
Please login to merge, or discard this patch.