Location: PHPKode > projects > Network Asset Management Archive > nama/getpicks3.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
print '<HTML>';
print '	<HEAD>';
print '	  <TITLE>Your Hosts</TITLE>';
print '	</HEAD>';

print '<body bgcolor="#FFFFCC">';
$stmt = stripslashes($stmt);
$now = date("j/m/y h:i:s",time());
$teststmt = "Select count(*) " . $stmt;
$stmt = "Select * " . $stmt . " order by IPNUM";
$teststh = ibase_query($dbh, $teststmt);
$row=ibase_fetch_object($teststh);
//if ($row->COUNT > 250) {
//	exit("To Many Records Selected<b> $row->COUNT, <br>Please use back button and narrow the selection.");
//} else {
//echo $row->COUNT . "<BR>";
//}
ibase_free_result($teststh);
$sth = ibase_query($dbh, $stmt);
//echo $stmt . "<br>";
$i = 0;
?>
<body bgcolor="#ffffff" text="#000000">
<form name="form1" method="post" action="php.php">
<?
while ($row = ibase_fetch_object($sth)) {
print '<table width="240" bgcolor="#ff9900" border="2">';
print '<input type="hidden" name="serial[]" value="' . $row->SERIAL . '">';
print '    <tr> ';
//if ($i % 2 == 0) {
//$stmt4 = "select DISTINCT a.SHORTDESC, a.FULLDESC, A.FIX, A.SEVERITY from VULNS a, VULNSFOUND b, HOSTS c where (c.ipaddressstr = '$row->IP_ADDRESS') and (c.hostid=b.hostid) and (b.vulnid=a.vulnid) and (a.severity > 1) ORDER BY a.SEVERITY DESC";
;
$stmt4 = "select max(A.SEVERITY) from VULNS a, VULNSFOUND b, HOSTS c where (c.ipaddressstr = '$row->IP_ADDRESS') and (c.hostid=b.hostid) and (b.vulnid=a.vulnid) ORDER BY a.SEVERITY DESC";
$sth4 = ibase_query($dbh,$stmt4);
if ($row4=ibase_fetch_object($sth4)) {
   if ($row4->MAX==3) {
     print '      <td nowrap bgcolor="#EED3D6"> ';
     $compliant='NO';
     ibase_free_result($sth4);
   } 
   if ($row4->MAX==2) {
     print '      <td nowrap bgcolor="#F9FBBE"> ';
     $compliant='NO';
     ibase_free_result($sth4);
   }
   if ($row4->MAX==1) {
     print '      <td nowrap bgcolor="#D3EED3"> ';
     $compliant='YES';
     ibase_free_result($sth4);
   }
} else {
    print '      <td nowrap bgcolor="#86F686"> ';
    $compliant='YES';
}

//$sth4 = ibase_query($dbh,$stmt4);
//if ($row4=ibase_fetch_object($sth4)) {
//    print '      <td nowrap bgcolor="#EED3D6"> ';
//    ibase_free_result($sth4);
//    $compliant='NO';
//}
//else {
//   print '      <td nowrap bgcolor="#D3EED3"> ';
//    $compliant='YES';
//}
$i = $i + 1;
print '<a href="right.php?COMP=';
print $compliant . '&SERIAL=' . $row->SERIAL . '" target="rightFrame">IP Address:<b>' . trim($row->IP_ADDRESS) . '</b><BR>';
print 'MAC Address:<b>' . trim(strtoupper($row->MAC_ADDRESS)) . '</b><BR>';
if (strlen($row->DNS_NAME)!=0) { 
     print 'DNS Name: <b>' . $row->DNS_NAME . '</b><br>';
}
if (strlen($row->NETBIOS_NAME)!=0) {
     print 'Netbios Name:<b>' . $row->NETBIOS_NAME . '</b>';
}
print '</A></table>';
}
print '<input type="submit" name="Submit" value="Submit">';
print "</form>";
?>

Return current item: Network Asset Management Archive