diff --git a/html/includes/table/arp-search.inc.php b/html/includes/table/arp-search.inc.php index 090476048f..b595029c0c 100644 --- a/html/includes/table/arp-search.inc.php +++ b/html/includes/table/arp-search.inc.php @@ -26,6 +26,11 @@ if (is_numeric($_POST['device_id'])) { $param[] = $_POST['device_id']; } +if (is_numeric($_POST['port_id'])) { + $sql .= ' AND P.port_id = ?'; + $param[] = $_POST['port_id']; +} + $count_sql = "SELECT COUNT(`M`.`port_id`) $sql"; $total = dbFetchCell($count_sql, $param); diff --git a/html/pages/device/port/arp.inc.php b/html/pages/device/port/arp.inc.php index 821787543d..21dd2551ed 100644 --- a/html/pages/device/port/arp.inc.php +++ b/html/pages/device/port/arp.inc.php @@ -1,48 +1,29 @@ + + + + + + + + + +
MAC addressIPv4 addressRemote deviceRemote interface
-echo ''; -$i = '1'; + - $arp_host = dbFetchRow('SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', array($arp['ipv4_address'])); - - if ($arp_host) { - $arp_name = generate_device_link($arp_host); - } - else { - unset($arp_name); - } - - if ($arp_host) { - $arp_if = generate_port_link($arp_host); - } - else { - unset($arp_if); - } - - if ($arp_host['device_id'] == $device['device_id']) { - $arp_name = 'Localhost'; - } - - if ($arp_host['port_id'] == $arp['port_id']) { - $arp_if = 'Local Port'; - } - - echo ' - - - - - - '; - $i++; -}//end foreach - -echo '
'.formatmac($arp['mac_address']).''.$arp['ipv4_address'].''.$arp_name.''.$arp_if.'
'; diff --git a/html/pages/device/ports/arp.inc.php b/html/pages/device/ports/arp.inc.php index 6ac7e39a5f..5c804464d4 100644 --- a/html/pages/device/ports/arp.inc.php +++ b/html/pages/device/ports/arp.inc.php @@ -1,51 +1,30 @@ + + + + + + + + + + +
PortMAC addressIPv4 addressRemote deviceRemote interface
-echo ''; -echo ''; + -foreach (dbFetchRows('SELECT * FROM ipv4_mac AS M, ports AS I WHERE I.port_id = M.port_id AND I.device_id = ?', array($device['device_id'])) as $arp) { - if (!is_integer($i / 2)) { - $bg_colour = $list_colour_a; - } - else { - $bg_colour = $list_colour_b; - } - - $arp_host = dbFetchRow('SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', array($arp['ipv4_address'])); - - if ($arp_host) { - $arp_name = generate_device_link($arp_host); - } - else { - unset($arp_name); - } - - if ($arp_host) { - $arp_if = generate_port_link($arp_host); - } - else { - unset($arp_if); - } - - if ($arp_host['device_id'] == $device['device_id']) { - $arp_name = 'Localhost'; - } - - if ($arp_host['port_id'] == $arp['port_id']) { - $arp_if = 'Local Port'; - } - - echo " - - - - - - - "; - $i++; -}//end foreach - -echo '
PortMAC addressIPv4 addressRemote deviceRemote port
".generate_port_link(array_merge($arp, $device)).''.formatmac($arp['mac_address']).''.$arp['ipv4_address']."$arp_name$arp_if
';