adminerevo/adminer/processlist.inc.php
jakubvrana ddb0a34b45 Remove intval
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1178 7c3ca157-0c34-0410-bff1-cbf682f78f5c
2009-10-07 15:52:34 +00:00

31 lines
963 B
PHP

<?php
if ($_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
if (queries("KILL " . ereg_replace("[^0-9]+", "", $val))) {
$killed++;
}
}
query_redirect(queries(), ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"], false, !$killed && $_POST["kill"]);
}
page_header(lang('Process list'), $error);
?>
<form action="" method="post">
<table cellspacing="0" onclick="table_click(event);">
<?php
$result = $connection->query("SHOW PROCESSLIST");
for ($i=0; $row = $result->fetch_assoc(); $i++) {
if (!$i) {
echo "<thead><tr lang='en'><th>&nbsp;<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
}
echo "<tr" . odd() . "><td>" . checkbox("kill[]", $row["Id"], 0) . "<td>" . implode("<td>", array_map('nbsp', $row)) . "\n";
}
?>
</table>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Kill'); ?>">
</form>