Completed
Push — master ( 637022...8149d9 )
by Yannick
55:10 queued 27:13
created
search-csv.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
 
7 7
 if (isset($_GET['start_date'])) {
8 8
 	//for the date manipulation into the query
9
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
10 10
 		$start_date = $_GET['start_date'].":00";
11 11
 		$end_date = $_GET['end_date'].":00";
12 12
 		$sql_date = $start_date.",".$end_date;
13
-	} else if($_GET['start_date'] != ""){
13
+	} else if ($_GET['start_date'] != "") {
14 14
 		$start_date = $_GET['start_date'].":00";
15 15
 		$sql_date = $start_date;
16
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
17 17
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
18 18
 		$sql_date = $end_date;
19 19
 	} else $sql_date = '';
@@ -21,38 +21,38 @@  discard block
 block discarded – undo
21 21
 
22 22
 if (isset($_GET['highest_altitude'])) {
23 23
 	//for altitude manipulation
24
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
25 25
 		$end_altitude = $_GET['highest_altitude'];
26 26
 		$start_altitude = $_GET['lowest_altitude'];
27 27
 		$sql_altitude = $start_altitude.",".$end_altitude;
28
-	} else if($_GET['highest_altitude'] != ""){
28
+	} else if ($_GET['highest_altitude'] != "") {
29 29
 		$end_altitude = $_GET['highest_altitude'];
30 30
 		$sql_altitude = $end_altitude;
31
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
32 32
 		$start_altitude = $_GET['lowest_altitude'].",60000";
33 33
 		$sql_altitude = $start_altitude;
34 34
 	} else $sql_altitude = '';
35 35
 } else $sql_altitude = '';
36 36
 
37 37
 //calculuation for the pagination
