add inventory

git-svn-id: http://www.observium.org/svn/observer/trunk@284 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-11-05 13:11:40 +00:00
parent e0f2b306d5
commit 19d87a8913

24
html/pages/inventory.php Normal file
View File

@ -0,0 +1,24 @@
<?
$sql = "SELECT * from entPhysical AS E, devices AS D WHERE E.device_id = D.device_id";
if($_POST['search']) { $sstring = $_POST['search']; $sql = "SELECT * from entPhysical AS E, devices AS D WHERE E.entPhysicalModelName LIKE '$sstring' AND E.device_id = D.device_id"; }
echo("<div style='align: right;'><form method=post><input name=search>$sstring</input><submit></form></div>");
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=2 width=100%>");
echo("<tr><th>Hostname</th><th>Description</th><th>Name</th><th>Part No</th><th>Serial No</th></tr>");
while($entry = mysql_fetch_array($query)) {
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
echo("<tr style=\"background-color: $bg\"><td>" . generatedevicelink($entry, shortHost($entry['hostname'])) . "</td><td>" . $entry['entPhysicalDescr'] . "</td><td>" . $entry['entPhysicalName'] . "</td><td>" . $entry['entPhysicalModelName'] . "</td><td>" . $entry['entPhysicalSerialNum'] . "</td></tr>");
}
echo("</table>");
?>
</table>