Correctly handle unix timestamp (RFE #1440386).
[phpmyadmin/crack.git] / server_variables.php
blobf3482d587bc127c9c75d4d72bdd68dac57f0f94a
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) {
6 define( 'PMA_NO_VARIABLES_IMPORT', true );
8 require_once './libraries/common.lib.php';
10 /**
11 * Does the common work
13 require './libraries/server_common.inc.php';
16 /**
17 * Displays the links
19 require './libraries/server_links.inc.php';
22 /**
23 * Displays the sub-page heading
25 echo '<h2>' . "\n"
26 . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_vars.png" width="16" height="16" alt="" />' : '' )
27 . '' . $strServerVars . "\n"
28 . '</h2>' . "\n";
31 /**
32 * Sends the queries and buffers the results
34 if (PMA_MYSQL_INT_VERSION >= 40003) {
35 $serverVars = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
36 $serverVarsGlobal = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);
37 } else {
38 $serverVars = PMA_DBI_fetch_result('SHOW VARIABLES;', 0, 1);
42 /**
43 * Displays the page
46 <table class="data">
47 <thead>
48 <tr><th><?php echo $strVar; ?></th>
49 <th>
50 <?php
51 if (PMA_MYSQL_INT_VERSION >= 40003) {
52 echo $strSessionValue . ' / ' . $strGlobalValue;
53 } else {
54 echo $strValue;
57 </th>
58 </tr>
59 </thead>
60 <tbody>
61 <?php
62 $odd_row = true;
63 foreach ($serverVars as $name => $value) {
65 <tr class="<?php
66 echo $odd_row ? 'odd' : 'even';
67 if (PMA_MYSQL_INT_VERSION >= 40003
68 && $serverVarsGlobal[$name] !== $value) {
69 echo ' marked';
71 ?>">
72 <th nowrap="nowrap">
73 <?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
74 <td class="value"><?php
75 if (is_numeric($value)) {
76 echo PMA_formatNumber($value, 0);
77 $is_numeric = true;
78 } else {
79 echo htmlspecialchars($value);
80 $is_numeric = false;
82 ?></td>
83 <?php
84 if (PMA_MYSQL_INT_VERSION >= 40003
85 && $serverVarsGlobal[$name] !== $value) {
87 </tr>
88 <tr class="<?php
89 echo $odd_row ? 'odd' : 'even';
90 ?> marked">
91 <td>(<?php echo $strGlobalValue; ?>)</td>
92 <td class="value"><?php
93 if ($is_numeric) {
94 echo PMA_formatNumber($serverVarsGlobal[$name], 0);
95 } else {
96 echo htmlspecialchars($serverVarsGlobal[$name]);
98 ?></td>
99 <?php } ?>
100 </tr>
101 <?php
102 $odd_row = !$odd_row;
105 </tbody>
106 </table>
107 <?php
111 * Sends the footer
113 require_once './libraries/footer.inc.php';