| Current Path : /var/www/html/mmishra/indem/dba/ |
| Current File : /var/www/html/mmishra/indem/dba/server_processlist.php |
<?php
/* $Id: server_processlist.php,v 1.7 2003/03/27 21:39:23 rabus Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Does the common work
*/
require('./server_common.inc.php');
/**
* Kills a selected process
*/
if (!empty($kill)) {
$sql_query = 'KILL ' . $kill . ';';
if (@PMA_mysql_query($sql_query, $userlink)) {
$message = sprintf($strThreadSuccessfullyKilled, $kill);
} else {
$message = sprintf($strCouldNotKill, $kill);
}
}
/**
* Displays the links
*/
require('./server_links.inc.php');
/**
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
. ' ' . $strProcesslist . "\n"
. '</h2>' . "\n";
/**
* Sends the query and buffers the result
*/
$serverProcesses = array();
$sql_query = 'SHOW' . (empty($full) ? '' : ' FULL') . ' PROCESSLIST;';
$res = @PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC)) {
$serverProcesses[] = $row;
}
@mysql_free_result($res);
unset($res);
unset($row);
/**
* Displays the page
*/
?>
<table border="0">
<tr>
<th><?php echo PMA_MYSQL_INT_VERSION < 32307 ? '' : '<a href="./server_processlist.php?'. $url_query . (empty($full) ? '&full=1' : '') . '" title="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '"><img src="./images/' . (empty($full) ? 'full' : 'partial') . 'text.png" width="50" height="20" border="0" alt="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '" /></a>'; ?></th>
<th> <?php echo $strId; ?> </th>
<th> <?php echo $strUser; ?> </th>
<th> <?php echo $strHost; ?> </th>
<th> <?php echo $strDatabase; ?> </th>
<th> <?php echo $strCommand; ?> </th>
<th> <?php echo $strTime; ?> </th>
<th> <?php echo $strStatus; ?> </th>
<th> <?php echo $strSQLQuery; ?> </th>
</tr>
<?php
$useBgcolorOne = TRUE;
while (list($name, $value) = each($serverProcesses)) {
?>
<tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <a href="./server_processlist.php?<?php echo $url_query . '&kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Id']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['User']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Host']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['db']) ? '<i>' . $strNone . '</i>' : $value['db']); ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Command']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Time']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['State']) ? '---' : $value['State']); ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($value['Info']))); ?> </td>
<?php
$useBgcolorOne = !$useBgcolorOne;
}
?>
</tr>
<?php
?>
</table>
<?php
/**
* Sends the footer
*/
require('./footer.inc.php');
?>