Location: PHPKode > projects > Network Asset Management Archive > nama/susbroke.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";

$now = date("j/m/y h:i:s",time());
echo '<body bgcolor="#F9F3E0">';
$tablerow = "style='border-color:#DBB748; border-width:1px; border-right: 2px solid #DBB748; border-collapse: collapse; border-style:solid;'";
$stmt2 = "Select distinct o.display_name, a.ip_address, a.netbios_name, a.building, a.room, a.barcode, a.last_seen, a.update_server, a.update_time from arp_table a, owner o  where (o.serial=a.iaso) and (update_server is not null) and (last_seen>'12/12/2003') and (update_time<'12/12/2003') and (ip_address <> '0.0.0.0') and (ip_address starts with '134.164.') order by o.display_name, a.ipnum";
#echo $stmt2 . '<br>';
$sth2 = ibase_query($dbh, $stmt2);
$i = -1;
$first = 0;
$iaso="";
$ip="";
while ($row2 = ibase_fetch_object($sth2)) {
if ($iaso!=$row2->DISPLAY_NAME) {
  if ($first = 0) {
     echo '</table>';
     $first = 1;
  }
   $i = -1;
   echo '<br><b>' . $iaso  . '</b><BR>' ; 
?>
<table style='border-color:#DBB748; border-width:3px; border-right: 3px solid #DBB748; border-collapse: collapse; border-style:solid;' width="700" border="2">
<?
echo "<tr BGCOLOR='#DBB748' ALIGN=left><th " . $tablerow . ">IP</th><th " . $tablerow . ">Name</th><th " . $tablerow . ">Building / Room</th><th " . $tablerow . ">Bar Code</th><th " . $tablerow . ">Update Server</th><th " . $tablerow . ">Last Seen</th><th " . $tablerow . ">Last Update</th></tr>";
}
if ($i%2) {
   echo "<tr BGCOLOR='#F5EACB'>";
} else {
   echo "<tr>";
}
list ($downloadeddate, $downloadedtime) = split(" ", $row2->DOWNLOADED);
list ($releasedate, $releasetime) = split(" ", $row2->RELEASE_DATE);
if ($ip!=$row2->IP_ADDRESS) {
 $i = $i + 1;
if ($i%2) {
   echo "<tr BGCOLOR='#F5EACB'>";
} else {
   echo "<tr>";
}
   echo '<td ' . $tablerow . 'width="15%">' . $row2->IP_ADDRESS . '</td><td ' . $tablerow . '>';
   echo $row2->NETBIOS_NAME . '</td>';
   echo '<td ' . $tablerow . '>' . $row2->BUILDING . ' / ';
   echo $row2->ROOM . '</td><td ' . $tablerow . '>';
   echo $row2->BARCODE . '</td>';
} else {
if ($i%2) {
   echo "<tr BGCOLOR='#F5EACB'>";
} else {
   echo "<tr>";
}
   echo '<td ' . $tablerow . '>&nbsp</td><td ' . $tablerow . '>&nbsp</td>';
}
echo '<td ' . $tablerow . '>' . $row2->UPDATE_SERVER . '</td>';
echo '<td ' . $tablerow . '>' . $row2->LAST_SEEN . '</td>';
echo '<td ' . $tablerow . '>' . $row2->UPDATE_TIME . '</td>';

echo '</tr>';
//$i = $i + 1;
$iaso=$row2->DISPLAY_NAME;
$ip=$row2->IP_ADDRESS;
}
echo '<B>' . $iaso . '</b>';
echo "</table>";
?>

Return current item: Network Asset Management Archive