<?php

include ('header.php');

echo "Plugins info<br>";

$query="SELECT count(*) from plugins";
$result=$dbconn->execute($query);

echo "There are <B>".$result->fields[0]."</B> Nessus plugins in the database<BR><BR><B>Latests 10 plugins added to the database:</B><BR>";

$query="SELECT t2.id, t2.name, date_format(t1.created,\"%W %M %e, %Y - %r\"), t3.description from plugins as t2, nessus_plugins as t1, risk_level as t3 where t2.id=t1.id and t1.risk=t3.id order by created desc limit 0,10";
$result=$dbconn->execute($query);

	echo "<table summary=\"10 Latest Plugins added\" border=1 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\"><tr><td>Date</td><td>Risk</td><td>Name</td></tr>";

while(!$result->EOF) {
        list($id, $name, $date, $risk)=$result->fields;
        echo "<tr><td>$date</td><td>$risk</td><td><a href=\"lookup.php?id=$id\">$name</A></td></tr>";

        $result->MoveNext();
}
	echo "</table>";
echo "<BR><B>Latest 10 plugins updated:</B><BR>";


$query="SELECT t2.id, t2.name, date_format(t1.modified,\"%W %M %e, %Y - %r\"), t3.description from plugins as t2, nessus_plugins as t1, risk_level as t3 where t2.id=t1.id and t1.modified is not null and t1.risk=t3.id order by modified desc limit 0,10";
$result=$dbconn->execute($query);

echo "<table summary=\"10 Latest Plugins updated\" border=1 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\"><tr><td>Date</td><td>Risk</td><td>Name</td></tr>";

while(!$result->EOF) {
        list($id, $name, $date, $risk)=$result->fields;
        echo "<tr><td>$date</td><td>$risk</td><td><a href=\"lookup.php?id=$id\">$name</A></td></tr>";


        $result->MoveNext();
}

echo "</table>";


include ('footer.php');

?>
