}
echo '
	</td>
</tr>';
#
if (isset($ws['last_year_low']) && isset($ws['last_year_high'])) {
    echo '
<tr>    <td class="dashTempsDesc">' . langtransstr('Last year') . ':</td>
	<td class="dashTempsHigh">' . wsNumber($ws['last_year_high'], $decTemp) . $uomTemp;
    if (isset($ws['last_year_highT'])) {
        echo '&nbsp;<small>(' . string_date($ws['last_year_highT'], $SITE['timeOnlyFormat']) . ')</small>';
    }
    echo '</td>
	<td class="dashTempsLow">' . wsNumber($ws['last_year_low'], $decTemp) . $uomTemp;
    if (isset($ws['last_year_lowT'])) {
        echo '&nbsp;<small>(' . string_date($ws['last_year_lowT'], $SITE['timeOnlyFormat']) . ')</small>';
    }
    echo '</td>
</tr>';
}
// eo lastyear
#
if (isset($ws['tempMaxRecordToday']) && isset($ws['tempMinRecordToday'])) {
    echo '
<tr>    <td class="dashTempsDesc">' . langtransstr('Station record') . ':</td>
	<td class="dashTempsHigh">' . wsNumber($ws['tempMaxRecordToday'], $decTemp) . $uomTemp;
    if (isset($ws['tempMaxRecordTodayYear'])) {
        echo '&nbsp;<small>(' . $ws['tempMaxRecordTodayYear'] . ')</small>';
    }
    echo '</td>
	<td class="dashTempsLow">' . wsNumber($ws['tempMinRecordToday'], $decTemp) . $uomTemp;
if ($wpCode != 'DW') {
    do_check($wpName . "Weather data files", $SITE['wsTags'], $SITE['wsNormTime'], 'file');
}
#
# check weatherfiles with yesterday tags
#
if (isset($SITE['wsYTags']) && $SITE['wsYTags'] != '' && $SITE['wsYTags'] != 'no') {
    do_check($wpName . "Weather data for yesterday", $SITE['wsYTags'], 24 * 60 * 60, 'file');
}
if (isset($SITE['ydayTags']) && $SITE['ydayTags'] != '' && $SITE['ydayTags'] != 'no') {
    do_check($wpName . "Weather data for yesterday", $SITE['ydayTags'], 24 * 60 * 60, 'file');
}
#
# check actual time of tags
#
$stringtime = string_date($ws['actTime'], 'Y-m-j G:i');
$unixtime = strtotime($stringtime);
do_check($wpName . "Weather data time", $unixtime, $SITE['wsDataTime'], 'applic');
#
$graphsArr = array('CU', 'MH', 'WC', 'WD', 'WL');
if (in_array($wpCode, $graphsArr)) {
    switch ($wpCode) {
        case 'WD':
            do_check($wpName . "Graphs", $SITE['graphImageDir'] . 'dirplot.gif', $SITE['wsFtpTime'], 'file');
            // windrose.png
            break;
        case 'MH':
            do_check($wpName . "Graphs", $SITE['graphImageDir'] . 'windrose.png', $SITE['wsFtpTime'], 'file');
            // windrose.png
            break;
        case 'CU':
Example #3
0
        echo '<tr>
<td style = "border-right: 1px solid grey;">' . $SITE['soilDepth_' . $i] . '</td>
<td>' . string_date($ws['moistMinMonthTime'][$i], $SITE['dateMDFormat']) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMinMonth'][$i]) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMaxMonth'][$i]) . '</td>
<td style = "border-right: 1px solid grey;">' . string_date($ws['moistMaxMonthTime'][$i], $SITE['dateMDFormat']) . '</td>';
        echo '
<td>' . string_date($ws['moistMinYearTime'][$i], $SITE['dateMDFormat']) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMinYear'][$i]) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMaxYear'][$i]) . '</td>
<td style = "border-right: 1px solid grey;">' . string_date($ws['moistMaxYearTime'][$i], $SITE['dateMDFormat']) . '</td>';
        echo '
