Révision 7786daaa
Ajouté par Colin Fleming il y a presque 10 ans
usr/local/www/diag_tables.php | ||
---|---|---|
91 | 91 |
exec("/sbin/pfctl -sT", $tables); |
92 | 92 |
|
93 | 93 |
include("head.inc"); |
94 |
include("fbegin.inc"); |
|
95 |
|
|
96 | 94 |
?> |
95 |
<body> |
|
96 |
<?php include("fbegin.inc"); ?> |
|
97 | 97 |
|
98 | 98 |
<?php if ($savemsg) print_info_box($savemsg); ?> |
99 |
<form method='post'>
|
|
99 |
<form method="post" action="diag_tables.php">
|
|
100 | 100 |
|
101 | 101 |
<script type="text/javascript"> |
102 |
//<![CDATA[ |
|
102 | 103 |
function method_change(entrytype) { |
103 | 104 |
window.location='diag_tables.php?type=' + entrytype; |
104 | 105 |
} |
... | ... | |
114 | 115 |
} |
115 | 116 |
}); |
116 | 117 |
} |
118 |
//]]> |
|
117 | 119 |
</script> |
118 | 120 |
|
119 | 121 |
<?=gettext("Table:");?> |
120 |
<select id='type' onChange='method_change(jQuery("#type").val());' name='type'>
|
|
122 |
<select id="type" onchange="method_change(jQuery('#type').val());" name="type">
|
|
121 | 123 |
<?php foreach ($tables as $table) { |
122 |
echo "<option name='{$table}' value='{$table}'";
|
|
124 |
echo "<option value=\"{$table}\"";
|
|
123 | 125 |
if ($tablename == $table) |
124 |
echo " selected ";
|
|
126 |
echo " selected=\"selected\"";
|
|
125 | 127 |
echo ">{$table}</option>\n"; |
126 | 128 |
} |
127 | 129 |
?> |
128 | 130 |
</select> |
129 | 131 |
|
130 |
<p/>
|
|
132 |
<br/><br/>
|
|
131 | 133 |
|
132 |
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
134 |
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="tables">
|
|
133 | 135 |
<tr> |
134 | 136 |
<td class="listhdrr"><?=gettext("IP Address");?></td> |
135 | 137 |
</tr> |
136 | 138 |
<?php $count = 0; foreach($entries as $entryA): ?> |
137 | 139 |
<?php $entry = trim($entryA); ?> |
138 |
<tr id='<?=$entry?>'>
|
|
140 |
<tr id="<?=$entry?>">
|
|
139 | 141 |
<td> |
140 | 142 |
<?php echo $entry; ?> |
141 | 143 |
</td> |
142 | 144 |
<td> |
143 | 145 |
<?php if ( ($tablename != "bogons") && ($tablename != "bogonsv6") ) { ?> |
144 |
<a onClick='del_entry("<?=htmlspecialchars($entry)?>");'> |
|
145 |
<img img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif"> |
|
146 |
<?php } ?> |
|
146 |
<a onclick="del_entry('<?=htmlspecialchars($entry)?>');"> |
|
147 |
<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" alt="delete" /> |
|
147 | 148 |
</a> |
149 |
<?php } ?> |
|
148 | 150 |
</td> |
149 | 151 |
</tr> |
150 | 152 |
<?php $count++; endforeach; ?> |
151 | 153 |
<?php |
152 | 154 |
if($count == 0) |
153 | 155 |
if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) |
154 |
echo "<p/>" . gettext("No entries exist in this table.") . "  " . "<input name='Download' type='submit' class='formbtn' value='" . gettext("Download") . "'> " . gettext(" the latest bogon data.");
|
|
156 |
echo "<tr><td>" . gettext("No entries exist in this table.") . " " . "<input name=\"Download\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Download") . "\" /> " . gettext(" the latest bogon data.");
|
|
155 | 157 |
else |
156 |
echo "<p/>" . gettext("No entries exist in this table.");
|
|
158 |
echo "<tr><td>" . gettext("No entries exist in this table.");
|
|
157 | 159 |
?> |
158 | 160 |
|
159 | 161 |
<?php |
160 | 162 |
if($count > 0) |
161 | 163 |
if( ($tablename == "bogons") || ($tablename == "bogonsv6") ) { |
162 | 164 |
$last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename)); |
163 |
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";
|
|
165 |
echo "<tr><td> <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";
|
|
164 | 166 |
} |
165 | 167 |
else |
166 |
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.");
|
|
168 |
echo "<tr><td>" . gettext("Delete") . " <a href=\"diag_tables.php?deleteall=true&type=" . htmlspecialchars($tablename) . "\">" . gettext("all") . "</a> " . "<b>$count</b> " . gettext("entries in this table.");
|
|
167 | 169 |
?> |
168 |
|
|
170 |
</td></tr> |
|
169 | 171 |
</table> |
172 |
</form> |
|
170 | 173 |
|
171 | 174 |
<?php include("fend.inc"); ?> |
175 |
</body> |
|
176 |
</html> |
Formats disponibles : Unified diff
Tidy up "diag_tables.php" XHTML
Add BODY tag
Add ACTION to FORM tag
Add CDATA section to SCRIPTS
Remove NAME from OPTION tag, not valid in XHTML
Update HTML Boolean operators
Add SUMMARY to TABLE
Close IMG tag and add ALT
Move closing Anchor tag into PHP staement
Change Paragraph tag to TR tag and close
Update non breaking space tag
Add missing closing FORM, closing BODY and closing HTML tags