#include <infodrom.style>
#include <db.style>

<page title="Infodrom Oldenburg - Todo">

<h1 align=center>Infodrom Oldenburg</h1>
<h3 align=center>&mdash; Outstanding jobs &mdash;</h3>


<?
  $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
		or die("Unable to connect to SQL server");

  pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");

  $query = "SELECT package,submitted,description FROM todo WHERE done IS NULL ORDER by package,submitted";
  $sth = pg_exec ($dbh, $query); // or die("Datenbank-Abfrage!");

  $package = '';
  for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
    $row = pg_fetch_array ($sth, $nr);
    $date = explode (" ", $row['submitted']);
    $date = explode ("-", $date[0]);
    $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);

    if ($package != $row['package']) {
      printf ("<h3><font face=\"<infodrom-font />\">%s</font></h3>", $row['package']);
      $package = $row['package'];
    }
?>

<table width=100% class=blueborder cellpadding=1 cellspacing=0>

<tr bgcolor=<colh>>
<th width=90% align=left><b><? echo $row['subject']; ?></b></th>
<th width=10% align=right><? echo $date; ?></th>
</tr>

<tr>
<td colspan=2 width=100%><? echo $row['description']; ?></td>
</tr>
</table>

<?
  }
?>

</page>

# Local variables:
# mode: indented-text
# mode: auto-fill
# mode-: iso-accents
# end:
