home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / tbl_printview.php < prev    next >
Encoding:
PHP Script  |  2004-10-08  |  21.8 KB  |  632 lines

  1. <?php
  2. /* $Id: tbl_printview.php,v 2.8 2004/10/08 11:14:07 garvinhicking Exp $ */
  3.  
  4.  
  5. /**
  6.  * Gets the variables sent or posted to this script, then displays headers
  7.  */
  8. if (!isset($selected_tbl)) {
  9.     require_once('./libraries/grab_globals.lib.php');
  10.     require_once('./header.inc.php');
  11. }
  12.  
  13. // Check parameters
  14.  
  15. if (!isset($the_tables) || !is_array($the_tables)) {
  16.     $the_tables = array();
  17. }
  18.  
  19. /**
  20.  * Gets the relations settings
  21.  */
  22. require_once('./libraries/relation.lib.php');
  23. require_once('./libraries/transformations.lib.php');
  24.  
  25. $cfgRelation  = PMA_getRelationsParam();
  26.  
  27.  
  28. /**
  29.  * Defines the url to return to in case of error in a sql statement
  30.  */
  31. if (isset($table)) {
  32.     $err_url = 'tbl_properties.php?' . PMA_generate_common_url($db, $table);
  33. } else {
  34.     $err_url = 'db_details.php?' . PMA_generate_common_url($db);
  35. }
  36.  
  37.  
  38. /**
  39.  * Selects the database
  40.  */
  41. PMA_DBI_select_db($db);
  42.  
  43.  
  44. /**
  45.  * Multi-tables printview thanks to Christophe GeschΘ from the "MySQL Form
  46.  * Generator for PHPMyAdmin" (http://sourceforge.net/projects/phpmysqlformgen/)
  47.  */
  48. if (isset($selected_tbl) && is_array($selected_tbl)) {
  49.     $the_tables   = $selected_tbl;
  50. } else if (isset($table)) {
  51.     $the_tables[] = $table;
  52. }
  53. $multi_tables     = (count($the_tables) > 1);
  54.  
  55. if ($multi_tables) {
  56.     $tbl_list     = '';
  57.     foreach ($the_tables AS $key => $table) {
  58.         $tbl_list .= (empty($tbl_list) ? '' : ', ')
  59.                   . PMA_backquote(urldecode($table));
  60.     }
  61.     echo '<b>'.  $strShowTables . ': ' . $tbl_list . '</b>' . "\n";
  62.     echo '<hr />' . "\n";
  63. } // end if
  64.  
  65. $tables_cnt = count($the_tables);
  66. $counter    = 0;
  67.  
  68. foreach ($the_tables AS $key => $table) {
  69.     $table = urldecode($table);
  70.     if ($counter + 1 >= $tables_cnt) {
  71.         $breakstyle = '';
  72.     } else {
  73.         $breakstyle = ' style="page-break-after: always;"';
  74.     }
  75.     $counter++;
  76.     echo '<div' . $breakstyle . '>' . "\n";
  77.     echo '<h1>' . $table . '</h1>' . "\n";
  78.  
  79.     /**
  80.      * Gets table informations
  81.      */
  82.     $result       = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';');
  83.     $showtable    = PMA_DBI_fetch_assoc($result);
  84.     $num_rows     = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
  85.     $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
  86.     PMA_DBI_free_result($result);
  87.  
  88.  
  89.     /**
  90.      * Gets table keys and retains them
  91.      */
  92.     $result       = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';');
  93.     $primary      = '';
  94.     $indexes      = array();
  95.     $lastIndex    = '';
  96.     $indexes_info = array();
  97.     $indexes_data = array();
  98.     $pk_array     = array(); // will be use to emphasis prim. keys in the table
  99.                              // view
  100.     while ($row = PMA_DBI_fetch_assoc($result)) {
  101.         // Backups the list of primary keys
  102.         if ($row['Key_name'] == 'PRIMARY') {
  103.             $primary .= $row['Column_name'] . ', ';
  104.             $pk_array[$row['Column_name']] = 1;
  105.         }
  106.         // Retains keys informations
  107.         if ($row['Key_name'] != $lastIndex ){
  108.             $indexes[] = $row['Key_name'];
  109.             $lastIndex = $row['Key_name'];
  110.         }
  111.         $indexes_info[$row['Key_name']]['Sequences'][]     = $row['Seq_in_index'];
  112.         $indexes_info[$row['Key_name']]['Non_unique']      = $row['Non_unique'];
  113.         if (isset($row['Cardinality'])) {
  114.             $indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
  115.         }
  116. //      I don't know what does following column mean....
  117. //      $indexes_info[$row['Key_name']]['Packed']          = $row['Packed'];
  118.         $indexes_info[$row['Key_name']]['Comment']         = $row['Comment'];
  119.  
  120.         $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name']  = $row['Column_name'];
  121.         if (isset($row['Sub_part'])) {
  122.             $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part'];
  123.         }
  124.  
  125.     } // end while
  126.     if ($result) {
  127.         PMA_DBI_free_result($result);
  128.     }
  129.  
  130.  
  131.     /**
  132.      * Gets fields properties
  133.      */
  134.     $result      = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
  135.     $fields_cnt  = PMA_DBI_num_rows($result);
  136.  
  137.     // Check if we can use Relations (Mike Beck)
  138.     if (!empty($cfgRelation['relation'])) {
  139.         // Find which tables are related with the current one and write it in
  140.         // an array
  141.         $res_rel = PMA_getForeigners($db, $table);
  142.  
  143.         if (count($res_rel) > 0) {
  144.             $have_rel = TRUE;
  145.         } else {
  146.             $have_rel = FALSE;
  147.         }
  148.     }
  149.     else {
  150.            $have_rel = FALSE;
  151.     } // end if
  152.  
  153.  
  154.     /**
  155.      * Displays the comments of the table if MySQL >= 3.23
  156.      */
  157.     if (!empty($show_comment)) {
  158.         echo $strTableComments . ': ' . $show_comment . '<br /><br />';
  159.     }
  160.  
  161.     /**
  162.      * Displays the table structure
  163.      */
  164.     ?>
  165.  
  166. <!-- TABLE INFORMATIONS -->
  167. <table width="95%" bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
  168. <tr>
  169.     <th width="50"><?php echo $strField; ?></th>
  170.     <th width="80"><?php echo $strType; ?></th>
  171.     <!--<th width="50"><?php echo $strAttr; ?></th>-->
  172.     <th width="40"><?php echo $strNull; ?></th>
  173.     <th width="70"><?php echo $strDefault; ?></th>
  174.     <!--<th width="50"><?php echo $strExtra; ?></th>-->
  175.     <?php
  176.     echo "\n";
  177.     if ($have_rel) {
  178.         echo '    <th>' . $strLinksTo . '</th>' . "\n";
  179.     }
  180.     if ($cfgRelation['commwork']) {
  181.         echo '    <th>' . $strComments . '</th>' . "\n";
  182.     }
  183.     if ($cfgRelation['mimework']) {
  184.         echo '    <th>MIME</th>' . "\n";
  185.     }
  186.     ?>
  187. </tr>
  188.  
  189.     <?php
  190.     $i = 0;
  191.     while ($row = PMA_DBI_fetch_assoc($result)) {
  192.         $bgcolor = ($i % 2) ?$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
  193.         $i++;
  194.  
  195.         $type             = $row['Type'];
  196.         // reformat mysql query output - staybyte - 9. June 2001
  197.         // loic1: set or enum types: slashes single quotes inside options
  198.         if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) {
  199.             $tmp[2]       = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
  200.             $type         = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
  201.             $type_nowrap  = '';
  202.  
  203.             $binary       = 0;
  204.             $unsigned     = 0;
  205.             $zerofill     = 0;
  206.         } else {
  207.             $type_nowrap  = ' nowrap="nowrap"';
  208.             $type         = preg_replace('@BINARY@i', '', $type);
  209.             $type         = preg_replace('@ZEROFILL@i', '', $type);
  210.             $type         = preg_replace('@UNSIGNED@i', '', $type);
  211.             if (empty($type)) {
  212.                 $type     = ' ';
  213.             }
  214.  
  215.             $binary       = stristr($row['Type'], 'binary');
  216.             $unsigned     = stristr($row['Type'], 'unsigned');
  217.             $zerofill     = stristr($row['Type'], 'zerofill');
  218.         }
  219.         $strAttribute     = ' ';
  220.         if ($binary) {
  221.             $strAttribute = 'BINARY';
  222.         }
  223.         if ($unsigned) {
  224.             $strAttribute = 'UNSIGNED';
  225.         }
  226.         if ($zerofill) {
  227.             $strAttribute = 'UNSIGNED ZEROFILL';
  228.         }
  229.         if (!isset($row['Default'])) {
  230.             if ($row['Null'] != '') {
  231.                 $row['Default'] = '<i>NULL</i>';
  232.             }
  233.         } else {
  234.             $row['Default'] = htmlspecialchars($row['Default']);
  235.         }
  236.         $field_name = htmlspecialchars($row['Field']);
  237.         echo "\n";
  238.         ?>
  239. <tr>
  240.     <td width="50" class="print" nowrap="nowrap">
  241.     <?php
  242.     if (isset($pk_array[$row['Field']])) {
  243.         echo '    <u>' . $field_name . '</u> ' . "\n";
  244.     } else {
  245.         echo '    ' . $field_name . ' ' . "\n";
  246.     }
  247.     ?>
  248.     </td>
  249.     <td width="80" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
  250.     <!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
  251.     <td width="40" class="print"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
  252.     <td width="70" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
  253.     <!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
  254.     <?php
  255.     echo "\n";
  256.     if ($have_rel) {
  257.         echo '    <td class="print">';
  258.         if (isset($res_rel[$field_name])) {
  259.             echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field'] );
  260.         }
  261.         echo ' </td>' . "\n";
  262.     }
  263.     if ($cfgRelation['commwork']) {
  264.         echo '    <td class="print">';
  265.         $comments = PMA_getComments($db, $table);
  266.         if (isset($comments[$field_name])) {
  267.             echo htmlspecialchars($comments[$field_name]);
  268.         }
  269.         echo ' </td>' . "\n";
  270.     }
  271.     if ($cfgRelation['mimework']) {
  272.         $mime_map = PMA_getMIME($db, $table, true);
  273.  
  274.         echo '    <td class="print">';
  275.         if (isset($mime_map[$field_name])) {
  276.             echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype']));
  277.         }
  278.         echo ' </td>' . "\n";
  279.     }
  280.     ?>
  281. </tr>
  282.         <?php
  283.     } // end while
  284.     PMA_DBI_free_result($result);
  285.  
  286.     echo "\n";
  287.     ?>
  288. </table>
  289.  
  290.  
  291.     <?php
  292.     /**
  293.      * Displays indexes
  294.      */
  295.     $index_count = (isset($indexes))
  296.                  ? count($indexes)
  297.                  : 0;
  298.     if ($index_count > 0) {
  299.         echo "\n";
  300.         ?>
  301. <br /><br />
  302.  
  303. <!-- Indexes -->
  304.  <big><?php echo $strIndexes . ':'; ?></big>
  305. <table bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
  306.     <tr>
  307.         <th><?php echo $strKeyname; ?></th>
  308.         <th><?php echo $strType; ?></th>
  309.         <th><?php echo $strCardinality; ?></th>
  310.         <th colspan="2"><?php echo $strField; ?></th>
  311.     </tr>
  312.         <?php
  313.         echo "\n";
  314.         foreach ($indexes AS $index_no => $index_name) {
  315.             $cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']);
  316.             $index_td = '        <td class="print" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n";
  317.             echo '    <tr>' . "\n";
  318.             echo $index_td
  319.                  . '            ' . htmlspecialchars($index_name) . "\n"
  320.                  . '        </td>' . "\n";
  321.  
  322.             if ($indexes_info[$index_name]['Comment'] == 'FULLTEXT') {
  323.                 $index_type = 'FULLTEXT';
  324.             } else if ($index_name == 'PRIMARY') {
  325.                 $index_type = 'PRIMARY';
  326.             } else if ($indexes_info[$index_name]['Non_unique'] == '0') {
  327.                 $index_type = 'UNIQUE';
  328.             } else {
  329.                 $index_type = 'INDEX';
  330.             }
  331.             echo $index_td
  332.                  . '            ' . $index_type . "\n"
  333.                  . '        </td>' . "\n";
  334.  
  335.             echo $index_td
  336.                  . '            ' . (isset($indexes_info[$index_name]['Cardinality']) ? $indexes_info[$index_name]['Cardinality'] : $strNone) . "\n"
  337.                  . '        </td>' . "\n";
  338.  
  339.             foreach ($indexes_info[$index_name]['Sequences'] AS $row_no => $seq_index) {
  340.                 if ($row_no > 0) {
  341.                     echo '    <tr>' . "\n";
  342.                 }
  343.                 if (!empty($indexes_data[$index_name][$seq_index]['Sub_part'])) {
  344.                     echo '        <td class="print">' . "\n"
  345.                          . '            ' . $indexes_data[$index_name][$seq_index]['Column_name'] . "\n"
  346.                          . '        </td>' . "\n";
  347.                     echo '        <td align="right" class="print">' . "\n"
  348.                          . '            ' . $indexes_data[$index_name][$seq_index]['Sub_part'] . "\n"
  349.                          . '        </td>' . "\n";
  350.                     echo '    </tr>' . "\n";
  351.                 } else {
  352.                     echo '        <td class="print" colspan="2">' . "\n"
  353.                          . '            ' . $indexes_data[$index_name][$seq_index]['Column_name'] . "\n"
  354.                          . '        </td>' . "\n";
  355.                     echo '    </tr>' . "\n";
  356.                 }
  357.             } // end while
  358.         } // end while
  359.         echo "\n";
  360.         ?>
  361. </table>
  362.         <?php
  363.         echo "\n";
  364.     } // end display indexes
  365.  
  366.  
  367.     /**
  368.      * Displays Space usage and row statistics
  369.      *
  370.      * staybyte - 9 June 2001
  371.      */
  372.     if ($cfg['ShowStats']) {
  373.         $nonisam     = FALSE;
  374.         if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) {
  375.             $nonisam = TRUE;
  376.         }
  377.         if ($nonisam == FALSE) {
  378.             // Gets some sizes
  379.             $mergetable     = FALSE;
  380.             if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
  381.                 $mergetable = TRUE;
  382.             }
  383.             list($data_size, $data_unit)         = PMA_formatByteDown($showtable['Data_length']);
  384.             if ($mergetable == FALSE) {
  385.                 list($index_size, $index_unit)   = PMA_formatByteDown($showtable['Index_length']);
  386.             }
  387.             if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
  388.                 list($free_size, $free_unit)     = PMA_formatByteDown($showtable['Data_free']);
  389.                 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
  390.             } else {
  391.                 unset($free_size);
  392.                 unset($free_unit);
  393.                 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
  394.             }
  395.             list($tot_size, $tot_unit)           = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
  396.             if ($num_rows > 0) {
  397.                 list($avg_size, $avg_unit)       = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
  398.             }
  399.  
  400.             // Displays them
  401.             ?>
  402. <br /><br />
  403.  
  404. <table border="0" cellspacing="0" cellpadding="0">
  405. <tr>
  406.  
  407.     <!-- Space usage -->
  408.     <td class="print" valign="top">
  409.          <big><?php echo $strSpaceUsage . ':'; ?></big>
  410.         <table width="100%" bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
  411.         <tr>
  412.             <th><?php echo $strType; ?></th>
  413.             <th colspan="2" align="center"><?php echo $strUsage; ?></th>
  414.         </tr>
  415.         <tr>
  416.             <td class="print" style="padding-right: 10px"><?php echo $strData; ?></td>
  417.             <td align="right" class="print" nowrap="nowrap"><?php echo $data_size; ?></td>
  418.             <td class="print"><?php echo $data_unit; ?></td>
  419.         </tr>
  420.             <?php
  421.             if (isset($index_size)) {
  422.                 echo "\n";
  423.                 ?>
  424.         <tr>
  425.             <td class="print" style="padding-right: 10px"><?php echo $strIndex; ?></td>
  426.             <td align="right" class="print" nowrap="nowrap"><?php echo $index_size; ?></td>
  427.             <td class="print"><?php echo $index_unit; ?></td>
  428.         </tr>
  429.                 <?php
  430.             }
  431.             if (isset($free_size)) {
  432.                 echo "\n";
  433.                 ?>
  434.         <tr style="color: #bb0000">
  435.             <td class="print" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
  436.             <td align="right" class="print" nowrap="nowrap"><?php echo $free_size; ?></td>
  437.             <td class="print"><?php echo $free_unit; ?></td>
  438.         </tr>
  439.         <tr>
  440.             <td class="print" style="padding-right: 10px"><?php echo $strEffective; ?></td>
  441.             <td align="right" class="print" nowrap="nowrap"><?php echo $effect_size; ?></td>
  442.             <td class="print"><?php echo $effect_unit; ?></td>
  443.         </tr>
  444.                 <?php
  445.             }
  446.             if (isset($tot_size) && $mergetable == FALSE) {
  447.                 echo "\n";
  448.                 ?>
  449.         <tr>
  450.             <td class="print" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
  451.             <td align="right" class="print" nowrap="nowrap"><?php echo $tot_size; ?></td>
  452.             <td class="print"><?php echo $tot_unit; ?></td>
  453.         </tr>
  454.                 <?php
  455.             }
  456.             echo "\n";
  457.             ?>
  458.         </table>
  459.     </td>
  460.  
  461.     <td width="20" class="print"> </td>
  462.  
  463.     <!-- Rows Statistic -->
  464.     <td valign="top">
  465.          <big><?php echo $strRowsStatistic . ':'; ?></big>
  466.         <table width=100% bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
  467.         <tr>
  468.             <th><?php echo $strStatement; ?></th>
  469.             <th align="center"><?php echo $strValue; ?></th>
  470.         </tr>
  471.             <?php
  472.             $i = 0;
  473.             if (isset($showtable['Row_format'])) {
  474.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  475.                 echo "\n";
  476.                 ?>
  477.         <tr>
  478.             <td class="print"><?php echo ucfirst($strFormat); ?></td>
  479.             <td align="<?php echo $cell_align_left; ?>" class="print" nowrap="nowrap">
  480.                 <?php
  481.                 echo '                ';
  482.                 if ($showtable['Row_format'] == 'Fixed') {
  483.                     echo $strFixed;
  484.                 } else if ($showtable['Row_format'] == 'Dynamic') {
  485.                     echo $strDynamic;
  486.                 } else {
  487.                     echo $showtable['Row_format'];
  488.                 }
  489.                 echo "\n";
  490.                 ?>
  491.             </td>
  492.         </tr>
  493.                 <?php
  494.             }
  495.             if (isset($showtable['Rows'])) {
  496.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  497.                 echo "\n";
  498.             ?>
  499.         <tr>
  500.             <td class="print"><?php echo ucfirst($strRows); ?></td>
  501.             <td align="right" class="print" nowrap="nowrap">
  502.                 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
  503.             </td>
  504.         </tr>
  505.                 <?php
  506.             }
  507.             if (isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
  508.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  509.                 echo "\n";
  510.                 ?>
  511.         <tr>
  512.             <td class="print"><?php echo ucfirst($strRowLength); ?> ø</td>
  513.             <td class="print" nowrap="nowrap">
  514.                 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
  515.             </td>
  516.         </tr>
  517.                 <?php
  518.             }
  519.             if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
  520.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  521.                 echo "\n";
  522.                 ?>
  523.         <tr>
  524.             <td class="print"><?php echo ucfirst($strRowSize); ?> ø</td>
  525.             <td align="right" class="print" nowrap="nowrap">
  526.                 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
  527.             </td>
  528.         </tr>
  529.                 <?php
  530.             }
  531.             if (isset($showtable['Auto_increment'])) {
  532.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  533.                 echo "\n";
  534.                 ?>
  535.         <tr>
  536.             <td class="print"><?php echo ucfirst($strNext); ?> Autoindex</td>
  537.             <td align="right" class="print" nowrap="nowrap">
  538.                 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
  539.             </td>
  540.         </tr>
  541.                 <?php
  542.             }
  543.             echo "\n";
  544.  
  545.             if (isset($showtable['Create_time'])) {
  546.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  547.                 echo "\n";
  548.                 ?>
  549.         <tr>
  550.             <td class="print"><?php echo $strStatCreateTime; ?></td>
  551.             <td align="right" class="print" nowrap="nowrap">
  552.                 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
  553.             </td>
  554.         </tr>
  555.                 <?php
  556.             }
  557.             echo "\n";
  558.  
  559.             if (isset($showtable['Update_time'])) {
  560.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  561.                 echo "\n";
  562.                 ?>
  563.         <tr>
  564.             <td class="print"><?php echo $strStatUpdateTime; ?></td>
  565.             <td align="right" class="print" nowrap="nowrap">
  566.                 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
  567.             </td>
  568.         </tr>
  569.                 <?php
  570.             }
  571.             echo "\n";
  572.  
  573.             if (isset($showtable['Check_time'])) {
  574.                 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
  575.                 echo "\n";
  576.                 ?>
  577.         <tr>
  578.             <td class="print"><?php echo $strStatCheckTime; ?></td>
  579.             <td align="right" class="print" nowrap="nowrap">
  580.                 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
  581.             </td>
  582.         </tr>
  583.                 <?php
  584.             }
  585.             echo "\n";
  586.             ?>
  587.         </table>
  588.     </td>
  589. </tr>
  590. </table>
  591.  
  592.             <?php
  593.         } // end if ($nonisam == FALSE)
  594.     } // end if ($cfg['ShowStats'])
  595.  
  596.     echo "\n";
  597.     if ($multi_tables) {
  598.         unset($ret_keys);
  599.         unset($num_rows);
  600.         unset($show_comment);
  601.         echo '<hr />' . "\n";
  602.     } // end if
  603.     echo '</div>' . "\n";
  604.  
  605. } // end while
  606.  
  607.  
  608.  
  609. /**
  610.  * Displays the footer
  611.  */
  612. echo "\n";
  613. ?>
  614. <script type="text/javascript" language="javascript1.2">
  615. <!--
  616. function printPage()
  617. {
  618.     document.getElementById('print').style.visibility = 'hidden';
  619.     // Do print the page
  620.     if (typeof(window.print) != 'undefined') {
  621.         window.print();
  622.     }
  623.     document.getElementById('print').style.visibility = '';
  624. }
  625. //-->
  626. </script>
  627. <?php
  628. echo '<br /><br /> <input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
  629.  
  630. require_once('./footer.inc.php');
  631. ?>
  632.