📄 server_databases.php
字号:
<?php/* $Id: server_databases.php 9422 2006-09-20 11:15:56Z cybot_tm $ */// vim: expandtab sw=4 ts=4 sts=4:/** * Does the common work */require_once './libraries/common.lib.php';$js_to_run = 'functions.js';require './libraries/server_common.inc.php';/** * avoids 'undefined index' errors */if (empty($_REQUEST['sort_by'])) { $sort_by = 'SCHEMA_NAME';} else { $sort_by = PMA_sanitize($_REQUEST['sort_by']);}if (isset($_REQUEST['sort_order']) && strtolower($_REQUEST['sort_order']) == 'desc') { $sort_order = 'desc';} else { $sort_order = 'asc';}$dbstats = empty($_REQUEST['dbstats']) ? 0 : 1;$pos = empty($_REQUEST['pos']) ? 0 : (int) $_REQUEST['pos'];/** * Drops multiple databases */// workaround for IE behavior (it returns some coordinates based on where// the mouse was on the Drop image):if (isset($_REQUEST['drop_selected_dbs_x'])) { $_REQUEST['drop_selected_dbs'] = true;}if ((isset($_REQUEST['drop_selected_dbs']) || isset($_REQUEST['query_type'])) && ($is_superuser || $cfg['AllowUserDropDatabase'])) { if (! isset($_REQUEST['selected_dbs']) && ! isset($_REQUEST['query_type'])) { $message = $strNoDatabasesSelected; } else { $action = 'server_databases.php'; $submit_mult = 'drop_db' ; $err_url = 'server_databases.php?' . PMA_generate_common_url(); if (isset($_REQUEST['selected_dbs'])) { $selected_db = $_REQUEST['selected_dbs']; } require './libraries/mult_submits.inc.php'; unset($action, $submit_mult, $err_url, $selected_db); if ($mult_btn == $strYes) { $message = sprintf($strDatabasesDropped, count($selected)); } else { $message = sprintf($strDatabasesDropped, 0); } }}/** * Displays the links */require './libraries/server_links.inc.php';/** * Displays the sub-page heading */echo '<h2>' . "\n" . ( $GLOBALS['cfg']['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_db.png" width="16"' .' height="16" alt="" />' : '' ) . ( $dbstats ? $strDatabasesStats : $strDatabases ) . "\n" .'</h2>' . "\n";/** * Gets the databases list */if ($server > 0) { $databases = PMA_DBI_get_databases_full(null, $dbstats, null, $sort_by, $sort_order, $pos, true); $databases_count = $PMA_List_Database->count();} else { $databases_count = 0;}/** * Displays the page */if ($databases_count > 0) { reset($databases); $first_database = current($databases); // table col order // there is no db specific collation or charset prior 4.1.0 if (PMA_MYSQL_INT_VERSION >= 40100) { $column_order['DEFAULT_COLLATION_NAME'] = array( 'disp_name' => $strCollation, 'description_function' => 'PMA_getCollationDescr', 'format' => 'string', 'footer' => PMA_getServerCollation(), ); } $column_order['SCHEMA_TABLES'] = array( 'disp_name' => $strNumTables, 'format' => 'number', 'footer' => 0, ); $column_order['SCHEMA_TABLE_ROWS'] = array( 'disp_name' => $strRows, 'format' => 'number', 'footer' => 0, ); $column_order['SCHEMA_DATA_LENGTH'] = array( 'disp_name' => $strData, 'format' => 'byte', 'footer' => 0, ); $column_order['SCHEMA_INDEX_LENGTH'] = array( 'disp_name' => $strIndexes, 'format' => 'byte', 'footer' => 0, ); $column_order['SCHEMA_LENGTH'] = array( 'disp_name' => $strTotalUC, 'format' => 'byte', 'footer' => 0, ); $column_order['SCHEMA_DATA_FREE'] = array( 'disp_name' => $strOverhead, 'format' => 'byte', 'footer' => 0, ); $_url_params = array( 'pos' => $pos, 'dbstats' => $dbstats, 'sort_by' => $sort_by, 'sort_order' => $sort_order, ); if ($GLOBALS['cfg']['MaxDbList'] && $GLOBALS['cfg']['MaxDbList'] < $databases_count) { // Move to the beginning or to the previous page if ($pos > 0) { // loic1: patch #474210 from Gosha Sakovich - part 1 if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption1 = '<<'; $caption2 = ' < '; $title1 = ' title="' . $GLOBALS['strPos1'] . '"'; $title2 = ' title="' . $GLOBALS['strPrevious'] . '"'; } else { $caption1 = $GLOBALS['strPos1'] . ' <<'; $caption2 = $GLOBALS['strPrevious'] . ' <'; $title1 = ''; $title2 = ''; } // end if... else... $_url_params['pos'] = 0; echo '<a' . $title1 . 'href="server_databases.php' . PMA_generate_common_url($_url_params) . '">' . $caption1 . '</a>'; $_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxDbList']; echo '<a' . $title2 . 'href="server_databases.php' . PMA_generate_common_url($_url_params) . '">' . $caption2 . '</a>'; } echo '<form action="./server_databases.php" method="post">' . "\n"; echo PMA_generate_common_hidden_inputs($_url_params); echo PMA_pageselector( 'server_databases.php' . PMA_generate_common_url($_url_params) . '&', $GLOBALS['cfg']['MaxDbList'], floor(($pos + 1) / $GLOBALS['cfg']['MaxDbList']) + 1, ceil($databases_count / $GLOBALS['cfg']['MaxDbList'])); echo '</form>'; if ($pos + $GLOBALS['cfg']['MaxDbList'] < $databases_count) { if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption3 = ' > '; $caption4 = '>>'; $title3 = ' title="' . $GLOBALS['strNext'] . '"'; $title4 = ' title="' . $GLOBALS['strEnd'] . '"'; } else { $caption3 = '> ' . $GLOBALS['strNext']; $caption4 = '>> ' . $GLOBALS['strEnd']; $title3 = ''; $title4 = '';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -