home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / tbl_printview.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  22.0 KB  |  637 lines

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