updated czech translation
[phpmyadmin/crack.git] / server_processlist.php3
blob89059432a994db4e6f2e491eefd0fada49aa895d
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Gets some core libraries
8 */
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');
16 /**
17 * Kills a selected process
19 if (!empty($kill)) {
20 $sql_query = 'KILL ' . $kill . ';';
21 if (@PMA_mysql_query($sql_query, $userlink)) {
22 $message = sprintf($strThreadSuccessfullyKilled, $kill);
23 } else {
24 $message = sprintf($strCouldNotKill, $kill);
28 /**
29 * Does the common work
31 require('./server_common.inc.php3');
33 /**
34 * Displays the links
36 require('./server_links.inc.php3');
38 /**
39 * Displays the sub-page heading
41 echo '<h2>' . "\n"
42 . ' ' . $strProcesslist . "\n"
43 . '</h2>' . "\n";
45 /**
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');
51 exit;
54 /**
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);
63 unset($res);
64 unset($row);
66 /**
67 * Displays the page
70 <table border="0">
71 <tr>
72 <th></th>
73 <th>&nbsp;<?php echo $strId; ?>&nbsp;</th>
74 <th>&nbsp;<?php echo $strUser; ?>&nbsp;</th>
75 <th>&nbsp;<?php echo $strHost; ?>&nbsp;</th>
76 <th>&nbsp;<?php echo $strDatabase; ?>&nbsp;</th>
77 <th>&nbsp;<?php echo $strCommand; ?>&nbsp;</th>
78 <th>&nbsp;<?php echo $strTime; ?>&nbsp;</th>
79 <th>&nbsp;<?php echo $strStatus; ?>&nbsp;</th>
80 <th>&nbsp;<?php echo $strSQLQuery; ?>&nbsp;</th>
81 </tr>
82 <?php
83 $useBgcolorOne = TRUE;
84 while (list($name, $value) = each($serverProcesses)) {
86 <tr>
87 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<a href="./server_processlist.php3?<?php echo $url_query . '&amp;kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a>&nbsp;</td>
88 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Id']; ?>&nbsp;</td>
89 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['User']; ?>&nbsp;</td>
90 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Host']; ?>&nbsp;</td>
91 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['db']) ? '<i>' . $strNone . '</i>' : $value['db']); ?>&nbsp;</td>
92 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Command']; ?>&nbsp;</td>
93 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Time']; ?>&nbsp;</td>
94 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['State']) ? '---' : $value['State']); ?>&nbsp;</td>
95 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($value['Info']))); ?>&nbsp;</td>
96 <?php
97 $useBgcolorOne = !$useBgcolorOne;
100 </tr>
101 <?php
103 </table>
104 <?php
107 * Sends the footer
109 require('./footer.inc.php3');