Completed
Push — master ( 7f80fe...90f8d8 )
by Yannick
08:33
created
manufacturer-statistics-time.php 1 patch
Spacing   +11 added lines, -11 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)));
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12 12
 
13
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
14
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
13
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
14
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
15 15
 
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Time of Day from %s"),$manufacturer);
18
+	$title = sprintf(_("Most Common Time of Day from %s"), $manufacturer);
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
21 21
 	print '<form action="'.$globalURL.'/manufacturer" method="post">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25 25
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
-	foreach($all_manufacturers as $all_manufacturer)
26
+	foreach ($all_manufacturers as $all_manufacturer)
27 27
 	{
28
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
28
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
29 29
 		{
30 30
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
31 31
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	include('manufacturer-sub-menu.php');
45 45
 	print '<div class="column">';
46 46
 	print '<h2>'._("Most Common Time of Day").'</h2>';
47
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$manufacturer).'</p>';
47
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $manufacturer).'</p>';
48 48
 
49 49
 	$hour_array = $Spotter->countAllHoursByManufacturer($manufacturer);
50 50
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	$hour_data = '';
55 55
 	$hour_cnt = '';
56 56
 	$last = 0;
57
-	foreach($hour_array as $hour_item)
57
+	foreach ($hour_array as $hour_item)
58 58
 	{
59
-		while($last != $hour_item['hour_name']) {
59
+		while ($last != $hour_item['hour_name']) {
60 60
 			$hour_data .= '"'.$last.':00",';
61 61
 			$hour_cnt .= '0,';
62 62
 			$last++;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		$hour_cnt .= $hour_item['hour_count'].',';
67 67
 	}
68 68
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
69
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
69
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
70 70
 	print 'c3.generate({
71 71
 	    bindto: "#chartHour",
72 72
 	    data: {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		print '</thead>';
92 92
 		print '<tbody>';
93 93
 		$i = 1;
94
-		foreach($hour_array as $hour_item)
94
+		foreach ($hour_array as $hour_item)
95 95
 		{
96 96
 			print '<tr>';
97 97
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
airport-statistics-time.php 1 patch
Spacing   +10 added lines, -10 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 Time of Day to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($airport == $airport_name['airport_icao'])
30
+		if ($airport == $airport_name['airport_icao'])
31 31
 		{
32 32
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Time of Day").'</h2>';
61
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 
63 63
 	$hour_array = $Spotter->countAllHoursByAirport($airport);
64 64
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	$hour_data = '';
69 69
 	$hour_cnt = '';
70 70
 	$last = 0;
71
-	foreach($hour_array as $hour_item)
71
+	foreach ($hour_array as $hour_item)
72 72
 	{
73
-		while($last != $hour_item['hour_name']) {
73
+		while ($last != $hour_item['hour_name']) {
74 74
 			$hour_data .= '"'.$last.':00",';
75 75
 			$hour_cnt .= '0,';
76 76
 			$last++;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		$hour_cnt .= $hour_item['hour_count'].',';
81 81
 	}
82 82
 	$hour_data = "[".substr($hour_data, 0, -1)."]";
83
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
83
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
84 84
 	print 'c3.generate({
85 85
 	    bindto: "#chartHour",
86 86
 	    data: {
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		print '</thead>';
104 104
 		print '<tbody>';
105 105
 		$i = 1;
106
-		foreach($hour_array as $hour_item)
106
+		foreach ($hour_array as $hour_item)
107 107
 		{
108 108
 			print '<tr>';
109 109
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
route-statistics-time.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@  discard block
 block discarded – undo
9 9
 require_once('require/class.Language.php');
10 10
 
11 11
 $Spotter = new Spotter();
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING);
14
-$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING);
14
+$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING);
15 15
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
16 16
 	$spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
17 17
 } else $spotter_array = array();
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
21
+	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
22 22
 	require_once('header.php');
23 23
 	print '<div class="info column">';
24 24
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	include('route-sub-menu.php');
30 30
 	print '<div class="column">';
31 31
 	print '<h2>'._("Most Common Time of Day").'</h2>';
32
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
32
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
33 33
 
34 34
 	$hour_array = $Spotter->countAllHoursByRoute($departure_airport, $arrival_airport);
35 35
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 	$hour_data = '';
40 40
 	$hour_cnt = '';
41 41
 	$last = 0;
42
-	foreach($hour_array as $hour_item)
42
+	foreach ($hour_array as $hour_item)
43 43
 	{
44
-		while($last != $hour_item['hour_name']) {
44
+		while ($last != $hour_item['hour_name']) {
45 45
 			$hour_data .= '"'.$last.':00",';
46 46
 			$hour_cnt .= '0,';
47 47
 			$last++;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$hour_cnt .= $hour_item['hour_count'].',';
52 52
 	}
53 53
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
54
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
54
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
55 55
 	print 'c3.generate({
56 56
 	    bindto: "#chartHour",
57 57
 	    data: {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		print '</thead>';
77 77
 		print '<tbody>';
78 78
 		$i = 1;
79
-		foreach($hour_array as $hour_item)
79
+		foreach ($hour_array as $hour_item)
80 80
 		{
81 81
 			print '<tr>';
82 82
 			print '<td>'.$hour_item['hour_name'].':00</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="'.$globalURL.'/js/d3.min.js"></script>';
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
45 45
 	print 'var series = [';
46 46
 	$country_data = '';
47
-	foreach($airline_array as $airline_item)
47
+	foreach ($airline_array as $airline_item)
48 48
 	{
49 49
 		$country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airport_item['airline_country_count'].'],';
50 50
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		print '</thead>';
92 92
 		print '<tbody>';
93 93
 		$i = 1;
94
-		foreach($airline_array as $airline_item)
94
+		foreach ($airline_array as $airline_item)
95 95
 		{
96 96
 			print '<tr>';
97 97
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-statistics-departure-airport.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
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "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]['ident']);
16
+	$title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-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 with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident);
29 29
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
30 30
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	print '<script>';
34 34
 	print 'var series = [';
35 35
 	$airport_data = '';
36
-	foreach($airport_airport_array as $airport_item)
36
+	foreach ($airport_airport_array as $airport_item)
37 37
 	{
38 38
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_name'].' ('.$airport_item['airport_departure_icao'].')",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
39 39
 	}
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	print '</thead>';
89 89
 	print '<tbody>';
90 90
 	$i = 1;
91
-	foreach($airport_airport_array as $airport_item)
91
+	foreach ($airport_airport_array as $airport_item)
92 92
 	{
93 93
 		print '<tr>';
94 94
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airport-detailed.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 			$metar_info = $METAR->getMETAR($airport_icao);
49 49
 			//print_r($metar_info);
50 50
 			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
51
-            		//print_r($metar_parse);
51
+					//print_r($metar_parse);
52 52
 		}
53 53
 		
54 54
 		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Stats.php');
6 6
 require_once('require/class.METAR.php');
7 7
 
8
-if (!isset($_GET['airport'])){
8
+if (!isset($_GET['airport'])) {
9 9
 	header('Location: '.$globalURL.'/airport');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	//calculation for the pagination
13
-	if(!isset($_GET['limit']))
13
+	if (!isset($_GET['limit']))
14 14
 	{
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 	$limit_next = $limit_end + $absolute_difference;
29 29
 	$limit_previous_1 = $limit_start - $absolute_difference;
30 30
 	$limit_previous_2 = $limit_end - $absolute_difference;
31
-	$airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
31
+	$airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
32 32
 	$airport = $airport_icao;
33 33
 	$page_url = $globalURL.'/airport/'.$airport_icao;
34 34
 	
35 35
 	if (isset($_GET['sort'])) {
36
-		$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort);
36
+		$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort);
38 38
 	} else {
39
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, '');
39
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, '');
40 40
 	}
41 41
 	$airport_array = $Spotter->getAllAirportInfo($airport_icao);
42 42
 	
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             		//print_r($metar_parse);
52 52
 		}
53 53
 		
54
-		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
54
+		$title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
55 55
 
56 56
 		require_once('header.php');
57 57
 		
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 		$airport_names = $Stats->getAllAirportNames();
64 64
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
65 65
 		ksort($airport_names);
66
-		foreach($airport_names as $airport_name)
66
+		foreach ($airport_names as $airport_name)
67 67
 		{
68
-			if($airport_icao == $airport_name['airport_icao'])
68
+			if ($airport_icao == $airport_name['airport_icao'])
69 69
 			{
70 70
 				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>';
71 71
 			} else {
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 				$date_data = '';
112 112
 				$departure_data = '';
113 113
 				$arrival_data = '';
114
-				foreach($all_data as $data)
114
+				foreach ($all_data as $data)
115 115
 				{
116 116
 					$date_data .= '"'.$data['date'].'",';
117 117
 					$departure_data .= $data['departure'].',';
118 118
 					$arrival_data .= $data['arrival'].',';
119 119
 				}
120
-				$date_data = "['x',".substr($date_data,0,-1)."]";
121
-				$departure_data = "['departure',".substr($departure_data,0,-1)."]";
122
-				$arrival_data = "['arrival',".substr($arrival_data,0,-1)."]";
120
+				$date_data = "['x',".substr($date_data, 0, -1)."]";
121
+				$departure_data = "['departure',".substr($departure_data, 0, -1)."]";
122
+				$arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]";
123 123
 				print 'c3.generate({
124 124
 				    bindto: "#chart",
125 125
 				    data: {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 					print _("Dew point:").' '.$metar_parse['dew'].' °C'." - ";
177 177
 				}
178 178
 				if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
179
-					$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
179
+					$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
180 180
 					print _("Humidity:").' '.$humidity.'%'." - ";
181 181
 				}
182 182
 				if (isset($metar_parse['QNH'])) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		print '<div class="table column">';
193 193
 		if ($airport_array[0]['iata'] != "NA")
194 194
 		{
195
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
195
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
196 196
 		}
197 197
 		include('table-output.php');  
198 198
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 			$METAR = new METAR();
48 48
 			$metar_info = $METAR->getMETAR($airport_icao);
49 49
 			//print_r($metar_info);
50
-			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
50
+			if (isset($metar_info[0]['metar'])) {
51
+				$metar_parse = $METAR->parse($metar_info[0]['metar']);
52
+			}
51 53
             		//print_r($metar_parse);
52 54
 		}
53 55
 		
@@ -61,7 +63,9 @@  discard block
 block discarded – undo
61 63
 		print '<option></option>';
62 64
 		$Stats = new Stats();
63 65
 		$airport_names = $Stats->getAllAirportNames();
64
-		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
66
+		if (empty($airport_names)) {
67
+			$airport_names = $Spotter->getAllAirportNames();
68
+		}
65 69
 		ksort($airport_names);
66 70
 		foreach($airport_names as $airport_name)
67 71
 		{
@@ -102,7 +106,9 @@  discard block
 block discarded – undo
102 106
 			// Use spotter also
103 107
 			if (isset($globalTimezone)) {
104 108
 				date_default_timezone_set($globalTimezone);
105
-			} else date_default_timezone_set('UTC');
109
+			} else {
110
+				date_default_timezone_set('UTC');
111
+			}
106 112
 			if (count($all_data) > 0) {
107 113
 				print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
108 114
 				print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
Please login to merge, or discard this patch.
registration-statistics-time.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  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
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
8 8
 $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
10 10
 
11 11
 if (!empty($spotter_array))
12 12
 {
13
-	$title = sprintf(_("Most Common Time of Day of aircraft with registration %s"),$registration);
13
+	$title = sprintf(_("Most Common Time of Day of aircraft with registration %s"), $registration);
14 14
 	require_once('header.php');
15 15
   
16 16
 	print '<div class="info column">';
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	include('registration-sub-menu.php');
24 24
 	print '<div class="column">';
25 25
 	print '<h2>'._("Most Common Time of Day").'</h2>';
26
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."),$registration).'</p>';
26
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."), $registration).'</p>';
27 27
 
28 28
 	$hour_array = $Spotter->countAllHoursByRegistration($registration);
29 29
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	$hour_data = '';
34 34
 	$hour_cnt = '';
35 35
 	$last = 0;
36
-	foreach($hour_array as $hour_item)
36
+	foreach ($hour_array as $hour_item)
37 37
 	{
38
-		while($last != $hour_item['hour_name']) {
38
+		while ($last != $hour_item['hour_name']) {
39 39
 			$hour_data .= '"'.$last.':00",';
40 40
 			$hour_cnt .= '0,';
41 41
 			$last++;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$hour_cnt .= $hour_item['hour_count'].',';
46 46
 	}
47 47
 	$hour_data = "[".substr($hour_data, 0, -1)."]";
48
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
48
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
49 49
 	print 'c3.generate({
50 50
 	    bindto: "#chartHour",
51 51
 	    data: {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		print '</thead>';
69 69
 		print '<tbody>';
70 70
 		$i = 1;
71
-		foreach($hour_array as $hour_item)
71
+		foreach ($hour_array as $hour_item)
72 72
 		{
73 73
 			print '<tr>';
74 74
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
aircraft-statistics-time.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 
11
-$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
11
+$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING);
12 12
 
13 13
 $Spotter = new Spotter();
14
-$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1","");
14
+$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", "");
15 15
 
16 16
 
17 17
 if (!empty($spotter_array))
18 18
 {
19
-	$title = sprintf(_("Most Common Time of Day from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']);
19
+	$title = sprintf(_("Most Common Time of Day from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']);
20 20
 	require_once('header.php');
21 21
 	print '<div class="select-item">';
22 22
 	print '<form action="'.$globalURL.'/aircraft" method="post">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$Stats = new Stats();
26 26
 	$aircraft_types = $Stats->getAllAircraftTypes();
27 27
 	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
28
-	foreach($aircraft_types as $aircraft_type)
28
+	foreach ($aircraft_types as $aircraft_type)
29 29
 	{
30
-		if($aircraft_type == $aircrafttype['aircraft_icao'])
30
+		if ($aircraft_type == $aircrafttype['aircraft_icao'])
31 31
 		{
32 32
 			print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
33 33
 		} else {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	include('aircraft-sub-menu.php');
54 54
 	print '<div class="column">';
55 55
 	print '<h2>'._("Most Common Time of Day").'</h2>';
56
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>';
56
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>';
57 57
 
58 58
 	$hour_array = $Spotter->countAllHoursByAircraft($aircraft_type);
59 59
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	$hour_data = '';
64 64
 	$hour_cnt = '';
65 65
 	$last = 0;
66
-	foreach($hour_array as $hour_item)
66
+	foreach ($hour_array as $hour_item)
67 67
 	{
68
-		while($last != $hour_item['hour_name']) {
68
+		while ($last != $hour_item['hour_name']) {
69 69
 			$hour_data .= '"'.$last.':00",';
70 70
 			$hour_cnt .= '0,';
71 71
 			$last++;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$hour_cnt .= $hour_item['hour_count'].',';
76 76
 	}
77 77
 	$hour_data = "[".substr($hour_data, 0, -1)."]";
78
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
78
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
79 79
 	print 'c3.generate({
80 80
 	    bindto: "#chartHour",
81 81
 	    data: {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		print '</thead>';
99 99
 		print '<tbody>';
100 100
 		$i = 1;
101
-		foreach($hour_array as $hour_item)
101
+		foreach ($hour_array as $hour_item)
102 102
 		{
103 103
 			print '<tr>';
104 104
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
date-statistics-departure-airport.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 
6 6
 $Spotter = new Spotter();
7
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
8
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
9
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
7
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
8
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
9
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
10 10
 
11 11
 if (!empty($spotter_array))
12 12
 {
13
-	$title = sprintf(_("Most Common Departure Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13
+	$title = sprintf(_("Most Common Departure Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
14 14
 
15 15
 	require_once('header.php');
16 16
 	print '<div class="select-item">';
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
29 29
 	print '<br />';
30 30
 	print '<div class="info column">';
31
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
32 32
 	print '</div>';
33 33
 
34 34
 	include('date-sub-menu.php');
35 35
 	print '<div class="column">';
36 36
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
37
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
38 38
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByDate($date);
39 39
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
40 40
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	print '<script>';
44 44
 	print 'var series = [';
45 45
 	$airport_data = '';
46
-	foreach($airport_airport_array as $airport_item)
46
+	foreach ($airport_airport_array as $airport_item)
47 47
 	{
48 48
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
49 49
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	print '</thead>';
99 99
 	print '<tbody>';
100 100
 	$i = 1;
101
-	foreach($airport_airport_array as $airport_item)
101
+	foreach ($airport_airport_array as $airport_item)
102 102
 	{
103 103
 		print '<tr>';
104 104
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.