Example #1
0
include "../../config/settings.inc.php";
define("IEM_APPID", 156);
include_once "../../include/myview.php";
include_once "../../include/database.inc.php";
include_once "../../include/forms.php";
include_once "../../include/imagemaps.php";
include_once "../../include/network.php";
$nt = new NetworkTable("NWSCLI");
$station = isset($_GET["station"]) ? $_GET["station"] : 'KDSM';
$year = isset($_GET["year"]) ? intval($_GET["year"]) : date("Y");
$month = isset($_GET["month"]) ? intval($_GET["month"]) : null;
$day = isset($_GET["day"]) ? intval($_GET["day"]) : null;
$opt = isset($_GET["opt"]) ? $_GET["opt"] : "bystation";
$ys = yearSelect(2009, $year, "year");
$ms = monthSelect($month, "month");
$ds = daySelect($day, "day");
$pgconn = iemdb("iem");
$byday = false;
if ($opt === "bystation") {
    $title = sprintf("Station: %s for Year: %s", $station, $year);
    $col1label = "Date";
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tstation = \$1 and valid BETWEEN \$2 and \$3 ORDER by valid ASC");
    $rs = pg_execute($pgconn, "SELECT", array($station, "{$year}-01-01", "{$year}-12-31"));
} else {
    $col1label = "Station";
    $byday = true;
    $day = mktime(0, 0, 0, $month, $day, $year);
    $title = sprintf("All Stations for Date: %s", date("d F Y", $day));
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tvalid = \$1 ORDER by station ASC");
    $rs = pg_execute($pgconn, "SELECT", array(date("Y-m-d", $day)));
Example #2
0
include "../../include/forms.php";
$prod = isset($_GET["prod"]) ? intval($_GET["prod"]) : 1;
$year = isset($_REQUEST["year"]) ? intval($_REQUEST["year"]) : date("Y");
$month = isset($_REQUEST["month"]) ? intval($_REQUEST["month"]) : date("m");
$old2new = array("/data/agclimate/air-temp-out.png" => 1, "/data/agclimate/4in-temp-out.png" => 2, "/agclimate/daily_pics/4in-temp-out.png" => 2, "/data/agclimate/soil-hilo-out.png" => 3, "/agclimate/daily_pics/soil-hilo-out.png" => 3, "/data/agclimate/rad-out.png" => 4, "/data/agclimate/prec-out.png" => 5, "/data/agclimate/et-out.png" => 6, "/data/agclimate/pk-wind-out.png" => 7, "/data/agclimate/avewind-out.png" => 8, "/data/agclimate/dwpts.png" => 9, "/data/agclimate/mon-et-out.png" => 10, "/data/agclimate/mon-prec-out.png" => 11);
// Legacy
if (isset($_GET["src"])) {
    $prod = $old2new[$_GET["src"]];
}
$data = array(1 => array("mapurl" => "/data/agclimate/air-temp-out.png", "desc" => "High and low air temperature for a local day. Measurements are \n            made at a 2 meter height."), 2 => array("mapurl" => "/data/agclimate/4in-temp-out.png", "desc" => "Average 4 inch soil depth temperature.  Usually under a \n            bare soil."), 3 => array("mapurl" => "/data/agclimate/soil-hilo-out.png", "desc" => "High and low 4 inch soil depth temperature.  Usually under a \n            bare soil."), 4 => array("mapurl" => "/data/agclimate/rad-out.png", "desc" => "Daily total (direct + diffuse) solar radiation."), 5 => array("mapurl" => "/data/agclimate/prec-out.png", "desc" => "Daily total precipitation.  This is measured with a <b>non-heated</b> tipping bucket located near the ground.  These reported values should be\nused with extreme caution.  For various reasons, the reported values are \noften too low."), 6 => array("mapurl" => "/data/agclimate/et-out.png", "desc" => "Potential maximum estimated evapotranspiration.  This value uses\n            a daily Penman formulation with a crop coefficient of 1."), 7 => array("mapurl" => "/data/agclimate/pk-wind-out.png", "desc" => "Peak 5 second sustained wind gust.  The value is presented along\n      with the time using a 24 hour clock.  For example, 18:00 would be 6 PM.\n      Values are in local time, either CDT or CST depending on the time of\n      year."), 8 => array("mapurl" => "/data/agclimate/avewind-out.png", "desc" => "Average wind speed for the day as recorded by the data logger\n            on the station."), 9 => array("mapurl" => "/data/agclimate/dwpts.png", "desc" => "High and low dew points for the day."), 10 => array("mapurl" => "/GIS/apps/agclimate/month.php?dvar=dailyet&direct=yes&year={$year}&month={$month}", "desc" => "Monthly total of daily maximum potential evapotranspiration. The\n            daily value is calculated via a Penman formulation with a crop\n            coefficient of 1.  The value would be a theoretical maximum."), 11 => array("mapurl" => "/GIS/apps/agclimate/month.php?dvar=rain_mm_tot&direct=yes&year={$year}&month={$month}", "desc" => "Monthly total of daily reported precipitation. This is measured with a <b>non-heated</b> tipping bucket located near the ground.  These reported values should be\nused with extreme caution.  For various reasons, the reported values are \noften too low."), 12 => array("mapurl" => "/data/agclimate/chill-sum.png", "desc" => "The Standard Chill Unit map is a summation of hours during \n   which the temperature was between 32 and 45 degrees <b>after</b> \n   1 September.  The value has application for \n   fruit growers in the state.  The departure from average is also \n   presented.  This average is computed from the observational record at\n   the site."));
$extra = "";
if ($prod == 10 || $prod == 11) {
    $extra .= "<form method='GET' name='ts'>";
    $extra .= "<input type='hidden' value='{$prod}' name='prod'>";
    $extra .= "<strong>Select Year: </strong>" . yearSelect(1987, $year);
    $extra .= "<strong>Select Month: </strong>" . monthSelect($month, "month");
    $extra .= "<input type='submit' value='Update Plot' />";
    $extra .= '</form>';
}
$t->content = <<<EOF

<table style="float: left;" width="100%">
<TR>
<TD valign="top">
{$extra}

<img src="{$data[$prod]["mapurl"]}" ALT="ISU Ag Climate" style="border: 1px solid #000; ">

<p><strong>Plot Description:</strong><br />
{$data[$prod]["desc"]}
Example #3
0
<?php

/* Daily Data download for the ISUAG Network */
include "../../../config/settings.inc.php";
include "../../../include/forms.php";
define("IEM_APPID", 12);
include "../../../include/myview.php";
$t = new MyView();
$t->title = "ISU AgClimate Legacy Daily Data Request";
$t->thispage = "networks-agclimate";
$ys = yearSelect2(1986, date("Y"), "startYear");
$ms = monthSelect(1, "startMonth");
$ds = daySelect2(1, "startDay");
$ys2 = yearSelect2(1986, date("Y"), "endYear");
$ms2 = monthSelect(date("m"), "endMonth");
$ds2 = daySelect2(date("d"), "endDay");
$t->content = <<<EOF
 <ol class="breadcrumb">
  <li><a href="/agclimate">ISU AgClimate</a></li>
  <li class="active">Legacy Network Daily Download</li>
 </ol>

<h4>Daily Data Request Form</h4>

<div class="alert alert-info">
This download page is for the legacy sites.  To download data from the new
ISU Soil Moisture network, please visit 
<a class="alert-link" href="daily.php">this page</a>.
</div>

<p>This interface allows the download of daily summary data from the legacy
Example #4
0
\t    \ttable.rows[i].style.display = rowStyle;
\t\t}
\t}
\tif (hide){
\t\tdocument.getElementById("metar_toggle").innerHTML = "Show METARs";
\t} else{
\t\tdocument.getElementById("metar_toggle").innerHTML = "Hide METARs";
\t}
\thide = !hide;
}
</script>
EOF;
$dstr = date("d F Y", $date);
$tzname = $metadata["tzname"];
$ys = yearSelect($startyear, date("Y", $date));
$ms = monthSelect(date("m", $date));
$ds = daySelect(date("d", $date));
$mbutton = preg_match("/ASOS|AWOS/", $network) ? "<a onclick=\"javascript:hideMetars();\" class=\"btn btn-default\" id=\"metar_toggle\">Show Metars</a>" : "";
$content = <<<EOF
<style>
.high {
  color: #F00;
}
.low {
  color: #00F;
}
.metar {
  display: none;
}
</style>
Example #5
0
<?php

