#include <infodrom.style>

<page func="Infodrom Oldenburg" title="Logbook">

<table width=100% class=font border=0 cellspacing=3 bgcolor="#<cold>">\
<tr bgcolor=#<colh>>\
<th width=15%><font face="Helvetica,Arial">Datum</font></th>\
<th width=85%><font face="Helvetica,Arial">Titel</font></th></tr>

<?
  $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 id,teaser,created FROM logbook ORDER BY created DESC";
  $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");

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

    printf ("<tr><td align=\"right\">%s</td><td><a href=\"show.php?id=%s\">%s</a></td></tr>",
	   $date, $row['id'], $row['teaser']);
  }
?>

</table>

</page>

# Local variables:
# mode: text
# mode: auto-fill
# end:
