0 || $entry['ifOutErrors'] > 0) { $error_img = generate_port_link($entry, "Interface Errors", port_errors); } else { $error_img = ''; } $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($entry['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'] == $entry['device_id']) { $arp_name = 'Localhost'; } if ($arp_host['port_id'] == $entry['port_id']) { $arp_if = 'Local port'; } $response[] = array( 'mac_address' => formatMac($entry['mac_address']), 'ipv4_address' => $entry['ipv4_address'], 'hostname' => generate_device_link($entry), 'interface' => generate_port_link($entry, makeshortif(fixifname(ifLabel($entry['label'])))).' '.$error_img, 'remote_device' => $arp_name, 'remote_interface' => $arp_if, ); }//end if unset($ignore); }//end foreach $output = array( 'current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => $total, ); echo _json_encode($output);