#
# List all hosts in an internet domain
#
($_domain, $_sort_order) = split(/,/, $html_script_args);

print CLIENT <<EOF;
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<title> Host Table - Domain $_domain</title>
<LINK REV="made" HREF="mailto:satan\@fish.com">
<LINK REV="made" HREF="mailto:sara\@arc.com">
</HEAD>
<BODY>
EOF
if ($pi_menu) {
  $screen = &$pi_menu;
} else {
  $screen = print_menu();
}
$screen =~ s/\\n/\n/g;
print CLIENT $screen;
print CLIENT <<EOF;
</TD><TD valign=top>
<CENTER><H1>Host Table - Domain $_domain</h1></CENTER>
<hr>

<h3> 
$domain_severities{$_domain} Vulnerable/$domain_count{$_domain} total.
Vulnerability counts in parentheses.
</h3>

<H4> Sort hosts by:
<A HREF="sara_results_domain.pl,$_domain,name,">name</a> |
<A HREF="sara_results_domain.pl,$_domain,type,">system type</a> |
<A HREF="sara_results_domain.pl,$_domain,subnet,">subnet</a> |
<A HREF="sara_results_domain.pl,$_domain,severity,">problem count</a> |
<A HREF="sara_results_domain.pl,$_domain,severity_type,">problem type</a>
</H4>
EOF

@_hosts = split(/\s+/, $all_domains{$_domain});
do "$html_root/reporting/sort_hosts.pl";
print CLIENT $@ if $@;

print CLIENT <<EOF;
<hr> <a href="/"> Back to the SARA start page </a> |
<a href=/reporting/analysis.pl> Back to SARA Reporting and Analysis </a>
</UL></UL></TABLE>
</BODY>
</HTML>
EOF
