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.