<html>
<head>
<title>Auflistung der Drucker</title>
<LINK href="global/css/inc.layout.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>Liste der Drucker</h1>
<?
require ("db_tools.php");
function head_out() {
echo "<table border=0 cellpadding=2 cellspacing=2>\n";
echo "<tr bgcolor=#F0D8D0>\n";
echo " <th>Inventar-Nr.</th>\n <th>Standort</th>\n <th>Name</th>\n <th>Benutzer</th>\n <th>Printserver</th>\n <th>Details</th>\n <th>Löschen</th>\n <th>Ändern</th>\n";
echo "</tr>\n";
}
function row_out($obj) {
echo "<tr bgcolor=#E8E8E8>\n";
echo " <td>$obj[id]</td>\n";
echo " <td>$obj[standort]</td>\n";
echo " <td>$obj[modell]</td>\n";
echo " <td>$obj[benutzer]</td>\n";
echo " <td>$obj[printserver]</td>\n";
echo " <td valign=middle><nobr><form action=\"details.php\" method=\"POST\"><input type=hidden name=\"id\" value=\"$obj[id]\"><input type=submit value=\"Details\"></form></td>\n";
echo " <td valign=middle><nobr><form action=\"delete_request.php\" method=\"POST\"><input type=hidden name=\"druckernr\" value=\"$obj[id]\"><input type=submit value=\"Löschen\"></form></td>\n";
echo " <td valign=middle><nobr><form action=\"update_drucker.php\" method=\"POST\"><input type=hidden name=\"druckernr\" value=\"$obj[id]\"><input type=submit value=\"Ändern\"></form></td>\n";
echo "</tr>\n";
}
function end_out() {
echo "</table>\n<br>\n";
}
$lk=xconnect();
$db="inventur-drucker";
$sql="SELECT id, standort, modell, benutzer, printserver geraet ORDER BY id";
echo "<table>\n<tr>\n<td>\n";
echo "<form action=\"new_drucker.php\" method=\"POST\"><input type=submit value=\"Neuen Drucker erfassen\"></form>\n";
echo "</td>\n<td>\n";
echo "<form action=\"index.php\" method=\"POST\"><input type=submit value=\"Neue Suche\"></form>\n";
echo "</td>\n</tr>\n</table>\n";
head_out();
$res=send_sql ($db,$sql);
while ($arr=mysql_fetch_array($res,MYSQL_ASSOC)) {
row_out($arr);
}
end_out();
echo "<table>\n<tr>\n <td>\n";
echo " <form action=\"new_drucker.php\" method=\"POST\"><input type=submit value=\"Neuen Drucker erfassen\"></form>\n";
echo " </td>\n <td>\n";
echo " <form action=\"index.php\" method=\"POST\"><input type=submit value=\"Neue Suche\"></form>\n";
echo " </td>\n</tr>\n</table>\n";
?>
</body>
</html>