Completed
Push — master ( 637022...8149d9 )
by Yannick
55:10 queued 27:13
created
owner-statistics-airline.php 3 patches
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.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,12 @@
 block discarded – undo
12 12
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
13 13
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
14 14
 $filter = array();
15
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
16
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
15
+if ($year != '') {
16
+	$filter = array_merge($filter,array('year' => $year));
17
+}
18
+if ($month != '') {
19
+	$filter = array_merge($filter,array('month' => $month));
20
+}
17 21
 $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
18 22
 
19 23
 if (!empty($spotter_array))
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  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 = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
12
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
13
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
12
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
13
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
14 14
 $filter = array();
15
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
16
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
15
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
16
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
17
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Airlines of %s"),$spotter_array[0]['aircraft_owner']);
21
+	$title = sprintf(_("Most Common Airlines of %s"), $spotter_array[0]['aircraft_owner']);
22 22
 	require_once('header.php');
23 23
 	print '<div class="info column">';
24 24
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	include('owner-sub-menu.php');
30 30
 	print '<div class="column">';
31 31
 	print '<h2>'._("Most Common Airlines").'</h2>';
32
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
32
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
33 33
 
34
-	$airline_array = $Spotter->countAllAirlinesByOwner($owner,$filter);
34
+	$airline_array = $Spotter->countAllAirlinesByOwner($owner, $filter);
35 35
 	if (!empty($airline_array))