include "../../../config/settings.inc.php";
include "../../../include/myview.php";
$t = new MyView();
$station = isset($_GET["station"]) ? $_GET["station"] : "";
$year = isset($_GET["year"]) ? $_GET["year"] : date("Y");
$month = isset($_GET["month"]) ? $_GET["month"] : date("m");
$day = isset($_GET["day"]) ? $_GET["day"] : date("d");
$t->thispage = "networks-awos";
$t->title = "AWOS 1 Minute Time Series";
include "../../../include/imagemaps.php";
include "../../../include/forms.php";
$nselect = networkSelect("AWOS", $station);
$yselect = yearSelect(1995, 2011, $year);
$mselect = monthSelect($month);
$dselect = daySelect($day);
$content = <<<EOF
<ol class="breadcrumb">
 <li><a href="/AWOS/">AWOS Network</a></li>
 <li class="active">One minute time series</li>
</ol>

<p><b>Note:</b>The archive currently contains data from 1 Jan 1995 
till the end of the previous month.  Fort Dodge and Clinton were converted to ~ASOS, 
but are available for some times earlier in the archive.<p>

  <form method="GET" action="1station_1min.php">
Make plot selections: <br>
    {$nselect} 
 
</script>

<h1 style='text-align:center'>Performance Summary</h1>
<h3 style='text-align:center'>Select the month to display the performance statistics for that month</h3>
<br/>
<div id='input' class='header' style='text-align:center; margin-bottom:20px;'>
	<select name='year' id='year' onchange="updateSummary($('#showMonth').val(), 'employee')" >
		<?php 
    $year = date("Y");
    for ($i = 0; $i < 5; $i++) {
        echo "<option value='" . $year . "'>" . $year . "</option>";
        $year--;
    }
    ?>
	</select>
	<select name='showMonth' id='showMonth' onchange='updateSummary(this.value,"employee")'>
		<option>Select Month</option>
		<?php 
    monthSelect();
    ?>
	</select>
</div>
<div id='results'>

</div>
<?php 
} else {
    echo "<h1>You are not Authorized to View this page</h1>";
}
require '../includes/includeAtEnd.php';
Example #7
0
/* 
 * Download front end for daily data from the ISUSM network
 */
include "../../../config/settings.inc.php";
include "../../../include/myview.php";
$t = new MyView();
$t->title = "ISU Soil Moisture Hourly Data Request";
$t->thispage = "networks-agclimate";
include "../../../include/network.php";
$nt = new NetworkTable("ISUSM");
include "../../../include/forms.php";
$yselect = yearSelect2(2013, date("Y"), "year1");
$mselect = monthSelect(date("m"), "month1");
$dselect = daySelect2(date("d"), "day1");
$yselect2 = yearSelect2(2013, date("Y"), "year2");
$mselect2 = monthSelect(date("m"), "month2");
$dselect2 = daySelect2(date("d"), "day2");
$sselect = "";
while (list($key, $val) = each($nt->table)) {
    $sselect .= sprintf("<br /><input type=\"checkbox\" name=\"sts\" value=\"%s\">%s (%s County, %s)", $key, $val["name"], $val["county"], $key);
}
$t->content = <<<EOF
<h3 class="heading">Hourly Data Request Form:</h3>

<div class="alert alert-info">
This download page is for the recently installed (2013) ISU Soil Moisture sites.  
To download data from the legacy ISU AgClimate network, please visit 
<a class="alert-link" href="hourlyRequest.php">this page</a>.
</div>

Example #8
0
        $data[] = $val['properties'];
    }
    if ($sortdir == 'ASC') {
        $sorted_data = sortBySecondIndex($data, $sortcol);
    } else {
        $sorted_data = aSortBySecondIndex($data, $sortcol);
    }
    while (list($key, $val) = each($sorted_data)) {
        $link = sprintf("extremes.php?station=%s&amp;network=%s&amp;tbl=%s", $val["station"], $network, $tbl);
        $table .= sprintf("<tr><td><a href=\"%s\">%s</a> (%s)</td><td>%s</td>\n \t\t\t\t<td>%.1f</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n \t\t\t\t<td></td>\n \t\t\t\t<td>%.1f</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n \t\t\t\t<td></td>\n \t\t\t\t<td>%.2f</td><td>%.2f</td><td>%s</td>\n \t\t\t\t</tr>", $link, $cities[$val["station"]]['name'], $val["station"], $val["years"], $val["avg_high"], $val["max_high"], implode(", ", $val["max_high_years"]), $val["min_high"], implode(", ", $val["min_high_years"]), $val["avg_low"], $val["max_low"], implode(", ", $val["max_low_years"]), $val["min_low"], implode(", ", $val["min_low_years"]), $val["avg_precip"], $val["max_precip"], implode(", ", $val["max_precip_years"]));
    }
    $h3 = "<h3>NWS COOP Climatology for " . date("d F", $valid) . "</h3>";
}
$ar = array("ILCLIMATE" => "Illinois", "INCLIMATE" => "Indiana", "IACLIMATE" => "Iowa", "KSCLIMATE" => "Kansas", "KYCLIMATE" => "Kentucky", "MICLIMATE" => "Michigan", "MNCLIMATE" => "Minnesota", "MOCLIMATE" => "Missouri", "NECLIMATE" => "Nebraska", "NDCLIMATE" => "North Dakota", "OHCLIMATE" => "Ohio", "SDCLIMATE" => "South Dakota", "WICLIMATE" => "Wisconsin");
$netselect = make_select("network", $network, $ar);
$mselect = monthSelect($month, "month");
$dselect = daySelect($day, "day");
$ar = array("climate" => "All Available", "climate51" => "Since 1951", "climate71" => "1971-2000", "climate81" => "1981-2010");
$tblselect = make_select("tbl", $tbl, $ar);
$sortdir2 = $sortdir == 'ASC' ? 'DESC' : 'ASC';
if ($station != null) {
    $uribase = sprintf("&station=%s&network=%s&tbl=%s&amp;sortdir=%s", $station, $network, $tbl, $sortdir2);
    $h4 = "<a href='extremes.php?sortcol=valid" . $uribase . "'>Date</a>";
} else {
    $uribase = sprintf("&day=%s&month=%s&network=%s&tbl=%s&amp;sortdir=%s", $day, $month, $network, $tbl, $sortdir2);
    $h4 = "<a href='extremes.php?sortcol=station&day=" . $day . "&month=" . $month . "'>Station</a>";
}
$t->content = <<<EOF
 
 {$h3}
 
Example #9
0
if (!isset($_GET["station"])) {
    $t->headextra = <<<EOF
<link rel="stylesheet" href="/vendor/openlayers/{$OL}/ol.css" type="text/css">
<link type="text/css" href="/vendor/openlayers/{$OL}/ol3-layerswitcher.css" rel="stylesheet" />
EOF;
    $t->jsextra = <<<EOF
<script src="/vendor/openlayers/{$OL}/ol.js" type="text/javascript"></script>
<script src='/vendor/openlayers/{$OL}/ol3-layerswitcher.js'></script>
<script src="/js/olselect.php?network={$network}"></script>
EOF;
}
$t->title = "SchoolNet One Minute Time Series";
$t->thispage = "networks-schoolnet";
$nselect = networkSelect($network, $station);
$ys = yearSelect2(2002, $year, "year");
$ms = monthSelect($month);
$ds = daySelect($day);
$content = "";
if (strlen($station) > 0) {
    $content .= sprintf("<p><img src=\"1min_T.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= sprintf("<p><img src=\"1min_V.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= sprintf("<p><img src=\"1min_P.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= "<p><b>Note:</b> The wind speeds are indicated every minute by the red line.  The blue dots represent wind direction and are shown every 10 minutes.</p>";
} else {
    $content = <<<EOF

<p>or select from this map...<p>

<div class="row well">
 <div class="col-md-4 col-sm-4">
<a href="?network=KCCI" style="text-decoration: none;">
Example #10
0
$year1 = isset($_REQUEST['year1']) ? intval($_REQUEST['year1']) : date("Y", $d2);
$month1 = isset($_REQUEST['month1']) ? intval($_REQUEST['month1']) : date("m", $d2);
$day1 = isset($_REQUEST['day1']) ? intval($_REQUEST['day1']) : date("d", $d2);
$hour1 = isset($_REQUEST['hour1']) ? intval($_REQUEST['hour1']) : 0;
$year2 = isset($_REQUEST['year2']) ? intval($_REQUEST['year2']) : date("Y", $now);
$month2 = isset($_REQUEST['month2']) ? intval($_REQUEST['month2']) : date("m", $now);
$day2 = isset($_REQUEST['day2']) ? intval($_REQUEST['day2']) : date("d", $now);
$hour2 = isset($_REQUEST['hour2']) ? intval($_REQUEST['hour2']) : date("H", $now);
$opt = isset($_REQUEST['opt']) ? $_REQUEST['opt'] : '1';
$sselect = networkSelect("ISUSM", $station);
$y1 = yearSelect2(2012, $year1, "year1");
$m1 = monthSelect($month1, "month1");
$d1 = daySelect2($day1, "day1");
$h1 = hourSelect($hour1, "hour1");
$y2 = yearSelect2(2012, $year2, "year2");
$m2 = monthSelect($month2, "month2");
$d2 = daySelect2($day2, "day2");
$h2 = hourSelect($hour2, "hour2");
$ar = array("1" => "3 Panel Plot", "2" => "Just Soil Temps", "3" => "Daily Max/Min 4 Inch Soil Temps", "4" => "Daily Solar Radiation", "5" => "Daily Potential Evapotranspiration");
$oselect = make_select("opt", $opt, $ar);
$img = sprintf("smts.py?opt=%s&amp;station=%s&amp;year1=%s&amp;year2=%s" . "&amp;month1=%s&amp;month2=%s&amp;day1=%s&amp;day2=%s&amp;" . "hour1=%s&amp;hour2=%s", $opt, $station, $year1, $year2, $month1, $month2, $day1, $day2, $hour1, $hour2);
$t->content = <<<EOF
<ol class="breadcrumb">
 <li><a href="/agclimate/">AgClimate Network</a></li>
 <li class="active">Soil Moisture Plots</li>
</ol>

<h3>Soil Moisture and Precipitation Timeseries</h3>

<p>This application plots a timeseries of soil moisture and precipitation from
a ISU Soil Moisture station of your choice.  Please select a start and end time
Example #11
0
    $pt->setXY($cities[$station]['lon'], $cities[$station]['lat'], 0);
    $pt->draw($map, $datal, $img, 0, $row["d"]);
}
$namer->draw($img);
$counties->draw($img);
$stlayer->draw($img);
//$ttt->draw($img);
$datal->draw($img);
iemmap_title($map, $img, $plotDate . " " . $var[$plot]);
$map->drawLabelCache($img);
$url = $img->saveWebImage();
$ar = array("all" => "Iowa", "ne" => "NE Iowa", "se" => "SE Iowa", "sw" => "SW Iowa", "nw" => "NW Iowa");
$aselect = make_select("area", $area, $ar);
$ar = array("high" => "Average High Temperature", "low" => "Average Low Temperature", "precip" => "Average Precip", "max_high" => "Record High Temperature", "min_low" => "Record Low Temperature", "max_precip" => "Record Precip", "min_high" => "Record Minimum High Temp", "max_low" => "Record Maximum Low Temp");
$pselect = make_select("plot", $plot, $ar);
$mselect = monthSelect("month", $month);
$dselect = daySelect("day", $day);
$t->content = <<<EOF
<h3>COOP Climate Data</h3>

 Using the COOP data archive, daily averages and extremes
  were calculated.  These numbers are <b>not</b> official, but we believe them
  to be accurate.  Please make your form selections on the left hand side and
  then click the 'Generate Plot' button.

  <div class="row">
  <div class="col-md-7">

<img src="{$url}" class="img img-responsive" />
   <br><i>You can right-click on the image to save it.</i>
  <br><li>Only one year with the record value is shown, there may have been 
Example #12
0
include "../../include/myview.php";
$t = new MyView();
$t->title = "Atmospheric Structure Instrumentation";
$t->thispage = "networks-other";
$channels = array("ch1" => "Wind Speed @48.5m [m/s]", "ch2" => "Wind Speed @48.5m [m/s]", "ch3" => "Wind Speed @32m [m/s]", "ch4" => "Wind Speed @32m [m/s]", "ch5" => "Wind Speed @10m [m/s]", "ch6" => "Wind Speed @10m [m/s]", "ch7" => "Wind Direction @47m [deg]", "ch8" => "Wind Direction @40m [deg]", "ch9" => "Wind Direction @10m [deg]", "ch10" => "Air Temperature @3m [C]", "ch11" => "Air Temperature @48.5m [C]", "ch12" => "Barometer @48.5m [mb]");
$c = "";
while (list($key, $ch) = each($channels)) {
    $c .= sprintf("<tr><td>%s</td><td>%s</td></tr>", $key, $ch);
}
$nselect = networkSelect("ISUASI", $station);
$ys = yearSelect2(2012, $syear, "syear");
$ms = monthSelect($smonth, "smonth");
$ds = daySelect2($sday, "sday");
$hs = hourSelect($shour, "shour");
$ye = yearSelect2(2012, $eyear, "eyear");
$me = monthSelect($emonth, "emonth");
$de = daySelect2($eday, "eday");
$he = hourSelect($ehour, "ehour");
$t->content = <<<EOF
<h3 class="heading">Atmospheric Structure Data</h3>

<p>The IEM is collecting and providing data from an instrumentation project
that outfitted two towers with wind and temperature sensors.  
(Insert more details here).

<h3>Plots of this data</h3>
<form method="GET" name="plot">
<input type="hidden" name="action" value="plot" />

<strong>Select station:</strong>{$nselect}
Example #13
0
include_once "../../../include/myview.php";
$t = new MyView();
$t->thispage = "networks-awos";
$t->title = "AWOS One Minute Data Download";
include "../../../include/iemprop.php";
$awos_archive_end = strtotime(get_iemprop("awos.1min.end"));
include "../../../include/imagemaps.php";
include "../../../include/forms.php";
$bogus = 0;
$ys1 = yearSelect2(1995, date("Y"), "year1");
$ms1 = monthSelect($bogus, "month1");
$ds1 = daySelect2($bogus, "day1");
$mi1 = minuteSelect($bogus, "minute1");
$hs1 = hour24Select($bogus, "hour1");
$ys2 = yearSelect2(1995, date("Y"), "year2");
$ms2 = monthSelect($bogus, "month2");
$ds2 = daySelect2($bogus, "day2");
$mi2 = minuteSelect($bogus, "minute2");
$hs2 = hour24Select($bogus, "hour2");
$aend = date('d M Y', $awos_archive_end);
$sselect = networkMultiSelect("AWOS", '', array(), 'station[]');
$t->content = <<<EOF
<ol class="breadcrumb">
 <li><a href="/AWOS/">AWOS Network</a></li>
 <li class="active">Download One Minute Data</li>
</ol>

<p>The Iowa Department of Transportation (DOT) manages the 
network of AWOS sensors in the state of Iowa.  While 20 minute interval data
is published to the world in real-time, they also collect one minute interval
data internally.  Each month, the DOT kindly provides us with the previous
Example #14
0
    function htmlEditor()
    {
        global $basins;
        $s = '
		<input type="hidden" value="' . $this->id . '" name="id">
<p><b>Name of Storm Event:</b> <input type="text" name="name" value="' . $this->name . '">

<script LANGUAGE="JavaScript1.2" type="text/javascript">
//<!--

function setMonth()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_month_"+ i].selectedIndex = document.estorm.gmonth.selectedIndex;
  }
}
function setDay()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_day_"+ i].selectedIndex = document.estorm.gday.selectedIndex;
  }
}
function setHour()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_hour_"+ i].selectedIndex = document.estorm.ghour.selectedIndex;
  }
}

