Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/reportiava.php
<html>
<head>
<title>Report Iava</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<?php
$labname = $_GET['LABNAME'];
$lab = $_GET['lab'];
$vnum = $_GET['vnum'];
$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">';

//$vnum = 'A2003-0028.1';
//$lab = 1;
//$labname = 'ITL';

$tablerow = "style='border-color:#DBB748; border-width:1px; border-right: 2px solid #DBB748; border-collapse: collapse; border-style:solid;'";
$stmt = "select * from vulnerability where num = '$vnum';";
$sth = ibase_query($dbh, $stmt);
$row = ibase_fetch_object($sth);

print '<b>Lab:</b> ' . $labname . '<br>';
Print '<b>IAVA:</b> ' . $vnum . '	<b>Description:</b><a href=' . substr($row->LINK,1) . ' TARGET=_blank>' . $row->DESCRIPT . '</a>'; 

$stmt2 = "select o.OS_SERIAL, v.serial as vserial, o.serial as oserial from os_application o, vulnerability v where (o.vulnerability_serial = v.serial) and (v.num = '$vnum');";

?>
<form name="reportiava" method="post" action="saveiava.php">
<table style='border-color:#DBB748; border-width:3px; border-right: 3px solid #DBB748; border-collapse: collapse; border-style:solid;' width="700" border="2">
<th>OS/Application</th><th>Database</th><th>Total # of Assets Affected</th><th># of Assets in Compliance</th><th># of Assets with Extensions</th><th># of Assets With Extension Pending</th><th># of Assets Not in Compliance</th>
<?
print '<input type="hidden" name="labname[]" value="' . $labname . '">';
print '<input type="hidden" name="vnum[]" value="' . $vnum . '">';
$i=1;
$tota = 0;
$totb = 0;
$totc = 0;
$totd = 0;
$tote = 0;
$totdb = 0;
$reportthis = '';
$sth2 = ibase_query($dbh, $stmt2);
while ($row2 = ibase_fetch_object($sth2)) {
if ($i%2) {
   echo "<tr BGCOLOR='#F5EACB'>";
} else {
   echo "<tr>";
}
$stmt3 = "select count(*) as total from arp_table a, subnets b, lab c where (a.subnet = b.subnet) and (b.lab = c.serial) and (b.LAB = '$lab') and (OS CONTAINING '$row2->OS_SERIAL') and (a.ip_address<>'0.0.0.0');";
$sth3 = ibase_query($dbh, $stmt3);
$row3 = ibase_fetch_object($sth3);
$stmt4 = "select * from iavacompliance where (lab = $lab) and (vulnerability = '$row2->VSERIAL') and (os_application = '$row2->OSERIAL');";
$sth4 = ibase_query($dbh, $stmt4);
$row4 = ibase_fetch_object($sth4);
print '<input type="hidden" name="lab[]" value="' . $lab . '">';
print '<input type="hidden" name="vserial[]" value="' . $row2->VSERIAL . '">';
print '<input type="hidden" name="oserial[]" value="' . $row2->OSERIAL . '">';
print '<td>' . $row2->OS_SERIAL . '</td>';
print '<td ';
if ($row3->TOTAL != $row4->A) {print 'BGCOLOR="#FFCCCC"';}
print '>' . $row3->TOTAL . '</td>';
$totdb += $row3->TOTAL;
print '<td><input type="text" name="TYPEA[]" value="' . $row4->A . '" size="10" maxlength="10"></td>';
print '<td><input type="text" name="TYPEB[]" value="' . $row4->B . '" size="10" maxlength="10"></td>';
print '<td><input type="text" name="TYPEC[]" value="' . $row4->C . '" size="10" maxlength="10"></td>';
print '<td><input type="text" name="TYPED[]" value="' . $row4->D . '" size="10" maxlength="10"></td>';
print '<td><input type="text" name="TYPEE[]" value="' . $row4->E . '" size="10" maxlength="10"></td>';
print '</tr>';
$i +=1;
if ($row4->A == '') {$A = '0';} else {$A=$row4->A; $tota += $row4->A;}
if ($row4->B == '') {$B = '0';} else {$B=$row4->B; $totb += $row4->B;}
if ($row4->C == '') {$C = '0';} else {$C=$row4->C; $totc += $row4->C;}
if ($row4->D == '') {$D = '0';} else {$D=$row4->D; $totd += $row4->D;}
if ($row4->E == '') {$E = '0';} else {$E=$row4->E; $tote += $row4->E;}
if (($A != 0) || ($B != 0) || ($C != 0) || ($D != 0) || ($E != 0)) {
$reportthis = $reportthis . $row2->OS_SERIAL . ' (' . $A . '/' . $B . '/' . $C . '/' . $D .'/' . $E . ') ';
}
}
print '<tr><td><b>Total</td><td><b>' . $totdb . '</td><td><b>' . $tota . '</td><td><b>' . $totb . '</td><td><b>' . $totc . '</td><td><b>' . $totd . '</td><td><b>' . $tote . '</td></tr>';
?>
</table>
<br>
<? print $reportthis;  ?>
<br>
<input type="submit" name="Submit" value="Save">
<input type="reset" name="Submit2" value="Reset">
</form>
</body>
</html>

Return current item: Network Asset Management Archive