diff options
author | Renato Botelho <garga@pfSense.org> | 2014-03-09 08:56:45 -0300 |
---|---|---|
committer | Renato Botelho <garga@pfSense.org> | 2014-03-09 08:56:45 -0300 |
commit | b517603f70ea73932297653af0452e1a89b528e0 (patch) | |
tree | d00f945d1211c3b707bc402fbf1e5a916e0d9370 | |
parent | 5ec1108682e58c6d0f645588d90618bbf200bab8 (diff) | |
parent | fe3088b965a99772e76622d17ceae87288471edc (diff) | |
download | pfsense-b517603f70ea73932297653af0452e1a89b528e0.zip pfsense-b517603f70ea73932297653af0452e1a89b528e0.tar.gz |
Merge pull request #1009 from N0YB/RELENG_2_1
XHTML Compliance
-rw-r--r-- | usr/local/www/diag_tables.php | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/usr/local/www/diag_tables.php b/usr/local/www/diag_tables.php index 9bbcc46..fdfc99a 100644 --- a/usr/local/www/diag_tables.php +++ b/usr/local/www/diag_tables.php @@ -91,19 +91,22 @@ exec("/sbin/pfctl -t " . escapeshellarg($tablename) . " -T show", $entries); exec("/sbin/pfctl -sT", $tables); include("head.inc"); +?> +<body> +<?php include("fbegin.inc"); +if ($savemsg) print_info_box($savemsg); ?> -<?php if ($savemsg) print_info_box($savemsg); ?> -<form method='post'> +<form method='post' action='' > -<script language="javascript"> +<script type="text/javascript"> function method_change(entrytype) { window.location='diag_tables.php?type=' + entrytype; } function del_entry(entry) { - jQuery.ajax("diag_tables.php?type=<?php echo htmlspecialchars($tablename);?>&delete=" + entry, { + jQuery.ajax("diag_tables.php?type=<?php echo htmlspecialchars($tablename);?>&delete=" + entry, { complete: function(response) { if (200 == response.status) { // Escape all dots to not confuse jQuery selectors @@ -117,11 +120,11 @@ include("fbegin.inc"); </script> <?=gettext("Table:");?> -<select id='type' onChange='method_change(jQuery("#type").val());' name='type'> +<select id='type' onchange='method_change(jQuery("#type").val());' name='type'> <?php foreach ($tables as $table) { - echo "<option name='{$table}' value='{$table}'"; + echo "<option id='{$table}' value='{$table}'"; if ($tablename == $table) - echo " selected "; + echo " selected=\"selected\" "; echo ">{$table}</option>\n"; } ?> @@ -129,43 +132,44 @@ include("fbegin.inc"); <p/> +<?php + if( (is_array($entries)) && (count($entries) > 0) ) + if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) { + $last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename)); + echo "<p/> <b>" . count($entries) . "</b> " . gettext("entries in this table.") . " " . "<input name='Download' type='submit' class='formbtn' value='" . gettext("Download") . "' /> " . gettext(" the latest bogon data.") . "<br />" . $last_updated; + } + else + echo "<p/>" . gettext("Delete") . " <a href='diag_tables.php?deleteall=true&type=" . htmlspecialchars($tablename) . "'>" . gettext("all") . "</a> " . "<b>" . count($entries) . "</b> " . gettext("entries in this table."); + + else + if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) + echo "<p/>" . gettext("No entries exist in this table.") . " " . "<input name='Download' type='submit' class='formbtn' value='" . gettext("Download") . "' /> " . gettext(" the latest bogon data."); + else + echo "<p/>" . gettext("No entries exist in this table."); +?> + <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="listhdrr"><?=gettext("IP Address");?></td> </tr> <?php $count = 0; foreach($entries as $entryA): ?> <?php $entry = trim($entryA); ?> - <tr id='<?=$entry?>'> + <tr id='table_row_<?=$count?>'> <td> <?php echo $entry; ?> </td> <td> <?php if ( ($tablename != "bogons") && ($tablename != "bogonsv6") ) { ?> - <a onClick='del_entry("<?=htmlspecialchars($entry)?>");'> - <img img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif"> - <?php } ?> + <a onclick='del_entry("<?=htmlspecialchars($entry)?>");'> + <img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" alt='' /> </a> + <?php } ?> </td> </tr> <?php $count++; endforeach; ?> -<?php - if($count == 0) - if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) - echo "<p/>" . gettext("No entries exist in this table.") . "  " . "<input name='Download' type='submit' class='formbtn' value='" . gettext("Download") . "'> " . gettext(" the latest bogon data."); - else - echo "<p/>" . gettext("No entries exist in this table."); -?> - -<?php - if($count > 0) - if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) { - $last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename)); - echo "<p/> <b>$count</b> " . gettext("entries in this table.") . "  " . "<input name='Download' type='submit' class='formbtn' value='" . gettext("Download") . "'> " . gettext(" the latest bogon data.") . "<br>" . "$last_updated"; - } - else - echo "<p/>" . gettext("Delete") . " <a href='diag_tables.php?deleteall=true&type=" . htmlspecialchars($tablename) . "'>" . gettext("all") . "</a> " . "<b>$count</b> " . gettext("entries in this table."); -?> - </table> +</form> <?php include("fend.inc"); ?> +</body> +</html> |