print "\t<td>"; if ($ip['state'] == "0") { $stateClass = _("Offline"); } else { if ($ip['state'] == "2") { $stateClass = _("Reserved"); } else { if ($ip['state'] == "3") { $stateClass = _("DHCP"); } else { $stateClass = _("Online"); } } } print $stateClass; print reformatIPState($ip['state'], true, false); print "\t</td>"; print "</tr>"; //hostname print "<tr>"; print "\t<th>" . _('Hostname') . "</th>"; print "\t<td>{$ip['dns_name']}</td>"; print "</tr>"; //mac if (in_array('owner', $setFields)) { print "<tr>"; print "\t<th>" . _('Owner') . "</th>"; print "\t<td>{$ip['owner']}</td>"; print "</tr>"; } //mac
$hStatus = "error"; $hTooltip = "rel='tooltip' data-container='body' data-html='true' data-placement='left' title='" . _("Device is offline") . "<hr>" . _("Last seen") . ": " . $ipaddress[$n]['lastSeen'] . "'"; } elseif ($ipaddress[$n]['lastSeen'] == "0000-00-00 00:00:00") { $hStatus = "neutral"; $hTooltip = "rel='tooltip' data-container='body' data-html='true' data-placement='left' title='" . _("Device is offline") . "<hr>" . _("Last seen") . ": " . _("Never") . "'"; } else { $hStatus = "neutral"; $hTooltip = "rel='tooltip' data-container='body' data-html='true' data-placement='left' title='" . _("Device status unknown") . "'"; } } else { $hStatus = "hidden"; $hTooltip = ""; } print "\t<td class='ipaddress'><span class='status status-{$hStatus}' {$hTooltip}></span><a href='subnets/{$_REQUEST['section']}/{$_REQUEST['subnetId']}/ipdetails/" . $ipaddress[$n]['id'] . "/'>" . Transform2long($ipaddress[$n]['ip_addr']); if (in_array('state', $setFields)) { print reformatIPState($ipaddress[$n]['state']); } print "</td>"; # resolve dns name if not provided, else print it - IPv4 only! if (empty($ipaddress[$n]['dns_name']) and $settings['enableDNSresolving'] == 1 and IdentifyAddress($ipaddress[$n]['ip_addr']) == "IPv4") { $dnsResolved = ResolveDnsName($ipaddress[$n]['ip_addr']); } else { $dnsResolved['class'] = ""; $dnsResolved['name'] = $ipaddress[$n]['dns_name']; } print "<td class='{$dnsResolved['class']} hostname'>{$dnsResolved['name']}</td>"; # print description - mandatory print "<td class='description'>" . $ipaddress[$n]['description'] . "</td>"; # Print mac address icon! if (in_array('mac', $setFields)) { if (!empty($ipaddress[$n]['mac'])) {
$stateClass = "offline"; } else { if ($line['state'] == "2") { $stateClass = "reserved"; } else { if ($line['state'] == "3") { $stateClass = "DHCP"; } } } } //print table print '<tr class="ipSearch ' . $stateClass . '" id="' . $line['id'] . '" subnetId="' . $line['subnetId'] . '" sectionId="' . $subnet['sectionId'] . '" link="' . $section['name'] . '|' . $subnet['id'] . '">' . "\n"; print ' <td><a href="subnets/' . $subnet['sectionId'] . '/' . $subnet['id'] . '/ipdetails/' . $line['id'] . '/">' . transform2long($line['ip_addr']) . "</a>"; if (in_array('state', $setFields)) { print reformatIPState($line['state']); } print ' </td>' . "\n"; print ' <td>' . $vlan['number'] . '</td>' . "\n"; print ' <td>' . ShortenText($line['description'], $chars = 50) . '</td>' . "\n"; print ' <td>' . $line['dns_name'] . '</td>' . "\n"; # mac if (in_array('mac', $setFields)) { print ' <td>' . "\n"; if (strlen($line['mac']) > 0) { print '<i class="fa fa-sitemap fa-gray" rel="tooltip" title="MAC: ' . $line['mac'] . '"></i>' . "\n"; } print ' </td>' . "\n"; } # switch if (in_array('switch', $setFields)) {