Documentation TYPO3 par Ameos

db_details_structure.php

00001 <?php
00002 /* $Id: db_details_structure.php,v 2.55 2005/07/22 15:25:53 lem9 Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00005 require_once('./libraries/grab_globals.lib.php');
00006 require_once('./libraries/common.lib.php');
00007 require_once('./libraries/mysql_charsets.lib.php');
00008 
00013 if (empty($is_info)) {
00014     // Drops/deletes/etc. multiple tables if required
00015     if ((!empty($submit_mult) && isset($selected_tbl))
00016        || isset($mult_btn)) {
00017         $action = 'db_details_structure.php';
00018         $err_url = 'db_details_structure.php?'. PMA_generate_common_url($db);
00019         require('./mult_submits.inc.php');
00020         $message = $strSuccess;
00021     }
00022     require('./db_details_common.php');
00023     $url_query .= '&amp;goto=db_details_structure.php';
00024 
00025     // Gets the database structure
00026     $sub_part = '_structure';
00027     require('./db_details_db_info.php');
00028     echo "\n";
00029 }
00030 
00031 if (PMA_MYSQL_INT_VERSION >= 40101) {
00032     $db_collation = PMA_getDbCollation($db);
00033 }
00034 
00035 
00036 // Display function
00037 function pma_TableHeader($alternate = FALSE, $record_count = TRUE) {
00038     $cnt = 0; // Let's count the columns...
00039     echo '            <table border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1">' . "\n"
00040        . '            <tr>' . "\n"
00041        . '                <td></td>' . "\n"
00042        . '                <th>' . "\n"
00043        . '                    &nbsp;' . $GLOBALS['strTable'] . '&nbsp;' . "\n"
00044        . '                </th>' . "\n"
00045        . '                <th colspan="6">' . "\n"
00046        . '                    &nbsp;' . $GLOBALS['strAction'] . '&nbsp;' . "\n"
00047        . '                </th>' . "\n";
00048     $cnt += 3;
00049     if ($record_count) {
00050         echo '                <th>' . "\n"
00051            . '                    &nbsp;' .  $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . '&nbsp;' . "\n"
00052            . '                </th>' . "\n";
00053         $cnt++;
00054     }
00055     if (!$alternate) {
00056         if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
00057             echo '                <th>' . "\n"
00058                . '                    &nbsp;' . $GLOBALS['strType'] . '&nbsp;' . "\n"
00059                . '                </th>' . "\n";
00060             $cnt++;
00061             if (PMA_MYSQL_INT_VERSION >= 40100) {
00062                 echo '                <th>' . "\n"
00063                    . '                    &nbsp;' . $GLOBALS['strCollation'] . '&nbsp;' . "\n"
00064                    . '                </th>' . "\n";
00065                 $cnt++;
00066             }
00067         }
00068         if ($GLOBALS['cfg']['ShowStats']) {
00069             echo '                <th>' . "\n"
00070                . '                    &nbsp;' . $GLOBALS['strSize'] . '&nbsp;' . "\n"
00071                . '                </th>' . "\n"
00072                . '                <th>' . "\n"
00073                . '                    &nbsp;' . $GLOBALS['strOverhead'] . '&nbsp;' . "\n"
00074                . '                </th>' . "\n";
00075             $cnt += 2;
00076         }
00077         echo "\n";
00078     }
00079     echo '            </tr>' . "\n";
00080     $GLOBALS['structure_tbl_col_cnt'] = $cnt;
00081 }
00082 
00083 
00087 ?>
00088 
00089 <!-- TABLE LIST -->
00090 
00091 <?php
00092 $titles = array();
00093 if ($cfg['PropertiesIconic'] == true) {
00094     // We need to copy the value or else the == 'both' check will always return true
00095     $propicon = (string)$cfg['PropertiesIconic'];
00096 
00097     if ($propicon == 'both') {
00098         $iconic_spacer = '<div class="nowrap">';
00099     } else {
00100         $iconic_spacer = '';
00101     }
00102 
00103     $titles['Browse']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
00104     $titles['NoBrowse']   = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
00105     $titles['Search']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
00106     $titles['NoSearch']   = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
00107     $titles['Insert']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
00108     $titles['NoInsert']   = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
00109     $titles['Structure']  = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" border="0" />';
00110     $titles['Drop']       = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
00111     $titles['NoDrop']     = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
00112     $titles['Empty']      = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
00113     $titles['NoEmpty']    = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
00114 
00115     if ($propicon == 'both') {
00116         $titles['Browse']     .= '&nbsp;' . $strBrowse . '</div>';
00117         $titles['Search']     .= '&nbsp;' . $strSearch . '</div>';
00118         $titles['NoBrowse']   .= '&nbsp;' . $strBrowse . '</div>';
00119         $titles['NoSearch']   .= '&nbsp;' . $strSearch . '</div>';
00120         $titles['Insert']     .= '&nbsp;' . $strInsert . '</div>';
00121         $titles['NoInsert']   .= '&nbsp;' . $strInsert . '</div>';
00122         $titles['Structure']  .= '&nbsp;' . $strStructure . '</div>';
00123         $titles['Drop']       .= '&nbsp;' . $strDrop . '</div>';
00124         $titles['NoDrop']     .= '&nbsp;' . $strDrop . '</div>';
00125         $titles['Empty']      .= '&nbsp;' . $strEmpty . '</div>';
00126         $titles['NoEmpty']    .= '&nbsp;' . $strEmpty . '</div>';
00127     }
00128 } else {
00129     $titles['Browse']     = $strBrowse;
00130     $titles['Search']     = $strSearch;
00131     $titles['NoBrowse']   = $strBrowse;
00132     $titles['NoSearch']   = $strSearch;
00133     $titles['Insert']     = $strInsert;
00134     $titles['NoInsert']   = $strInsert;
00135     $titles['Structure']  = $strStructure;
00136     $titles['Drop']       = $strDrop;
00137     $titles['NoDrop']     = $strDrop;
00138     $titles['Empty']      = $strEmpty;
00139     $titles['NoEmpty']    = $strEmpty;
00140 }
00141 
00142 // 1. No tables
00143 if ($num_tables == 0) {
00144     echo $strNoTablesFound . "\n";
00145 }
00146 // 2. Shows table informations - staybyte - 11 June 2001
00147 else {
00148     ?>
00149 <form method="post" action="db_details_structure.php" name="tablesForm">
00150     <?php echo PMA_generate_common_hidden_inputs($db); ?>
00151 
00152 <?php
00153     if ($cfg['PropertiesNumColumns'] > 1) {
00154 ?>
00155 <table cellspacing="0" cellpadding="0" border="0">
00156     <tr>
00157         <td valign="top">
00158 <?php
00159     }
00160 
00161     // rabus: disable statistics for information_schema.
00162     if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
00163         $cfg['ShowStats'] = FALSE;
00164         pma_TableHeader(FALSE, FALSE);
00165     } else {
00166         pma_TableHeader();
00167     }
00168 
00169     $i = $sum_entries = 0;
00170     (double) $sum_size = 0;
00171     (double) $overhead_size = 0;
00172     $overhead_check = '';
00173     $checked   = (!empty($checkall) ? ' checked="checked"' : '');
00174     $num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
00175     $row_count = 0;
00176 
00177     if ($cfg['NaturalOrder']) {
00178         $tables_temp = $tables;
00179         foreach (array_keys($tables_temp) as $each) {
00180             $tables_sort[$each] = $tables_temp[$each]['Name'];
00181         }
00182         natsort($tables_sort);
00183         $sort_i = 0;
00184         foreach (array_keys($tables_sort) as $each) {
00185             $tables_temp[$sort_i] = $tables[$each];
00186             $sort_i++;
00187         }
00188         $tables = $tables_temp;
00189     }
00190 
00191     foreach ($tables AS $keyname => $sts_data) {
00192         $table         = $sts_data['Name'];
00193         $table_encoded = urlencode($table);
00194         $table_name    = htmlspecialchars($table);
00195         $is_view       = (PMA_MYSQL_INT_VERSION >= 50000
00196                            && !isset($sts_data['Type'])
00197                            && $sts_data['Comment'] == 'view');
00198 
00199         $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$table]))
00200                    ? htmlspecialchars($tooltip_aliasname[$table])
00201                    :  htmlspecialchars($sts_data['Name']);
00202         $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$table]))
00203                    ? htmlspecialchars($tooltip_truename[$table])
00204                    : htmlspecialchars($sts_data['Name']);
00205 
00206         // Sets parameters for links
00207         $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
00208         $bgcolor       = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
00209         echo "\n";
00210 
00211         if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
00212             $on_mouse = ' onmouseover="setPointer(this, ' . $i . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
00213                       . ' onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
00214         } else {
00215            $on_mouse = '';
00216         }
00217         if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
00218             $on_mouse .= ' onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
00219         }
00220 
00221         $click_mouse = ' onmousedown="document.getElementById(\'checkbox_tbl_' . $i . '\').checked = (document.getElementById(\'checkbox_tbl_' . $i . '\').checked ? false : true);" ';
00222 
00223         $row_count++;
00224         if ($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
00225             $bgcolor       = $cfg['BgcolorTwo'];
00226             $row_count = 1;
00227         ?>
00228             </tr>
00229         </table>
00230     </td>
00231     <td><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="10" height="1" alt="" /></td>
00232     <td valign="top">
00233             <?php
00234             pma_TableHeader(FALSE, !(PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema'));
00235         }
00236         ?>
00237             <tr <?php echo $on_mouse; ?>>
00238                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00239                     <input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
00240         <?php
00241         if ($is_view) {
00242             ?>
00243                     <input type="hidden" name="views[]" value="<?php echo $table_encoded; ?>" />
00244             <?php
00245         }
00246         ?>
00247                 </td>
00248                 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
00249                     &nbsp;<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>&nbsp;</b>&nbsp;
00250                 </td>
00251                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00252         <?php
00253         require_once('./libraries/bookmark.lib.php');
00254         $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
00255 
00256         if (!empty($sts_data['Rows']) || $is_view || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
00257             echo '<a href="sql.php?' . $tbl_url_query . '&amp;sql_query='
00258                  . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
00259                  . '&amp;pos=0">' . $titles['Browse'] . '</a>';
00260         } else {
00261             echo $titles['NoBrowse'];
00262         }
00263         ?>
00264                 </td>
00265                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00266                     <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>">
00267                         <?php echo $titles['Structure']; ?></a>
00268                             </td>
00269                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00270         <?php
00271         if (!empty($sts_data['Rows']) || $is_view || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
00272             echo '<a href="tbl_select.php?' . $tbl_url_query . '">'
00273                  . $titles['Search'] . '</a>';
00274         } else {
00275             echo $titles['NoSearch'];
00276         }
00277         ?>
00278                 </td>
00279                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00280         <?php
00281         if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
00282             // rabus: We cannot insert into information_schema tables!
00283             echo $titles['NoInsert'];
00284         } else {
00285             ?>
00286                     <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
00287                         <?php echo $titles['Insert']; ?></a>
00288             <?php
00289         }
00290         ?>
00291                 </td>
00292                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00293         <?php
00294         if (!empty($sts_data['Rows'])) {
00295             echo '<a href="sql.php?' . $tbl_url_query
00296                  . '&amp;sql_query=';
00297             if (PMA_MYSQL_INT_VERSION >= 40000) {
00298                 echo urlencode('TRUNCATE ' . PMA_backquote($table))
00299                      . '&amp;zero_rows='
00300                      . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
00301                      . '" onclick="return confirmLink(this, \'TRUNCATE ';
00302             } else {
00303                 echo urlencode('DELETE FROM ' . PMA_backquote($table))
00304                      . '&amp;zero_rows='
00305                      . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
00306                      . '" onclick="return confirmLink(this, \'DELETE FROM ';
00307             }
00308             echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
00309         } else {
00310              echo $titles['NoEmpty'];
00311         }
00312 
00313         $drop_query = 'DROP '
00314                    . ($is_view ? 'VIEW' : 'TABLE')
00315                    . ' ' . PMA_backquote($table);
00316         $drop_message = sprintf(($is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped), htmlspecialchars($table));
00317         ?>
00318                 </td>
00319                 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
00320         <?php
00321         // rabus: We cannot drop information_schema tables!
00322         if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
00323             echo $titles['NoDrop'];
00324         } else {
00325             ?>
00326                     <a href="sql.php?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode($drop_query); ?>&amp;zero_rows=<?php echo urlencode($drop_message); ?>"
00327                         onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, FALSE); ?>')">
00328                         <?php echo $titles['Drop']; ?></a>
00329             <?php
00330         }
00331         ?>
00332                 </td>
00333         <?php
00334         unset($drop_query, $drop_message);
00335         echo "\n";
00336 
00337         // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
00338         //        statistics whatever is the table type
00339         if (isset($sts_data['Rows']) || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
00340             // MyISAM, ISAM or Heap table: Row count, data size and index size
00341             // is accurate.
00342             if (isset($sts_data['Type']) && preg_match('@^(MyISAM|ISAM|HEAP)$@', $sts_data['Type'])) {
00343                 if ($cfg['ShowStats']) {
00344                     $tblsize                    =  doubleval($sts_data['Data_length']) + doubleval($sts_data['Index_length']);
00345                     $sum_size                   += $tblsize;
00346                     list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
00347                     if (isset($sts_data['Data_free']) && $sts_data['Data_free'] > 0) {
00348                         list($formated_overhead, $overhead_unit)     = PMA_formatByteDown($sts_data['Data_free']);
00349                         $overhead_size           += $sts_data['Data_free'];
00350                     }
00351                 }
00352                 $sum_entries                    += $sts_data['Rows'];
00353                 $display_rows                   =  number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
00354             }
00355 
00356             // InnoDB table: Row count is not accurate but data and index
00357             // sizes are.
00358             else if (isset($sts_data['Type']) && $sts_data['Type'] == 'InnoDB') {
00359                 if ($cfg['ShowStats']) {
00360                     $tblsize                    =  $sts_data['Data_length'] + $sts_data['Index_length'];
00361                     $sum_size                   += $tblsize;
00362                     list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
00363                 }
00364                 //$display_rows                   =  '&nbsp;-&nbsp;';
00365                 // get row count with another method
00366                 if ($sts_data['Rows'] < $cfg['MaxExactCount']) {
00367                     $local_query         = 'SELECT COUNT(*) AS count FROM '
00368                                          . PMA_backquote($db) . '.'
00369                                          . PMA_backquote($table);
00370                     $table_info_result   = PMA_DBI_query($local_query);
00371                     list($row_count)     = PMA_DBI_fetch_row($table_info_result);
00372                     PMA_DBI_free_result($table_info_result);
00373                     unset($table_info_result);
00374                     $sum_entries         += $row_count;
00375                 } else {
00376                     $row_count           = $sts_data['Rows'];
00377                     $sum_entries         += $sts_data['Rows'];
00378                 }
00379                 $display_rows        = number_format($row_count, 0, $number_decimal_separator, $number_thousands_separator);
00380             }
00381 
00382             // Merge or BerkleyDB table: Only row count is accurate.
00383             else if (isset($sts_data['Type']) && preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $sts_data['Type'])) {
00384                 if ($cfg['ShowStats']) {
00385                     $formated_size              =  '&nbsp;-&nbsp;';
00386                     $unit                       =  '';
00387                 }
00388                 $sum_entries                    += $sts_data['Rows'];
00389                 $display_rows                   =  number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
00390             }
00391 
00392             // Unknown table type.
00393             else {
00394                 if ($cfg['ShowStats']) {
00395                     $formated_size              =  'unknown';
00396                     $unit                       =  '';
00397                 }
00398                 $display_rows                   =  'unknown';
00399             }
00400             // Don't display number of rows for information_schema tables.
00401             if (!(PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
00402                 ?>
00403                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
00404                 <?php
00405                 echo "\n" . '        ' . $display_rows . "\n";
00406                 ?>
00407                 </td>
00408                 <?php
00409             }
00410             if (!($cfg['PropertiesNumColumns'] > 1)) {
00411                 echo '                <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
00412                    . '                    &nbsp;' . (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;') . '&nbsp;' . "\n"
00413                    . '                </td>' . "\n";
00414                 if (PMA_MYSQL_INT_VERSION >= 40100) {
00415                     echo '                <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
00416                        . '                    &nbsp;' . (isset($sts_data['Collation']) ? '<dfn title="' . PMA_getCollationDescr($sts_data['Collation']) . '">' . $sts_data['Collation'] . '</dfn>' : '---') . '&nbsp;' . "\n"
00417                        . '                </td>' . "\n";
00418                 }
00419             }
00420 
00421             if ($cfg['ShowStats']) {
00422                 echo "\n";
00423                 ?>
00424                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
00425                     &nbsp;&nbsp;
00426                     <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
00427                 </td>
00428                 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
00429                     &nbsp;&nbsp;
00430                     <?php
00431                     if (isset($formated_overhead)) {
00432                         echo '<a href="tbl_properties_structure.php?' . $tbl_url_query . '#showusage">' . $formated_overhead . ' ' . $overhead_unit . '</a>' . "\n";
00433                         unset($formated_overhead);
00434                         $overhead_check .= "document.getElementById('checkbox_tbl_$i').checked = true;";
00435                     } else {
00436                         echo "&nbsp;-&nbsp;\n";
00437                     }
00438                     ?>
00439                 </td>
00440                 <?php
00441                 echo "\n";
00442             } // end if
00443         } else if (PMA_MYSQL_INT_VERSION >= 50000 && $sts_data['Comment'] == 'view') {
00444             // rabus: We've found a view
00445             ?>
00446                 <td align="right" bgcolor="<?php echo $bgcolor; ?>">
00447                     &nbsp;-&nbsp;
00448                 </td>
00449                 <td bgcolor="<?php echo $bgcolor; ?>">
00450                     &nbsp;<?php echo $strView ; ?>&nbsp;
00451                 </td>
00452                 <td bgcolor="<?php echo $bgcolor; ?>">
00453                     &nbsp;---&nbsp;
00454                 </td>
00455             <?php
00456                 if ($cfg['ShowStats']) {
00457                 ?>
00458                <td align="right" bgcolor="<?php echo $bgcolor; ?>">
00459                   &nbsp;-&nbsp;
00460                </td>
00461                <td align="right" bgcolor="<?php echo $bgcolor; ?>">
00462                   &nbsp;-&nbsp;
00463                </td>
00464                 <?php
00465             }
00466         } else {
00467             ?>
00468                 <td colspan="<?php echo ($structure_tbl_col_cnt - 8) ?>" align="center" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
00469                     <?php echo $strInUse . "\n"; ?>
00470                 </td>
00471             <?php
00472         }
00473         echo "\n";
00474         ?>
00475             </tr>
00476         <?php
00477     }
00478     // Show Summary
00479     if ($cfg['ShowStats']) {
00480         list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
00481         list($overhead_formated, $overhead_unit) = PMA_formatByteDown($overhead_size, 3, 1);
00482     }
00483     echo "\n";
00484     ?>
00485             <tr>
00486                 <td></td>
00487                 <th align="center" nowrap="nowrap">
00488                     &nbsp;<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>&nbsp;
00489                 </th>
00490     <?php
00491     if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
00492         ?>
00493                 <th colspan="6">&nbsp;</th>
00494         <?php
00495     } else {
00496         ?>
00497                 <th colspan="6" align="center">
00498                     <b><?php echo $strSum; ?></b>
00499                 </th>
00500                 <th align="right" nowrap="nowrap">
00501                     <b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
00502                 </th>
00503         <?php
00504     }
00505     if (!($cfg['PropertiesNumColumns'] > 1)) {
00506         echo '                <th align="center">' . "\n"
00507            . '                    <b>--</b>' . "\n"
00508            . '                </th>' . "\n";
00509         if (PMA_MYSQL_INT_VERSION >= 40101) {
00510             echo '                <th align="center">' . "\n"
00511                . '                    &nbsp;<b><dfn title="' . PMA_getCollationDescr($db_collation) . '">' . $db_collation . '</dfn></b>&nbsp;' . "\n"
00512                . '                </th>' . "\n";
00513         }
00514     }
00515 
00516     if ($cfg['ShowStats']) {
00517         echo "\n";
00518         ?>
00519                 <th align="right" nowrap="nowrap">
00520                     &nbsp;
00521                     <b><?php echo $sum_formated . ' ' . $unit; ?></b>
00522                 </th>
00523                 <th align="right" nowrap="nowrap">
00524                     &nbsp;
00525                     <b><?php echo $overhead_formated . ' ' . $overhead_unit; ?></b>
00526                 </th>
00527         <?php
00528     }
00529     echo "\n";
00530     ?>
00531             </tr>
00532 
00533     <?php
00534     // Check all tables url
00535     $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
00536     echo "\n";
00537 
00538     ?>
00539             <tr>
00540                 <td colspan="<?php echo $structure_tbl_col_cnt; ?>" valign="bottom">
00541                     <img src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
00542                     <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
00543                         <?php echo $strCheckAll; ?></a>
00544                     &nbsp;/&nbsp;
00545                     <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
00546                         <?php echo $strUncheckAll; ?></a>
00547                     <?php if ($overhead_check != '') { ?>
00548                     &nbsp;/&nbsp;
00549                     <a href="#" onclick="setCheckboxes('tablesForm', false); <?php echo $overhead_check; ?> return false;">
00550                         <?php echo $strCheckOverhead; ?></a>
00551                     <?php } ?>
00552                     &nbsp;&nbsp;&nbsp;
00553                     <img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="38" height="1" alt="" />
00554                     <select name="submit_mult" dir="ltr" onchange="this.form.submit();">
00555     <?php
00556     echo "\n";
00557     echo '            <option value="' . $strWithChecked . '" selected="selected">'
00558          . $strWithChecked . '</option>' . "\n";
00559     echo '            <option value="' . $strDrop . '" >'
00560          . $strDrop . '</option>' . "\n";
00561     echo '            <option value="' . $strEmpty . '" >'
00562          . $strEmpty . '</option>' . "\n";
00563     echo '            <option value="' . $strPrintView . '" >'
00564          . $strPrintView . '</option>' . "\n";
00565     echo '            <option value="' . $strCheckTable . '" >'
00566          . $strCheckTable . '</option>' . "\n";
00567     echo '            <option value="' . $strOptimizeTable . '" >'
00568          . $strOptimizeTable . '</option>' . "\n";
00569     echo '            <option value="' . $strRepairTable . '" >'
00570          . $strRepairTable . '</option>' . "\n";
00571     echo '            <option value="' . $strAnalyzeTable . '" >'
00572          . $strAnalyzeTable . '</option>' . "\n";
00573     ?>
00574                     </select>
00575                     <script type="text/javascript" language="javascript">
00576                     <!--
00577                     // Fake js to allow the use of the <noscript> tag
00578                     //-->
00579                     </script>
00580                     <noscript>
00581                         <input type="submit" value="<?php echo $strGo; ?>" />
00582                     </noscript>
00583                 </td>
00584             </tr>
00585             </table>
00586 <?php
00587 if ($cfg['PropertiesNumColumns'] > 1) {
00588 ?>
00589         </td>
00590     </tr>
00591 </table>
00592 <?php
00593 }
00594 ?>
00595 </form>
00596     <?php
00597 } // end if more than one table
00598 
00599 echo "\n";
00600 ?>
00601 <hr />
00602 
00603 <?php
00608 ?>
00609 <!-- DATABASE WORK -->
00610 
00611 <?php
00612 if ($num_tables > 0) {
00613     ?>
00614     <!-- Printable view of a table -->
00615 <table border="0" cellpadding="2" cellspacing="0">
00616                 <tr><td nowrap="nowrap" colspan="3"><?php
00617     echo '<a href="db_printview.php?' . $url_query . '">';
00618     if ($cfg['PropertiesIconic']) {
00619          echo '<img src="' . $pmaThemeImage . 'b_print.png" border="0" width="16" height="16" hspace="2" align="middle" />';
00620      }
00621       echo $strPrintView . '</a>';
00622     ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00623      <?php
00624       echo '<a href="./db_datadict.php?' . $url_query . '">';
00625       if($cfg['PropertiesIconic']){
00626           echo '<img src="' . $pmaThemeImage . 'b_tblanalyse.png" border="0" width="16" height="16" hspace="2" align="middle" />';
00627       }
00628       echo $strDataDict . '</a>';
00629 ?></td></tr>
00630 <tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr></table>
00631     <?php
00632 } // end if
00633 
00634 if (PMA_MYSQL_INT_VERSION < 50002 || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
00635 ?>
00636     <!-- Create a new table -->
00637 <form method="post" action="tbl_create.php" onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldCount']); ?>', 1))">
00638      <table border="0" cellpadding="2" cellspacing="0">
00639      <tr>
00640      <td class="tblHeaders" colspan="3" nowrap="nowrap"><?php
00641         echo PMA_generate_common_hidden_inputs($db);
00642         if($cfg['PropertiesIconic']){ echo '<img src="' . $pmaThemeImage . 'b_newtbl.png" border="0" width="16" height="16" hspace="2" align="middle" />'; }
00643         // if you want navigation:
00644         $strDBLink = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url() . '&amp;db=' . urlencode($GLOBALS['db']) . '">'
00645                    . htmlspecialchars($GLOBALS['db']) . '</a>';
00646         // else use
00647         // $strDBLink = htmlspecialchars($db);
00648     echo '             ' . sprintf($strCreateNewTable, $strDBLink) . ':&nbsp;' . "\n";
00649     echo '     </td></tr>';
00650     echo '     <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
00651     echo '             ' . $strName . ':&nbsp;' . "\n";
00652     echo '     </td>';
00653     echo '     <td nowrap="nowrap">';
00654     echo '             ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
00655     echo '     </td><td>&nbsp;</td></tr>';
00656     echo '     <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
00657     if (!isset($strNumberOfFields)) {
00658         $strNumberOfFields = $strFields;
00659     }
00660     echo '             ' . $strNumberOfFields . ':&nbsp;' . "\n";
00661     echo '     </td>';
00662     echo '     <td nowrap="nowrap">';
00663     echo '             ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
00664     echo '     </td>';
00665     echo '     <td align="right">';
00666     echo '             ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
00667     echo '     </td> </tr>';
00668     echo '     </table>';
00669     echo '</form>';
00670 } // end if (Create Table dialog)
00671 
00675 echo "\n";
00676 require_once('./footer.inc.php');
00677 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6