3 // vim: expandtab sw=4 ts=4 sts=4:
7 * Gets some core libraries
9 if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
10 include('./libraries/grab_globals.lib.php3');
12 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
13 include('./libraries/common.lib.php3');
17 * Kills a selected process
20 $sql_query = 'KILL ' . $kill . ';';
21 if (@PMA_mysql_query
($sql_query, $userlink)) {
22 $message = sprintf($strThreadSuccessfullyKilled, $kill);
24 $message = sprintf($strCouldNotKill, $kill);
29 * Does the common work
31 require('./server_common.inc.php3');
36 require('./server_links.inc.php3');
39 * Displays the sub-page heading
42 . ' ' . $strProcesslist . "\n"
46 * Checks if the user is allowed to do what he tries to...
48 if (!$is_superuser && !$cfg['ShowMysqlVars']) {
49 echo $strNoPrivileges;
50 include('./footer.inc.php3');
55 * Sends the query and buffers the result
57 $serverProcesses = array();
58 $res = @PMA_mysql_query
('SHOW PROCESSLIST;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW PROCESSLIST;');
59 while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
)) {
60 $serverProcesses[] = $row;
62 @mysql_free_result
($res);
73 <th
> 
;<?php
echo $strId; ?
> 
;</th
>
74 <th
> 
;<?php
echo $strUser; ?
> 
;</th
>
75 <th
> 
;<?php
echo $strHost; ?
> 
;</th
>
76 <th
> 
;<?php
echo $strDatabase; ?
> 
;</th
>
77 <th
> 
;<?php
echo $strCommand; ?
> 
;</th
>
78 <th
> 
;<?php
echo $strTime; ?
> 
;</th
>
79 <th
> 
;<?php
echo $strStatus; ?
> 
;</th
>
80 <th
> 
;<?php
echo $strSQLQuery; ?
> 
;</th
>
83 $useBgcolorOne = TRUE;
84 while (list($name, $value) = each($serverProcesses)) {
87 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<a href
="./server_processlist.php3?<?php echo $url_query . '&kill=' . $value['Id']; ?>"><?php
echo $strKill; ?
></a
> 
;</td
>
88 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo $value['Id']; ?
> 
;</td
>
89 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $value['User']; ?
> 
;</td
>
90 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $value['Host']; ?
> 
;</td
>
91 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo (empty($value['db']) ?
'<i>' . $strNone . '</i>' : $value['db']); ?
> 
;</td
>
92 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $value['Command']; ?
> 
;</td
>
93 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo $value['Time']; ?
> 
;</td
>
94 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo (empty($value['State']) ?
'---' : $value['State']); ?
> 
;</td
>
95 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo (empty($value['Info']) ?
'---' : PMA_SQP_formatHtml(PMA_SQP_parse($value['Info']))); ?
> 
;</td
>
97 $useBgcolorOne = !$useBgcolorOne;
109 require('./footer.inc.php3');