38
-if(!isset($_GET['limit']))
38
+if (!isset($_GET['limit']))
39 39
 {
40 40
 	if (!isset($_GET['number_results'])) {
41 41
 		$limit_start = 0;
42 42
 		$limit_end = 25;
43 43
 		$absolute_difference = 25;
44 44
 	} else {
45
-		if ($_GET['number_results'] > 1000){
45
+		if ($_GET['number_results'] > 1000) {
46 46
 			$_GET['number_results'] = 1000;
47 47
 		}
48 48
 		$limit_start = 0;
49
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
51 51
 	}
52
-}  else {
52
+} else {
53 53
 	$limit_explode = explode(",", $_GET['limit']);
54
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
55
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
55
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
56 56
 }
57 57
 $absolute_difference = abs($limit_start - $limit_end);
58 58
 $limit_next = $limit_end + $absolute_difference;
@@ -69,29 +69,29 @@  discard block
 block discarded – undo
69 69
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
70 70
 else $sort = '';
71 71
 
72
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
84
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
85
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
88
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
72
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
84
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
85
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
89 89
  
90 90
       
91 91
 $output = "id,ident,registration,aircraft_icao,aircraft_name,aircraft_manufacturer,airline,airline_icao,airline_iata,airline_country,airline_callsign,airline_type,departure_airport_city,departure_airport_country,departure_airport_iata,departure_airport_icao,departure_airport_latitude,departure_airport_longitude,departure_airport_altitude,arrival_airport_city,arrival_airport_country,arrival_airport_iata,arrival_airport_icao,arrival_airport_latitude,arrival_airport_longitude,arrival_airport_altitude,latitude,longitude,altitude,ground_speed,heading,heading_name,waypoints,date\n";
92 92
 
93 93
 if (!empty($spotter_array)) {
94
-	foreach($spotter_array as $spotter_item) {
94
+	foreach ($spotter_array as $spotter_item) {
95 95
 		$output .= $spotter_item['spotter_id'].',';
96 96
 		$output .= $spotter_item['ident'].',';
97 97
 		$output .= $spotter_item['registration'].',';
Please login to merge, or discard this patch.
ident-statistics-airline.php 1 patch
Spacing   +6 added lines, -6 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 Airlines of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Airlines 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 Airlines").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$airline_array = $Spotter->countAllAirlinesByIdent($ident);
30 30
 	if (!empty($airline_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($airline_array as $airline_item)
44
+		foreach ($airline_array as $airline_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
search-ajax.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 $Spotter = new Spotter();
8 8
 $orderby = $Spotter->getOrderBy();
9 9
 
10
-$ask = filter_input(INPUT_GET,'ask',FILTER_SANITIZE_STRING);
10
+$ask = filter_input(INPUT_GET, 'ask', FILTER_SANITIZE_STRING);
11 11
 if ($ask == 'aircraftsdetected') {
12 12
 	require_once('require/class.SpotterLive.php');
13 13
 	$SpotterLive = new SpotterLive();
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	$manufacturers = $Stats->getAllManufacturers();
28 28
 	if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers();
29 29
 	$all_manufacturers = array();
30
-	foreach($manufacturers as $manufacturer)
30
+	foreach ($manufacturers as $manufacturer)
31 31
 	{
32
-		$all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ','-',$manufacturer['aircraft_manufacturer'])));
32
+		$all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ', '-', $manufacturer['aircraft_manufacturer'])));
33 33
 	}
34 34
 	echo json_encode($all_manufacturers);
35 35
 } elseif ($ask == 'aircrafttypes') {
36 36
 	$aircraft_types = $Stats->getAllAircraftTypes();
37 37
 	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
38 38
 	$all_aircraft_types = array();
39
-	foreach($aircraft_types as $aircraft_type)
39
+	foreach ($aircraft_types as $aircraft_type)
40 40
 	{
41 41
 		$all_aircraft_types[] = array('id' => $aircraft_type['aircraft_icao'], 'value' => $aircraft_type['aircraft_name'].' ('.$aircraft_type['aircraft_icao'].')');
42 42
 	}
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 } elseif ($ask == 'airlinenames') {
45 45
 	$airline_names = $Stats->getAllAirlineNames();
46 46
 	$all_airline_names = array();
47
-	foreach($airline_names as $airline_name)
47
+	foreach ($airline_names as $airline_name)
48 48
 	{
49 49
 		$all_airline_names[] = array('id' => $airline_name['airline_icao'], 'value' => $airline_name['airline_name'].' ('.$airline_name['airline_icao'].')');
50 50
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 } elseif ($ask == 'airlinecountries') {
53 53
 	$airline_countries = $Spotter->getAllAirlineCountries();
54 54
 	$all_airline_countries = array();
55
-	foreach($airline_countries as $airline_country)
55
+	foreach ($airline_countries as $airline_country)
56 56
 	{
57 57
 		$all_airline_countries[] = array('id' => $airline_country['airline_country'], 'value' => $airline_country['airline_country']);
58 58
 	}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
63 63
 	ksort($airport_names);
64 64
 	$all_airport_names = array();
65
-	foreach($airport_names as $airport_name)
65
+	foreach ($airport_names as $airport_name)
66 66
 	{
67 67
 		$all_airport_names[] = array('id' => $airport_name['airport_icao'], 'value' => $airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')');
68 68
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 } elseif ($ask == 'airportcountries') {
71 71
 	$airport_countries = $Spotter->getAllAirportCountries();
72 72
 	$all_airport_countries = array();
73
-	foreach($airport_countries as $airport_country)
73
+	foreach ($airport_countries as $airport_country)
74 74
 	{
75 75
 		$all_airport_countries[] = array('id' => $airport_country['airport_country'], 'value' => $airport_country['airport_country']);
76 76
 	}
Please login to merge, or discard this patch.
space-data.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <button type="button" class="close">&times;</button>
10 10
 <?php
11 11
 
12
-$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING);
12
+$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING);
13 13
 $sat = urldecode($sat);
14 14
 //$info = $Satellite->get_info(str_replace(' ','-',$sat));
15 15
 //print_r($info);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$aircraft_name = 'INTEGRAL';
49 49
 //	$ground_speed = 14970;
50 50
 	$launch_date = '17 October 2002';
51
-} elseif (strpos($sat,'IRIDIUM') !== false) {
51
+} elseif (strpos($sat, 'IRIDIUM') !== false) {
52 52
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg';
53 53
 	$image_copyright = 'Cliff';
54 54
 	$ident = 'Iridium satellite constellation';
@@ -56,23 +56,23 @@  discard block
 block discarded – undo
56 56
 	$aircraft_name = $sat;
57 57
 //	$ground_speed = 14970;
58 58
 //	$launch_date = '29 september 2011';
59
-} elseif (strpos($sat,'ORBCOMM') !== false) {
59
+} elseif (strpos($sat, 'ORBCOMM') !== false) {
60 60
 	$ident = 'Orbcomm';
61 61
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)';
62 62
 	$aircraft_name = $sat;
63
-} elseif (strpos($sat,'GLOBALSTAR') !== false) {
63
+} elseif (strpos($sat, 'GLOBALSTAR') !== false) {
64 64
 	$ident = 'Globalstar';
65 65
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar';
66 66
 	$aircraft_name = $sat;
67
-	$satname = str_replace(array('[+]','[-]'),'',$sat);
68
-} elseif (strpos($sat,'OSCAR 7') !== false) {
67
+	$satname = str_replace(array('[+]', '[-]'), '', $sat);
68
+} elseif (strpos($sat, 'OSCAR 7') !== false) {
69 69
 	$image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg';
70 70
 	$image_copyright = 'Amsat.org';
71 71
 	$ident = 'AMSAT-OSCAR 7';
72 72
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7';
73 73
 	$aircraft_name = $sat;
74 74
 	$launch_date = '15 November 1974';
75
-} elseif (strpos($sat,'santaclaus') !== false) {
75
+} elseif (strpos($sat, 'santaclaus') !== false) {
76 76
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg';
77 77
 	$image_copyright = 'Jonathan G Meath';
78 78
 	$ident = 'Santa Claus';
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 //	$launch_date = '15 November 1974';
82 82
 } else {
83 83
 	$ident = $sat;
84
-	if (strpos($sat,'(')) $satname = $sat;
85
-	else $satname = str_replace(array(' '),'-',$sat);
84
+	if (strpos($sat, '(')) $satname = $sat;
85
+	else $satname = str_replace(array(' '), '-', $sat);
86 86
 }
87 87
 if (!isset($satname)) $satname = $sat;
88 88
 $info = $Satellite->get_info(strtolower(trim($satname)));
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		print '<div><span>'._("Orbit").'</span>'.$info['orbit'].'</div>';
146 146
 	}
147 147
 	if ($info['launch_date'] != '') {
148
-		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d',strtotime($info['launch_date'])).'</div>';
148
+		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d', strtotime($info['launch_date'])).'</div>';
149 149
 	}
150 150
 	if ($info['launch_site'] != '') {
151 151
 		print '<div><span>'._("Launch Site").'</span>'.$info['launch_site'].'</div>';
Please login to merge, or discard this patch.
scripts/daemon-acars.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 
18 18
 $debug = true;
19 19
 
20
-$ACARS=new ACARS(null,true);
20
+$ACARS = new ACARS(null, true);
21 21
 date_default_timezone_set('UTC');
22 22
 // signal handler - playing nice with sockets and dump1090
23
-pcntl_signal(SIGINT,  function($signo) {
23
+pcntl_signal(SIGINT, function($signo) {
24 24
     global $sock;
25 25
     echo "\n\nctrl-c or kill signal received. Tidying up ... ";
26 26
     socket_shutdown($sock, 0);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n");
37 37
 
38 38
 // Bind the source address
39
-if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) )
39
+if (!socket_bind($sock, $globalACARSHost, $globalACARSPort))
40 40
 {
41 41
     $errorcode = socket_last_error();
42 42
     $errormsg = socket_strerror($errorcode);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 echo "LISTEN UDP MODE \n\n";
48
-while(1) {
48
+while (1) {
49 49
     $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port);
50 50
 
51 51
     // lets play nice and handle signals such as ctrl-c/kill properly
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     //  (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1
55 55
     echo $buffer."\n";
56 56
     $ACARS->add(trim($buffer));
57
-    socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port);
57
+    socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port);
58 58
     $ACARS->deleteLiveAcarsData();
59 59
 }
60
-pcntl_exec($_,$argv);
60
+pcntl_exec($_, $argv);
61 61
 ?>
Please login to merge, or discard this patch.
getImages.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 	$hex = str_replace("#", "", $hex);
5 5
 	$color = array();
6 6
 	if (strlen($hex) == 3) {
7
-	    $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1));
8
-	    $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1));
9
-	    $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1));
7
+	    $color['r'] = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));
8
+	    $color['g'] = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));
9
+	    $color['b'] = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));
10 10
 	} else if (strlen($hex) == 6) {
11 11
 	    $color['r'] = hexdec(substr($hex, 0, 2));
12 12
 	    $color['g'] = hexdec(substr($hex, 2, 2));
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 }
17 17
 
