addParam(count($selected)); } else { $message->addParam(0); } } } } /** * Displays the links */ require './libraries/server_links.inc.php'; /** * Displays the sub-page heading */ echo '

' . "\n" . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') . ($dbstats ? $strDatabasesStats : $strDatabases) . "\n" .'

' . "\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 = count($GLOBALS['pma']->databases); } else { $databases_count = 0; } /** * Displays the page */ if ($databases_count > 0) { reset($databases); $first_database = current($databases); // table col order $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, ); PMA_listNavigator($databases_count, $pos, $_url_params, 'server_databases.php', 'frame_content', $GLOBALS['cfg']['MaxDbList']); $_url_params['pos'] = $pos; echo '
' . "\n" . PMA_generate_common_hidden_inputs($_url_params); $_url_params['sort_by'] = 'SCHEMA_NAME'; $_url_params['sort_order'] = ($sort_by == 'SCHEMA_NAME' && $sort_order == 'asc') ? 'desc' : 'asc'; echo '' . "\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, $first_database)) { if ($stat['format'] === 'byte') { $table_columns += 2; $colspan = ' colspan="2"'; } else { $table_columns++; $colspan = ''; } $_url_params['sort_by'] = $stat_name; $_url_params['sort_order'] = ($sort_by == $stat_name && $sort_order == 'desc') ? 'asc' : 'desc'; echo ' ' .'' . "\n" .' ' . $stat['disp_name'] . "\n" .($sort_by == $stat_name ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') .' ' . "\n"; } } if ($is_superuser) { echo ' ' . "\n"; } echo '' . "\n" . '' . "\n" . '' . "\n"; $odd_row = true; foreach ($databases as $current) { echo '' . "\n"; $odd_row = ! $odd_row; if ($is_superuser || $cfg['AllowUserDropDatabase']) { 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"; } } } if ($is_superuser) { echo ' ' . "\n"; } echo '' . "\n"; } // end foreach ($databases as $key => $current) unset($current, $odd_row); echo '' . "\n"; if ($is_superuser || $cfg['AllowUserDropDatabase']) { echo ' ' . "\n"; } echo ' ' . "\n"; foreach ($column_order as $stat_name => $stat) { if (array_key_exists($stat_name, $first_database)) { 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"; echo '' . "\n" .'
 ' . "\n" . ' ' . $strDatabase . "\n" . ($sort_by == 'SCHEMA_NAME' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') . ' ' . ($cfg['PropertiesIconic'] ? ' ' : $strAction) . "\n" . '
' . "\n"; if ($current['SCHEMA_NAME'] != 'mysql' && $current['SCHEMA_NAME'] != 'information_schema') { echo ' ' . "\n"; } else { echo ' ' . "\n"; } echo ' ' . "\n" . ' ' . "\n" . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n" . ' ' . "\n" . ' '; if (isset($stat['description_function'])) { echo ''; } echo $value; if (isset($stat['description_function'])) { echo ''; } echo '' . $unit . '' . "\n" . ' '. "\n" . ' ' . ($cfg['PropertiesIconic'] ? ' ' . $strCheckPrivs . ' ' : $strCheckPrivs) . "\n" . '
 ' . $strTotalUC . ': ' . $databases_count . ''; if (isset($stat['description_function'])) { echo ''; } echo $value; if (isset($stat['description_function'])) { echo ''; } echo '' . $unit . ' 
' . "\n"; unset($column_order, $stat_name, $stat, $databases, $table_columns); if ($is_superuser || $cfg['AllowUserDropDatabase']) { $common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats; echo '' . $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"; echo '
'; } else { echo $strNoDatabases; } unset($databases_count); /** * Create new database. */ if ($cfg['ShowCreateDb']) { echo '' . "\n"; } /** * Sends the footer */ require_once './libraries/footer.inc.php'; ?>