Completed
Push — master ( 7bb360...c01d59 )
by Yannick
22:07
created
date-statistics-route.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Routes on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Routes on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
28 28
 	print '<br />';
29 29
 	print '<div class="info column">';
30
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31 31
 	print '</div>';
32 32
 
33 33
 	include('date-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Routes").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37 37
 
38 38
 	$route_array = $Spotter->countAllRoutesByDate($date);
39 39
 	if (!empty($route_array))
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		print '</thead>';
51 51
 		print '<tbody>';
52 52
 		$i = 1;
53
-		foreach($route_array as $route_item)
53
+		foreach ($route_array as $route_item)
54 54
 		{
55 55
 			print '<tr>';
56 56
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
date-statistics-airline-country.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8 8
 
9 9
 $Spotter = new Spotter();
10
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
10
+if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
11 11
 else $spotter_array = array();
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
15
+	$title = sprintf(_("Most Common Airlines by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
16 16
 	require_once('header.php');
17 17
 	print '<div class="select-item">';
18 18
 	print '<form action="'.$globalURL.'/date" method="post" class="form-inline">';
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
30 30
 	print '<br />';
31 31
 	print '<div class="info column">';
32
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
32
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
33 33
 	print '</div>';
34 34
 
35 35
 	include('date-sub-menu.php');
36 36
 	print '<div class="column">';
37 37
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
38
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
38
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
39 39
 
40 40
 	$airline_array = $Spotter->countAllAirlineCountriesByDate($date);
41 41
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             var data = google.visualization.arrayToDataTable([
48 48
             	["'._("Country").'", "'._("# of times").'"], ';
49 49
 	$country_data = '';
50
-	foreach($airline_array as $airline_item)
50
+	foreach ($airline_array as $airline_item)
51 51
 	{
52 52
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
53 53
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		print '</thead>';
82 82
 		print '<tbody>';
83 83
 		$i = 1;
84
-		foreach($airline_array as $airline_item)
84
+		foreach ($airline_array as $airline_item)
85 85
 		{
86 86
 			print '<tr>';
87 87
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
manufacturer-statistics-airline.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/manufacturer');
8 8
         die();
9 9
 }
10
-$aircraft_manufacturer = filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING);
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$aircraft_manufacturer = filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING);
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12 12
 $Spotter = new Spotter();
13 13
 $manufacturer = ucwords(str_replace("-", " ", $aircraft_manufacturer));
14 14
 
15
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
15
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
16 16
 
17 17
 if (!empty($spotter_array))
18 18
 {
19
-	$title = sprintf(_("Most Common Airlines from %s"),$manufacturer);
19
+	$title = sprintf(_("Most Common Airlines from %s"), $manufacturer);
20 20
 
21 21
 	require_once('header.php');
22 22
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$Stats = new Stats();
26 26
 	$all_manufacturers = $Stats->getAllManufacturers();
27 27
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
28
-	foreach($all_manufacturers as $all_manufacturer)
28
+	foreach ($all_manufacturers as $all_manufacturer)
29 29
 	{
30
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
30
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
31 31
 		{
32 32
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
33 33
 		} else {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	include('manufacturer-sub-menu.php');
47 47
 	print '<div class="column">';
48 48
 	print '<h2>'._("Most Common Airlines").'</h2>';
49
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s</strong>."),$manufacturer).'</p>';
49
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s</strong>."), $manufacturer).'</p>';
50 50
 	$airline_array = $Spotter->countAllAirlinesByManufacturer($manufacturer);
51 51
 	if (!empty($airline_array))
52 52
 	{
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		print '</thead>';
63 63
 		print '<tbody>';
64 64
 		$i = 1;
65
-		foreach($airline_array as $airline_item)
65
+		foreach ($airline_array as $airline_item)
66 66
 		{
67 67
 			print '<tr>';
68 68
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-registration.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airline');
8 8
         die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
16
+	$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
17 17
 	require_once('header.php');
18 18
 
19 19
 	print '<div class="select-item">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$airline_names = $Stats->getAllAirlineNames();
25 25
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
26
-	foreach($airline_names as $airline_name)
26
+	foreach ($airline_names as $airline_name)
27 27
 	{
28
-		if($airline == $airline_name['airline_icao'])
28
+		if ($airline == $airline_name['airline_icao'])
29 29
 		{
30 30
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
31 31
 		} else {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	include('airline-sub-menu.php');
64 64
 	print '<div class="column">';
65 65
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
66
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
66
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
67 67
 
68 68
 	$aircraft_array = $Spotter->countAllAircraftRegistrationByAirline($airline);
69 69
 	if (!empty($aircraft_array))
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		print '</thead>';
81 81
 		print '<tbody>';
82 82
 		$i = 1;
83
-		foreach($aircraft_array as $aircraft_item)
83
+		foreach ($aircraft_array as $aircraft_item)
84 84
 		{
85 85
 			print '<tr>';
86 86
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-aircraft.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airline');
8 8
         die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Aircraft from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
16
+	$title = sprintf(_("Most Common Aircraft from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/airline" method="post">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24 24
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
25
-	foreach($airline_names as $airline_name)
25
+	foreach ($airline_names as $airline_name)
26 26
 	{
27
-		if($airline == $airline_name['airline_icao'])
27
+		if ($airline == $airline_name['airline_icao'])
28 28
 		{
29 29
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
30 30
 		} else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	include('airline-sub-menu.php');
63 63
 	print '<div class="column">';
64 64
 	print '<h2>'._("Most Common Aircraft").'</h2>';
65
-	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
65
+	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
66 66
 
67 67
 	$aircraft_array = $Spotter->countAllAircraftTypesByAirline($airline);
68 68
 	if (!empty($aircraft_array))
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		print '</thead>';
78 78
 		print '<tbody>';
79 79
 		$i = 1;
80
-		foreach($aircraft_array as $aircraft_item)
80
+		foreach ($aircraft_array as $aircraft_item)
81 81
 		{
82 82
 			print '<tr>';
83 83
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	print '<div class="column">';
16 16
 	print '<h1>'._("Airlines").'</h1>';
17 17
 	if (isset($_POST['airline_type'])) {
18
-		$airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING);
18
+		$airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING);
19 19
 		//$airline_names = $Spotter->getAllAirlineNames($airline_type);
20 20
 	} else {
21 21
 		//$airline_names = $Spotter->getAllAirlineNames();
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	$Stats = new Stats();
38 38
 	if (isset($_POST['airline_type'])) 
39 39
 	{
40
-		$airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING);
40
+		$airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING);
41 41
 		//$airline_names = $Stats->getAllAirlineNames($airline_type);
42 42
 		$airline_names = $Spotter->getAllAirlineNames($airline_type);
43 43
 	} else {
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 	$previous = null;
52 52
 	print '<div class="alphabet-legend">';
53
-	foreach($airline_names as $value) 
53
+	foreach ($airline_names as $value) 
54 54
 	{
55 55
 		//echo $value['airline_name']."\n";
56 56
 		//echo mb_substr($value['airline_name'],0,1).' - '.$value['airline_name']."\n";
57
-		$firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1),'UTF-8');
58
-		if($previous !== $firstLetter)
57
+		$firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1), 'UTF-8');
58
+		if ($previous !== $firstLetter)
59 59
 		{
60 60
 			if ($previous !== null) print ' | ';
61 61
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 	}
65 65
 	print '</div>';
66 66
 	$previous = null;
67
-	foreach($airline_names as $value) {
67
+	foreach ($airline_names as $value) {
68 68
 		$firstLetter = strtoupper(substr($value['airline_name'], 0, 1));
69 69
 		if ($firstLetter != "")
70 70
 		{
71
-			if($previous !== $firstLetter)
71
+			if ($previous !== $firstLetter)
72 72
 			{
73 73
 				if ($previous !== null) print '</div>';
74 74
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
airline-detailed.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,17 +4,17 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 
7
-if (!isset($_GET['airline'])){
7
+if (!isset($_GET['airline'])) {
8 8
 	header('Location: '.$globalURL.'/airline');
9
-} else{
9
+} else {
10 10
 	$Spotter = new Spotter();
11 11
 	//calculuation for the pagination
12
-	if(!isset($_GET['limit']) || $_GET['limit'] == "")
12
+	if (!isset($_GET['limit']) || $_GET['limit'] == "")
13 13
 	{
14 14
 		$limit_start = 0;
15 15
 		$limit_end = 25;
16 16
 		$absolute_difference = 25;
17
-	}  else {
17
+	} else {
18 18
 		$limit_explode = explode(",", $_GET['limit']);
19 19
 		$limit_start = $limit_explode[0];
20 20
 		$limit_end = $limit_explode[1];
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	$limit_previous_1 = $limit_start - $absolute_difference;
29 29
 	$limit_previous_2 = $limit_end - $absolute_difference;
30 30
 	
31
-	$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
31
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
32 32
 	$page_url = $globalURL.'/airline/'.$airline;
33 33
 	
34
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
35
-	$spotter_array = $Spotter->getSpotterDataByAirline($_GET['airline'],$limit_start.",".$absolute_difference, $sort);
34
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
35
+	$spotter_array = $Spotter->getSpotterDataByAirline($_GET['airline'], $limit_start.",".$absolute_difference, $sort);
36 36
 	
37 37
 	if (!empty($spotter_array))
38 38
 	{
39 39
 		if (isset($spotter_array[0]['airline_name']) && isset($spotter_array[0]['airline_icao'])) {
40
-			$title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
40
+			$title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
41 41
 		} else $title = '';
42 42
 		require_once('header.php');
43 43
 	  
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 		$Stats = new Stats();
49 49
 		$airline_names = $Stats->getAllAirlineNames();
50 50
 		if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
51
-		foreach($airline_names as $airline_name)
51
+		foreach ($airline_names as $airline_name)
52 52
 		{
53
-			if($_GET['airline'] == $airline_name['airline_icao'])
53
+			if ($_GET['airline'] == $airline_name['airline_icao'])
54 54
 			{
55 55
 				print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
56 56
 			} else {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		include('airline-sub-menu.php');
89 89
 		print '<div class="table column">';
90 90
 		if (isset($spotter_array[0]['airline_name'])) {
91
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
91
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
92 92
 		}
93 93
 
94 94
 		include('table-output.php');  
Please login to merge, or discard this patch.
manufacturer-statistics-route.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13 13
 
14
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
14
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
15 15
 
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Routes from %s"),$manufacturer);
18
+	$title = sprintf(_("Most Common Routes from %s"), $manufacturer);
19 19
 
20 20
 	require_once('header.php');
21 21
 	print '<div class="select-item">';
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 	$Stats = new Stats();
25 25
 	$all_manufacturers = $Stats->getAllManufacturers();
26 26
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
27
-	foreach($all_manufacturers as $all_manufacturer)
27
+	foreach ($all_manufacturers as $all_manufacturer)
28 28
 	{
29
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
29
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
30 30
 		{
31 31
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
32 32
 		} else {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	include('manufacturer-sub-menu.php');
46 46
 	print '<div class="column">';
47 47
 	print '<h2>'._("Most Common Routes").'</h2>';
48
-	print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$manufacturer).'</p>';
48
+	print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $manufacturer).'</p>';
49 49
 
50 50
 	$route_array = $Spotter->countAllRoutesByManufacturer($manufacturer);
51 51
 	if (!empty($route_array))
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		print '</thead>';
63 63
 		print '<tbody>';
64 64
 		$i = 1;
65
-		foreach($route_array as $route_item)
65
+		foreach ($route_array as $route_item)
66 66
 		{
67 67
 			print '<tr>';
68 68
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airport-statistics-departure-airport.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airport');
8 8
         die();
9 9
 }
10
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
13 13
 $airport_array = $Spotter->getAllAirportInfo($airport);
14 14
 
15 15
 if (!empty($airport_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Departure Airports to %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Departure Airports to %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 	require_once('header.php');
19 19
 	print '<div class="select-item">';
20 20
 	print '<form action="'.$globalURL.'/airport" method="post">';
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 	$airport_names = $Stats->getAllAirportNames();
25 25
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26 26
 	ksort($airport_names);
27
-	foreach($airport_names as $airport_name)
27
+	foreach ($airport_names as $airport_name)
28 28
 	{
29
-		if($airport == $airport_name['airport_icao'])
29
+		if ($airport == $airport_name['airport_icao'])
30 30
 		{
31 31
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
32 32
 		} else {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	include('airport-sub-menu.php');
57 57
 	print '<div class="column">';
58 58
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
59
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights to <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
59
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights to <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
60 60
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByAirport($airport);
61 61
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
62 62
     	<script>
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         var data = google.visualization.arrayToDataTable([ 
71 71
         	["'._("Airport").'", "'._("# of times").'"],';
72 72
 	$airport_data = '';
73
-	foreach($airport_airport_array as $airport_item)
73
+	foreach ($airport_airport_array as $airport_item)
74 74
 	{
75 75
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
76 76
 		$name = str_replace("'", "", $name);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	print '</thead>';
110 110
 	print '<tbody>';
111 111
 	$i = 1;
112
-	foreach($airport_airport_array as $airport_item)
112
+	foreach ($airport_airport_array as $airport_item)
113 113
 	{
114 114
 		print '<tr>';
115 115
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.