\n"; $type = 'message ui-state-highlight'; if (isset($_REQUEST['prcid']) && is_array($_REQUEST['prcid'])) { $killed = $missed = array(); foreach($_REQUEST['prcid'] as $process_id) { if (ctype_digit($process_id) && killProcess($db, $process_id)) { $killed[] = $process_id; } else { $missed[] = $process_id; } } if (count($killed) > 0) { $msg = str_replace('{{PID}}', implode(',', $killed), __('The process with id [{{PID}}] was killed')); $type = 'message ui-state-default'; } else { $msg = str_replace('{{PID}}', implode(',', $missed), __('No such process [id = {{PID}}]')); $type = 'message ui-state-error'; } } else $msg = __('Select a process and click the button to kill the process'); displayProcessList($db, $msg, $type); } function displayProcessList(&$db, $msg, $type) { print ""; print ""; print ""; print ""; if ($msg != "") { $div = '
'.$msg.'
'; print ""; } print ""; print "\n"; print ""; } else print __('Failed to get process list'); } function killProcess(&$db, $id) { if ($id) { if ($db->query("kill '".$db->escape($id)."'")) return true; } return false; } ?>
$div
"; if ($db->query("show full processlist")) { print ""; print ""; while($row = $db->fetchRow()) print ""; print "
".__('Process ID')."".__('Command')."".__('Time')."".__('Info')."
$row[Id]$row[Command]$row[Time]$row[Info]
"; print "