Completed
Push — master ( 6fd228...599365 )
by Yannick
29:38
created
location-data.php 1 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 1 patch
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.