Here is how I have mine in my ajax-dashboard.php
Make sure you have the $timeoflastrain in your testtags.txt file
<tr>
<td class="data1" nowrap="nowrap">Last Tip: </td>
<td style="text-align: right;" class="data1">
<?php echo $timeoflastrain; ?>
</td>
</tr>
Chuck
Hey guys, First Thanks Chuck for this. I expanded on it a bit and wanted to share the result with you. Again the code just replaces the "Storm Rain" field that wasn't being utilized on my site.
This code takes the following 3 tags into the picture so they need to be in testtags.txt:
$timeoflastrainalways = "%timeoflastrainalways%"; //Time that the last rain tip was recorded (not reset).
$dateoflastrainalways =" %dateoflastrainalways%"; //Date that the last rain tip was recorded (not rest).
$timeoflastrain = "%timeoflastrain%"; //Time that the last rain tip was recorded.
Then I put 2 little if statements in the page in the Rain column that in the case of rain today, It shows the last tip. but as midnight comes,that last tip info is reset to "-" so on a dry day it didn't look good.
Then I used the other 2 tags and moved the last tip to the bottom of the column by using the if statement, and it shows up as date and time of last rain at the bottom of the column, deleting the Last tip field as it is blank after midnight and on dry days, and not needed until rain starts again, then the reverse happens.
Here is my code for the modified rain column:
NOTE - I copied the previous <tr> tag to assist in locating the lines to change and also note the changes go right to the close tag </table>
<tr>
<td class="data1" nowrap="nowrap"><?php echo $date_year ?> to Date:</td>
<td style="text-align: right;" class="data1" nowrap="nowrap">
<span class="ajax" id="ajaxrainyr">
<?php echo strip_units($yearrn) . $uomRain; ?>
</span>
</td>
</tr>
<tr>
<?php if ($timeoflastrain != "-"){ ?>
<td class="data2" colspan="2" style="text-align: center;">
<?php } else{ ?>
<td class="data1" colspan="2" style="text-align: center;">
<?php } ?>
<?php
if ($dayswithrain <= 0 and strip_units($dayrn) <= 0) {
print "$dayswithnorain days since last rain.";
} else {
print "$dayswithrain rain day";
$t = ($dayswithrain > 1)? 's':'';
print "$t in " . $monthname;
} ?>
</td>
</tr>
<?php if ($timeoflastrain == "-"){ ?>
<tr title= "Last date and time rain sensor 'bucket' was activated">
<td style="font-size: 10px; text-align: center;" class="data2" colspan="2" >Last Rain Event Recorded on
<?php echo $dateoflastrainalways . " at" . $timeoflastrainalways; ?>
</td>
</tr>
<?php } ?>
</table>
Hope you like it, and credit to Tony and Chuck for this idea.
All the best,
Jim