'); $where = "AND `ifPhysAddress` LIKE '%".$_POST['address']."%'"; if (is_numeric($_POST['device_id'])) { $where .= " AND I.device_id = '".$_POST['device_id']."'"; } if ($_POST['interface']) { $where .= " AND I.ifDescr LIKE '".mres($_POST['interface'])."'"; } $sql = "SELECT * FROM `ports` AS P, `devices` AS D WHERE P.device_id = D.device_id $where ORDER BY P.ifPhysAddress"; $query = mysql_query($sql); echo('DeviceInterfaceMAC AddressDescription'); $row = 1; while ($entry = mysql_fetch_assoc($query)) { if (!$ignore) { if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } $speed = humanspeed($entry['ifSpeed']); $type = humanmedia($entry['ifType']); if ($entry['in_errors'] > 0 || $entry['out_errors'] > 0) { $error_img = generate_port_link($entry,"Interface Errors",errors); } else { $error_img = ""; } if (port_permitted($entry['interface_id'])) { $interface = ifLabel ($interface, $interface); echo(' ' . generate_device_link($entry) . ' ' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . ' ' . formatMac($entry['ifPhysAddress']) . ' ' . $entry['ifAlias'] . " \n"); $row++; } } unset($ignore); } echo(""); ?>