Alberniweather Banner Image of Harbour

Vancouver Island Inland Sections Forecast

Issued : 4.00 PM PST Tuesday: 9 March 2010 Tonight: Rain changing to flurries near midnight. Snowfall amount 2 cm. Low minus 2.   Wednesday: Cloudy. 60 percent chance of flurries early in the morning. Rain beginning in the afternoon. High 6.   Wednesday: night Rain. Low plus 2.   Thursday: Periods of rain. High 8.   Friday: Rain. Low plus 2. High 8.   Saturday: Cloudy with 60 percent chance of showers. Low plus 2. High 8.   Sunday: Cloudy with 60 percent chance of showers. Low plus 3. High 10.   Monday: Periods of rain. Low plus 4. High 10.   ©Environment Canada

Search Tabular Weather Data

//header(“Content-type: application/octet-stream”);
//header(“Content-Disposition: attachment; filename=”my-data.csv”“);
//Call the Work function
?>

Select a date range to view hourly weather statistics for that time period

All Times are UTC/GMT (+8 Hours from PST)


if ($_POST[‘range’] 1) {

$poststarthour = $_POST['starthour'];

if ($poststarthour < 10) {

$poststarthour = $poststarthour;

}

$weatherperiod[Custom] = ‘TRUE’;
$weatherperiod[starttime] = $_POST['startyear'] . $_POST['startmonth'] . $_POST['startday'] . $poststarthour . ‘00′ . ‘00′;
$weatherperiod[endtime] = $_POST['endyear'] . $_POST['endmonth'] . $_POST['endday'] . $_POST['endhour'] . ‘00′ . ‘00′;
echo $weatherperiod[starttime];
echo ‘<br/>’;
echo $weatherperiod[endtime];
echo ‘<br/>’;
$weatherArray = unitConverter($weatherperiod);
//echo $weatherperiod[Custom];
$i = 1;

?>
<form method=”post” action=”/wp-content/themes/default/createfile.php”>
<input type=”hidden” name=”customfile” value=’<?php echo $weatherperiod[Custom];?>’>
<input type=”hidden” name=”rangefile” value=’1′>
<input type=”hidden” name=”refinedsearchfile” value=’1′>
<input type=”hidden” name=”starttimefile” value=”<?php echo $weatherperiod[starttime]; ?>”/>
<input type=”hidden” name=”endtimefile” value=”<?php echo $weatherperiod[endtime]; ?>”/>
<input TYPE=’SUBMIT’ NAME=’SUBMIT’ VALUE=’Create a CSV File From This Data’></form>
</p>

<?php

echo ‘<table>’;
echo ‘<tr>’;
echo ‘<td class=”tabularheader”>UTCTime</td>’;
echo ‘<td class=”tabularheader”>Temp</td>’;
echo ‘<td class=”tabularheader”>Barom</td>’;
echo ‘<td class=”tabularheader”>Humid</td>’;
echo ‘<td class=”tabularheader”>Rain</td>’;
echo ‘<td class=”tabularheader”">HiRainRate</td>’;
echo ‘<td class=”tabularheader”>Wind</td>’;
echo ‘<td class=”tabularheader”>HiWind</td>’;
echo ‘<td class=”tabularheader”>WdDir</td>’;
echo ‘<td class=”tabularheader”>HiWdDir</td>’;
echo ‘<td class=”tabularheader”>Dew</td>’;
echo ‘<td class=”tabularheader”>Chill</td>’;
echo ‘<td class=”tabularheader”>HeatIdx</td>’;
echo ‘<td class=”tabularheader”>SolRad</td>’;
echo ‘<td class=”tabularheader”>UV</td>’;
echo ‘<td class=”tabularheader”>Evap</td>’;
echo ‘</tr>’;

//echo $weatherArray[SQLData][RecordTime][3];

$countresult = count($weatherArray[SQLData][RecordTime]);
$j = 0;

$HiRainRate = 0;
$HiWindSpeed = 0;

while ($i <= $countresult) {
if ($j 12) {

echo ‘‘;
echo ‘‘;
echo $weatherArray[SQLData][RecordTime][$i];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][OutTemp][$i];
echo $weatherArray[tempUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][Barometer][$i];
echo ‘hPa’;
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][OutHumid][$i];
echo $weatherArray[humUnit];
echo ‘‘; echo ‘‘;
echo $rainSum;
echo $weatherArray[rainUnit];
echo ‘‘; echo ‘‘;
echo $HiRainRate;
echo $weatherArray[rainUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][WindSpeed][$i];
echo $weatherArray[windUnit];
echo ‘‘; echo ‘‘;
echo $HiWindSpeed;
echo $weatherArray[windUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][WindDir][$i];
echo ‘‘; echo ‘‘;
echo $HiWindDir;
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][Dewpoint][$i];
echo $weatherArray[tempUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][WindChill][$i];
echo $weatherArray[tempUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][HeatIndex][$i];
echo $weatherArray[tempUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][SolarRadSQL][$i];
echo $weatherArray[solarUnit];
echo ‘‘; echo ‘‘;
echo $weatherArray[SQLData][UVSQL][$i];
echo ‘‘; echo ‘‘;
echo $etSum;
echo $weatherArray[rainUnit];
echo ‘‘; echo ‘‘;

$i++;
$j = 1;
$rainSum = $weatherArray[SQLData][Rain][$i]*10;
$etSum = $weatherArray[SQLData][ET][$i]*10;
$HiRainRate = $weatherArray[SQLData][HiRainRate][$i];
$HiWindSpeed = $weatherArray[SQLData][HiWindSpeed][$i];
}

else {
$j++;
$i++;
$rainSum = $rainSum + ($weatherArray[SQLData][Rain][$i]*10);
$etSum = $etSum + ($weatherArray[SQLData][ET][$i]*10);

if ($HiRainRate < $weatherArray[SQLData][HiRainRate][$i]) {

$HiRainRate = $weatherArray[SQLData][HiRainRate][$i];

}

if ($HiWindSpeed < $weatherArray[SQLData][HiWindSpeed][$i]) {

$HiWindSpeed = $weatherArray[SQLData][HiWindSpeed][$i];
$HiWindDir = $weatherArray[SQLData][HiWindDir][$i];

}

}
}

echo ‘‘;
}

else {

echo ‘

Waiting for Your Selection

‘;

}
?>