$query = "SELECT component.id,component.name,serno,types.name as type "
."FROM component,types "
."WHERE hwtype = types.id ";
- if (isset($_GET['type'])) {
+ if (isset($_GET['status']))
+ $query .= sprintf ("AND status = '%s' ", $_GET['status']);
+ if (isset($_GET['type']))
$query .= sprintf ("AND hwtype = %d ", $_GET['type']);
- }
+
$query .= "ORDER BY type,name";
$sth = pg_exec ($dbh, $query) or die_query("Cannot issue query!", $query);
<a href="compounds.php">Compounds</a><br>
<a href="components.php">Components</a><br>
<a href="types.php">Types</a><br>
+ <a href="components.php?status=unused">unused</a><br>
<menu-rule>