[ Index ]
 

Code source de phpMyAdmin 2.10.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> server_status.php (source)

   1  <?php
   2  /* $Id: server_status.php 10047 2007-03-02 15:16:15Z lem9 $ */
   3  // vim: expandtab sw=4 ts=4 sts=4:
   4  /**
   5   * displays status variables with descriptions and some hints an optmizing
   6   *  + reset status variables
   7   */
   8  if (! defined('PMA_NO_VARIABLES_IMPORT')) {
   9      define('PMA_NO_VARIABLES_IMPORT', true);
  10  }
  11  require_once  './libraries/common.lib.php';
  12  
  13  /**
  14   * Does the common work
  15   */
  16  require  './libraries/server_common.inc.php';
  17  
  18  
  19  /**
  20   * Displays the links
  21   */
  22  require  './libraries/server_links.inc.php';
  23  
  24  
  25  /**
  26   * Displays the sub-page heading
  27   */
  28  echo '<div id="serverstatus">' . "\n";
  29  echo '<h2>' . "\n"
  30     . ($GLOBALS['cfg']['MainPageIconic']
  31         ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] .
  32           's_status.png" width="16" height="16" alt="" />'
  33         : '')
  34     . $strServerStatus . "\n"
  35     . '</h2>' . "\n";
  36  
  37  
  38  /**
  39   * flush status variables if requested
  40   */
  41  if (isset($_REQUEST['flush'])) {
  42      $_flush_commands = array(
  43          'STATUS',
  44          'TABLES',
  45          'QUERY CACHE',
  46      );
  47  
  48      if (in_array($_REQUEST['flush'], $_flush_commands)) {
  49          PMA_DBI_query('FLUSH ' . $_REQUEST['flush'] . ';');
  50      }
  51      unset($_flush_commands);
  52  }
  53  
  54  
  55  /**
  56   * get status from server
  57   */
  58  if (PMA_MYSQL_INT_VERSION >= 50002) {
  59      $server_status = PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1);
  60  } else {
  61      $server_status = PMA_DBI_fetch_result('SHOW STATUS', 0, 1);
  62  }
  63  
  64  
  65  /**
  66   * for some calculations we require also some server settings
  67   */
  68  if (PMA_MYSQL_INT_VERSION >= 40003) {
  69      $server_variables = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1);
  70  } else {
  71      $server_variables = PMA_DBI_fetch_result('SHOW VARIABLES', 0, 1);
  72  }
  73  
  74  
  75  /**
  76   * starttime calculation
  77   */
  78  $start_time = PMA_DBI_fetch_value(
  79      'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']);
  80  
  81  
  82  /**
  83   * cleanup some deprecated values
  84   */
  85  $deprecated = array(
  86      'Com_prepare_sql' => 'Com_stmt_prepare',
  87      'Com_execute_sql' => 'Com_stmt_execute',
  88      'Com_dealloc_sql' => 'Com_stmt_close',
  89  );
  90  
  91  foreach ($deprecated as $old => $new) {
  92      if (isset($server_status[$old])
  93        && isset($server_status[$new])) {
  94          unset($server_status[$old]);
  95      }
  96  }
  97  unset($deprecated);
  98  
  99  
 100  /**
 101   * calculate some values
 102   */
 103  // Key_buffer_fraction
 104  if (isset($server_status['Key_blocks_unused'])
 105    && isset($server_variables['key_cache_block_size'])
 106    && isset($server_variables['key_buffer_size'])) {
 107      $server_status['Key_buffer_fraction_%'] =
 108          100
 109        - $server_status['Key_blocks_unused']
 110        * $server_variables['key_cache_block_size']
 111        / $server_variables['key_buffer_size']
 112        * 100;
 113  } elseif (
 114       isset($server_status['Key_blocks_used'])
 115    && isset($server_variables['key_buffer_size'])) {
 116      $server_status['Key_buffer_fraction_%'] =
 117          $server_status['Key_blocks_used']
 118        * 1024
 119        / $server_variables['key_buffer_size'];
 120    }
 121  
 122  // Ratio for key read/write
 123  if (isset($server_status['Key_writes'])
 124      && isset($server_status['Key_write_requests'])
 125      && $server_status['Key_write_requests'] > 0)
 126          $server_status['Key_write_ratio_%'] = 100 * $server_status['Key_writes'] / $server_status['Key_write_requests'];
 127  
 128  if (isset($server_status['Key_reads'])
 129      && isset($server_status['Key_read_requests'])
 130      && $server_status['Key_read_requests'] > 0)
 131          $server_status['Key_read_ratio_%'] = 100 * $server_status['Key_reads'] / $server_status['Key_read_requests'];
 132  
 133  // Threads_cache_hitrate
 134  if (isset($server_status['Threads_created'])
 135    && isset($server_status['Connections'])
 136    && $server_status['Connections'] > 0) {
 137      $server_status['Threads_cache_hitrate_%'] =
 138          100
 139        - $server_status['Threads_created']
 140        / $server_status['Connections']
 141        * 100;
 142  }
 143  
 144  
 145  /**
 146   * define some alerts
 147   */
 148  // name => max value before alert
 149  $alerts = array(
 150      // lower is better
 151      // variable => max value
 152      'Aborted_clients' => 0,
 153      'Aborted_connects' => 0,
 154  
 155      'Binlog_cache_disk_use' => 0,
 156  
 157      'Created_tmp_disk_tables' => 0,
 158  
 159      'Handler_read_rnd' => 0,
 160      'Handler_read_rnd_next' => 0,
 161  
 162      'Innodb_buffer_pool_pages_dirty' => 0,
 163      'Innodb_buffer_pool_reads' => 0,
 164      'Innodb_buffer_pool_wait_free' => 0,
 165      'Innodb_log_waits' => 0,
 166      'Innodb_row_lock_time_avg' => 10, // ms
 167      'Innodb_row_lock_time_max' => 50, // ms
 168      'Innodb_row_lock_waits' => 0,
 169  
 170      'Slow_queries' => 0,
 171      'Delayed_errors' => 0,
 172      'Select_full_join' => 0,
 173      'Select_range_check' => 0,
 174      'Sort_merge_passes' => 0,
 175      'Opened_tables' => 0,
 176      'Table_locks_waited' => 0,
 177      'Qcache_lowmem_prunes' => 0,
 178      'Slow_launch_threads' => 0,
 179  
 180      // depends on Key_read_requests
 181      // normaly lower then 1:0.01
 182      'Key_reads' => (0.01 * $server_status['Key_read_requests']),
 183      // depends on Key_write_requests
 184      // normaly nearly 1:1
 185      'Key_writes' => (0.9 * $server_status['Key_write_requests']),
 186  
 187      'Key_buffer_fraction' => 0.5,
 188  
 189      // alert if more than 95% of thread cache is in use
 190      'Threads_cached' => 0.95 * $server_variables['thread_cache_size']
 191  
 192      // higher is better
 193      // variable => min value
 194      //'Handler read key' => '> ',
 195  );
 196  
 197  
 198  /**
 199   * split variables in sections
 200   */
 201  $allocations = array(
 202      // variable name => section
 203  
 204      'Com_'              => 'com',
 205      'Innodb_'           => 'innodb',
 206      'Ndb_'              => 'ndb',
 207      'Ssl_'              => 'ssl',
 208      'Handler_'          => 'handler',
 209      'Qcache_'           => 'qcache',
 210      'Threads_'          => 'threads',
 211      'Slow_launch_threads' => 'threads',
 212  
 213      'Binlog_cache_'     => 'binlog_cache',
 214      'Created_tmp_'      => 'created_tmp',
 215      'Key_'              => 'key',
 216  
 217      'Delayed_'          => 'delayed',
 218      'Not_flushed_delayed_rows' => 'delayed',
 219  
 220      'Flush_commands'    => 'query',
 221      'Last_query_cost'   => 'query',
 222      'Slow_queries'      => 'query',
 223  
 224      'Select_'           => 'select',
 225      'Sort_'             => 'sort',
 226  
 227      'Open_tables'       => 'table',
 228      'Opened_tables'     => 'table',
 229      'Table_locks_'      => 'table',
 230  
 231      'Rpl_status'        => 'repl',
 232      'Slave_'            => 'repl',
 233  
 234      'Tc_'               => 'tc',
 235  );
 236  
 237  $sections = array(
 238      // section => section name (description)
 239      'com'           => array('title' => ''),
 240      'query'         => array('title' => ''),
 241      'innodb'        => array('title' => 'InnoDB'),
 242      'ndb'           => array('title' => 'NDB'),
 243      'ssl'           => array('title' => 'SSL'),
 244      'handler'       => array('title' => $strHandler),
 245      'qcache'        => array('title' => $strQueryCache),
 246      'threads'       => array('title' => $strThreads),
 247      'binlog_cache'  => array('title' => $strBinaryLog),
 248      'created_tmp'   => array('title' => $strTempData),
 249      'delayed'       => array('title' => $strServerStatusDelayedInserts),
 250      'key'           => array('title' => $strKeyCache),
 251      'select'        => array('title' => $strJoins),
 252      'repl'          => array('title' => $strReplication),
 253      'sort'          => array('title' => $strSorting),
 254      'table'         => array('title' => $strNumTables),
 255      'tc'            => array('title' => $strTransactionCoordinator),
 256  );
 257  
 258  
 259  /**
 260   * define some needfull links/commands
 261   */
 262  // variable or section name => (name => url)
 263  $links = array();
 264  
 265  // because of PMA_NO_VARIABLES_IMPORT, the $PHP_SELF globalized by 
 266  // grab_globals is not available here when register_globals = Off
 267  // and in some situations, $_SERVER['PHP_SELF'] is not defined
 268  $links['table'][$strFlushTables]
 269      = PMA_getenv('PHP_SELF') . '?flush=TABLES&amp;' . PMA_generate_common_url();
 270  $links['table'][$strShowOpenTables]
 271      = 'sql.php?sql_query=' . urlencode('SHOW OPEN TABLES') .
 272        '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
 273  
 274  $links['repl'][$strShowSlaveHosts]
 275      = 'sql.php?sql_query=' . urlencode('SHOW SLAVE HOSTS') .
 276        '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
 277  $links['repl'][$strShowSlaveStatus]
 278      = 'sql.php?sql_query=' . urlencode('SHOW SLAVE STATUS') .
 279        '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
 280  $links['repl']['MySQL - ' . $strDocu]
 281      = $cfg['MySQLManualBase'] . '/replication.html';
 282  
 283  $links['qcache'][$strFlushQueryCache]
 284      = PMA_getenv('PHP_SELF') . '?flush=' . urlencode('QUERY CACHE') . '&amp;' .
 285        PMA_generate_common_url();
 286  $links['qcache']['MySQL - ' . $strDocu]
 287      = $cfg['MySQLManualBase'] . '/query-cache.html';
 288  
 289  $links['threads'][$strMySQLShowProcess]
 290      = 'server_processlist.php?' . PMA_generate_common_url();
 291  $links['threads']['MySQL - ' . $strDocu]
 292      = $cfg['MySQLManualBase'] . '/mysql-threads.html';
 293  
 294  $links['key']['MySQL - ' . $strDocu]
 295      = $cfg['MySQLManualBase'] . '/myisam-key-cache.html';
 296  
 297  $links['slow_queries']['MySQL - ' . $strDocu]
 298      = $cfg['MySQLManualBase'] . '/slow-query-log.html';
 299  
 300  $links['binlog_cache']['MySQL - ' . $strDocu]
 301      = $cfg['MySQLManualBase'] . '/binary-log.html';
 302  
 303  $links['Slow_queries']['MySQL - ' . $strDocu]
 304      = $cfg['MySQLManualBase'] . '/slow-query-log.html';
 305  
 306  $links['innodb'][$strServerTabVariables]
 307      = 'server_engines.php?engine=innodb&amp;' . PMA_generate_common_url();
 308  $links['innodb'][$strInnodbStat]
 309      = 'server_engines.php?engine=innodb&amp;page=status&amp;' .
 310        PMA_generate_common_url();
 311  $links['innodb']['MySQL - ' . $strDocu]
 312      = $cfg['MySQLManualBase'] . '/innodb.html';
 313  
 314  
 315  // sort status vars into arrays
 316  foreach ($server_status as $name => $value) {
 317      if (isset($allocations[$name])) {
 318          $sections[$allocations[$name]]['vars'][$name] = $value;
 319          unset($server_status[$name]);
 320      } else {
 321          foreach ($allocations as $filter => $section) {
 322              if (preg_match('/^' . $filter . '/', $name)
 323                && isset($server_status[$name])) {
 324                  unset($server_status[$name]);
 325                  $sections[$section]['vars'][$name] = $value;
 326              }
 327          }
 328      }
 329  }
 330  unset($name, $value, $filter, $section, $allocations);
 331  
 332  // rest
 333  $sections['all']['vars'] =& $server_status;
 334  
 335  $hour_factor    = 3600 / $server_status['Uptime'];
 336  
 337  /**
 338   * start output
 339   */
 340  ?>
 341  <div id="statuslinks">
 342      <a href="<?php echo
 343          PMA_getenv('PHP_SELF') . '?' . PMA_generate_common_url(); ?>"
 344         ><?php echo $strRefresh; ?></a>
 345      <a href="<?php echo
 346          PMA_getenv('PHP_SELF') . '?flush=STATUS&amp;' . PMA_generate_common_url(); ?>"
 347         ><?php echo $strShowStatusReset; ?></a>
 348      <a href="<?php echo
 349          $cfg['MySQLManualBase']; ?>/server-status-variables.html"
 350         target="documentation">MySQL - <?php echo $strDocu; ?></a>
 351  </div>
 352  
 353  <p>
 354  <?php
 355  echo sprintf($strServerStatusUptime,
 356      PMA_timespanFormat($server_status['Uptime']),
 357      PMA_localisedDate($start_time)) . "\n";
 358  ?>
 359  </p>
 360  
 361  <div id="sectionlinks">
 362  <?php
 363  foreach ($sections as $section_name => $section) {
 364      if (! empty($section['vars']) && ! empty($section['title'])) {
 365          echo '<a href="' . PMA_getenv('PHP_SELF') . '?' .
 366               PMA_generate_common_url() . '#' . $section_name . '">' .
 367               $section['title'] . '</a>' . "\n";
 368      }
 369  }
 370  ?>
 371  </div>
 372  
 373  <h3><?php echo $strServerTrafficNotes; ?></h3>
 374  
 375  <table id="serverstatustraffic" class="data">
 376  <thead>
 377  <tr>
 378      <th colspan="2"><?php echo $strTraffic . '&nbsp;' . PMA_showHint($strStatisticsOverrun); ?></th>
 379      <th>&oslash; <?php echo $strPerHour; ?></th>
 380  </tr>
 381  </thead>
 382  <tbody>
 383  <tr class="odd">
 384      <th class="name"><?php echo $strReceived; ?></th>
 385      <td class="value"><?php echo
 386          implode(' ',
 387              PMA_formatByteDown($server_status['Bytes_received'], 4)); ?></td>
 388      <td class="value"><?php echo
 389          implode(' ',
 390              PMA_formatByteDown(
 391                  $server_status['Bytes_received'] * $hour_factor, 4)); ?></td>
 392  </tr>
 393  <tr class="even">
 394      <th class="name"><?php echo $strSent; ?></th>
 395      <td class="value"><?php echo
 396          implode(' ',
 397              PMA_formatByteDown($server_status['Bytes_sent'], 4)); ?></td>
 398      <td class="value"><?php echo
 399          implode(' ',
 400              PMA_formatByteDown(
 401                  $server_status['Bytes_sent'] * $hour_factor, 4)); ?></td>
 402  </tr>
 403  <tr class="odd">
 404      <th class="name"><?php echo $strTotalUC; ?></th>
 405      <td class="value"><?php echo
 406          implode(' ',
 407              PMA_formatByteDown(
 408                  $server_status['Bytes_received'] + $server_status['Bytes_sent'], 4)
 409          ); ?></td>
 410      <td class="value"><?php echo
 411          implode(' ',
 412              PMA_formatByteDown(
 413                  ($server_status['Bytes_received'] + $server_status['Bytes_sent'])
 414                  * $hour_factor, 4)
 415          ); ?></td>
 416  </tr>
 417  </tbody>
 418  </table>
 419  
 420  <table id="serverstatusconnections" class="data">
 421  <thead>
 422  <tr>
 423      <th colspan="2"><?php echo $strConnections; ?></th>
 424      <th>&oslash; <?php echo $strPerHour; ?></th>
 425      <th>%</th>
 426  </tr>
 427  </thead>
 428  <tbody>
 429  <tr class="odd">
 430      <th class="name"><?php echo $strMaxConnects; ?></th>
 431      <td class="value"><?php echo
 432          PMA_formatNumber($server_status['Max_used_connections'], 0); ?>  </td>
 433      <td class="value">--- </td>
 434      <td class="value">--- </td>
 435  </tr>
 436  <tr class="even">
 437      <th class="name"><?php echo $strFailedAttempts; ?></th>
 438      <td class="value"><?php echo
 439          PMA_formatNumber($server_status['Aborted_connects'], 4, 0); ?></td>
 440      <td class="value"><?php echo
 441          PMA_formatNumber($server_status['Aborted_connects'] * $hour_factor,
 442              4, 2); ?></td>
 443      <td class="value"><?php echo
 444          $server_status['Connections'] > 0
 445        ? PMA_formatNumber(
 446              $server_status['Aborted_connects'] * 100 / $server_status['Connections'],
 447              0, 2) . '%'
 448        : '--- '; ?></td>
 449  </tr>
 450  <tr class="odd">
 451      <th class="name"><?php echo $strAbortedClients; ?></th>
 452      <td class="value"><?php echo
 453          PMA_formatNumber($server_status['Aborted_clients'], 4, 0); ?></td>
 454      <td class="value"><?php echo
 455          PMA_formatNumber($server_status['Aborted_clients'] * $hour_factor,
 456              4, 2); ?></td>
 457      <td class="value"><?php echo
 458          $server_status['Connections'] > 0
 459        ? PMA_formatNumber(
 460              $server_status['Aborted_clients'] * 100 / $server_status['Connections'],
 461              0, 2) . '%'
 462        : '--- '; ?></td>
 463  </tr>
 464  <tr class="even">
 465      <th class="name"><?php echo $strTotalUC; ?></th>
 466      <td class="value"><?php echo
 467          PMA_formatNumber($server_status['Connections'], 4, 0); ?></td>
 468      <td class="value"><?php echo
 469          PMA_formatNumber($server_status['Connections'] * $hour_factor,
 470              4, 2); ?></td>
 471      <td class="value"><?php echo
 472          PMA_formatNumber(100, 0, 2); ?>%</td>
 473  </tr>
 474  </tbody>
 475  </table>
 476  
 477  <hr class="clearfloat" />
 478  
 479  <h3><?php echo
 480      sprintf($strQueryStatistics,
 481          PMA_formatNumber($server_status['Questions'], 0)); ?></h3>
 482  
 483  <table id="serverstatusqueriessummary" class="data">
 484  <thead>
 485  <tr>
 486      <th><?php echo $strTotalUC; ?></th>
 487      <th>&oslash; <?php echo $strPerHour; ?></th>
 488      <th>&oslash; <?php echo $strPerMinute; ?></th>
 489      <th>&oslash; <?php echo $strPerSecond; ?></th>
 490  </tr>
 491  </thead>
 492  <tbody>
 493  <tr class="odd">
 494      <td class="value"><?php echo
 495          PMA_formatNumber($server_status['Questions'], 4, 0); ?></td>
 496      <td class="value"><?php echo
 497          PMA_formatNumber($server_status['Questions'] * $hour_factor,
 498              3, 2); ?></td>
 499      <td class="value"><?php echo
 500          PMA_formatNumber(
 501              $server_status['Questions'] * 60 / $server_status['Uptime'],
 502              3, 2); ?></td>
 503      <td class="value"><?php echo
 504          PMA_formatNumber(
 505              $server_status['Questions'] / $server_status['Uptime'],
 506              3, 2); ?></td>
 507  </tr>
 508  </tbody>
 509  </table>
 510  
 511  <div id="serverstatusqueriesdetails">
 512  <?php
 513  // number of tables to split values into
 514  $tables         = 2;
 515  $rows_per_table = (int) ceil(count($sections['com']['vars']) / $tables);
 516  $current_table  = 0;
 517  $odd_row        = true;
 518  $countRows      = 0;
 519  $perc_factor    = 100 / ($server_status['Questions'] - $server_status['Connections']);
 520  foreach ($sections['com']['vars'] as $name => $value) {
 521      $current_table++;
 522      if ($countRows === 0 || $countRows === $rows_per_table) {
 523          $odd_row = true;
 524          if ($countRows === $rows_per_table) {
 525              echo '    </tbody>' . "\n";
 526              echo '    </table>' . "\n";
 527          }
 528  ?>
 529      <table id="serverstatusqueriesdetails<?php echo $current_table; ?>" class="data">
 530      <col class="namecol" />
 531      <col class="valuecol" span="3" />
 532      <thead>
 533          <tr><th colspan="2"><?php echo $strQueryType; ?></th>
 534              <th>&oslash; <?php echo $strPerHour; ?></th>
 535              <th>%</th>
 536          </tr>
 537      </thead>
 538      <tbody>
 539  <?php
 540      } else {
 541          $odd_row = !$odd_row;
 542      }
 543      $countRows++;
 544  
 545  // For the percentage column, use Questions - Connections, because
 546  // the number of connections is not an item of the Query types
 547  // but is included in Questions. Then the total of the percentages is 100.
 548      $name = str_replace('Com_', '', $name);
 549      $name = str_replace('_', ' ', $name);
 550  ?>
 551          <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
 552              <th class="name"><?php echo htmlspecialchars($name); ?></th>
 553              <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td>
 554              <td class="value"><?php echo
 555                  PMA_formatNumber($value * $hour_factor, 4, 2); ?></td>
 556              <td class="value"><?php echo
 557                  PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
 558          </tr>
 559  <?php
 560  }
 561  ?>
 562      </tbody>
 563      </table>
 564  </div>
 565  
 566  <div id="serverstatussection">
 567  <?php
 568  //Unset used variables
 569  unset(
 570      $tables, $rows_per_table, $current_table, $countRows, $perc_factor,
 571      $hour_factor, $sections['com'],
 572      $server_status['Aborted_clients'], $server_status['Aborted_connects'],
 573      $server_status['Max_used_connections'], $server_status['Bytes_received'],
 574      $server_status['Bytes_sent'], $server_status['Connections'],
 575      $server_status['Questions'], $server_status['Uptime']
 576  );
 577  
 578  foreach ($sections as $section_name => $section) {
 579      if (! empty($section['vars'])) {
 580  ?>
 581      <table class="data" id="serverstatussection<?php echo $section_name; ?>">
 582      <caption class="tblHeaders">
 583          <a class="top"
 584             href="<?php echo PMA_getenv('PHP_SELF') . '?' .
 585                   PMA_generate_common_url() . '#serverstatus'; ?>"
 586             name="<?php echo $section_name; ?>"><?php echo $strPos1; ?>
 587              <?php echo
 588                  ($GLOBALS['cfg']['MainPageIconic']
 589                ? '<img src="' . $GLOBALS['pmaThemeImage'] .
 590                  's_asc.png" width="11" height="9" align="middle" alt="" />'
 591                : ''); ?>
 592          </a>
 593  <?php
 594  if (! empty($section['title'])) {
 595      echo $section['title'];
 596  }
 597  ?>
 598      </caption>
 599      <col class="namecol" />
 600      <col class="valuecol" />
 601      <col class="descrcol" />
 602      <thead>
 603          <tr>
 604              <th><?php echo $strVar; ?></th>
 605              <th><?php echo $strValue; ?></th>
 606              <th><?php echo $strDescription; ?></th>
 607          </tr>
 608      </thead>
 609  <?php
 610          if (! empty($links[$section_name])) {
 611  ?>
 612      <tfoot>
 613          <tr class="tblFooters">
 614              <th colspan="3" class="tblFooters">
 615  <?php
 616              foreach ($links[$section_name] as $link_name => $link_url) {
 617                  echo '<a href="' . $link_url . '">' . $link_name . '</a>' . "\n";
 618              }
 619              unset($link_url, $link_name);
 620  ?>
 621              </th>
 622          </tr>
 623      </tfoot>
 624  <?php
 625          }
 626  ?>
 627      <tbody>
 628  <?php
 629          $odd_row = false;
 630          foreach ($section['vars'] as $name => $value) {
 631              $odd_row = !$odd_row;
 632  ?>
 633          <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
 634              <th class="name"><?php echo htmlspecialchars($name); ?></th>
 635              <td class="value"><?php
 636              if (isset($alerts[$name])) {
 637                  if ($value > $alerts[$name]) {
 638                      echo '<span class="attention">';
 639                  } else {
 640                      echo '<span class="allfine">';
 641                  }
 642              }
 643              if ('%' === substr($name, -1, 1)) {
 644                  echo PMA_formatNumber($value, 0, 2) . ' %';
 645              } elseif (is_numeric($value) && $value == (int) $value) {
 646                  echo PMA_formatNumber($value, 4, 0);
 647              } elseif (is_numeric($value)) {
 648                  echo PMA_formatNumber($value, 4, 2);
 649              } else {
 650                  echo htmlspecialchars($value);
 651              }
 652              if (isset($alerts[$name])) {
 653                  echo '</span>';
 654              }
 655              ?></td>
 656              <td class="descr">
 657              <?php
 658              if (isset($GLOBALS['strShowStatus' . $name . 'Descr'])) {
 659                  echo $GLOBALS['strShowStatus' . $name . 'Descr'];
 660              }
 661  
 662              if (isset($links[$name])) {
 663                  foreach ($links[$name] as $link_name => $link_url) {
 664                      echo ' <a href="' . $link_url . '">' . $link_name . '</a>' .
 665                          "\n";
 666                  }
 667                  unset($link_url, $link_name);
 668              }
 669              ?>
 670              </td>
 671          </tr>
 672  <?php
 673          }
 674          unset($name, $value);
 675  ?>
 676      </tbody>
 677      </table>
 678  <?php
 679      }
 680  }
 681  unset($section_name, $section, $sections, $server_status, $odd_row, $alerts);
 682  ?>
 683  </div>
 684  </div>
 685  <?php
 686  
 687  
 688  /**
 689   * Sends the footer
 690   */
 691  require_once  './libraries/footer.inc.php';
 692  ?>


Généré le : Mon Nov 26 15:18:20 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics