<?php
require_once "../../config/settings.inc.php";
require_once "../../include/myview.php";
$t = new MyView();
require_once "../../include/database.inc.php";
$t->title = "IEM Robin Tracker";

$connection = iemdb("postgis");
$q = "SELECT * from robins ORDER by id";
$rs = pg_query($connection, $q);

$table = "";
while ($row = pg_fetch_assoc($rs)) {

    $table .= "<tr> <td>" . $row["id"] . "</td>
    <td>" . $row["name"] . "</td>
    <td>" . $row["day"] . "</td>
    <td>" . $row["city"] . "</td>
    </tr>\n";
}

$t->content = <<<EOM
The Red Robin is a welcome sign of spring in Iowa!  Here is a graphical
view and listing of reports received at the IEM of Robin sightings.  If you
have a report to add, please send it to Daryl (<a href="mailto:akrherz@iastate.edu">akrherz@iastate.edu</a>).

<table>
<tr>
 <td><img src="/onsite/features/2003/03/030310.gif" width=150></td>
 <td><img src="/GIS/apps/onsite/robins.php"></td>
</tr>

<tr>
 <td colspan="2">

<table width="100%">
<tr>
  <th align="left">Map ID</th>
  <th align="left">Person</th>
  <th align="left">Date</th>
  <th align="left">Where</th>
</tr>

{$table}

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