home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / server_processlist.php < prev    next >
PHP Script  |  2008-06-23  |  3KB  |  105 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  *
  5.  * @version $Id: server_processlist.php 10240 2007-04-01 11:02:46Z cybot_tm $
  6.  */
  7.  
  8. /**
  9.  *
  10.  */
  11. require_once './libraries/common.inc.php';
  12.  
  13. /**
  14.  * Does the common work
  15.  */
  16. require_once './libraries/server_common.inc.php';
  17.  
  18.  
  19. /**
  20.  * Kills a selected process
  21.  */
  22. if (!empty($kill)) {
  23.     if (PMA_DBI_try_query('KILL ' . $kill . ';')) {
  24.         $message = sprintf($strThreadSuccessfullyKilled, $kill);
  25.     } else {
  26.         $message = sprintf($strCouldNotKill, $kill);
  27.     }
  28. }
  29.  
  30.  
  31. /**
  32.  * Displays the links
  33.  */
  34. require './libraries/server_links.inc.php';
  35.  
  36.  
  37. /**
  38.  * Displays the sub-page heading
  39.  */
  40. echo '<h2>' . "\n"
  41.    . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_process.png" width="16" height="16" alt="" />' : '')
  42.    . $strProcesslist . "\n"
  43.    . '</h2>' . "\n";
  44.  
  45.  
  46. /**
  47.  * Sends the query
  48.  */
  49. $sql_query = 'SHOW' . (empty($full) ? '' : ' FULL') . ' PROCESSLIST';
  50. $result = PMA_DBI_query($sql_query);
  51.  
  52. PMA_showMessage($GLOBALS['strSuccess']);
  53.  
  54.  
  55. /**
  56.  * Displays the page
  57.  */
  58. ?>
  59. <table id="tableprocesslist" class="data">
  60. <thead>
  61. <tr><td><a href="./server_processlist.php?<?php echo $url_query . (empty($full) ? '&full=1' : ''); ?>"
  62.             title="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>">
  63.         <img src="<?php echo $pmaThemeImage . 's_' . (empty($full) ? 'full' : 'partial'); ?>text.png"
  64.             width="50" height="20" alt="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>" />
  65.         </a></td>
  66.     <th><?php echo $strId; ?></th>
  67.     <th><?php echo $strUser; ?></th>
  68.     <th><?php echo $strHost; ?></th>
  69.     <th><?php echo $strDatabase; ?></th>
  70.     <th><?php echo $strCommand; ?></th>
  71.     <th><?php echo $strTime; ?></th>
  72.     <th><?php echo $strStatus; ?></th>
  73.     <th><?php echo $strSQLQuery; ?></th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <?php
  78. $odd_row = true;
  79. while($process = PMA_DBI_fetch_assoc($result)) {
  80.     ?>
  81. <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
  82.     <td><a href="./server_processlist.php?<?php echo $url_query . '&kill=' . $process['Id']; ?>"><?php echo $strKill; ?></a></td>
  83.     <td class="value"><?php echo $process['Id']; ?></td>
  84.     <td><?php echo $process['User']; ?></td>
  85.     <td><?php echo $process['Host']; ?></td>
  86.     <td><?php echo ((! isset($process['db']) || ! strlen($process['db'])) ? '<i>' . $strNone . '</i>' : $process['db']); ?></td>
  87.     <td><?php echo $process['Command']; ?></td>
  88.     <td class="value"><?php echo $process['Time']; ?></td>
  89.     <td><?php echo (empty($process['State']) ? '---' : $process['State']); ?></td>
  90.     <td><?php echo (empty($process['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']))); ?></td>
  91. </tr>
  92.     <?php
  93.     $odd_row = ! $odd_row;
  94. }
  95. ?>
  96. </tbody>
  97. </table>
  98. <?php
  99.  
  100. /**
  101.  * Sends the footer
  102.  */
  103. require_once './libraries/footer.inc.php';
  104. ?>
  105.