= '5') { $sql = "SELECT * from entPhysical AS E, devices AS D WHERE D.device_id = E.device_id"; } else { $sql = "SELECT * from entPhysical AS E, devices AS D, devices_perms AS P WHERE D.device_id = E.device_id AND P.device_id = D.device_id AND P.user_id = ?"; $param[] = $_SESSION['user_id']; } if (isset($_POST['string']) && strlen($_POST['string'])) { $sql .= " AND E.entPhysicalDescr LIKE ?"; $param[] = "%".$_POST['string']."%"; } if (isset($_POST['device_string']) && strlen($_POST['device_string'])) { $sql .= " AND D.hostname LIKE ?"; $param[] = "%".$_POST['device_string']."%"; } if (isset($_POST['part']) && strlen($_POST['part'])) { $sql .= " AND E.entPhysicalModelName = ?"; $param[] = $_POST['part']; } if (isset($_POST['serial']) && strlen($_POST['serial'])) { $sql .= " AND E.entPhysicalSerialNum LIKE ?"; $param[] = "%".$_POST['serial']."%"; } if (isset($_POST['device']) && is_numeric($_POST['device'])) { $sql .= " AND D.device_id = ?"; $param[] = $_POST['device']; } echo(""); echo(""); foreach (dbFetchRows($sql, $param) as $entry) { echo(''); } echo("
HostnameDescriptionNamePart NoSerial No
' . generate_device_link($entry, shortHost($entry['hostname'])) . '' . $entry['entPhysicalDescr'] . '' . $entry['entPhysicalName'] . '' . $entry['entPhysicalModelName'] . '' . $entry['entPhysicalSerialNum'] . '
"); ?>