-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrainfallf-year-month.php
executable file
·56 lines (46 loc) · 2.66 KB
/
rainfallf-year-month.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
####################################################################################################
# CREATED FOR HOMEWEATHERSTATION MB SMART TEMPLATE #
# https://weather34.com/homeweatherstation/index.html #
# #
# Release: July 2019 #
# #
# https://www.weather34.com #
####################################################################################################
include('livedata.php');header('Content-type: text/html; charset=utf-8');date_default_timezone_set($TZ);?>
<div class="topframe">
<div class="rainmaxthismonth">
<?php //rain month
if($weather["rainmmax"]>=1000){ echo "<maxtempblue>".round($weather["rainmmax"],0) ;}
else echo "<maxtempblue>".$weather["rainmmax"] ;echo "</maxtempblue><wunit>".$weather["rain_units"];
?>
</div></wunit>
<div class="wmonthmax"><?php echo date('M Y')?></div>
<div class="tmonthconv"><?php
if ($weather["rain_units"] =='mm'){ echo number_format($weather["rainmmax"]*0.0393701,2)."in";}
else if ($weather["rain_units"] =='in'){echo number_format($weather["rainmmax"]*25.400013716,1)."mm";}
?></div>
<div class="rainavgthisyear">
<?php //rain last month
if($weather["rainlastmonth"]<0.1){ echo " N/A";}
if($weather["rainlastmonth"]>=1000){ echo "<maxtempblue>".round($weather["rainlastmonth"],0) ;}
else if ($weather["rainlastmonth"]>0){echo "<maxtempblue>".$weather["rainlastmonth"] ;echo "</maxtempblue><wunit>".$weather["rain_units"];}
?>
</div></wunit>
<div class="ryearavg"><?php echo date('M Y', strtotime("last month"));?></div>
<div class="tavgconv"><?php
if ($weather["rain_units"] =='mm'){ echo number_format($weather["rainlastmonth"]*0.0393701,2)."in";}
else if ($weather["rain_units"] =='in'){echo number_format($weather["rainlastmonth"]*25.400013716,1)."mm";}
?></div>
<div class="yearwordwindbig">Rainfall</div>
<div class="rainmaxthisyear">
<?php //rain year
if($weather["rainymax"]>=1000){ echo "<maxtempblue>".round($weather["rainymax"],0) ;}
else echo "<maxtempblue>".$weather["rainymax"] ;echo "</maxtempblue><wunit>".$weather["rain_units"];
?>
</div></wunit>
<div class="wyearmax">Total <?php echo date('Y')?></div>
<div class="tyearconv"><?php
if ($weather["rain_units"] =='mm'){ echo number_format($weather["rainymax"]*0.0393701,2)."in";}
else if ($weather["rain_units"] =='in'){echo number_format($weather["rainymax"]*25.400013716,1)."mm";}
?></div>