# headers print "<tr>"; print "\t<th>" . _('IP address') . "</th>"; print "\t<th>" . _('Port') . "</th>"; print "\t<th>" . _('Subnet') . "</th>"; print "\t<th colspan='2'>" . _('Description') . "</th>"; print "\t<th>" . _('Hostname') . "</th>"; print "\t<th>" . _('Owner') . "</th>"; print "</tr>"; # IP addresses foreach ($ipaddresses as $ip) { # check permission $permission = checkSubnetPermission($ip['subnetId']); if ($permission != "0") { # get subnet details for belonging IP $subnet = getSubnetDetails($ip['subnetId']); # get section details $section = getSectionDetailsById($subnet['sectionId']); # print print "<tr>"; print "\t<td class='ip'>" . transform2long($ip['ip_addr']) . "/{$subnet['mask']}</td>"; print "\t<td class='port'>{$ip['port']}</td>"; print "\t<td class='subnet'><a href='/subnets/{$section['id']}/{$subnet['id']}/'>{$subnet['description']}</a></td>"; print "\t<td class='description'>{$ip['description']}</td>"; # print info button for hover print "<td class='note'>"; if (!empty($ip['note'])) { $ip['note'] = str_replace("\n", "<br>", $ip['note']); print "\t<i class='icon-gray icon-comment' rel='tooltip' title='{$ip['note']}'></i>"; } print "</td>";
$html[] = "<head></head>"; $html[] = "<body>"; //title $html[] = "<h3>phpIPAM found " . sizeof($addresses) . " new hosts</h3>"; //table $html[] = "<table style='margin-left:10px;margin-top:5px;width:auto;padding:0px;border-collapse:collapse;border:1px solid gray;'>"; $html[] = "<tr>"; $html[] = "\t<th style='padding:3px 8px;border:1px solid silver;border-bottom:2px solid gray;'>IP</th>"; $html[] = "\t<th style='padding:3px 8px;border:1px solid silver;border-bottom:2px solid gray;'>Hostname</th>"; $html[] = "\t<th style='padding:3px 8px;border:1px solid silver;border-bottom:2px solid gray;'>Subnet</th>"; $html[] = "\t<th style='padding:3px 8px;border:1px solid silver;border-bottom:2px solid gray;'>Section</th>"; $html[] = "</tr>"; //Changes foreach ($addresses as $change) { //set subnet $subnet = getSubnetDetails($change['subnetId']); $subnetPrint = Transform2long($subnet['subnet']) . "/" . $subnet['mask'] . " - " . $subnet['description']; //set section $section = getSectionDetailsById($subnet['sectionId']); $sectionPrint = $section['name'] . " (" . $section['description'] . ")"; $html[] = "<tr>"; $html[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>" . Transform2long($change['ip_addr']) . "</td>"; $html[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>{$change['dns_name']}</td>"; $html[] = "\t<td style='padding:3px 8px;border:1px solid silver;'><a href='{$settings['siteURL']}" . create_link("subnets", $section['id'], $subnet['id']) . "'>{$subnetPrint}</a></td>"; $html[] = "\t<td style='padding:3px 8px;border:1px solid silver;'><a href='{$settings['siteURL']}" . create_link("subnets", $section['id']) . "'>{$sectionPrint}</a></td>"; $html[] = "</tr>"; } $html[] = "</table>"; //footer //end $html[] = "</body>";