Completed
Push — master ( 6fd228...599365 )
by Yannick
29:38
created
location-data.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 $Source = new Source();
6 6
 
7 7
 if (isset($_GET['sourceid'])) {
8
-	$sourceid = filter_input(INPUT_GET,'sourceid',FILTER_SANITIZE_NUMBER_INT);
8
+	$sourceid = filter_input(INPUT_GET, 'sourceid', FILTER_SANITIZE_NUMBER_INT);
9 9
 	$source_data = $Source->getLocationInfoById($sourceid);
10 10
 	if (isset($source_data[0])) {
11 11
  ?>
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 print '</div>';
38 38
 
39 39
 if ($spotter_item['city'] != '') print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>';
40
-if ($spotter_item['country'] !='') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
41
-print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],4).', '.round($spotter_item['longitude'],4).'</div>';
40
+if ($spotter_item['country'] != '') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
41
+print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 4).', '.round($spotter_item['longitude'], 4).'</div>';
42 42
 /*
43 43
 if ($spotter_item['atc_range'] > 0) {
44 44
     print '<div><span>'._("Range").'</span>';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 }
48 48
 */
49 49
 if ($spotter_item['type'] == 'wx') {
50
-	$weather = json_decode($spotter_item['description'],true);
50
+	$weather = json_decode($spotter_item['description'], true);
51 51
 	//print_r($weather);
52 52
 	if (isset($weather['temp'])) print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>';
53 53
 	if (isset($weather['pressure'])) print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>';
Please login to merge, or discard this patch.
Braces   +38 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,11 +17,17 @@  discard block
 block discarded – undo
17 17
 date_default_timezone_set('UTC');
18 18
 
19 19
 print '<div class="top">';
20
-if ($spotter_item['name'] != '') print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>';
21
-elseif ($spotter_item['location_id'] != 0) print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>';
22
-elseif ($spotter_item['type'] == 'lightning') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Lightning").'</div>';
23
-elseif ($spotter_item['type'] == 'wx') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Weather Station").'</div>';
24
-else print '<div class="right"><div class="callsign-details"><div class="callsign"></div>';
20
+if ($spotter_item['name'] != '') {
21
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>';
22
+} elseif ($spotter_item['location_id'] != 0) {
23
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>';
24
+} elseif ($spotter_item['type'] == 'lightning') {
25
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Lightning").'</div>';
26
+} elseif ($spotter_item['type'] == 'wx') {
27
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Weather Station").'</div>';
28
+} else {
29
+	print '<div class="right"><div class="callsign-details"><div class="callsign"></div>';
30
+}
25 31
 print '</div>';
26 32
 
27 33
 print '</div></div>';
@@ -36,8 +42,12 @@  discard block
 block discarded – undo
36 42
 print $spotter_item['last_seen'].' UTC';
37 43
 print '</div>';
38 44
 
39
-if ($spotter_item['city'] != '') print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>';
40
-if ($spotter_item['country'] !='') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
45
+if ($spotter_item['city'] != '') {
46
+	print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>';
47
+}
48
+if ($spotter_item['country'] !='') {
49
+	print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
50
+}
41 51
 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],4).', '.round($spotter_item['longitude'],4).'</div>';
