diff --git a/html/pages/inventory.php b/html/pages/inventory.php
index 213a70b3e..05ad3e096 100644
--- a/html/pages/inventory.php
+++ b/html/pages/inventory.php
@@ -1,13 +1,67 @@
+
+
+
+
+
-$sql = "SELECT * from entPhysical AS E, devices AS D WHERE E.device_id = D.device_id";
+if($_POST['string']) {
+ $where = " AND E.entPhysicalDescr LIKE '%".$_POST['string']."%'";
+}
-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"; }
+if($_POST['part']) {
+ $where .= " AND E.entPhysicalModelName = '".$_POST['part']."'";
+}
-echo("");
+if($_POST['serial']) {
+ $where .= " AND E.entPhysicalSerialNum LIKE '%".$_POST['serial']."%'";
+}
+if($_POST['device']) {
+ $where .= " AND D.device_id = '".$_POST['device']."'";
+}
+
+$sql = "SELECT * from entPhysical AS E, devices AS D WHERE E.device_id = D.device_id $where ORDER BY D.hostname";
$query = mysql_query($sql);
echo("");
@@ -16,7 +70,8 @@ echo("| Hostname | Description | Name | Part No |
while($entry = mysql_fetch_array($query)) {
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
-echo(" |
|---|
| " . generatedevicelink($entry, shortHost($entry['hostname'])) . " | " . $entry['entPhysicalDescr'] . " | " . $entry['entPhysicalName'] . " | " . $entry['entPhysicalModelName'] . " | " . $entry['entPhysicalSerialNum'] . " |
");
+echo("| " . generatedevicelink($entry, shortHost($entry['hostname'])) . " | " . $entry['entPhysicalDescr'] .
+ " | " . $entry['entPhysicalName'] . " | " . $entry['entPhysicalModelName'] . " | " . $entry['entPhysicalSerialNum'] . " |
");
}
echo("
");