?>
" onClick="fr_bgcolor('<?php 
    echo $nnats;
    ?>
')" style="margin: 0; padding: 0;"></td>
		<td class="listr" 
			id="frd<?php 
    echo $nnats;
    ?>
"
			ondblclick="document.location='snort_interfaces_edit.php?id=<?php 
    echo $nnats;
    ?>
';">
			<?php 
    echo snort_get_friendly_interface($natent['interface']);
    ?>
		</td>
		<td class="listr" 
			id="frd<?php 
    echo $nnats;
    ?>
"
			ondblclick="document.location='snort_interfaces_edit.php?id=<?php 
    echo $nnats;
    ?>
';">
			<?php 
    $check_snort_info = $config['installedpackages']['snortglobal']['rule'][$nnats]['enable'];
    if ($check_snort_info == "on") {
        echo strtoupper("enabled");
        $input_errors[] = "Custom rules have errors:\n {$error}";
    } else {
        header("Location: /snort/snort_rules.php?id={$id}&openruleset={$currentruleset}");
        exit;
    }
} else {
    if ($_POST) {
        unset($a_rule[$id]['customrules']);
        write_config();
        header("Location: /snort/snort_rules.php?id={$id}&openruleset={$currentruleset}");
        exit;
    }
}
require_once "guiconfig.inc";
include_once "head.inc";
$if_friendly = snort_get_friendly_interface($pconfig['interface']);
$pgtitle = "Snort: {$if_friendly} Category: {$currentruleset}";
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php 
include "fbegin.inc";
if ($pfsense_stable == 'yes') {
    echo '<p class="pgtitle">' . $pgtitle . '</p>';
}
/* Display message */
if ($input_errors) {
    print_input_errors($input_errors);
    // TODO: add checks
}
if ($savemsg) {
		<table class="tabcont" width="100%" border="1" cellspacing="0" cellpadding="0">
			<form action="/snort/snort_alerts.php" method="post" id="formalert">
			<tr>
				<td width="22%" colspan="0" class="listtopic">Last <?php 
echo $anentries;
?>
 Alert Entries.</td>
				<td width="78%" class="listtopic">Latest Alert Entries Are Listed First.</td>
			</tr>
			<tr>
				<td width="22%" class="vncell">Instance to inspect</td>
				<td width="78%" class="vtable">
					<br/>   <select name="instance" id="instance" class="formfld unkown" onChange="document.getElementById('formalert').submit()">
			<?php 
foreach ($a_instance as $id => $instance) {
    echo "<option value='{$id}'> (" . snort_get_friendly_interface($instance['interface']) . "){$instance['descr']}</option>\n";
}
?>
					</select><br/>   Choose which instance alerts you want to inspect.
				</td>
			<tr>
				<td width="22%" class="vncell">Save or Remove Logs</td>
				<td width="78%" class="vtable">
					<input name="download" type="submit" class="formbtn" value="Download"> All
						log files will be saved. <a href="/snort/snort_alerts.php?action=clear">
					<input name="delete" type="button" class="formbtn" value="Clear"
					onclick="return confirm('Do you really want to remove all instance logs?')"></a>
					<span class="red"><strong>Warning:</strong></span> all log files will be deleted.
				</td>
			</tr>
			<tr>