<?php
require_once "../../../config/settings.inc.php";
require_once "../../../include/forms.php";
require_once "../../../include/myview.php";
$t = new MyView();
$t->iemss = True;
$t->title = "SCAN Data Download";

$ys = yearSelect(1983, date("Y"), "year1");
$ms = monthSelect(1, "month1");
$ds = daySelect(1, "day1");
$hs = gmtHourSelect(0, "hour1");
$ys2 = yearSelect(1983, date("Y"), "year2");
$ms2 = monthSelect(12, "month2");
$ds2 = daySelect(31, "day2");
$hs2 = gmtHourSelect(0, "hour2");

$t->content = <<<EOM
<ol class="breadcrumb">
    <li><a href="/scan/">SCAN</a></li>
    <li class="active">Download Data</li>
 </ol>

<p>Filling out this form will provide you with whatever archive data the
IEM has from the SCAN network.  The archive has some holes in it.
<a href="/cgi-bin/request/scan.py?help" class="btn btn-secondary">Backend documentation</a>
exists for those that wish to script against this service.</p>

<form method="GET" action="/cgi-bin/request/scan.py">
<div class="form2url"></div>
<div class="row">
<div class="col-md-7">

<div id="iemss" data-network="SCAN"></div>

</div><div class="col-md-5">

<p><h3>2. Select Start/End Time:</h3><br>
<i>Times are in UTC.</i>
<table>
  <tr>
    <td></td>
    <th>Year</th><th>Month</th><th>Day</th><th>Hour</th>
  </tr>

  <tr>
    <th>Start:</th>
    <td>{$ys}</td>
    <td>{$ms}</td>
    <td>{$ds}</td>
    <td>{$hs}
    </td>
  </tr>

  <tr>
    <th>End:</th>
    <td>{$ys2}</td>
    <td>
     {$ms2}
    </td>
    <td>
     {$ds2}
    </td>
    <td>
     {$hs2}
    </td>
  </tr>
</table>

<p><h3>3. Select Variables:</h3><br>
<select size=5 name="vars" MULTIPLE>
  <option value="tmpf">Air Temperature
  <option value="dwpf">Dew Point Temperature
  <option value="sknt">Wind Speed [knots]
  <option value="drct">Wind Direction
  <option value="srad">Solar Radiation [Wm**-2]
  <option value="pres">Pressure
  <option value="phour">Hourly Precipitation
  <option value="c1tmpf">2 inch Soil Temperature
  <option value="c2tmpf">4 inch Soil Temperature
  <option value="c3tmpf">8 inch Soil Temperature
  <option value="c4tmpf">20 inch Soil Temperature
  <option value="c5tmpf">40 inch Soil Temperature
  <option value="c1smv">2 inch Volumetric Soil Moisture
  <option value="c2smv">4 inch Volumetric Soil Moisture
  <option value="c3smv">8 inch Volumetric Soil Moisture
  <option value="c4smv">20 inch Volumetric Soil Moisture
  <option value="c5smv">40 inch Volumetric Soil Moisture
</select>

<p><h3>4. How to view?</h3><br>
<select name="what">
  <option value="download">Download to Disk
  <option value="view">View on-line
</select>

<p><h3>5. Data Delimitation:</h3><br>
How shall the output values be seperated?
<br><select name="delim">
    <option value="comma">Comma</option>
    <option value="space">Space</option>
    <option value="tab">Tab</option>
</select>

<p><h3>Submit Form:</h3><br>
<input type="submit" value="Process Data Request">
<input type="reset">

</div></div>

</form>
EOM;
$t->render('single.phtml');
