patch #1250935, interface improvements
[phpmyadmin/crack.git] / server_processlist.php
blob4eecdc7679a9147fe22a6e3ad55ac99b63ff169c
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Does the common work
8 */
9 require_once('./server_common.inc.php');
12 /**
13 * Kills a selected process
15 if (!empty($kill)) {
16 if (PMA_DBI_try_query('KILL ' . $kill . ';')) {
17 $message = sprintf($strThreadSuccessfullyKilled, $kill);
18 } else {
19 $message = sprintf($strCouldNotKill, $kill);
24 /**
25 * Displays the links
27 require('./server_links.inc.php');
30 /**
31 * Displays the sub-page heading
33 echo '<h2>' . "\n"
34 . ($cfg['MainPageIconic'] ? '<img src="' . $pmaThemeImage . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '' )
35 . ' ' . $strProcesslist . "\n"
36 . '</h2>' . "\n";
39 /**
40 * Sends the query and buffers the result
42 $serverProcesses = array();
43 $sql_query = 'SHOW' . (empty($full) ? '' : ' FULL') . ' PROCESSLIST';
44 $res = PMA_DBI_query($sql_query);
45 while ($row = PMA_DBI_fetch_assoc($res)) {
46 $serverProcesses[] = $row;
48 @PMA_DBI_free_result($res);
49 unset($res);
50 unset($row);
52 PMA_showMessage($GLOBALS['strSuccess']);
55 /**
56 * Displays the page
59 <table border="0" cellpadding="2" cellspacing="1">
60 <tr>
61 <td><a href="./server_processlist.php?<?php echo $url_query . (empty($full) ? '&amp;full=1' : ''); ?>" title="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>"><img src="<?php echo $pmaThemeImage . 's_' . (empty($full) ? 'full' : 'partial'); ?>text.png" width="50" height="20" border="0" alt="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>" /></a></td>
62 <th>&nbsp;<?php echo $strId; ?>&nbsp;</th>
63 <th>&nbsp;<?php echo $strUser; ?>&nbsp;</th>
64 <th>&nbsp;<?php echo $strHost; ?>&nbsp;</th>
65 <th>&nbsp;<?php echo $strDatabase; ?>&nbsp;</th>
66 <th>&nbsp;<?php echo $strCommand; ?>&nbsp;</th>
67 <th>&nbsp;<?php echo $strTime; ?>&nbsp;</th>
68 <th>&nbsp;<?php echo $strStatus; ?>&nbsp;</th>
69 <th>&nbsp;<?php echo $strSQLQuery; ?>&nbsp;</th>
70 </tr>
71 <?php
72 $useBgcolorOne = TRUE;
73 foreach ($serverProcesses AS $name => $value) {
75 <tr>
76 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<a href="./server_processlist.php?<?php echo $url_query . '&amp;kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a>&nbsp;</td>
77 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Id']; ?>&nbsp;</td>
78 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['User']; ?>&nbsp;</td>
79 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Host']; ?>&nbsp;</td>
80 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['db']) ? '<i>' . $strNone . '</i>' : $value['db']); ?>&nbsp;</td>
81 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Command']; ?>&nbsp;</td>
82 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Time']; ?>&nbsp;</td>
83 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['State']) ? '---' : $value['State']); ?>&nbsp;</td>
84 <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>
85 </tr>
86 <?php
87 $useBgcolorOne = !$useBgcolorOne;
90 <?php
92 </table>
93 <?php
96 /**
97 * Sends the footer
99 require_once('./footer.inc.php');