<td>' . string_date($ws['moistMinAllTime'][$i], $SITE['dateOnlyFormat']) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMinAll'][$i]) . '</td>
<td style="">' . sprintf("%01.1f", $ws['moistMaxAll'][$i]) . '</td>
<td>' . string_date($ws['moistMaxAllTime'][$i], $SITE['dateOnlyFormat']) . '</td>';
        echo '</tr>';
    }
}
echo '	
</tbody></table>
</div>
<!-- end of current soil -->
</div>' . PHP_EOL;
# ------------supportting soil moist  functions ------------------------------------------
#
function getSoilMoistIndex($moist)
{
    $soilArr = array(0, 11, 26, 61, 101, 240);
    $moist = $moist * 1.0;
    global $SITE;
</td>
	<td style="border: 1px solid; border-radius:5px; border-color: #FF0000; background-color: #F3E5E5">
	        <?php 
echo wsNumber($ws['tempMaxYear']) . $uomTemp;
?>
</span>
		<br /><?php 
echo "(" . string_date($ws['tempMaxYearTime'], $SITE['dateMDFormat']) . ")";
?>
</td>
	<td style="border: 1px solid; border-radius:5px; border-color: #0000FF; background-color: #D0E2FF">
		<?php 
echo wsNumber($ws['tempMinYear']) . $uomTemp;
?>
		<br /><?php 
echo "(" . string_date($ws['tempMinYearTime'], $SITE['dateMDFormat']) . ")";
?>
</td>
</tr>
<?php 
if (isset($ws['tempMinRecordToday']) && isset($ws['tempMaxRecordToday'])) {
    ?>
<tr>    <td style="font-weight: bold; "><?php 
    echo langtransstr('Rcrd this Day:');
    ?>
</td>
	<td style="border: 1px solid; border-radius:5px; border-color: #FF0000; background-color: #F3E5E5">
	        <?php 
    echo $ws['tempMaxRecordToday'] . $uomTemp;
    if (isset($ws['tempMaxRecordTodayYear'])) {
        ?>
Example #5
0
<td>&nbsp;&nbsp;' . langtransstr('Yesterday') . '</td>
<td>' . wsNumber($ws['gustMaxYday'], $decWind) . $uomWind . ' ' . langtransstr('at') . ' ' . string_date($ws['gustMaxYdayTime'], $timeOnlyFormat) . '</td>' . $extra . '
</tr>';
}
// end $maxgustyest
$windLines++;
$string .= '
<tr class="row-light">
<td>&nbsp;&nbsp;' . langtransstr('Month') . '</td>
<td>' . wsNumber($ws['gustMaxMonth'], $decWind) . $uomWind . ' ' . langtransstr('on') . ' ' . string_date($ws['gustMaxMonthTime'], $dateOnlyFormat) . '</td>' . $extra . '
</tr>';
$windLines++;
$string .= '
<tr class="row-dark">
<td>&nbsp;&nbsp;' . langtransstr('Year') . '</td>
<td>' . wsNumber($ws['gustMaxYear'], $decWind) . $uomWind . ' ' . langtransstr('on') . ' ' . string_date($ws['gustMaxYearTime'], $dateOnlyFormat) . '</td>' . $extra . '
</tr>';
for ($i = $windLines; $i < 9; $i++) {
    $windLines++;
    $class = 'class="row-light"';
    $string .= '<tr><td colspan="2" ' . $class . '>&nbsp;</td>' . $extra . '</tr>' . PHP_EOL;
    if ($class == 'class="row-light"') {
        $class = 'class="row-dark"';
    } else {
        $class = 'class="row-light"';
    }
}
$cnt = (string) ($windLines + 2);
$string = str_replace('##', $cnt, $string);
echo $string . '
</table>
Example #6
0
echo langtransstr('Low:');
?>
</td>
		<td><span class="ajax" id="ajaxtempmin"><?php 
echo $vars['ajaxtempmin'];
?>
</span>
		<br />(<span class="ajax" id="ajaxtempminTime"><?php 
echo $vars['ajaxtempminTime'];
?>
</span>)</td>
		<td><?php 
echo wsNumber($ws['tempMinYday']) . $uomTemp;
?>
<br /><?php 
echo "(" . string_date($ws['tempMinYdayTime'], $SITE['timeOnlyFormat']) . ")";
?>
</td>
	</tr>
	</tbody>
	</table> <!-- today yesterday min max values -->
	</div> <!-- col-temp -->	
	<div class="colRight">	
	<h3 class="ajaxHead"><?php 
echo langtransstr("Rain");
?>
</h3>
<?php 
$unit = ' ' . langtransstr($SITE['uomRain']);
?>
	<p><span class="lTxt"><?php 
Example #7
0
        $string1 .= "\r\najaxVars['ajaxsolarpct']        = '" . wsNumber($ws['solActPerc'], 0) . "';";
    } elseif (isset($ws['solarActPerc'])) {
        $string1 .= "\r\najaxVars['ajaxsolarpct']        = '" . wsNumber($ws['solarActPerc'], 0) . "';";
    }
    $string1 .= "\r\najaxVars['ajaxsolarmax']        = '" . wsNumber($ws['solarMaxToday'], 0) . "';";
    if ($ws['solarMaxToday'] != 0) {
        $string1 .= "\r\najaxVars['ajaxsolarmaxtime']    = '" . string_date($ws['solarMaxTodayTime'], $SITE['timeOnlyFormat']) . "';";
    } else {
        $string1 .= "\r\najaxVars['ajaxsolarmaxtime']    = 'none';";
    }
}
// EO solar
if ($SITE['UV']) {
    $string1 .= "\r\najaxVars['ajaxuv']              = '" . wsNumber($ws['uvAct']) . "';\r\najaxVars['ajaxuvword']          = '" . wsgetUVword($ws['uvAct']) . "';\r\najaxVars['ajaxuvmax']           = '" . wsNumber($ws['uvMaxToday']) . "';";
    if ($ws['uvMaxTodayTime'] != 0) {
        $string1 .= "\r\najaxVars['ajaxuvmaxtime']       = '" . string_date($ws['uvMaxTodayTime'], $SITE['timeOnlyFormat']) . "';";
    } else {
        $string1 .= "\r\najaxVars['ajaxuvmaxtime']       = 'none';" . PHP_EOL;
    }
}
// eo UV
#
function wsGenArrow($nowTemp, $diff, $textUP, $textDN, $DP = 1)
{
    global $SITE, $wsDebug;
    if ($SITE['WXsoftware'] == 'WL' || $SITE['WXsoftware'] == 'DW') {
        return '';
    }
    $nowTemp = 1.0 * str_replace(',', '.', $nowTemp);
    $diff = 1.0 * str_replace(',', '.', $diff);
    $absDiff = abs($diff);
Example #8
0
function generate_date($value, $date_time = 'time', $style = '')
{
    global $no_value, $timeOnlyFormat, $dateOnlyFormat, $dateMDFormat;
    if ($date_time == 'date') {
        $format = $dateOnlyFormat;
    } elseif ($date_time == 'month') {
        $format = $dateMDFormat;
    } else {
        $format = $timeOnlyFormat;
    }
    global $no_value;
    $from = array('n/a', '---', '--');
    $repl = trim(str_replace($from, '', $value));
    if ($repl != '') {
        return '<td style="text-align: left;"><small>&nbsp;(' . string_date($value, $format) . ')</small></td>';
    } else {
        return '<td style="text-align: left;"><small>&nbsp;' . $no_value . '</small></td>';
    }
}