Completed
Push — master ( 2358e7...48bf48 )
by Yannick
21:19
created
ident-detailed.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 	$type = 'aircraft';
20 20
 }
21 21
 
22
-if (!isset($_GET['ident'])){
22
+if (!isset($_GET['ident'])) {
23 23
 	header('Location: '.$globalURL.'');
24 24
 } else {
25 25
 	$Translation = new Translation();
26 26
 	//calculuation for the pagination
27
-	if(!isset($_GET['limit']))
27
+	if (!isset($_GET['limit']))
28 28
 	{
29 29
 		$limit_start = 0;
30 30
 		$limit_end = 25;
@@ -45,19 +45,19 @@  discard block
 block discarded – undo
45 45
 	
46 46
 	$page_url = $globalURL.'/ident/'.$_GET['ident'];
47 47
 	
48
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
49
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
48
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
49
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
50 50
 	if ($type == 'aircraft') {
51 51
 		if ($sort != '') 
52 52
 		{
53
-			$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
53
+			$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
54 54
 			if (empty($spotter_array)) {
55
-				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
55
+				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
56 56
 			}
57 57
 		} else {
58
-			$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
58
+			$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
59 59
 			if (empty($spotter_array)) {
60
-				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
60
+				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
61 61
 			}
62 62
 		}
63 63
 		if (empty($spotter_array)) {
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
 				$ident = $new_ident;
67 67
 				if ($sort != '') 
68 68
 				{
69
-					$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
69
+					$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
70 70
 					if (empty($spotter_array)) {
71
-						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
71
+						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
72 72
 					}
73 73
 				} else {
74
-					$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
74
+					$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
75 75
 					if (empty($spotter_array)) {
76
-						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
76
+						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
77 77
 					}
78 78
 				}
79 79
 			}
@@ -81,21 +81,21 @@  discard block
 block discarded – undo
81 81
 	} elseif ($type == 'marine') {
82 82
 		if ($sort != '') 
83 83
 		{
84
-			$spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
84
+			$spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
85 85
 			if (empty($spotter_array)) {
86
-				$spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
86
+				$spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
87 87
 			}
88 88
 		} else {
89
-			$spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference);
89
+			$spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference);
90 90
 			if (empty($spotter_array)) {
91
-				$spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference);
91
+				$spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference);
92 92
 			}
93 93
 		}
94 94
 	}
95 95
 
96 96
 	if (!empty($spotter_array))
97 97
 	{
98
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']);
98
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']);
99 99
 		$ident = $spotter_array[0]['ident'];
100 100
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
101 101
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
                         var data = google.visualization.arrayToDataTable([
117 117
                             ["Hour","'._("Altitude").'","'._("Speed").'"], ';
118 118
                             $altitude_data = '';
119
-				foreach($all_data as $data)
119
+				foreach ($all_data as $data)
120 120
 				{
121
-					$altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],';
121
+					$altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],';
122 122
 				}
123 123
 				$altitude_data = substr($altitude_data, 0, -1);
124 124
 				print $altitude_data.']);
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	
159 159
 		if ($type == 'aircraft') include('ident-sub-menu.php');
160 160
 		print '<div class="table column">';
161
-		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
162
-		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
161
+		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
162
+		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
163 163
 
164 164
 		include('table-output.php'); 
165 165
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +20 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,8 +97,12 @@  discard block
 block discarded – undo
97 97
 	{
98 98
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']);
99 99
 		$ident = $spotter_array[0]['ident'];
100
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
101
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
100
+		if (isset($spotter_array[0]['latitude'])) {
101
+			$latitude = $spotter_array[0]['latitude'];
102
+		}
103
+		if (isset($spotter_array[0]['longitude'])) {
104
+			$longitude = $spotter_array[0]['longitude'];
105
+		}
102 106
 		require_once('header.php');
103 107
 		if (isset($globalArchive) && $globalArchive && $type == 'aircraft') {
104 108
 			// Requirement for altitude graph
@@ -106,7 +110,9 @@  discard block
 block discarded – undo
106 110
 			$all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']);
107 111
 			if (isset($globalTimezone)) {
108 112
 				date_default_timezone_set($globalTimezone);
109
-			} else date_default_timezone_set('UTC');
113
+			} else {
114
+				date_default_timezone_set('UTC');
115
+			}
110 116
 			if (count($all_data) > 0) {
111 117
 				print '<div id="chart6" class="chart" width="100%"></div>
112 118
                     <script> 
@@ -153,13 +159,20 @@  discard block
 block discarded – undo
153 159
 		if (isset($spotter_array[0]['airline_icao'])) {
154 160
 			print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; 
155 161
 		}
156
-		if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>';
162
+		if ($type == 'aircraft') {
163
+			print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>';
164
+		}
157 165
 		print '</div>';
158 166
 	
159
-		if ($type == 'aircraft') include('ident-sub-menu.php');
167
+		if ($type == 'aircraft') {
168
+			include('ident-sub-menu.php');
169
+		}
160 170
 		print '<div class="table column">';
161
-		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
162
-		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
171
+		if ($type == 'aircraft') {
172
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
173
+		} elseif ($type == 'marine') {
174
+			print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
175
+		}
163 176
 
164 177
 		include('table-output.php'); 
165 178
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
ident.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once(dirname(__FILE__).'/require/settings.php');
3 3
 $ident = '';
4
-if (isset($_POST['ident'])) $ident = filter_input(INPUT_POST,'ident',FILTER_SANITIZE_STRING);
5
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
4
+if (isset($_POST['ident'])) $ident = filter_input(INPUT_POST, 'ident', FILTER_SANITIZE_STRING);
5
+if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
6 6
 if ($ident != '')
7 7
 {
8 8
 	if (isset($_GET['marine'])) header('Location: '.$globalURL.'/marine/ident/'.$ident);
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,20 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once(dirname(__FILE__).'/require/settings.php');
3 3
 $ident = '';
4
-if (isset($_POST['ident'])) $ident = filter_input(INPUT_POST,'ident',FILTER_SANITIZE_STRING);
5
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
4
+if (isset($_POST['ident'])) {
5
+	$ident = filter_input(INPUT_POST,'ident',FILTER_SANITIZE_STRING);
6
+}
7
+if (isset($_GET['ident'])) {
8
+	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
9
+}
6 10
 if ($ident != '')
7 11
 {
8
-	if (isset($_GET['marine'])) header('Location: '.$globalURL.'/marine/ident/'.$ident);
9
-	else header('Location: '.$globalURL.'/ident/'.$ident);
10
-} else {
12
+	if (isset($_GET['marine'])) {
13
+		header('Location: '.$globalURL.'/marine/ident/'.$ident);
14
+	} else {
15
+		header('Location: '.$globalURL.'/ident/'.$ident);
16
+	}
17
+	} else {
11 18
 	header('Location: '.$globalURL);
12 19
 }
13 20
 ?>
14 21
\ No newline at end of file
Please login to merge, or discard this patch.