2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
12 require_once './libraries/server_common.inc.php';
13 require './libraries/server_links.inc.php';
17 * Displays the sub-page heading
20 . ($GLOBALS['cfg']['MainPageIconic'] ?
'<img src="' . $pmaThemeImage . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" alt="" />' : '')
21 . ' ' . __('Processes') . "\n"
25 * Kills a selected process
27 if (!empty($_REQUEST['kill'])) {
28 if (PMA_DBI_try_query('KILL ' . $_REQUEST['kill'] . ';')) {
29 $message = PMA_Message
::success(__('Thread %s was successfully killed.'));
31 $message = PMA_Message
::error(__('phpMyAdmin was unable to kill thread %s. It probably has already been closed.'));
33 $message->addParam($_REQUEST['kill']);
37 $url_params = array();
39 if (! empty($_REQUEST['full'])) {
40 $sql_query = 'SHOW FULL PROCESSLIST';
41 $url_params['full'] = 1;
42 $full_text_link = 'server_processlist.php' . PMA_generate_common_url(array(), 'html', '?');
44 $sql_query = 'SHOW PROCESSLIST';
45 $full_text_link = 'server_processlist.php' . PMA_generate_common_url(array('full' => 1));
47 $result = PMA_DBI_query($sql_query);
53 <table id
="tableprocesslist" class="data">
55 <tr
><td
><a href
="<?php echo $full_text_link; ?>"
56 title
="<?php echo empty($full) ? __('Show Full Queries') : __('Truncate Shown Queries'); ?>">
57 <img src
="<?php echo $pmaThemeImage . 's_' . (empty($_REQUEST['full']) ? 'full' : 'partial'); ?>text.png"
58 alt
="<?php echo empty($_REQUEST['full']) ? __('Show Full Queries') : __('Truncate Shown Queries'); ?>" />
60 <th
><?php
echo __('ID'); ?
></th
>
61 <th
><?php
echo __('User'); ?
></th
>
62 <th
><?php
echo __('Host'); ?
></th
>
63 <th
><?php
echo __('Database'); ?
></th
>
64 <th
><?php
echo __('Command'); ?
></th
>
65 <th
><?php
echo __('Time'); ?
></th
>
66 <th
><?php
echo __('Status'); ?
></th
>
67 <th
><?php
echo __('SQL query'); ?
></th
>
73 while($process = PMA_DBI_fetch_assoc($result)) {
74 $url_params['kill'] = $process['Id'];
75 $kill_process = 'server_processlist.php' . PMA_generate_common_url($url_params);
77 <tr
class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
78 <td
><a href
="<?php echo $kill_process ; ?>"><?php
echo __('Kill'); ?
></a
></td
>
79 <td
class="value"><?php
echo $process['Id']; ?
></td
>
80 <td
><?php
echo $process['User']; ?
></td
>
81 <td
><?php
echo $process['Host']; ?
></td
>
82 <td
><?php
echo ((! isset($process['db']) ||
! strlen($process['db'])) ?
'<i>' . __('None') . '</i>' : $process['db']); ?
></td
>
83 <td
><?php
echo $process['Command']; ?
></td
>
84 <td
class="value"><?php
echo $process['Time']; ?
></td
>
85 <td
><?php
echo (empty($process['State']) ?
'---' : $process['State']); ?
></td
>
86 <td
><?php
echo (empty($process['Info']) ?
'---' : PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']))); ?
></td
>
89 $odd_row = ! $odd_row;
99 require './libraries/footer.inc.php';