' . "\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 = $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 '' . $caption1 . ''; $_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxDbList']; echo '' . $caption2 . ''; } echo '
' . "\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 '
'; 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 = ''; } // end if... else... $_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxDbList']; echo '' . $caption3 . ''; $_url_params['pos'] = floor($databases_count / $GLOBALS['cfg']['MaxDbList']) * $GLOBALS['cfg']['MaxDbList']; echo '' . $caption4 . ''; } } $_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' && (PMA_MYSQL_INT_VERSION < 50002 || $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"; require './libraries/display_create_database.lib.php'; echo '
  • ' . "\n"; echo '
' . "\n"; } /** * Sends the footer */ require_once './libraries/footer.inc.php'; ?>