home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / db_details_structure.php < prev    next >
Encoding:
PHP Script  |  2004-12-01  |  27.4 KB  |  615 lines

  1. <?php
  2. /* $Id: db_details_structure.php,v 2.42 2004/12/01 11:33:20 lem9 Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. require_once('./libraries/grab_globals.lib.php');
  6. require_once('./libraries/common.lib.php');
  7. require_once('./libraries/mysql_charsets.lib.php');
  8.  
  9. /**
  10.  * Prepares the tables list if the user where not redirected to this script
  11.  * because there is no table in the database ($is_info is TRUE)
  12.  */
  13. if (empty($is_info)) {
  14.     // Drops/deletes/etc. multiple tables if required
  15.     if ((!empty($submit_mult) && isset($selected_tbl))
  16.        || isset($mult_btn)) {
  17.         $action = 'db_details_structure.php';
  18.         $err_url = 'db_details_structure.php?'. PMA_generate_common_url($db);
  19.         require('./mult_submits.inc.php');
  20.         $message = $strSuccess;
  21.     }
  22.     require('./db_details_common.php');
  23.     $url_query .= '&goto=db_details_structure.php';
  24.  
  25.     // Gets the database structure
  26.     $sub_part = '_structure';
  27.     require('./db_details_db_info.php');
  28.     echo "\n";
  29. }
  30.  
  31. if (PMA_MYSQL_INT_VERSION >= 40101) {
  32.     $db_collation = PMA_getDbCollation($db);
  33. }
  34.  
  35.  
  36. // Display function
  37. function pma_TableHeader($alternate = FALSE) {
  38.     echo '            <table border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1">' . "\n"
  39.        . '            <tr>' . "\n"
  40.        . '                <td></td>' . "\n"
  41.        . '                <th>' . "\n"
  42.        . '                     ' . $GLOBALS['strTable'] . ' ' . "\n"
  43.        . '                </th>' . "\n"
  44.        . '                <th colspan="6">' . "\n"
  45.        . '                     ' . $GLOBALS['strAction'] . ' ' . "\n"
  46.        . '                </th>' . "\n"
  47.        . '                <th>' . "\n"
  48.        . '                     ' .  $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . ' ' . "\n"
  49.        . '                </th>' . "\n";
  50.     if (!$alternate) {
  51.         if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
  52.             echo '                <th>' . "\n"
  53.                . '                     ' . $GLOBALS['strType'] . ' ' . "\n"
  54.                . '                </th>' . "\n";
  55.             if (PMA_MYSQL_INT_VERSION >= 40100) {
  56.                 echo '                <th>' . "\n"
  57.                    . '                     ' . $GLOBALS['strCollation'] . ' ' . "\n"
  58.                    . '                </th>' . "\n";
  59.             }
  60.         }
  61.         if ($GLOBALS['cfg']['ShowStats']) {
  62.             echo '                <th>' . "\n"
  63.                . '                     ' . $GLOBALS['strSize'] . ' ' . "\n"
  64.                . '                </th>' . "\n"
  65.                . '                <th>' . "\n"
  66.                . '                     ' . $GLOBALS['strOverhead'] . ' ' . "\n"
  67.                . '                </th>' . "\n";
  68.         }
  69.         echo "\n";
  70.     }
  71.     echo '            </tr>' . "\n";
  72. }
  73.  
  74.  
  75. /**
  76.  * Settings for relations stuff
  77.  */
  78. require_once('./libraries/relation.lib.php');
  79. $cfgRelation = PMA_getRelationsParam();
  80.  
  81. /**
  82.  * Displays the tables list
  83.  */
  84. ?>
  85.  
  86. <!-- TABLE LIST -->
  87.  
  88. <?php
  89. $titles = array();
  90. if ($cfg['PropertiesIconic'] == true) {
  91.     // We need to copy the value or else the == 'both' check will always return true
  92.     $propicon = (string)$cfg['PropertiesIconic'];
  93.  
  94.     if ($propicon == 'both') {
  95.         $iconic_spacer = '<div class="nowrap">';
  96.     } else {
  97.         $iconic_spacer = '';
  98.     }
  99.  
  100.     $titles['Browse']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
  101.     $titles['Search']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
  102.     $titles['NoBrowse']   = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
  103.     $titles['NoSearch']   = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
  104.     $titles['Insert']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
  105.     $titles['Structure']  = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" border="0" />';
  106.     $titles['Drop']       = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
  107.     $titles['Empty']      = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
  108.     $titles['NoEmpty']    = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
  109.  
  110.     if ($propicon == 'both') {
  111.         $titles['Browse']     .= ' ' . $strBrowse . '</div>';
  112.         $titles['Search']     .= ' ' . $strSearch . '</div>';
  113.         $titles['NoBrowse']   .= ' ' . $strBrowse . '</div>';
  114.         $titles['NoSearch']   .= ' ' . $strSearch . '</div>';
  115.         $titles['Insert']     .= ' ' . $strInsert . '</div>';
  116.         $titles['Structure']  .= ' ' . $strStructure . '</div>';
  117.         $titles['Drop']       .= ' ' . $strDrop . '</div>';
  118.         $titles['Empty']      .= ' ' . $strEmpty . '</div>';
  119.         $titles['NoEmpty']    .= ' ' . $strEmpty . '</div>';
  120.     }
  121. } else {
  122.     $titles['Browse']     = $strBrowse;
  123.     $titles['Search']     = $strSearch;
  124.     $titles['NoBrowse']   = $strBrowse;
  125.     $titles['NoSearch']   = $strSearch;
  126.     $titles['Insert']     = $strInsert;
  127.     $titles['Structure']  = $strStructure;
  128.     $titles['Drop']       = $strDrop;
  129.     $titles['Empty']      = $strEmpty;
  130.     $titles['NoEmpty']    = $strEmpty;
  131. }
  132.  
  133. // 1. No tables
  134. if ($num_tables == 0) {
  135.     echo $strNoTablesFound . "\n";
  136. }
  137. // 2. Shows table informations - staybyte - 11 June 2001
  138. else {
  139.     // Get additional information about tables for tooltip is done in db_details_db_info.php only once
  140.     if ($cfgRelation['commwork']) {
  141.         $comment = PMA_getComments($db);
  142.  
  143.         /**
  144.          * Displays table comment
  145.          */
  146.         if (is_array($comment)) {
  147.             ?>
  148.         <!-- DB comment -->
  149.         <p id="dbComment"><i>
  150.             <?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
  151.         </i></p>
  152.             <?php
  153.         } // end if
  154.     }
  155.     ?>
  156. <form method="post" action="db_details_structure.php" name="tablesForm">
  157.     <?php echo PMA_generate_common_hidden_inputs($db); ?>
  158.  
  159. <?php
  160.     if ($cfg['PropertiesNumColumns'] > 1) {
  161. ?>
  162. <table cellspacing="0" cellpadding="0" border="0">
  163.     <tr>
  164.         <td valign="top">
  165. <?php
  166.     }
  167.  
  168.     pma_TableHeader();
  169.  
  170.     $i = $sum_entries = 0;
  171.     (double) $sum_size = 0;
  172.     (double) $overhead_size = 0;
  173.     $overhead_check = '';
  174.     $checked   = (!empty($checkall) ? ' checked="checked"' : '');
  175.     $num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
  176.     $row_count = 0;
  177.  
  178.     if ($cfg['NaturalOrder']) {
  179.         $tables_temp = $tables;
  180.         foreach (array_keys($tables_temp) as $each) {
  181.             $tables_sort[$each] = $tables_temp[$each]['Name'];
  182.         }
  183.         natsort($tables_sort);
  184.         $sort_i = 0;
  185.         foreach (array_keys($tables_sort) as $each) {
  186.             $tables_temp[$sort_i] = $tables[$each];
  187.             $sort_i++;
  188.         }
  189.         $tables = $tables_temp;
  190.     }
  191.  
  192.     foreach ($tables AS $keyname => $sts_data) {
  193.         $table         = $sts_data['Name'];
  194.         $table_encoded = urlencode($table);
  195.         $table_name    = htmlspecialchars($table);
  196.  
  197.         $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$table]))
  198.                    ? htmlspecialchars($tooltip_aliasname[$table])
  199.                    :  htmlspecialchars($sts_data['Name']);
  200.         $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$table]))
  201.                    ? htmlspecialchars($tooltip_truename[$table])
  202.                    : htmlspecialchars($sts_data['Name']);
  203.  
  204.         // Sets parameters for links
  205.         $tbl_url_query = $url_query . '&table=' . $table_encoded;
  206.         $bgcolor       = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
  207.         echo "\n";
  208.  
  209.         if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
  210.             $on_mouse = ' onmouseover="setPointer(this, ' . $i . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
  211.                       . ' onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
  212.         } else {
  213.            $on_mouse = '';
  214.         }
  215.         if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
  216.             $on_mouse .= ' onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
  217.         }
  218.  
  219.         $click_mouse = ' onmousedown="document.getElementById(\'checkbox_tbl_' . $i . '\').checked = (document.getElementById(\'checkbox_tbl_' . $i . '\').checked ? false : true);" ';
  220.  
  221.         $row_count++;
  222.         if ($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
  223.             $bgcolor       = $cfg['BgcolorTwo'];
  224.             $row_count = 1;
  225.         ?>
  226.             </tr>
  227.         </table>
  228.     </td>
  229.     <td><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="10" height="1" alt="" /></td>
  230.     <td valign="top">
  231.         <?php
  232.             pma_TableHeader();
  233.         }
  234.         ?>
  235.             <tr <?php echo $on_mouse; ?>>
  236.                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  237.                     <input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
  238.                 </td>
  239.                 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
  240.                      <b><label onclick="javascript: return (document.getElementById('checkbox_tbl_<?php echo $i; ?>') ? false : true)" for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label> </b> 
  241.                 </td>
  242.                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  243.         <?php
  244.         require_once('./libraries/bookmark.lib.php');
  245.         $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
  246.  
  247.         if (!empty($sts_data['Rows'])) {
  248.             echo '<a href="sql.php?' . $tbl_url_query . '&sql_query='
  249.                  . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
  250.                  . '&pos=0">' . $titles['Browse'] . '</a>';
  251.         } else {
  252.             echo $titles['NoBrowse'];
  253.         }
  254.         ?>
  255.                 </td>
  256.                 <td bgcolor="<?php echo $bgcolor; ?>">
  257.         <?php
  258.         if (!empty($sts_data['Rows'])) {
  259.             echo '<a href="tbl_select.php?' . $tbl_url_query . '">'
  260.                  . $titles['Search'] . '</a>';
  261.         } else {
  262.             echo $titles['NoSearch'];
  263.         }
  264.         ?>
  265.                 </td>
  266.                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  267.                     <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
  268.                         <?php echo $titles['Insert']; ?></a>
  269.                             </td>
  270.                             <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  271.                     <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>">
  272.                         <?php echo $titles['Structure']; ?></a>
  273.                             </td>
  274.                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  275.         <?php
  276.         if (!empty($sts_data['Rows'])) {
  277.             echo '<a href="sql.php?' . $tbl_url_query
  278.                  . '&sql_query=';
  279.             if (PMA_MYSQL_INT_VERSION >= 40000) {
  280.                 echo urlencode('TRUNCATE ' . PMA_backquote($table))
  281.                      . '&zero_rows='
  282.                      . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
  283.                      . '" onclick="return confirmLink(this, \'TRUNCATE ';
  284.             } else {
  285.                 echo urlencode('DELETE FROM ' . PMA_backquote($table))
  286.                      . '&zero_rows='
  287.                      . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
  288.                      . '" onclick="return confirmLink(this, \'DELETE FROM ';
  289.             }
  290.             echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
  291.         } else {
  292.              echo $titles['NoEmpty'];
  293.         }
  294.         ?>
  295.                 </td>
  296.                             <td align="center" bgcolor="<?php echo $bgcolor; ?>">
  297.                     <a href="sql.php?<?php echo $tbl_url_query; ?>&reload=1&purge=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
  298.                         onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
  299.                         <?php echo $titles['Drop']; ?></a>
  300.                 </td>
  301.         <?php
  302.         echo "\n";
  303.  
  304.         // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
  305.         //        statistics whatever is the table type
  306.         if (isset($sts_data['Rows'])) {
  307.             // MyISAM, ISAM or Heap table: Row count, data size and index size
  308.             // is accurate.
  309.             if (isset($sts_data['Type']) && preg_match('@^(MyISAM|ISAM|HEAP)$@', $sts_data['Type'])) {
  310.                 if ($cfg['ShowStats']) {
  311.                     $tblsize                    =  doubleval($sts_data['Data_length']) + doubleval($sts_data['Index_length']);
  312.                     $sum_size                   += $tblsize;
  313.                     list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
  314.                     if (isset($sts_data['Data_free']) && $sts_data['Data_free'] > 0) {
  315.                         list($formated_overhead, $overhead_unit)     = PMA_formatByteDown($sts_data['Data_free']);
  316.                         $overhead_size           += $sts_data['Data_free'];
  317.                     }
  318.                 }
  319.                 $sum_entries                    += $sts_data['Rows'];
  320.                 $display_rows                   =  number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
  321.             }
  322.  
  323.             // InnoDB table: Row count is not accurate but data and index
  324.             // sizes are.
  325.             else if (isset($sts_data['Type']) && $sts_data['Type'] == 'InnoDB') {
  326.                 if ($cfg['ShowStats']) {
  327.                     $tblsize                    =  $sts_data['Data_length'] + $sts_data['Index_length'];
  328.                     $sum_size                   += $tblsize;
  329.                     list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
  330.                 }
  331.                 //$display_rows                   =  ' - ';
  332.                 // get row count with another method
  333.                 if ($sts_data['Rows'] < $cfg['MaxExactCount']) {
  334.                     $local_query         = 'SELECT COUNT(*) AS count FROM '
  335.                                          . PMA_backquote($db) . '.'
  336.                                          . PMA_backquote($table);
  337.                     $table_info_result   = PMA_DBI_query($local_query);
  338.                     list($row_count)     = PMA_DBI_fetch_row($table_info_result);
  339.                     PMA_DBI_free_result($table_info_result);
  340.                     unset($table_info_result);
  341.                     $sum_entries         += $row_count;
  342.                 } else {
  343.                     $row_count           = $sts_data['Rows'];
  344.                     $sum_entries         += $sts_data['Rows'];
  345.                 }
  346.                 $display_rows        = number_format($row_count, 0, $number_decimal_separator, $number_thousands_separator);
  347.             }
  348.  
  349.             // Merge or BerkleyDB table: Only row count is accurate.
  350.             else if (isset($sts_data['Type']) && preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $sts_data['Type'])) {
  351.                 if ($cfg['ShowStats']) {
  352.                     $formated_size              =  ' - ';
  353.                     $unit                       =  '';
  354.                 }
  355.                 $sum_entries                    += $sts_data['Rows'];
  356.                 $display_rows                   =  number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
  357.             }
  358.  
  359.             // Unknown table type.
  360.             else {
  361.                 if ($cfg['ShowStats']) {
  362.                     $formated_size              =  'unknown';
  363.                     $unit                       =  '';
  364.                 }
  365.                 $display_rows                   =  'unknown';
  366.             }
  367.             ?>
  368.                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
  369.             <?php
  370.             echo "\n" . '        ' . $display_rows . "\n";
  371.             ?>
  372.                 </td>
  373.             <?php
  374.             if (!($cfg['PropertiesNumColumns'] > 1)) {
  375.                 echo '                <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
  376.                    . '                     ' . (isset($sts_data['Type']) ? $sts_data['Type'] : ' ') . ' ' . "\n"
  377.                    . '                </td>' . "\n";
  378.                 if (PMA_MYSQL_INT_VERSION >= 40100) {
  379.                     echo '                <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
  380.                        . '                     ' . (isset($sts_data['Collation']) ? '<dfn title="' . PMA_getCollationDescr($sts_data['Collation']) . '">' . $sts_data['Collation'] . '</dfn>' : '---') . ' ' . "\n"
  381.                        . '                </td>' . "\n";
  382.                 }
  383.             }
  384.  
  385.             if ($cfg['ShowStats']) {
  386.                 echo "\n";
  387.                 ?>
  388.                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
  389.                       
  390.                     <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
  391.                 </td>
  392.                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
  393.                       
  394.                     <?php
  395.                     if (isset($formated_overhead)) {
  396.                         echo '<a href="tbl_properties_structure.php?' . $tbl_url_query . '#showusage">' . $formated_overhead . ' ' . $overhead_unit . '</a>' . "\n";
  397.                         unset($formated_overhead);
  398.                         $overhead_check .= "document.getElementById('checkbox_tbl_$i').checked = true;";
  399.                     } else {
  400.                         echo " - \n";
  401.                     }
  402.                     ?>
  403.                 </td>
  404.                 <?php
  405.                 echo "\n";
  406.             } // end if
  407.         } else {
  408.             ?>
  409.                 <td colspan="4" align="center" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
  410.                     <?php echo $strInUse . "\n"; ?>
  411.                 </td>
  412.             <?php
  413.         }
  414.         echo "\n";
  415.         ?>
  416.             </tr>
  417.         <?php
  418.     }
  419.     // Show Summary
  420.     if ($cfg['ShowStats']) {
  421.         list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
  422.         list($overhead_formated, $overhead_unit) = PMA_formatByteDown($overhead_size, 3, 1);
  423.     }
  424.     echo "\n";
  425.     ?>
  426.             <tr>
  427.                 <td></td>
  428.                 <th align="center" nowrap="nowrap">
  429.                      <b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b> 
  430.                 </th>
  431.                 <th colspan="6" align="center">
  432.                     <b><?php echo $strSum; ?></b>
  433.                 </th>
  434.                 <th align="right" nowrap="nowrap">
  435.                     <b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
  436.                 </th>
  437.     <?php
  438.     if (!($cfg['PropertiesNumColumns'] > 1)) {
  439.         echo '                <th align="center">' . "\n"
  440.            . '                    <b>--</b>' . "\n"
  441.            . '                </th>' . "\n";
  442.         if (PMA_MYSQL_INT_VERSION >= 40101) {
  443.             echo '                <th align="center">' . "\n"
  444.                . '                     <b><dfn title="' . PMA_getCollationDescr($db_collation) . '">' . $db_collation . '</dfn></b> ' . "\n"
  445.                . '                </th>' . "\n";
  446.         }
  447.     }
  448.  
  449.     if ($cfg['ShowStats']) {
  450.         echo "\n";
  451.         ?>
  452.                 <th align="right" nowrap="nowrap">
  453.                      
  454.                     <b><?php echo $sum_formated . ' ' . $unit; ?></b>
  455.                 </th>
  456.                 <th align="right" nowrap="nowrap">
  457.                      
  458.                     <b><?php echo $overhead_formated . ' ' . $overhead_unit; ?></b>
  459.                 </th>
  460.         <?php
  461.     }
  462.     echo "\n";
  463.     ?>
  464.             </tr>
  465.  
  466.     <?php
  467.     // Check all tables url
  468.     $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
  469.     echo "\n";
  470.  
  471.     $basecolspan = 9;
  472.     if (!($cfg['PropertiesNumColumns'] > 1)) {
  473.         $basecolspan++;
  474.         if (PMA_MYSQL_INT_VERSION >= 40100) {
  475.             $basecolspan++;
  476.         }
  477.     }
  478.  
  479.     if ($cfg['ShowStats']) {
  480.         $basecolspan += 2;
  481.     }
  482.     ?>
  483.             <tr>
  484.                 <td colspan="<?php echo $basecolspan; ?>" valign="bottom">
  485.                     <img src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
  486.                     <a href="<?php echo $checkall_url; ?>&checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
  487.                         <?php echo $strCheckAll; ?></a>
  488.                      / 
  489.                     <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
  490.                         <?php echo $strUncheckAll; ?></a>
  491.                     <?php if ($overhead_check != '') { ?>
  492.                      / 
  493.                     <a href="#" onclick="setCheckboxes('tablesForm', false); <?php echo $overhead_check; ?> return false;">
  494.                         <?php echo $strCheckOverhead; ?></a>
  495.                     <?php } ?>
  496.                        
  497.                     <img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="38" height="1" alt="" />
  498.                     <select name="submit_mult" dir="ltr" onchange="this.form.submit();">
  499.     <?php
  500.     echo "\n";
  501.     echo '            <option value="' . $strWithChecked . '" selected="selected">'
  502.          . $strWithChecked . '</option>' . "\n";
  503.     echo '            <option value="' . $strDrop . '" >'
  504.          . $strDrop . '</option>' . "\n";
  505.     echo '            <option value="' . $strEmpty . '" >'
  506.          . $strEmpty . '</option>' . "\n";
  507.     echo '            <option value="' . $strPrintView . '" >'
  508.          . $strPrintView . '</option>' . "\n";
  509.     echo '            <option value="' . $strCheckTable . '" >'
  510.          . $strCheckTable . '</option>' . "\n";
  511.     echo '            <option value="' . $strOptimizeTable . '" >'
  512.          . $strOptimizeTable . '</option>' . "\n";
  513.     echo '            <option value="' . $strRepairTable . '" >'
  514.          . $strRepairTable . '</option>' . "\n";
  515.     echo '            <option value="' . $strAnalyzeTable . '" >'
  516.          . $strAnalyzeTable . '</option>' . "\n";
  517.     ?>
  518.                     </select>
  519.                     <script type="text/javascript" language="javascript">
  520.                     <!--
  521.                     // Fake js to allow the use of the <noscript> tag
  522.                     //-->
  523.                     </script>
  524.                     <noscript>
  525.                         <input type="submit" value="<?php echo $strGo; ?>" />
  526.                     </noscript>
  527.                 </td>
  528.             </tr>
  529.             </table>
  530. <?php
  531. if ($cfg['PropertiesNumColumns'] > 1) {
  532. ?>
  533.         </td>
  534.     </tr>
  535. </table>
  536. <?php
  537. }
  538. ?>
  539. </form>
  540.     <?php
  541. } // end if more than one table
  542.  
  543. echo "\n";
  544. ?>
  545. <hr />
  546.  
  547. <?php
  548. /**
  549.  * Work on the database
  550.     * redesigned 2004-05-08 by mkkeck
  551.  */
  552. ?>
  553. <!-- DATABASE WORK -->
  554.  
  555. <?php
  556. if ($num_tables > 0) {
  557.     ?>
  558.     <!-- Printable view of a table -->
  559. <table border="0" cellpadding="2" cellspacing="0">
  560.                 <tr><td nowrap="nowrap" colspan="3"><?php
  561.     echo '<a href="db_printview.php?' . $url_query . '">';
  562.     if ($cfg['PropertiesIconic']) {
  563.          echo '<img src="' . $pmaThemeImage . 'b_print.png" border="0" width="16" height="16" hspace="2" align="middle" />';
  564.      }
  565.       echo $strPrintView . '</a>';
  566.     ?>      
  567.      <?php
  568.       echo '<a href="./db_datadict.php?' . $url_query . '">';
  569.       if($cfg['PropertiesIconic']){
  570.           echo '<img src="' . $pmaThemeImage . 'b_tblanalyse.png" border="0" width="16" height="16" hspace="2" align="middle" />';
  571.       }
  572.       echo $strDataDict . '</a>';
  573. ?></td></tr>
  574. <tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr></table>
  575.     <?php
  576. } // end if
  577. ?>
  578. <table border="0" cellpadding="2" cellspacing="0">
  579.     <!-- Create a new table -->
  580.         <form method="post" action="tbl_create.php" onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', 1))">
  581.      <tr>
  582.      <td class="tblHeaders" colspan="3" nowrap="nowrap"><?php
  583.         echo PMA_generate_common_hidden_inputs($db);
  584.         if($cfg['PropertiesIconic']){ echo '<img src="' . $pmaThemeImage . 'b_newtbl.png" border="0" width="16" height="16" hspace="2" align="middle" />'; }
  585.         // if you want navigation:
  586.         $strDBLink = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url() . '&db=' . urlencode($GLOBALS['db']) . '">'
  587.                    . htmlspecialchars($GLOBALS['db']) . '</a>';
  588.         // else use
  589.         // $strDBLink = htmlspecialchars($db);
  590. echo '             ' . sprintf($strCreateNewTable, $strDBLink) . ': ' . "\n";
  591. echo '     </td></tr>';
  592. echo '     <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
  593. echo '             ' . $strName . ': ' . "\n";
  594. echo '     </td>';
  595. echo '     <td nowrap="nowrap">';
  596. echo '             ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
  597. echo '     </td><td> </td></tr>';
  598. echo '     <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
  599. echo '             ' . $strFields . ': ' . "\n";
  600. echo '     </td>';
  601. echo '     <td nowrap="nowrap">';
  602. echo '             ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
  603. echo '     </td>';
  604. echo '     <td align="right">';
  605. echo '             ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
  606. echo '     </td> </tr>';
  607. echo '        </form>';
  608.  
  609. /**
  610.  * Displays the footer
  611.  */
  612. echo "\n";
  613. require_once('./footer.inc.php');
  614. ?>
  615.