<?php
require_once "../../config/settings.inc.php";
require_once "../../include/forms.php";
require_once "../../include/myview.php";
require_once "../../include/database.inc.php";
$t = new MyView();

$t->title = "NLAE Flux Sites Variables";

$pg_conn = iemdb("other");
$sql = "SELECT * from flux_vars ORDER by name ASC";
$rs = pg_query($pg_conn, $sql);
$rows = "";
for ($i = 0; $row = pg_fetch_assoc($rs); $i++) {
    $rows .= sprintf("<tr><th>%s</th><td>%s</td><td>%s</td></tr>", $row["name"], $row["units"], $row["details"]);
}

$t->content = <<<EOM
<ol class="breadcrumb">
 <li><a href="/nstl_flux/">NLAE Flux Sites</a></li>
 <li class="active">Data Variables and Units</li>
</ol>

<h3>Variables Collected from NLAE Flux Sites</h3>

<p>This page lists out variables collected on the 4 sites in this network.
Each variable is not collected at every site.

<table class="table table-striped table-sm table-bordered">
<thead><tr><th colspan="3" align="left">Site Information:</th></tr></thead>
<tr><th align="left">ID</th><th align="left">Units</th><th align="left">Details</th></tr>
</thead>
<tbody>
{$rows}
</tbody>
</table>

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