adminerevo/adminer/processlist.inc.php

54 lines
1.8 KiB
PHP
Raw Normal View History

<?php
2011-05-11 09:48:51 +00:00
if (support("kill") && $_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
2010-10-22 22:02:24 +00:00
if (queries("KILL " . (+$val))) {
$killed++;
}
}
queries_redirect(ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"]);
}
page_header(lang('Process list'), $error);
?>
<form action="" method="post">
2012-10-04 07:42:56 +00:00
<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
<?php
2011-08-11 09:43:37 +00:00
// HTML valid because there is always at least one process
$i = -1;
2011-05-11 09:48:51 +00:00
foreach (process_list() as $i => $row) {
if (!$i) {
2013-04-18 00:57:14 +00:00
echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "");
foreach ($row as $key => $val) {
echo "<th>$key" . doc_link("show-processlist.html#processlist_" . strtolower($key));
2013-04-18 00:57:14 +00:00
}
echo "</thead>\n";
}
2011-05-11 09:48:51 +00:00
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
foreach ($row as $key => $val) {
2012-05-10 21:07:34 +00:00
echo "<td>" . (
($jush == "sql" && $key == "Info" && preg_match("~Query|Killed~", $row["Command"]) && $val != "") ||
2012-05-10 21:07:34 +00:00
($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
($jush == "oracle" && $key == "sql_text" && $val != "")
? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>'
2012-05-10 21:07:34 +00:00
: nbsp($val)
);
}
echo "\n";
}
?>
</table>
2011-08-11 11:48:27 +00:00
<script type='text/javascript'>tableCheck();</script>
<p>
2011-05-11 09:48:51 +00:00
<?php
if (support("kill")) {
echo ($i + 1) . "/" . lang('%d in total', $connection->result("SELECT @@max_connections"));
echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
}
?>
2011-03-08 12:43:05 +00:00
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>