#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# Display a FORM to select the the report options override some defaults.
#
$system = "sara";
$sans10_release = "SANS Top 10";
$sans10_release = "SANS TOP 20" if (-f "config/sans10.r2");
print CLIENT <<EOF;
<HTML>
<HEAD>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<TITLE>SARA Report Selection</TITLE>
<LINK REV="update" 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>
<hr>
EOF
# Pre-set buttons
$full = $full_subnet = $summary = $comma = "";
$novulchk = $correctchk = "";
$default = $selected = "";


  $html        = "selected" if $report_type eq "html";
  $xml         = "selected" if $report_type eq "xml";
  $comma       = "selected" if $report_type eq "comma";
  $selected    = "checked" if $option eq "selected"; 
  $default     = "checked" if $option eq "default";
  $novulchk    = "checked" if $novul eq "on"; $novuls = "off";
  $correctchk  = "checked" if $correction eq "on"; $corrections = "off";
  $generate    = ""; $regenerate = "";
  $option = "";
print CLIENT <<EOF;
<FORM METHOD=POST ACTION="sara_report_action.pl">
<input Type=hidden Name=sequence Value="$seq">
<TABLE BORDER="0" WIDTH="650"
<TR><TD BGCOLOR="#000000">
<Font Color="#FFFFFF">
<Center> <H2>Select Report Type</H2></Center>
</FONT>
</TD></TR></TABLE>
<UL>
<SELECT NAME="report_type">
<OPTION VALUE="html" $html>SARA Report in HTML</OPTION>
<OPTION VALUE="xml" $xml>SARA Report in XML</OPTION>
<OPTION VALUE="comma" $comma>SARA_REPORT in CSV</OPTION>
</SELECT>

</UL>
<H2>Select Report Options</H2>
<UL>
<INPUT TYPE="radio" NAME="option" VALUE="default" $default>
<strong>Use Default Report Parameters</strong>
<BR>
<INPUT TYPE="radio" NAME="option" VALUE="selected" $selected>
<strong>Select Report Options</strong>

<UL><Font Size="2"><INPUT TYPE="checkbox" NAME="corrections" VALUE="on" $correctchk>
<strong>Correct Report IAW <i>config/corrections</i></strong>
</FONT></UL>

<UL><Font Size="2"><INPUT TYPE="checkbox" NAME="novuls" VALUE="on" $novulchk> 
<strong>Exclude Hosts with no Vulnerabilities</strong>
</FONT></UL>
<P>
<Font Size="2"><INPUT TYPE="checkbox" NAME="regenerate" VALUE="on" $generate>
<strong>Regenerate</strong> (required if corrections or option changes)
</FONT></UL>

</UL></UL>
<CENTER><INPUT TYPE="submit" VALUE=" Generate Report "></CENTER>
<P>
<Center><I>Once started, Do Not Interrupt this process!</I></Center>
</TD></TR></TABLE>
</FORM>
</BODY>
</HTML>
EOF