42 52
 /*
43 53
 if ($spotter_item['atc_range'] > 0) {
@@ -49,13 +59,27 @@  discard block
 block discarded – undo
49 59
 if ($spotter_item['type'] == 'wx') {
50 60
 	$weather = json_decode($spotter_item['description'],true);
51 61
 	//print_r($weather);
52
-	if (isset($weather['temp'])) print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>';
53
-	if (isset($weather['pressure'])) print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>';
54
-	if (isset($weather['wind_gust'])) print '<div><span>'._("Wind Gust").'</span>'.$weather['wind_gust'].' km/h</div>';
55
-	if (isset($weather['humidity'])) print '<div><span>'._("Humidity").'</span>'.$weather['humidity'].'%</div>';
56
-	if (isset($weather['rain'])) print '<div><span>'._("Rain").'</span>'.$weather['rain'].' mm</div>';
57
-	if (isset($weather['precipitation'])) print '<div><span>'._("Precipitation 24H").'</span>'.$weather['precipitation'].' mm</div>';
58
-	if (isset($weather['precipitation24h'])) print '<div><span>'._("Precipitation Today").'</span>'.$weather['precipitation24h'].' mm</div>';
62
+	if (isset($weather['temp'])) {
63
+		print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>';
64
+	}
65
+	if (isset($weather['pressure'])) {
66
+		print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>';
67
+	}
68
+	if (isset($weather['wind_gust'])) {
69
+		print '<div><span>'._("Wind Gust").'</span>'.$weather['wind_gust'].' km/h</div>';
70
+	}
71
+	if (isset($weather['humidity'])) {
72
+		print '<div><span>'._("Humidity").'</span>'.$weather['humidity'].'%</div>';
73
+	}
74
+	if (isset($weather['rain'])) {
75
+		print '<div><span>'._("Rain").'</span>'.$weather['rain'].' mm</div>';
76
+	}
77
+	if (isset($weather['precipitation'])) {
78
+		print '<div><span>'._("Precipitation 24H").'</span>'.$weather['precipitation'].' mm</div>';
79
+	}
80
+	if (isset($weather['precipitation24h'])) {
81
+		print '<div><span>'._("Precipitation Today").'</span>'.$weather['precipitation24h'].' mm</div>';
82
+	}
59 83
 	$spotter_item['description'] = $weather['comment'];
60 84
 }
61 85
 print '</div>';
Please login to merge, or discard this patch.
location-geojson.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,37 +14,37 @@  discard block
 block discarded – undo
14 14
 	{
15 15
 		$coords = explode(',',$_GET['coord']);
16 16
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
17
-		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
17
+			|| (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
18 18
 			//$spotter_array = $Source->getAllLocationInfo();
19 19
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs',$coords));
20 20
 		}
21 21
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
22
-		    || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
22
+			|| (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
23 23
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx',$coords));
24 24
 		}
25 25
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
26
-		    || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
26
+			|| (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
27 27
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning',$coords));
28 28
 		}
29 29
 		
30 30
 		if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
31
-		    || (!isset($_COOKIE['show_Fire']) && (!isset($globalMapFire) || $globalMapFire === TRUE))) {
31
+			|| (!isset($_COOKIE['show_Fire']) && (!isset($globalMapFire) || $globalMapFire === TRUE))) {
32 32
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',$coords));
33 33
 		}
34 34
 		
35 35
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
36 36
 	} else {
37 37
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
38
-		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
38
+			|| (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
39 39
 			//$spotter_array = $Source->getAllLocationInfo();
40 40
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs'));
41 41
 		}
42 42
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
43
-		    || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
43
+			|| (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
44 44
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx'));
45 45
 		}
46 46
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
47
-		    || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
47
+			|| (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
48 48
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning'));
49 49
 		}
50 50
 		/*
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		date_default_timezone_set('UTC');
66 66
 		//waypoint plotting
67 67
 		$output .= '{"type": "Feature",';
68
-		    $output .= '"properties": {';
68
+			$output .= '"properties": {';
69 69
 			$output .= '"id": "'.$spotter_item['id'].'",';
70 70
 			$output .= '"location_id": "'.$spotter_item['location_id'].'",';
71 71
 			$output .= '"name": "'.$spotter_item['name'].'",';
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 				if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",';
84 84
 			}
85 85
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
86
-		    $output .= '},';
87
-		    $output .= '"geometry": {';
86
+			$output .= '},';
87
+			$output .= '"geometry": {';
88 88
 			$output .= '"type": "Point",';
89 89
 			$output .= '"coordinates": [';
90
-			    $output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
90
+				$output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
91 91
 			$output .= ']';
92
-		    $output .= '}';
92
+			$output .= '}';
93 93
 		$output .= '},';
94 94
 	}
95 95
 	$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,40 +12,40 @@  discard block
 block discarded – undo
12 12
 if (!isset($globalDemo)) {
13 13
 	if (isset($_GET['coord'])) 
14 14
 	{
15
-		$coords = explode(',',$_GET['coord']);
15
+		$coords = explode(',', $_GET['coord']);
16 16
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
17 17
 		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
18 18
 			//$spotter_array = $Source->getAllLocationInfo();
19
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs',$coords));
19
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs', $coords));
20 20
 		}
21 21
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
22 22
 		    || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
23
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx',$coords));
23
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx', $coords));
24 24
 		}
25 25
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
26 26
 		    || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
27
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning',$coords));
27
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning', $coords));
28 28
 		}
29 29
 		
30 30
 		if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
31 31
 		    || (!isset($_COOKIE['show_Fire']) && (!isset($globalMapFire) || $globalMapFire === TRUE))) {
32
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',$coords));
32
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('fires', $coords));
33 33
 		}
34 34
 		
35
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
35
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
36 36
 	} else {
37 37
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
38 38
 		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
39 39
 			//$spotter_array = $Source->getAllLocationInfo();
40
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs'));
40
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs'));
41 41
 		}
42 42
 		if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
43 43
 		    || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
44
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx'));
44
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx'));
45 45
 		}
46 46
 		if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
47 47
 		    || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
48
-			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning'));
48
+			$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning'));
49 49
 		}
50 50
 		/*
51 51
 		if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 			$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires'));
54 54
 		}
55 55
 		*/
