#include <infocon.style>
#include "hwdb.inc"

<page func=InfoCon title="Hardware Database">

<h3>Available Compounds</h3>

<p>
<?
<dbconnect>

   $query = "SELECT compound.id,compound.name,organisation.name as position "
	   ."FROM compound,organisation "
	   ."WHERE location = organisation.id "
	   ."ORDER BY name";
   $sth = pg_exec ($dbh, $query) or die_query("Cannot issue query!", $query);

   for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
     $row = pg_fetch_array ($sth, $nr);
     printf ("<br><a href=\"compound.php?id=%d\">%s</a> (%s) "
	    ."[<a href=\"edit_compound.php?id=%d\">Edit</a>]\n",
	    $row['id'], $row['name'], $row['position'], $row['id']);
   }
?>
</p>

</page>

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