-->
</script>


<p><b>Date Defaults:</b>
 <br /><i>Modify these items to set all times at once:</i>
<br /><b>Month:</b>  
<select name="gmonth" onchange="javascript: setMonth();">
 <option value="1">January
 <option value="2">February
 <option value="3">March
 <option value="4">April
 <option value="5">May
 <option value="6">June
 <option value="7">July
 <option value="8">August
 <option value="9">September
 <option value="10">October
 <option value="11">November
 <option value="12">December
</select>

<b>Day:</b>
<select name="gday" onchange="javascript: setDay();">
 <option value="1">1 <option value="2">2 <option value="3">3 
 <option value="4">4 <option value="5">5 <option value="6">6 
 <option value="7">7 <option value="8">8 <option value="9">9 
 <option value="10">10 <option value="11">11 <option value="12">12 
 <option value="13">13 <option value="14">14 <option value="15">15 
 <option value="16">16 <option value="17">17 <option value="18">18 
 <option value="19">19 <option value="20">20 <option value="21">21 
 <option value="22">22 <option value="23">23 <option value="24">24 
 <option value="25">25 <option value="26">26 <option value="27">27 
 <option value="28">28 <option value="29">29 <option value="30">30 
 <option value="31">31
</select>

<b>Hour:</b>  
<select name="ghour" onchange="javascript: setHour();">
 <option value="0">Midnight
 <option value="1">1 AM
 <option value="2">2 AM
 <option value="3">3 AM
 <option value="4">4 AM
 <option value="5">5 AM
 <option value="6">6 AM
 <option value="7">7 AM
 <option value="8">8 AM
 <option value="9">9 AM
 <option value="10">10 AM
 <option value="11">11 AM
 <option value="12">Noon
 <option value="13">1 PM
 <option value="14">2 PM
 <option value="15">3 PM
 <option value="16">4 PM
 <option value="17">5 PM
 <option value="18">6 PM
 <option value="19">7 PM
 <option value="20">8 PM
 <option value="21">9 PM
 <option value="22">10 PM
 <option value="23">11 PM
</select>


<p><b>Enter Rainfall Totals:</b>
<table class="ruler">
<thead>
<tr>
        <th>ID:</th>
        <th>Basin:</th>
        <th>Storm Precip:</th>
        <th>Month:</th>
        <th>Day:</th>
        <th>Hour:</th>
        <th>Duration (hrs):</th>
        </tr>
</thead>
                                                                                
<tbody>
';
        for ($i = 0; $i < 13; $i++) {
            $s .= "<tr class=\"row" . $i % 2 . "\"><th>{$i}</th>\n\t\t <th>" . $basins[$i]["name"] . "</th>\n\t\t <td><input type=\"text\" size=\"5\" name=\"r_stp_{$i}\" value=\"" . $this->data[$i]["precip"] . "\"></td>\n <td>" . monthSelect(date("m", $this->data[$i]["sts"]), "r_month_{$i}") . "</td>\n <td>" . daySelect(date("d", $this->data[$i]["sts"]), "r_day_{$i}") . "</td>\n <td>" . localHourSelect(date("G", $this->data[$i]["sts"]), "r_hour_{$i}") . "</td>\n\t\t <td><input type=\"text\" size=\"5\" name=\"r_dur_{$i}\" value=\"" . $this->data[$i]["dur"] . "\"></td>\n\t\t </tr>";
        }
        $s .= '</tbody></table>';
        $s .= '<p><b>Year of Event:</b>
<input type="text" value="2005" name="year" size="5">
		<p><b>Notes on event:</b><br>
<textarea name="notes" cols=60 rows=5>' . $this->notes . '</textarea>';
        return $s;
    }