36 36
 	{
37 37
 		print '<div class="table-responsive">';
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		print '</thead>';
47 47
 		print '<tbody>';
48 48
 		$i = 1;
49
-		foreach($airline_array as $airline_item)
49
+		foreach ($airline_array as $airline_item)
50 50
 		{
51 51
 			print '<tr>';
52 52
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
pilot.php 2 patches
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.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['pilot']))
9 9
 {
10
-	header('Location: '.$globalURL.'/pilot/'.filter_input(INPUT_POST,'pilot',FILTER_SANITIZE_STRING));
10
+	header('Location: '.$globalURL.'/pilot/'.filter_input(INPUT_POST, 'pilot', FILTER_SANITIZE_STRING));
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 = _("Pilots");
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	//ksort($pilot_names);
25 25
 	$previous = null;
26 26
 	print '<div class="alphabet-legend">';
27
-	foreach($pilot_names as $value) {
27
+	foreach ($pilot_names as $value) {
28 28
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['pilot_name'], 0, 1));
29
-		if($previous !== $firstLetter && $firstLetter != "'")
29
+		if ($previous !== $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($pilot_names as $value) {
40
+	foreach ($pilot_names as $value) {
41 41
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['pilot_name'], 0, 1));
42 42
 		if ($firstLetter != "")
43 43
 		{
44
-			if($previous !== $firstLetter && $firstLetter != "'")
44
+			if ($previous !== $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.
owner.php 2 patches
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.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['owner']))
9 9
 {
10
-	header('Location: '.$globalURL.'/owner/'.filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING));
10
+	header('Location: '.$globalURL.'/owner/'.filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING));
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(strtoupper($Common->replace_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(strtoupper($Common->replace_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.
statistics-fatalities-month.php 2 patches
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.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 print '<div id="chart" class="chart" width="100%"></div><script>';
21 21
 $year_data = '';
22 22
 $year_cnt = '';
23
-foreach($date_array as $year_item)
23
+foreach ($date_array as $year_item)
24 24
 {
25 25
 	$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
26 26
 	$year_cnt .= $year_item['count'].',';
27 27
 }
28 28
 $year_data = "['x',".substr($year_data, 0, -1)."]";
29
-$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
29
+$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
30 30
 print 'c3.generate({
31 31
     bindto: "#chart",
32 32
     data: { x: "x",
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 
37 37
 if (!empty($date_array))
38 38
 {
39
-	foreach($date_array as $key => $row) {
39
+	foreach ($date_array as $key => $row) {
40 40
 		$years[$key] = $row['year'];
41 41
 		$months[$key] = $row['month'];
42 42
 		$counts[$key] = $row['count'];
43 43
 	}
44 44
 //	array_multisort($years,SORT_DESC,$months,SORT_DESC,$date_array);
45
-	array_multisort($counts,SORT_DESC,$date_array);
45
+	array_multisort($counts, SORT_DESC, $date_array);
46 46
 	print '<div class="table-responsive">';
47 47
 	print '<table class="common-date table-striped">';
48 48
 	print '<thead>';
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 	print '</thead>';
53 53
 	print '<tbody>';
54 54
 	$i = 1;
55
-	foreach($date_array as $date_item)
55
+	foreach ($date_array as $date_item)
56 56
 	{
57 57
 		print '<tr>';
58 58
 		print '<td><strong>'.$i.'</strong></td>';
59 59
 		print '<td>';
60 60
 		if ($date_item['month'] < 10) $month = '0'.$date_item['month'];
61 61
 		else $month = $date_item['month'];
62
-		print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$month.'">'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>';
62
+		print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$month.'">'.date('F, Y', strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>';
63 63
 		print '</td>';
64 64
 		print '<td>';
65 65
 		print $date_item['count'];
Please login to merge, or discard this patch.
statistics-registration.php 3 patches
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,15 @@
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Aircraft Registrations");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12
-}
13
+    if (isset($globalFilter['airline'])) {
14
+    	$airline_icao = $globalFilter['airline'][0];
15
+    }
16
+    }
13 17
 setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14 18
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15 19
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Aircraft Registrations");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13
-setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
13
+setcookie('stats_airline_icao', $airline_icao, time() + 60*60*24, '/');
14
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
15
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
16 16
 
17 17
 require_once('header.php');
18 18
 include('statistics-sub-menu.php'); 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	</div>
25 25
     	<p>'._("Below are the <strong>Top 10</strong> most common aircraft registrations.").'</p>';
26 26
   
27
-$registration_array = $Stats->countAllAircraftRegistrations(true,$airline_icao,$filter_name,$year,$month);
27
+$registration_array = $Stats->countAllAircraftRegistrations(true, $airline_icao, $filter_name, $year, $month);
28 28
 print '<div id="chart" class="chart" width="100%"></div><script>';
29 29
 $registration_data = '';
30
-foreach($registration_array as $registration_item)
30
+foreach ($registration_array as $registration_item)
31 31
 {
32 32
 	$registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],';
33 33
 }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	print '</thead>';
55 55
 	print '<tbody>';
56 56
 	$i = 1;
57
-	foreach($registration_array as $registration_item)
57
+	foreach ($registration_array as $registration_item)
58 58
 	{
59 59
 		print '<tr>';
60 60
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 setcookie('stats_airline_icao',$airline_icao,time()+60*60*24,'/');
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
statistics-aircraft.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 14
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Aircraft");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
13
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
14
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
15 15
 
16 16
 require_once('header.php');
17 17
 
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 	</div>
24 24
 	<p>'._("Below are the <strong>Top 10</strong> most common aircraft types.").'</p>';
25 25
 	  
26
-$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
26
+$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
27 27
 print '<div id="chart" class="chart" width="100%"></div><script>';
28 28
 $aircraft_data = '';
29
-foreach($aircraft_array as $aircraft_item)
29
+foreach ($aircraft_array as $aircraft_item)
30 30
 {
31 31
 	if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
32 32
 	else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	print '</thead>';
53 53
 	print '<tbody>';
54 54
 	$i = 1;
55
-	foreach($aircraft_array as $aircraft_item)
55
+	foreach ($aircraft_array as $aircraft_item)
56 56
 	{
57 57
 		print '<tr>';
58 58
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,11 +5,15 @@  discard block
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Aircraft");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12
-}
13
+    if (isset($globalFilter['airline'])) {
14
+    	$airline_icao = $globalFilter['airline'][0];
15
+    }
16
+    }
13 17
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 18
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
15 19
 
@@ -28,9 +32,12 @@  discard block
 block discarded – undo
28 32
 $aircraft_data = '';
29 33
 foreach($aircraft_array as $aircraft_item)
30 34
 {
31
-	if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
32
-	else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
33
-}
35
+	if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') {
36
+		$aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
37
+	} else {
38
+		$aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
39
+	}
40
+	}
34 41
 $aircraft_data = substr($aircraft_data, 0, -1);
35 42
 print 'var series = ['.$aircraft_data.'];';
36 43
 print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
Please login to merge, or discard this patch.
statistics-month.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 
14 14
 require_once('header.php');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	$Tracker = new Tracker();
17 17
 }
18 18
 if (!isset($filter_name)) $filter_name = '';
19
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
19
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
20 20
 if ($airline_icao == '' && isset($globalFilter)) {
21 21
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
22 22
 }
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 	  </div>
33 33
       <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>';
34 34
 
35
-if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
35
+if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
36 36
 elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth();
37 37
 elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth();
38 38
 
39 39
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 40
 $month_data = '';
41 41
 $month_cnt = '';
42
-foreach($date_array as $month_item)
42
+foreach ($date_array as $month_item)
43 43
 {
44 44
 	$month_data .= '"'.$month_item['date_name'].'",';
45 45
 	$month_cnt .= $month_item['date_count'].',';
46 46
 }
47 47
 $month_data = "['x',".substr($month_data, 0, -1)."]";
48
-$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
48
+$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
49 49
 print 'c3.generate({
50 50
     bindto: "#chart",
51 51
     data: { x: "x",
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 //$date_array = $Stats->countAllDates();
57 57
 if (!empty($date_array))
58 58
 {
59
-	foreach($date_array as $key => $row) {
59
+	foreach ($date_array as $key => $row) {
60 60
 		$years[$key] = $row['date_name'];
61 61
 		$counts[$key] = $row['date_count'];
62 62
 	}
63
-	array_multisort($counts,SORT_DESC,$date_array);
63
+	array_multisort($counts, SORT_DESC, $date_array);
64 64
 	print '<div class="table-responsive">';
65 65
 	print '<table class="common-date table-striped">';
66 66
 	print '<thead>';
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	print '</thead>';
71 71
 	print '<tbody>';
72 72
 	$i = 1;
73
-	foreach($date_array as $date_item)
73
+	foreach ($date_array as $date_item)
74 74
 	{
75 75
 		print '<tr>';
76 76
 		print '<td><strong>'.$i.'</strong></td>';
77 77
 		print '<td>';
78
-		if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
79
-		else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
78
+		if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
79
+		else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
80 80
 		print '</td>';
81 81
 		print '<td>';
82 82
 		print $date_item['date_count'];
Please login to merge, or discard this patch.
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,11 +15,15 @@  discard block
 block discarded – undo
15 15
 	require_once('require/class.Tracker.php');
16 16
 	$Tracker = new Tracker();
17 17
 }
18
-if (!isset($filter_name)) $filter_name = '';
18
+if (!isset($filter_name)) {
19
+	$filter_name = '';
20
+}
19 21
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
20 22
 if ($airline_icao == '' && isset($globalFilter)) {
21
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
22
-}
23
+    if (isset($globalFilter['airline'])) {
24
+    	$airline_icao = $globalFilter['airline'][0];
25
+    }
26
+    }
23 27
 
24 28
 require_once('header.php');
25 29
 include('statistics-sub-menu.php'); 
@@ -32,9 +36,13 @@  discard block
 block discarded – undo
32 36
 	  </div>
33 37
       <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>';
34 38
 
35
-if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
36
-elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth();
37
-elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth();
39
+if ($type == 'aircraft') {
40
+	$date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
41
+} elseif ($type == 'marine') {
42
+	$date_array = $Marine->countAllDatesLastMonth();
43
+} elseif ($type == 'tracker') {
44
+	$date_array = $Tracker->countAllDatesLastMonth();
45
+}
38 46
 
39 47
 print '<div id="chart" class="chart" width="100%"></div><script>';
40 48
 $month_data = '';
@@ -75,8 +83,11 @@  discard block
 block discarded – undo
75 83
 		print '<tr>';
76 84
 		print '<td><strong>'.$i.'</strong></td>';
77 85
 		print '<td>';
78
-		if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
79
-		else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
86
+		if ($type == 'aircraft') {
87
+			print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
88
+		} else {
89
+			print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
90
+		}
80 91
 		print '</td>';
81 92
 		print '<td>';
82 93
 		print $date_item['date_count'];
Please login to merge, or discard this patch.
statistics-owner.php 3 patches
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,15 @@
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common owners");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12
-}
13
+    if (isset($globalFilter['airline'])) {
14
+    	$airline_icao = $globalFilter['airline'][0];
15
+    }
16
+    }
13 17
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 18
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
15 19
 require_once('header.php');
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 14
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common owners");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
13
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
14
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
15 15
 require_once('header.php');
16 16
 include('statistics-sub-menu.php');
17 17
 print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	</div>
22 22
 	<p>'._("Below are the <strong>Top 10</strong> most common owner.").'</p>';
23 23
  
24
-$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
24
+$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
25 25
 print '<div id="chart" class="chart" width="100%"></div><script>';
26 26
 $owner_data = '';
27
-foreach($owner_array as $owner_item)
27
+foreach ($owner_array as $owner_item)
28 28
 {
29 29
 	$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
30 30
 }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	print '</thead>';
50 50
 	print '<tbody>';
51 51
 	$i = 1;
52
-	foreach($owner_array as $owner_item)
52
+	foreach ($owner_array as $owner_item)
53 53
 	{
54 54
 		print '<tr>';
55 55
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
statistics-airport-arrival.php 3 patches
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,15 @@
 block discarded – undo
5 5
 $Stats = new Stats();
6 6
 $title = _("Statistics").' - '._("Most common Arrival Airport");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 12
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12
-}
13
+    if (isset($globalFilter['airline'])) {
14
+    	$airline_icao = $globalFilter['airline'][0];
15
+    }
16
+    }
13 17
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 18
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
15 19
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 if (!isset($filter_name)) $filter_name = '';
9 9
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11
-    if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
11
+	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13 13
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14 14
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $airport_airport_array = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
29 29
 
30 30
 print 'var series = [';
31
-    $airport_data = '';
31
+	$airport_data = '';
32 32
 foreach($airport_airport_array as $airport_item)
33 33
 {
34 34
 	$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Most common Arrival Airport");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 if ($airline_icao == '' && isset($globalFilter)) {
11 11
     if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
12 12
 }
13
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
14
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
13
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
14
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
15 15
 
16 16
 require_once('header.php');
17 17
 include('statistics-sub-menu.php'); 
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
     	 <p>'._("Below are the <strong>Top 10</strong> most common arrival airports.").'</p>';
26 26
 print '<div id="chartAirport" class="chart" width="100%"></div>';
27 27
 print '<script>';
28
-$airport_airport_array = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
28
+$airport_airport_array = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
29 29
 
30 30
 print 'var series = [';
31 31
     $airport_data = '';
32
-foreach($airport_airport_array as $airport_item)
32
+foreach ($airport_airport_array as $airport_item)
33 33
 {
34 34
 	$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
35 35
 }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 print '</thead>';
84 84
 print '<tbody>';
85 85
 $i = 1;
86
-foreach($airport_airport_array as $airport_item)
86
+foreach ($airport_airport_array as $airport_item)
87 87
 {
88 88
 	print '<tr>';
89 89
 	print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.