Completed
Push — master ( f606e5...57ec45 )
by Yannick
25:55
created
owner-detailed.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
 //require_once('require/class.SpotterLive.php');
8 8
 require_once('require/class.SpotterArchive.php');
9 9
 
10
-if (!isset($_GET['owner'])){
10
+if (!isset($_GET['owner'])) {
11 11
 	header('Location: '.$globalURL.'');
12 12
 } else {
13 13
 	$Spotter = new Spotter();
14 14
 	$SpotterArchive = new SpotterArchive();
15 15
 	//$Translation = new Translation();
16 16
 	//calculuation for the pagination
17
-	if(!isset($_GET['limit']))
17
+	if (!isset($_GET['limit']))
18 18
 	{
19 19
 		$limit_start = 0;
20 20
 		$limit_end = 25;
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
 	
36 36
 	$page_url = $globalURL.'/owner/'.$_GET['owner'];
37 37
 	
38
-	$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
39
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
40
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
41
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
38
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
39
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
40
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
41
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
42 42
 	$filter = array();
43
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
44
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
43
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
44
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
45 45
 	if ($sort != '') 
46 46
 	{
47
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
47
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter);
48 48
 		/*
49 49
 		if (empty($spotter_array)) {
50 50
 			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
51 51
 		}
52 52
 		*/
53 53
 	} else {
54
-		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter);
54
+		$spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, '', $filter);
55 55
 		/*
56 56
 		if (empty($spotter_array)) {
57 57
 			$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference,'',$filter);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 	if (!empty($spotter_array))
63 63
 	{
64
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
64
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['aircraft_owner']);
65 65
 		//$ident = $spotter_array[0]['ident'];
66 66
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
67 67
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -121,23 +121,23 @@  discard block
 block discarded – undo
121 121
 		$Stats = new Stats();
122 122
 		if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner);
123 123
 		else $flights = 0;
124
-		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter);
124
+		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner, $filter);
125 125
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
126
-		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter));
126
+		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner, $filter));
127 127
 		print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>';
128
-		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner,$filter));
128
+		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner, $filter));
129 129
 		print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>';
130
-		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner,$filter));
130
+		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner, $filter));
131 131
 		print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
132
-		$airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter));
132
+		$airlines = count($Spotter->countAllAirlinesByOwner($owner, $filter));
133 133
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
134
-		$duration = $Spotter->getFlightDurationByOwner($owner,$filter);
134
+		$duration = $Spotter->getFlightDurationByOwner($owner, $filter);
135 135
 		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
136 136
 		print '</div>';
137 137
 	
138 138
 		include('owner-sub-menu.php');
139 139
 		print '<div class="table column">';
140
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
140
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
141 141
 
142 142
 		include('table-output.php'); 
143 143
 		print '<div class="pagination">';
Please login to merge, or discard this patch.