Completed
Push — master ( 1eb6f5...a1a065 )
by Yannick
24:23
created
airline.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	print '<div class="column">';
16 16
 	print '<h1>'._("Airlines").'</h1>';
17 17
 	if (isset($_POST['airline_type'])) {
18
-		$airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING);
18
+		$airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING);
19 19
 		//$airline_names = $Spotter->getAllAirlineNames($airline_type);
20 20
 	} else {
21 21
 		//$airline_names = $Spotter->getAllAirlineNames();
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 		print '<div class="alphabet">';
28 28
 		foreach ($alliances as $alliance) {
29 29
 			print '<div class="alphabet-airline alphabet-item">';
30
-			print '<a href="'.$globalURL.'/airline/alliance_'.str_replace(' ','_',$alliance['alliance']).'">';
31
-			if (file_exists('images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png'))
30
+			print '<a href="'.$globalURL.'/airline/alliance_'.str_replace(' ', '_', $alliance['alliance']).'">';
31
+			if (file_exists('images/airlines/'.str_replace(' ', '_', $alliance['alliance']).'.png'))
32 32
 			{
33
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png" alt="'._("Click to see alliance activity").'" title="'._("Click to see alliance activity").'" /> ';
33
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace(' ', '_', $alliance['alliance']).'.png" alt="'._("Click to see alliance activity").'" title="'._("Click to see alliance activity").'" /> ';
34 34
 			} else print $alliance['alliance'];
35 35
 			print '</a>';
36 36
 			print '</div>';
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	$Stats = new Stats();
54 54
 	if (isset($_POST['airline_type'])) 
55 55
 	{
56
-		$airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING);
56
+		$airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING);
57 57
 		//$airline_names = $Stats->getAllAirlineNames($airline_type);
58 58
 		$airline_names = $Spotter->getAllAirlineNames($airline_type);
59 59
 	} else {
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 	$previous = null;
68 68
 	print '<div class="alphabet-legend">';
69
-	foreach($airline_names as $value) 
69
+	foreach ($airline_names as $value) 
70 70
 	{
71 71
 		//echo $value['airline_name']."\n";
72 72
 		//echo mb_substr($value['airline_name'],0,1).' - '.$value['airline_name']."\n";
73
-		$firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1),'UTF-8');
74
-		if($previous !== $firstLetter)
73
+		$firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1), 'UTF-8');
74
+		if ($previous !== $firstLetter)
75 75
 		{
76 76
 			if ($previous !== null) print ' | ';
77 77
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	}
81 81
 	print '</div>';
82 82
 	$previous = null;
83
-	foreach($airline_names as $value) {
83
+	foreach ($airline_names as $value) {
84 84
 		$firstLetter = strtoupper(substr($value['airline_name'], 0, 1));
85 85
 		if ($firstLetter != "")
86 86
 		{
87
-			if($previous !== $firstLetter)
87
+			if ($previous !== $firstLetter)
88 88
 			{
89 89
 				if ($previous !== null) print '</div>';
90 90
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
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.