' . $strNoRights . '
' . "\n"; include('./footer.inc.php3'); exit(); } // end if /** * Drop databases if required */ if ((!empty($submit_mult) && isset($selected_db)) || isset($mult_btn)) { $err_url = 'db_stats.php3?' . PMA_generate_common_url(); $action = 'db_stats.php3'; $show_query = '1'; include('./mult_submits.inc.php3'); } /** * Sorts the databases array according to the user's choice * * @param array a record associated to a database * @param array a record associated to a database * * @return integer a value representing whether $a should be before $b in the * sorted array or not * * @global mixed the array to sort * @global mixed 'key' if the table has to be sorted by key, the column * number to use to sort the array else * * @access private */ function PMA_dbCmp($a, $b) { global $dbs_array; global $col; $is_asc = ($GLOBALS['sort_order'] == 'asc'); // Sort by key (the db names) if required if (!is_int($col) && $col == 'key') { return (($is_asc) ? strcasecmp($a, $b) : -strcasecmp($a, $b)); } // Sort by key (the db names) in ascending order if the columns' values are // the same else if ($dbs_array[$a][$col] == $dbs_array[$b][$col]) { return strcasecmp($a, $b); } // Other cases else { $tmp = (($dbs_array[$a][$col] < $dbs_array[$b][$col]) ? -1 : 1); return (($is_asc) ? $tmp : -$tmp); } } // end of the 'PMA_dbCmp()' function /** * Get the list and number of available databases. * Skipped if no server selected: in this case no database should be displayed * before the user choose among available ones at the welcome screen. */ if ($server > 0) { // Get the valid databases list $num_dbs = count($dblist); $dbs = @mysql_list_dbs() or PMA_mysqlDie('', 'mysql_list_dbs()', '', 'main.php3?' . PMA_generate_common_url()); if ($dbs) { while ($a_db = PMA_mysql_fetch_object($dbs)) { if (!$num_dbs) { $dblist[] = $a_db->Database; } else { $true_dblist[$a_db->Database] = ''; } } // end while mysql_free_result($dbs); } // end if if ($num_dbs && empty($true_dblist)) { $dblist = array(); } else if ($num_dbs) { for ($i = 0; $i < $num_dbs; $i++) { if (isset($true_dblist[$dblist[$i]])) { $dblist_valid[] = $dblist[$i]; } } if (isset($dblist_valid)) { $dblist = $dblist_valid; unset($dblist_valid); } else { $dblist = array(); } unset($true_dblist); } // Get the valid databases count $num_dbs = count($dblist); } else { $num_dbs = 0; } /** * Displays the page */ ?>