db_operations.php

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

PHP
674
字号
        <?php echo PMA_getIcon('b_comment.png', $strDBComment, false, true); ?>        </legend>        <input type="text" name="comment" class="textfield" size="30"            value="<?php            echo htmlspecialchars(PMA_getDBComment($db)); ?>" />        <input type="submit" value="<?php echo $strGo; ?>" />    </fieldset>    </form>        <?php    }    /**     * rename database     */    ?>    <form method="post" action="db_operations.php"        onsubmit="return emptyFormElements(this, 'newname')">        <?php    if (isset($db_collation)) {        echo '<input type="hidden" name="db_collation" value="' . $db_collation            .'" />' . "\n";    }        ?>    <input type="hidden" name="what" value="data" />    <input type="hidden" name="db_rename" value="true" />    <?php echo PMA_generate_common_hidden_inputs($db); ?>    <fieldset>        <legend>    <?php    if ($cfg['PropertiesIconic']) {        echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'            .' alt="" width="16" height="16" />';    }    echo $strDBRename . ':';    ?>        </legend>        <input type="text" name="newname" size="30" class="textfield" value="" />        <?php    echo '(' . $strCommand . ': ';    /**     * @todo (see explanations above in a previous todo)     */    //if (PMA_MYSQL_INT_VERSION >= XYYZZ) {    //    echo 'RENAME DATABASE';    //} else {        echo 'INSERT INTO ... SELECT';    //}    echo ')'; ?>        <input type="submit" value="<?php echo $strGo; ?>" onclick="return confirmLink(this, 'CREATE DATABASE ... <?php echo $strAndThen; ?> DROP DATABASE <?php echo PMA_jsFormat($db); ?>')" />    </fieldset>    </form>    <?php    /**     * Copy database     */    ?>    <form method="post" action="db_operations.php"        onsubmit="return emptyFormElements(this, 'newname')">    <?php    if (isset($db_collation)) {        echo '<input type="hidden" name="db_collation" value="' . $db_collation            .'" />' . "\n";    }    echo '<input type="hidden" name="db_copy" value="true" />' . "\n";    echo PMA_generate_common_hidden_inputs($db);    ?>    <fieldset>        <legend>    <?php    if ($cfg['PropertiesIconic']) {        echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'            .' alt="" width="16" height="16" />';    }    echo $strDBCopy . ':';    $drop_clause = 'DROP TABLE / DROP VIEW';    ?>        </legend>        <input type="text" name="newname" size="30" class="textfield" value="" /><br /><?php        $choices = array(            'structure' => $strStrucOnly,            'data'      => $strStrucData,             'dataonly'  => $strDataOnly);        PMA_generate_html_radio('what', $choices, 'data', true);        unset($choices);?>        <input type="checkbox" name="create_database_before_copying" value="1"            id="checkbox_create_database_before_copying"            style="vertical-align: middle" checked="checked" />        <label for="checkbox_create_database_before_copying">            <?php echo $strCreateDatabaseBeforeCopying; ?></label><br />        <input type="checkbox" name="drop_if_exists" value="true"            id="checkbox_drop" style="vertical-align: middle" />        <label for="checkbox_drop"><?php echo sprintf($strAddClause, $drop_clause); ?></label><br />        <input type="checkbox" name="sql_auto_increment" value="1" checked="checked"            id="checkbox_auto_increment" style="vertical-align: middle" />        <label for="checkbox_auto_increment">            <?php echo $strAddAutoIncrement; ?></label><br />        <input type="checkbox" name="add_constraints" value="1"            id="checkbox_constraints" style="vertical-align: middle" />        <label for="checkbox_constraints">            <?php echo $strAddConstraints; ?></label><br />    <?php    unset($drop_clause);    if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new'])      && $_COOKIE['pma_switch_to_new'] == 'true') {        $pma_switch_to_new = 'true';    }    ?>        <input type="checkbox" name="switch_to_new" value="true"            id="checkbox_switch"            <?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? ' checked="checked"' : ''); ?>            style="vertical-align: middle" />        <label for="checkbox_switch"><?php echo $strSwitchToDatabase; ?></label>    </fieldset>    <fieldset class="tblFooters">        <input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" />    </fieldset>    </form>    <?php    /*     * BLOB streaming support    */    // load PMA_Config    $PMA_Config = $_SESSION['PMA_Config'];    // if all blobstreaming plugins exist, begin checking for blobstreaming tables    if (!empty($PMA_Config))    {        if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))        {            if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))            {                $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');                $bs_tables = $bs_tables[$db];                $oneBSTableExists = FALSE;                $allBSTablesExist = TRUE;                // first check that all blobstreaming tables do not exist                foreach ($bs_tables as $table_key=>$tbl)                    if ($bs_tables[$table_key]['Exists'])                        $oneBSTableExists = TRUE;                    else                        $allBSTablesExist = FALSE;                ?>                    <form method="post" action="./db_operations.php">                    <?php echo PMA_generate_common_hidden_inputs($db); ?>                    <fieldset>                    <legend>                    <?php echo PMA_getIcon('b_edit.png', $strBLOBRepository, false, true); ?>                    </legend>                    <?php echo $strBLOBRepositoryStatus; ?>:                    <?php                    // if the blobstreaming tables exist, provide option to disable the BLOB repository                    if ($allBSTablesExist)                    {                        ?>                            <?php echo $strBLOBRepositoryEnabled; ?>                            </fieldset>                            <fieldset class="tblFooters">                            <input type="hidden" name="db_blob_streaming_op" value="disable" />                            <input type="submit" onclick="return confirmDisableRepository('<?php echo $db; ?>');" value="<?php echo $strBLOBRepositoryDisable; ?>" />                            </fieldset>                            <?php                    }                    else                    {                        // if any of the blobstreaming tables are missing, provide option to repair the BLOB repository                        if ($oneBSTableExists && !$allBSTablesExist)                        {                            ?>                                <?php echo $strBLOBRepositoryDamaged; ?>                                </fieldset>                                <fieldset class="tblFooters">                                <input type="hidden" name="db_blob_streaming_op" value="repair" />                                <input type="submit" value="<?php echo $strBLOBRepositoryRepair; ?>" />                                </fieldset>                                <?php                        }                        // if none of the blobstreaming tables exist, provide option to enable BLOB repository                        else                        {                            ?>                                <?php echo $strBLOBRepositoryDisabled; ?>                                </fieldset>                                <fieldset class="tblFooters">                                <input type="hidden" name="db_blob_streaming_op" value="enable" />                                <input type="submit" value="<?php echo $strBLOBRepositoryEnable; ?>" />                                </fieldset>                                <?php                        }                    }   // end if ($allBSTablesExist)                ?>                    </form>                <?php            }   // end  if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))        }   // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))    }    /**     * Change database charset     */    echo '<form method="post" action="./db_operations.php">' . "\n"       . PMA_generate_common_hidden_inputs($db, $table)       . '<fieldset>' . "\n"       . '    <legend>';    if ($cfg['PropertiesIconic']) {        echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'            .' alt="" width="16" height="16" />';    }    echo '    <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"       . '    </legend>' . "\n"       . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,            'db_collation', 'select_db_collation', $db_collation, false, 3)       . '    <input type="submit" name="submitcollation"'       . ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"       . '</fieldset>' . "\n"       . '</form>' . "\n";    if ($num_tables > 0      && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {        $message = PMA_Message::notice('strRelationNotWorking');        $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);        $message->addParam('</a>', false);        /* Show error if user has configured something, notice elsewhere */        if (!empty($cfg['Servers'][$server]['pmadb'])) {            $message->isError(true);        }        $message->display();    } // end if} // end if (!$is_information_schema)// not sure about displaying the PDF dialog in case db is information_schemaif ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>    <!-- Work on PDF Pages -->    <?php    // We only show this if we find something in the new pdf_pages table    $test_query = '         SELECT *           FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '          WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';    $test_rs    = PMA_query_as_cu($test_query, null, PMA_DBI_QUERY_STORE);    if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>    <!-- PDF schema -->    <form method="post" action="pdf_schema.php">    <fieldset>        <legend>        <?php        echo PMA_generate_common_hidden_inputs($db);        if ($cfg['PropertiesIconic']) {            echo '<img class="icon" src="' . $pmaThemeImage . 'b_view.png"'                .' alt="" width="16" height="16" />';        }        echo $strDisplayPDF;        ?>:        </legend>        <label for="pdf_page_number_opt"><?php echo $strPageNumber; ?></label>        <select name="pdf_page_number" id="pdf_page_number_opt">        <?php        while ($pages = @PMA_DBI_fetch_assoc($test_rs)) {            echo '                <option value="' . $pages['page_nr'] . '">'                . $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>' . "\n";        } // end while        PMA_DBI_free_result($test_rs);        unset($test_rs);        ?>        </select><br />        <input type="checkbox" name="show_grid" id="show_grid_opt" />        <label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />        <input type="checkbox" name="show_color" id="show_color_opt"            checked="checked" />        <label for="show_color_opt"><?php echo $strShowColor; ?></label><br />        <input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />        <label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?>            </label><br />        <input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" />        <label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?>            </label><br />        <input type="checkbox" name="with_doc" id="with_doc" checked="checked" />        <label for="with_doc"><?php echo $strDataDict; ?></label><br />		<input type="checkbox" name="show_keys" id="show_keys" />        <label for="show_keys"><?php echo $strShowKeys; ?></label><br />        <label for="orientation_opt"><?php echo $strShowDatadictAs; ?></label>        <select name="orientation" id="orientation_opt">            <option value="L"><?php echo $strLandscape;?></option>            <option value="P"><?php echo $strPortrait;?></option>        </select><br />        <label for="paper_opt"><?php echo $strPaperSize; ?></label>        <select name="paper" id="paper_opt">        <?php            foreach ($cfg['PDFPageSizes'] AS $key => $val) {                echo '<option value="' . $val . '"';                if ($val == $cfg['PDFDefaultPageSize']) {                    echo ' selected="selected"';                }                echo ' >' . $val . '</option>' . "\n";            }        ?>        </select>    </fieldset>    <fieldset class="tblFooters">        <input type="submit" value="<?php echo $strGo; ?>" />    </fieldset>    </form>        <?php    }   // end if    echo '<br /><a href="pdf_pages.php?' . $url_query . '">';    if ($cfg['PropertiesIconic']) {        echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'            .' alt="" width="16" height="16" />';    }    echo $strEditPDFPages . '</a>';} // end if/** * Displays the footer */require_once './libraries/footer.inc.php';?>

⌨️ 快捷键说明

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