diff --git a/ChangeLog b/ChangeLog index f9e9074f9..7b394de1a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,9 +5,19 @@ phpMyAdmin - Changelog $Id$ $Source$ -2005-11-04 Sebastian Mendel +2005-11-05 Sebastian Mendel * themes/*/css/theme_right.css.php: dropped deprecated style classes + * server_databases, libraries/databases_interface.lib.php, + libraries/mysql_charsets.lib.php: + updated database list: + - added PMA_getServerCollation() + - display server collation in db list footer + - added PMA_DBI_get_databases_full() + - make use of info_schema on MySQL 5 + - always display db stats for MySQL 5 + - fixed html output + - replaced " with ' in some queries 2005-11-04 Marc Delisle * lang/spanish: Updated, thanks to Daniel Hinostroza (hinostroza) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index d26f8d19a..b1b4c0827 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -26,34 +26,26 @@ function PMA_DBI_query($query, $link = NULL, $options = 0) { return $res; } -function PMA_DBI_get_dblist($link = NULL) { - if (empty($link)) { - if (isset($GLOBALS['userlink'])) { - $link = $GLOBALS['userlink']; - } else { - return FALSE; +/** + * returns array with database names + * + * @return array $databases + */ +function PMA_DBI_get_dblist( $link = NULL ) { + + $dbs_array = PMA_DBI_fetch_result( 'SHOW DATABASES;', $link ); + + // Before MySQL 4.0.2, SHOW DATABASES could send the + // whole list, so check if we really have access: + if ( PMA_MYSQL_INT_VERSION < 40002 ) { + foreach ( $dbs_array as $key => $db ) { + if ( ! PMA_DBI_select_db( $db, $link ) ) { + unset( $dbs_array[$key] ); + } } + // re-index values + $dbs_array = array_values( $dbs_array ); } - $res = PMA_DBI_try_query('SHOW DATABASES;', $link); - $dbs_array = array(); - while ($row = PMA_DBI_fetch_row($res)) { - - // Before MySQL 4.0.2, SHOW DATABASES could send the - // whole list, so check if we really have access: - //if (PMA_MYSQL_CLIENT_API < 40002) { - // Better check the server version, in case the client API - // is more recent than the server version - - if (PMA_MYSQL_INT_VERSION < 40002) { - $dblink = @PMA_DBI_select_db($row[0], $link); - if (!$dblink) { - continue; - } - } - $dbs_array[] = $row[0]; - } - PMA_DBI_free_result($res); - unset($res); return $dbs_array; } @@ -117,13 +109,13 @@ function PMA_DBI_get_tables_full( $database, $table = false, // get table information from information_schema if ( $table ) { if ( true === $tbl_is_group ) { - $sql_where_table = 'AND `TABLE_NAME` LIKE "' - . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%"'; + $sql_where_table = 'AND `TABLE_NAME` LIKE \'' + . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%\''; } elseif ( 'comment' === $tbl_is_group ) { - $sql_where_table = 'AND `TABLE_COMMENT` LIKE "' - . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%"'; + $sql_where_table = 'AND `TABLE_COMMENT` LIKE \'' + . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%\''; } else { - $sql_where_table = 'AND `TABLE_NAME` = "' . addslashes( $table ) . '"'; + $sql_where_table = 'AND `TABLE_NAME` = \'' . addslashes( $table ) . '\''; } } else { $sql_where_table = ''; @@ -131,7 +123,7 @@ function PMA_DBI_get_tables_full( $database, $table = false, // for PMA bc: // `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME` - $sql = ' + $sql = ' SELECT *, `TABLE_SCHEMA` AS `Db`, `TABLE_NAME` AS `Name`, @@ -154,7 +146,7 @@ function PMA_DBI_get_tables_full( $database, $table = false, `CREATE_OPTIONS` AS `Create_options`, `TABLE_COMMENT` AS `Comment` FROM `information_schema`.`TABLES` - WHERE `TABLE_SCHEMA` = "' . addslashes( $database ) . '" + WHERE `TABLE_SCHEMA` = \'' . addslashes( $database ) . '\' ' . $sql_where_table; $tables = PMA_DBI_fetch_result( $sql, 'TABLE_NAME', NULL, $link ); @@ -163,7 +155,7 @@ function PMA_DBI_get_tables_full( $database, $table = false, if ( true === $tbl_is_group ) { $sql = 'SHOW TABLE STATUS FROM ' . PMA_backquote( addslashes( $database ) ) - .' LIKE "' . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%"'; + .' LIKE \'' . PMA_escape_mysql_wildcards( addslashes( $table ) ) . '%\''; } else { $sql = 'SHOW TABLE STATUS FROM ' . PMA_backquote( addslashes( $database ) ) . ';'; @@ -229,6 +221,101 @@ function PMA_DBI_get_tables_full( $database, $table = false, return $tables; } +/** + * returns array with databases containing extended infos about them + * + * @param string $databases database + * @param boolean $force_stats retrieve stats also for MySQL < 5 + * @param resource $link mysql link + * @return array $databases + */ +function PMA_DBI_get_databases_full( $database = NULL, $force_stats = false, $link = NULL ) { + if ( PMA_MYSQL_INT_VERSION >= 50002 ) { + // get table information from information_schema + if ( $database ) { + $sql_where_schema = 'WHERE `SCHEMA_NAME` LIKE \'' + . addslashes( $database ) . '\''; + } else { + $sql_where_schema = ''; + } + + // for PMA bc: + // `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME` + $sql = ' + SELECT `information_schema`.`SCHEMATA`.*, + COUNT(`information_schema`.`TABLES`.`TABLE_SCHEMA`) + AS `SCHEMA_TABLES`, + SUM(`information_schema`.`TABLES`.`TABLE_ROWS`) + AS `SCHEMA_TABLE_ROWS`, + SUM(`information_schema`.`TABLES`.`DATA_LENGTH`) + AS `SCHEMA_DATA_LENGTH`, + SUM(`information_schema`.`TABLES`.`MAX_DATA_LENGTH`) + AS `SCHEMA_MAX_DATA_LENGTH`, + SUM(`information_schema`.`TABLES`.`INDEX_LENGTH`) + AS `SCHEMA_INDEX_LENGTH`, + SUM(`information_schema`.`TABLES`.`DATA_LENGTH` + + `information_schema`.`TABLES`.`INDEX_LENGTH`) + AS `SCHEMA_LENGTH`, + SUM(`information_schema`.`TABLES`.`DATA_FREE`) + AS `SCHEMA_DATA_FREE` + FROM `information_schema`.`SCHEMATA` + LEFT JOIN `information_schema`.`TABLES` + ON `information_schema`.`TABLES`.`TABLE_SCHEMA` + = `information_schema`.`SCHEMATA`.`SCHEMA_NAME` + ' . $sql_where_schema . ' + GROUP BY `information_schema`.`SCHEMATA`.`SCHEMA_NAME`'; + $databases = PMA_DBI_fetch_result( $sql, 'SCHEMA_NAME', NULL, $link ); + unset( $sql_where_schema, $sql ); + } else { + foreach ( PMA_DBI_get_dblist( $link ) as $database_name ) { + // MySQL forward compatibility + // so pma could use this array as if every server is of version >5.0 + $databases[$database_name]['SCHEMA_NAME'] = $database_name; + + if ( $force_stats ) { + require_once 'mysql_charsets.lib.php'; + + $databases[$database_name]['DEFAULT_COLLATION_NAME'] + = PMA_getDbCollation( $database_name ); + + // get additonal info about tables + $databases[$database_name]['SCHEMA_TABLES'] = 0; + $databases[$database_name]['SCHEMA_TABLE_ROWS'] = 0; + $databases[$database_name]['SCHEMA_DATA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_MAX_DATA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_INDEX_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_DATA_FREE'] = 0; + + $res = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote( $database_name ) . ';'); + while ( $row = PMA_DBI_fetch_assoc( $res ) ) { + $databases[$database_name]['SCHEMA_TABLES']++; + $databases[$database_name]['SCHEMA_TABLE_ROWS'] + += $row['Rows']; + $databases[$database_name]['SCHEMA_DATA_LENGTH'] + += $row['Data_length']; + $databases[$database_name]['SCHEMA_MAX_DATA_LENGTH'] + += $row['Max_data_length']; + $databases[$database_name]['SCHEMA_INDEX_LENGTH'] + += $row['Index_length']; + $databases[$database_name]['SCHEMA_DATA_FREE'] + += $row['Data_free']; + $databases[$database_name]['SCHEMA_LENGTH'] + += $row['Data_length'] + $row['Index_length']; + } + PMA_DBI_free_result( $res ); + unset( $res ); + } + } + } + + if ( $GLOBALS['cfg']['NaturalOrder'] ) { + uksort( $databases, 'strnatcasecmp' ); + } + + return $databases; +} + function PMA_DBI_get_fields($database, $table, $link = NULL) { if (empty($link)) { if (isset($GLOBALS['userlink'])) { diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index 0ee726a67..699a6d505 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -358,6 +358,16 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ return ' CHARACTER SET ' . $charset . ($charset == $collation ? '' : ' COLLATE ' . $collation); } + /** + * returns default server collation from show variables + * + * @uses PMA_DBI_fetch_value() + * @return string $server_collation + */ + function PMA_getServerCollation() { + return PMA_DBI_fetch_value( + 'SHOW VARIABLES LIKE \'collation_server\'', 0, 1 ); + } } ?> diff --git a/server_databases.php b/server_databases.php index 0468e3ad1..057a2f2c7 100644 --- a/server_databases.php +++ b/server_databases.php @@ -2,13 +2,6 @@ /* $Id$ */ // vim: expandtab sw=4 ts=4 sts=4: - -/** - * Checks if the left frame has to be reloaded - */ -require_once('./libraries/grab_globals.lib.php'); - - /** * Does the common work */ @@ -29,18 +22,17 @@ require('./server_common.inc.php'); * * @access private */ -function PMA_dbCmp($a, $b) -{ +function PMA_dbCmp($a, $b) { global $sort_by, $sort_order; if ($GLOBALS['cfg']['NaturalOrder']) { $sorter = 'strnatcmp'; } else { $sorter = 'strcasecmp'; } - if ($sort_by == 'db_name') { - return ($sort_order == 'asc' ? 1 : -1) * $sorter($a['db_name'], $b['db_name']); - } else if ($a[$sort_by] == $b[$sort_by]) { - return $sorter($a['db_name'], $b['db_name']); + if ($sort_by == 'SCHEMA_NAME') { + return ($sort_order == 'asc' ? 1 : -1) * $sorter($a['SCHEMA_NAME'], $b['SCHEMA_NAME']); + } elseif ($a[$sort_by] == $b[$sort_by]) { + return $sorter($a['SCHEMA_NAME'], $b['SCHEMA_NAME']); } else { return ($sort_order == 'asc' ? 1 : -1) * ((int)$a[$sort_by] > (int)$b[$sort_by] ? 1 : -1); } @@ -48,11 +40,24 @@ function PMA_dbCmp($a, $b) /** - * Gets the databases list - if it has not been built yet + * avoids 'undefined index' errors */ -if ($server > 0 && empty($dblist)) { - PMA_availableDatabases(); +if (empty($sort_by)) { + $sort_by = 'SCHEMA_NAME'; +} else { + $sort_by = PMA_sanitize($sort_by); } +if (empty($sort_order)) { + if ($sort_by == 'SCHEMA_NAME') { + $sort_order = 'asc'; + } else { + $sort_order = 'desc'; + } +} else { + $sort_order = PMA_sanitize($sort_order); +} + +$dbstats = empty( $dbstats ) ? 0 : 1; /** @@ -71,13 +76,9 @@ if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg } else { $message = sprintf($strDatabasesDropped, 0); } - // we need to reload the database list now. - PMA_availableDatabases(); - $reload = 1; } } - /** * Displays the links */ @@ -92,288 +93,276 @@ echo '

' . "\n" ? '' : '' ) - . ( empty($dbstats) ? $strDatabases : $strDatabasesStats ) . "\n" + . ( $dbstats ? $strDatabasesStats : $strDatabases ) . "\n" .'

' . "\n"; /** * Checks if the user is allowed to do what he tries to... */ -if (!empty($dbstats) && !$is_superuser) { +if ( $dbstats && ! $is_superuser ) { echo $strNoPrivileges . "\n"; require_once('./footer.inc.php'); } /** - * Prepares the statistics + * Gets the databases list */ -$statistics = array(); -foreach ($dblist AS $current_db) { - $tmp_array = array( - 'db_name' => $current_db, - 'tbl_cnt' => 0, - 'data_sz' => 0, - 'idx_sz' => 0, - 'tot_sz' => 0 - ); - if (!empty($dbstats)) { - $res = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($current_db) . ';'); - while ($row = PMA_DBI_fetch_assoc($res)) { - $tmp_array['tbl_cnt']++; - $tmp_array['data_sz'] += $row['Data_length']; - $tmp_array['idx_sz'] += $row['Index_length']; - } - PMA_DBI_free_result($res); - unset($res); - } - $tmp_array['tot_sz'] = $tmp_array['data_sz'] + $tmp_array['idx_sz']; - $statistics[] = $tmp_array; -} - -// avoids 'undefined index' errors -if (empty($sort_by)) { - $sort_by = 'db_name'; +if ( $server > 0 ) { + $databases = PMA_DBI_get_databases_full( NULL, $dbstats ); } else { - $sort_by = PMA_sanitize($sort_by); + $databases = array(); } -if (empty($sort_order)) { - if ($sort_by == 'db_name') { - $sort_order = 'asc'; - } else { - $sort_order = 'desc'; - } -} else { - $sort_order = PMA_sanitize($sort_order); -} - -// sorts the array -usort($statistics, 'PMA_dbCmp'); /** * Displays the page */ -if (count($statistics) > 0) { +if ( count($databases) > 0 ) { + // sorts the array + usort( $databases, 'PMA_dbCmp' ); + + // table col order + $column_order = array( + 'DEFAULT_COLLATION_NAME' => array( + 'disp_name' => $strCollation, + 'description_function' => 'PMA_getCollationDescr', + 'format' => 'string', + 'footer' => PMA_getServerCollation(), + ), + 'SCHEMA_TABLES' => array( + 'disp_name' => $strNumTables, + 'format' => 'number', + 'footer' => 0, + ), + 'SCHEMA_TABLE_ROWS' => array( + 'disp_name' => $strRows, + 'format' => 'number', + 'footer' => 0, + ), + 'SCHEMA_DATA_LENGTH' => array( + 'disp_name' => $strData, + 'format' => 'byte', + 'footer' => 0, + ), + 'SCHEMA_INDEX_LENGTH' => array( + 'disp_name' => $strIndexes, + 'format' => 'byte', + 'footer' => 0, + ), + 'SCHEMA_LENGTH' => array( + 'disp_name' => $strTotalUC, + 'format' => 'byte', + 'footer' => 0, + ), + 'SCHEMA_DATA_FREE' => array( + 'disp_name' => $strOverhead, + 'format' => 'byte', + 'footer' => 0, + ), + ); + echo '
' . "\n" . PMA_generate_common_hidden_inputs('', '', 1) - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ($is_superuser || $cfg['AllowUserDropDatabase'] ? ' ' . "\n" : '') - . ' ' . "\n"; - if (!empty($dbstats)) { - if (PMA_MYSQL_INT_VERSION >= 40101) { - echo ' ' . "\n"; + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '
 ' . "\n" - . ' ' . "\n" - . ' ' . $strDatabase . "\n" - . ($sort_by == 'db_name' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') - . ' ' . "\n" - . ' ' . $strCollation . '
' . "\n" + . '' . "\n" + . '' . "\n" + . ($is_superuser || $cfg['AllowUserDropDatabase'] ? ' ' . "\n" : '') + . ' ' . "\n"; + $table_columns = 3; + foreach ( $column_order as $stat_name => $stat ) { + if ( array_key_exists( $stat_name, $databases[0] ) ) { + if ( $stat['format'] === 'byte' ) { + $table_columns += 2; + $colspan = ' colspan="2"'; + } else { + $table_columns++; + $colspan = ''; + } + echo ' ' + .'' . "\n" + .' ' . $stat['disp_name'] . "\n" + .($sort_by == $stat_name ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') + .' ' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; } if ($is_superuser) { - echo ' ' . "\n"; + echo ' ' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; - $total_calc = array( - 'db_cnt' => 0, - 'tbl_cnt' => 0, - 'data_sz' => 0, - 'idx_sz' => 0, - 'tot_sz' => 0 - ); - $odd_row = false; - foreach ( $statistics as $current ) { - $odd_row = !$odd_row; - list($data_size, $data_unit) = PMA_formatByteDown($current['data_sz'], 3, 1); - list($idx_size, $idx_unit) = PMA_formatByteDown($current['idx_sz'], 3, 1); - list($tot_size, $tot_unit) = PMA_formatByteDown($current['tot_sz'], 3, 1); - $total_calc['db_cnt']++; - $total_calc['tbl_cnt'] += $current['tbl_cnt']; - $total_calc['data_sz'] += $current['data_sz']; - $total_calc['idx_sz'] += $current['idx_sz']; - $total_calc['tot_sz'] += $current['tot_sz']; - echo ' ' . "\n"; - if ($is_superuser || $cfg['AllowUserDropDatabase']) { - echo ' ' . "\n" + . '' . "\n" + . '' . "\n"; + + $odd_row = true; + foreach ( $databases as $key => $current ) { + + echo '' . "\n"; + $odd_row = ! $odd_row; + + if ( $is_superuser || $cfg['AllowUserDropDatabase'] ) { + echo ' ' . "\n"; + echo ' ' . "\n"; } - echo ' ' . "\n"; - if (!empty($dbstats)) { - if (PMA_MYSQL_INT_VERSION >= 40101) { - $current_collation = PMA_getDbCollation($current['db_name']); - echo ' ' . "\n"; + echo ' ' . "\n"; + + foreach ( $column_order as $stat_name => $stat ) { + if ( array_key_exists( $stat_name, $current ) ) { + if ( is_numeric( $stat['footer'] ) ) { + $column_order[$stat_name]['footer'] += $current[$stat_name]; + } + if ( $stat['format'] === 'byte' ) { + list( $value, $unit ) = PMA_formatByteDown( $current[$stat_name], 3, 1 ); + } elseif ( $stat['format'] === 'number' ) { + $value = PMA_formatNumber( $current[$stat_name], 0 ); + } else { + $value = htmlentities( $current[$stat_name], 0 ); + } + echo ' ' . "\n"; + if ( $stat['format'] === 'byte' ) { + echo ' ' . "\n"; + } } - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; } + if ($is_superuser) { - echo ' ' . "\n"; + echo ' ' . "\n"; } - echo ' ' . "\n"; - } // end foreach ( $statistics as $current ) - if (!empty($dbstats)) { - list($data_size, $data_unit) = PMA_formatByteDown($total_calc['data_sz'], 3, 1); - list($idx_size, $idx_unit) = PMA_formatByteDown($total_calc['idx_sz'], 3, 1); - list($tot_size, $tot_unit) = PMA_formatByteDown($total_calc['tot_sz'], 3, 1); - echo ' ' . "\n" - . ' ' . "\n"; - if (PMA_MYSQL_INT_VERSION >= 40101) { - echo ' ' . "\n"; - } - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; + echo '' . "\n"; + } // end foreach ( $databases as $key => $current ) + unset( $key, $current, $odd_row ); + + echo '' . "\n"; + if ( $is_superuser ) { + echo ' ' . "\n"; } + echo ' ' . "\n"; + foreach ( $column_order as $stat_name => $stat ) { + if ( array_key_exists( $stat_name, $databases[0] ) ) { + if ( $stat['format'] === 'byte' ) { + list( $value, $unit ) = PMA_formatByteDown( $stat['footer'], 3, 1 ); + } elseif ( $stat['format'] === 'number' ) { + $value = PMA_formatNumber( $stat['footer'], 0 ); + } else { + $value = htmlentities( $stat['footer'], 0 ); + } + echo ' ' . "\n"; + if ( $stat['format'] === 'byte' ) { + echo ' ' . "\n"; + } + } + } + if ( $is_superuser ) { + echo ' ' . "\n"; + } + echo '' . "\n"; + unset( $column_order, $stat_name, $stat, $databases ); + if ($is_superuser || $cfg['AllowUserDropDatabase']) { - $common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . (empty($dbstats) ? '0' : '1'); - echo ' ' . "\n" - . ' ' . "\n"; + $common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats; + echo '' . "\n" + . '' . "\n"; } - echo ' ' . "\n" - .'
 ' . "\n" + . ' ' . $strDatabase . "\n" + . ($sort_by == 'SCHEMA_NAME' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') + . ' ' . "\n" - . ' ' . $strNumTables . "\n" - . ($sort_by == 'tbl_cnt' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $strData . "\n" - . ($sort_by == 'data_sz' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $strIndexes . "\n" - . ($sort_by == 'idx_sz' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $strTotalUC . "\n" - . ($sort_by == 'tot_sz' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') - . ' ' . "\n" - . ' ' . ($cfg['PropertiesIconic'] ? ' ' : $strAction ) . "\n" - . ' ' . ($cfg['PropertiesIconic'] ? ' ' : $strAction ) . "\n" + . '
' . "\n"; - if ($current['db_name'] != 'mysql' && (PMA_MYSQL_INT_VERSION < 50002 || $current['db_name'] != 'information_schema')) { - echo ' ' . "\n"; + echo '
' . "\n"; + if ($current['SCHEMA_NAME'] != 'mysql' && (PMA_MYSQL_INT_VERSION < 50002 || $current['SCHEMA_NAME'] != 'information_schema')) { + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . htmlspecialchars($current['db_name']) . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . htmlspecialchars($current_collation) . "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n" + . ' ' . "\n" + . ' '; + if ( isset( $stat['description_function'] ) ) { + echo ''; + } + echo $value; + if ( isset( $stat['description_function'] ) ) { + echo ''; + } + echo '' . $unit . '' . $current['tbl_cnt'] . '' . $data_size . '' . $data_unit . '' . $idx_size . '' . $idx_unit . '' . $tot_size . '' . $tot_unit . '' . "\n" - . ' '. "\n" - . ' ' .($cfg['PropertiesIconic'] ? ' ' .$strCheckPrivs . ' ' : $strCheckPrivs ). "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' '. "\n" + . ' ' .($cfg['PropertiesIconic'] ? ' ' .$strCheckPrivs . ' ' : $strCheckPrivs ). "\n" + . '
 ' . $strTotalUC . ': ' . $total_calc['db_cnt'] - . '  ' . $total_calc['tbl_cnt'] . '' . $data_size . '' . $data_unit . '' . $idx_size . '' . $idx_unit . '' . $tot_size . '' . $tot_unit . ' 
 ' . $strTotalUC . ': ' . count( $databases ) . ''; + if ( isset( $stat['description_function'] ) ) { + echo ''; + } + echo $value; + if ( isset( $stat['description_function'] ) ) { + echo ''; + } + echo '' . $unit . ' 
' . "\n" - . ' ' . $strWithChecked . '' . "\n" - . ' ' . "\n" - . ' ' . $strCheckAll - . ' ' . "\n" - . ' / ' . "\n" - . ' ' . "\n" - . ' ' . $strUncheckAll - . ' ' . "\n" - . '
' . "\n" + . ' ' . $strWithChecked . '' . "\n" + . ' ' . "\n" + . ' ' . $strCheckAll + . ' / ' . "\n" + . ' ' . "\n" + . ' ' . $strUncheckAll + . ' ' . "\n" + . ' ' . $strWithChecked . '' . "\n"; + PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' ); + echo '
' . "\n"; - unset($data_size); - unset($data_unit); - unset($idx_size); - unset($idx_unit); - unset($tot_size); - unset($tot_unit); - if ( $GLOBALS['cfg']['PropertiesIconic'] ) - { + echo '' . "\n" + .'' . "\n"; + unset( $table_columns ); + + if ( $GLOBALS['cfg']['PropertiesIconic'] ) { // iconic view if ($is_superuser || $cfg['AllowUserDropDatabase']) { - echo '
' . "\n"; - if ($is_superuser && empty($dbstats)) { - echo ' ' . "\n"; - } else if ($is_superuser && !empty($dbstats)) { - echo ' ' . "\n"; + echo '
' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $strDatabasesStatsEnable . "\n" - . ' ' . "\n" - . ' ' . "\n" - . '
' . "\n" - . ' ' . $strDatabasesStatsHeavyTraffic . "\n" - . '
 
' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $strDatabasesStatsDisable . "\n" - . ' ' . "\n" - . ' ' . "\n" - . '
 
' . "\n"; + if ( $is_superuser && ! $dbstats && PMA_MYSQL_INT_VERSION < 50002 ) { + echo '' . "\n" + . ' ' . "\n"; + } elseif ( $is_superuser && $dbstats ) { + echo '' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n" - . '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . $strDatabasesStatsEnable . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . ' ' . $strDatabasesStatsHeavyTraffic . "\n" + . '
 
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . $strDatabasesStatsDisable . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
 
' . "\n" - . ' ' - . ' ' . $strDropSelectedDatabases - . ' ' . "\n" - . '
 ' . "\n" - . ' ' . "\n" - . '
 
' . "\n"; + echo '' . "\n"; } - } - else - { + } else { // classic view if ($is_superuser || $cfg['AllowUserDropDatabase']) { - echo '
' . "\n"; } } echo '
' . "\n"; @@ -387,16 +376,14 @@ if (count($statistics) > 0) { if ( $GLOBALS['cfg']['PropertiesIconic'] ) { echo '' . "\n"; - echo '' . "\n" - . ' ' . "\n" . '
' . "\n" + echo '
' . "\n" . ' ' . "\n" . ' ' . "\n"; } else { - echo '
    ' . "\n"; - echo '
  • ' . "\n"; + echo '
    • ' . "\n"; } require('./libraries/display_create_database.lib.php');