<input type="hidden" name="mode" value="edit">
<input type="hidden" name="LineNb" value="<?print int( $cgi->param( 'LineNb' ) )?>">

<br>

<table width="95%" cellpadding="2" align="center" border="0" class="bordered">
  <tr>
    <td rowspan="5" width="8%">&nbsp;</td>
    <td colspan="2">
<b>Use a predefined filter :</b>
<select name="load">
  <option value=""> --
<?

local *DIRECTORY;
opendir(DIRECTORY,'generated/Filters/');
foreach my $DirEntry (sort readdir(DIRECTORY))
{
  if ($DirEntry =~ m/^(.*)\.flt$/)
  {
    my $FilterName=$1;
    print "  <option value=\"$FilterName\">$FilterName\n";
  }
}
?>
</select>
<input type="radio" name="trigger" value="load" checked> load&nbsp;
<input type="radio" name="trigger" value="add"> add
    </td>
    <td rowspan="5" width="1%"><input type="submit" name="loader" value="submit"></td>
  </tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr>
    <td colspan="2">
As an example, put :
  "Address address S 81.91.66" /
  "Classification name C ICMP" /
  "Impact severity = high"
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <table>
<?
my $LineNb = int( $cgi->param( 'LineNb' ) );
foreach my $Line ( 0..$LineNb )
{
  my $Id = chr( 65 + $Line );

  print "  <tr>\n";
  print "    <td>$Id</td>\n";
  print '    <td>';TableList( $Id ); print "</td>\n";
  print '    <td>';OperatorList( $Id ).print "</td>\n";
  print '    <td>';ValueInput( $Id );print "</td>\n";
  print "  </tr>\n";
}
?>
      </table>
    </td>
  </tr>
  <tr>
    <td>
Formula : <input type="text" name="Formula" value="<?print uc( $cgi->param( 'Formula' ) )?>"> for example, (A OR B) AND C
    </td>
    <td><input type="checkbox" name="addline"> add a criteria</td>
  </tr>
</table>

<br>

<table width="95%" cellpadding="2" align="center" border="0" class="bordered">
  <tr>
    <td rowspan="3" width="8%">&nbsp;</td>
    <td colspan="2"><b>Save this filter :</b></td>
    <td rowspan="3" width="1%"><input type="submit" name="submit" value="save"></td>
  </tr>
  <tr>
    <td>Name :</td>
    <td>
<input type=text name="name" value="<?
if ( $cgi->param( 'name' ) !~ m/^(defaults|Temp)\// ) {print $cgi->param( 'name' );};
?>">
    </td>
  </tr>
  <tr>
    <td>Comment :</td>
    <td>
<textarea name="comment" cols="80" rows="4">
<?

	my $comment = $cgi->param( 'comment' );
	$comment =~ s/<br>/\r\n/ig;
	$cgi->param( 'comment', $comment );

	print $comment;

?>
</textarea>
    </td>
  </tr>
</table>

<br>