56
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
56
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
57 57
 	}
58 58
 }
59 59
 
60 60
 $output = '{"type": "FeatureCollection","features": [';
61 61
 if (!empty($spotter_array) && count($spotter_array) > 0)
62 62
 {
63
-	foreach($spotter_array as $spotter_item)
63
+	foreach ($spotter_array as $spotter_item)
64 64
 	{
65 65
 		date_default_timezone_set('UTC');
66 66
 		//waypoint plotting
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 			$output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",';
80 80
 			$output .= '"type": "'.$spotter_item['type'].'",';
81 81
 			if ($spotter_item['type'] == 'wx') {
82
-				$weather = json_decode($spotter_item['description'],true);
83
-				if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",';
82
+				$weather = json_decode($spotter_item['description'], true);
83
+				if (isset($weather['temp'])) $output .= '"temp": "'.$weather['temp'].'",';
84 84
 			}
85 85
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
86 86
 		    $output .= '},';
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		    $output .= '}';
93 93
 		$output .= '},';
94 94
 	}
95
-	$output  = substr($output, 0, -1);
95
+	$output = substr($output, 0, -1);
96 96
 }
97 97
 $output .= ']}';
98 98
 
Please login to merge, or discard this patch.
country-detailed.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-if (!isset($_GET['country'])){
6
+if (!isset($_GET['country'])) {
7 7
 	header('Location: '.$globalURL.'');
8 8
 } else {
9 9
 	$Spotter = new Spotter();
10 10
 	//calculuation for the pagination
11
-	if(!isset($_GET['limit']))
11
+	if (!isset($_GET['limit']))
12 12
 	{
13 13
 	  $limit_start = 0;
14 14
 	  $limit_end = 25;
15 15
 	  $absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		$limit_start = $limit_explode[0];
19 19
 		$limit_end = $limit_explode[1];
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	$country = ucwords(str_replace("-", " ", $_GET['country']));
31 31
 	
32 32
 	$page_url = $globalURL.'/country/'.$_GET['country'];
33
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
33
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
34 34
 	if ($country == 'Na') {
35 35
 		$spotter_array = array();
36 36
 	} else {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 	if (!empty($spotter_array))
45 45
 	{
46
-		$title = sprintf(_("Detailed View for Airports &amp; Airlines from %s"),$country);
46
+		$title = sprintf(_("Detailed View for Airports &amp; Airlines from %s"), $country);
47 47
 
48 48
 		require_once('header.php');
49 49
 		print '<div class="select-item">';
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 		print '<select name="country" class="selectpicker" data-live-search="true">';
52 52
 		print '<option></option>';
53 53
 		$all_countries = $Spotter->getAllCountries();
54
-		foreach($all_countries as $all_country)
54
+		foreach ($all_countries as $all_country)
55 55
 		{
56
-			if($country == $all_country['country'])
56
+			if ($country == $all_country['country'])
57 57
 			{
58 58
 				print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
59 59
 			} else {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		if ($_GET['country'] != "NA")
69 69
 		{
70 70
 			print '<div class="info column">';
71
-			print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
71
+			print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
72 72
 			print '</div>';
73 73
 		} else {
74 74
 			print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 		include('country-sub-menu.php');
78 78
 		print '<div class="table column">';
79
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure &amp; arrival) OR airlines from <strong>%s</strong>."),$country).'</p>';
79
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure &amp; arrival) OR airlines from <strong>%s</strong>."), $country).'</p>';
80 80
 
81 81
 		include('table-output.php');
82 82
 		print '<div class="pagination">';
Please login to merge, or discard this patch.