db_structure.php

来自「phpMyAdmin图形界面化操作,我已经配置好了,只要把解要压缩后的文件放到站」· PHP 代码 · 共 585 行 · 第 1/2 页

PHP
585
字号
            $overhead = '<a href="tbl_structure.php?'                . $tbl_url_query . '#showusage">' . $formatted_overhead                . ' ' . $overhead_unit . '</a>' . "\n";            unset($formatted_overhead);            $overhead_check .=                "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;";        } else {            $overhead = '-';        }    } // end if    $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))               ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))               : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));    $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))               ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))               : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));    $i++;    $row_count++;    if ($table_is_view) {        $hidden_fields[] = '<input type="hidden" name="views[]" value="' .  $each_table['TABLE_NAME'] . '" />';    }    if ($each_table['TABLE_ROWS'] > 0) {        $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';        $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';    } else {        $browse_table = $titles['NoBrowse'];        $search_table = $titles['NoSearch'];    }    if (! $db_is_information_schema) {        if (! empty($each_table['TABLE_ROWS'])) {            $empty_table = '<a href="sql.php?' . $tbl_url_query                 . '&amp;sql_query=';            $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))                 . '&amp;zero_rows='                 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))                 . '" onclick="return confirmLink(this, \'TRUNCATE ';            $empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';        } else {            $empty_table = $titles['NoEmpty'];        }        $drop_query = 'DROP '            . ($table_is_view ? 'VIEW' : 'TABLE')            . ' ' . PMA_backquote($each_table['TABLE_NAME']);        $drop_message = sprintf(            $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,            str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));    }    if ($num_columns > 0 && $num_tables > $num_columns      && (($row_count % $num_columns) == 0)) {        $row_count = 1;        $odd_row = true;        ?>    </tr></tbody></table>        <?php        PMA_TableHeader();    }    ?><tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">    <td align="center">        <input type="checkbox" name="selected_tbl[]"            value="<?php echo $each_table['TABLE_NAME']; ?>"            id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>    <th><label for="checkbox_tbl_<?php echo $i; ?>"            title="<?php echo $alias; ?>"><?php echo $truename; ?></label>    </th>    <td align="center"><?php echo $browse_table; ?></td>    <td align="center">        <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">            <?php echo $titles['Structure']; ?></a></td>    <td align="center"><?php echo $search_table; ?></td>    <?php if (! $db_is_information_schema) { ?>    <td align="center">        <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">            <?php echo $titles['Insert']; ?></a></td>    <td align="center"><?php echo $empty_table; ?></td>    <td align="center">        <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); ?>"            onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">            <?php echo $titles['Drop']; ?></a></td>    <?php } // end if (! $db_is_information_schema)    // there is a null value in the ENGINE    // - when the table needs to be repaired, or    // - when it's a view    //  so ensure that we'll display "in use" below for a table    //  that needs to be repaired    if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {        if ($table_is_view) {            $row_count_pre = '~';            $sum_row_count_pre = '~';            $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));        } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {            // InnoDB table: we did not get an accurate row count            $row_count_pre = '~';            $sum_row_count_pre = '~';            $show_superscript = '';        } else {            $row_count_pre = '';            $show_superscript = '';        }    ?>    <td class="value"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>        <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>    <td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>            <?php if (isset($collation)) { ?>    <td nowrap="nowrap"><?php echo $collation ?></td>            <?php } ?>        <?php } ?>        <?php if ($is_show_stats) { ?>    <td class="value"><a        href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"        ><?php echo $formatted_size . ' ' . $unit; ?></a></td>    <td class="value"><?php echo $overhead; ?></td>        <?php } // end if ?>    <?php } elseif ($table_is_view) { ?>    <td class="value">-</td>    <td><?php echo $strView; ?></td>    <td>---</td>        <?php if ($is_show_stats) { ?>    <td class="value">-</td>    <td class="value">-</td>        <?php } ?>    <?php } else { ?>    <td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"        align="center">        <?php echo $strInUse; ?></td>    <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?></tr>    <?php} // end foreach// Show Summaryif ($is_show_stats) {    list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);    list($overhead_formatted, $overhead_unit) =        PMA_formatByteDown($overhead_size, 3, 1);}?></tbody><tbody><tr><td></td>    <th align="center" nowrap="nowrap">        <?php            // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0            // (we don't want negative numbers here) - rajk            if ($num_tables == 0)                $tableReductionCount = 0;            echo sprintf($strTables, PMA_formatNumber($num_tables - $tableReductionCount, 0));        ?>    </th>    <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">        <?php echo $strSum; ?></th>    <th class="value"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th><?phpif (!($cfg['PropertiesNumColumns'] > 1)) {    $default_engine = PMA_DBI_get_default_engine();    echo '    <th align="center">' . "\n"       . '        <dfn title="'       . sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";    // we got a case where $db_collation was empty    echo '    <th align="center">' . "\n";    if (! empty($db_collation)) {        echo '        <dfn title="'            . PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation            . '</dfn>';    }    echo '</th>';}if ($is_show_stats) {    ?>    <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>    <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>    <?php}?></tr></tbody></table><div class="clearfloat"><?php// Check all tables url$checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);?><img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"    width="38" height="22" alt="<?php echo $strWithChecked; ?>" /><a href="<?php echo $checkall_url; ?>&amp;checkall=1"    onclick="if (markAllRows('tablesForm')) return false;">    <?php echo $strCheckAll; ?></a>/<a href="<?php echo $checkall_url; ?>"    onclick="if (unMarkAllRows('tablesForm')) return false;">    <?php echo $strUncheckAll; ?></a><?php if ($overhead_check != '') { ?>/<a href="#" onclick="unMarkAllRows('tablesForm');    <?php echo $overhead_check; ?> return false;">    <?php echo $strCheckOverhead; ?></a><?php } ?><select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;"><?phpecho '    <option value="' . $strWithChecked . '" selected="selected">'     . $strWithChecked . '</option>' . "\n";echo '    <option value="' . $strEmpty . '" >'     . $strEmpty . '</option>' . "\n";echo '    <option value="' . $strDrop . '" >'     . $strDrop . '</option>' . "\n";echo '    <option value="' . $strPrintView . '" >'     . $strPrintView . '</option>' . "\n";echo '    <option value="' . $strCheckTable . '" >'     . $strCheckTable . '</option>' . "\n";echo '    <option value="' . $strOptimizeTable . '" >'     . $strOptimizeTable . '</option>' . "\n";echo '    <option value="' . $strRepairTable . '" >'     . $strRepairTable . '</option>' . "\n";echo '    <option value="' . $strAnalyzeTable . '" >'     . $strAnalyzeTable . '</option>' . "\n";?></select><script type="text/javascript"><!--// Fake js to allow the use of the <noscript> tag//--></script><noscript>    <input type="submit" value="<?php echo $strGo; ?>" /></noscript><?php echo implode("\n", $hidden_fields) . "\n"; ?></div></form><?php// display again the table list navigatorPMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);?><hr /><?php// Routinesrequire './libraries/db_routines.inc.php';// Eventsif (PMA_MYSQL_INT_VERSION > 50100) {    require './libraries/db_events.inc.php';}/** * Work on the database * redesigned 2004-05-08 by mkkeck *//* DATABASE WORK *//* Printable view of a table */echo '<p>';echo '<a href="db_printview.php?' . $url_query . '">';if ($cfg['PropertiesIconic']) {     echo '<img class="icon" src="' . $pmaThemeImage        .'b_print.png" width="16" height="16" alt="" />';}echo $strPrintView . '</a> ';echo '<a href="./db_datadict.php?' . $url_query . '">';if ($cfg['PropertiesIconic']) {    echo '<img class="icon" src="' . $pmaThemeImage        .'b_tblanalyse.png" width="16" height="16" alt="" />';}echo $strDataDict . '</a>';echo '</p>';if (empty($db_is_information_schema)) {    require './libraries/display_create_table.lib.php';} // end if (Create Table dialog)/** * Displays the footer */require_once './libraries/footer.inc.php';?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?