18 18
 
19
-if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { 
19
+if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $_GET['color'])) { 
20 20
     exit(0);
21 21
 }
22 22
 $color = $_GET['color'];
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
 
48 48
 if (extension_loaded('gd') && function_exists('gd_info')) {
49 49
     $image = imagecreatefrompng($original);
50
-    $index = imagecolorexact($image,26,49,81);
50
+    $index = imagecolorexact($image, 26, 49, 81);
51 51
     if ($index < 0) {
52
-	$index = imagecolorexact($image,25,49,79);
52
+	$index = imagecolorexact($image, 25, 49, 79);
53 53
     }
54 54
     if ($index < 0) {
55
-	$index = imagecolorexact($image,0,0,0);
55
+	$index = imagecolorexact($image, 0, 0, 0);
56 56
     }
57 57
     $c = hexToRGB($color);
58
-    imagecolorset($image,$index,$c['r'],$c['g'],$c['b']);
58
+    imagecolorset($image, $index, $c['r'], $c['g'], $c['b']);
59 59
  /*
60 60
     $ig = imagecolorat($image, 0, 0);
61 61
     imagecolortransparent($image, $ig);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 
64 64
     header('Content-type: image/png');
65 65
     if (isset($_GET['resize']) && function_exists('imagecopyresampled')) {
66
-	$resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT);
67
-	$newimg = imagecreatetruecolor($resize,$resize);
66
+	$resize = filter_input(INPUT_GET, 'resize', FILTER_SANITIZE_NUMBER_INT);
67
+	$newimg = imagecreatetruecolor($resize, $resize);
68 68
         imagealphablending($newimg, false);
69 69
 	imagesavealpha($newimg, true);
70
-	imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image));
70
+	imagecopyresampled($newimg, $image, 0, 0, 0, 0, 15, 15, imagesx($image), imagesy($image));
71 71
 	if (isset($_GET['heading'])) {
72
-    	    $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT);
73
-    	    $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127));
72
+    	    $heading = filter_input(INPUT_GET, 'heading', FILTER_SANITIZE_NUMBER_INT);
73
+    	    $rotation = imagerotate($newimg, $heading, imageColorAllocateAlpha($newimg, 0, 0, 0, 127));
74 74
     	    imagealphablending($rotation, false);
75 75
 	    imagesavealpha($rotation, true);
76 76
     	    imagepng($rotation);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	imagepng($image);
90 90
 	imagepng($image);
91 91
 	if (is_writable(dirname(__FILE__).'/cache')) {
92
-    	    imagepng($image,dirname(__FILE__).'/cache/'.$color.'-'.$filename);
92
+    	    imagepng($image, dirname(__FILE__).'/cache/'.$color.'-'.$filename);
93 93
 	}
94 94
         imagedestroy($image);
95 95
     }
Please login to merge, or discard this patch.
pilot.php 1 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 1 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.
accident-latest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 $page_url = $globalURL.'/accident-latest';
10 10
 
11
-if(!isset($_GET['limit']))
11
+if (!isset($_GET['limit']))
12 12
 {
13 13
 	$limit_start = 0;
14 14
 	$limit_end = 25;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 print '<div class="table column">';
35 35
 print '<p>'._("The table below shows the latest Accidents.").'</p>';
36
-$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'accident');
36
+$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'accident');
37 37
 if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) {
38 38
 	include('table-output.php');
39 39
 	print '<div class="pagination">';
Please login to merge, or discard this patch.