home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / server_databases.php < prev    next >
Encoding:
PHP Script  |  2004-12-29  |  20.8 KB  |  419 lines

  1. <?php
  2. /* $Id: server_databases.php,v 2.14 2004/12/29 12:31:43 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Checks if the left frame has to be reloaded
  8.  */
  9. require_once('./libraries/grab_globals.lib.php');
  10.  
  11.  
  12. /**
  13.  * Does the common work
  14.  */
  15. $js_to_run = 'functions.js';
  16. require('./server_common.inc.php');
  17.  
  18. ?>
  19. <script type="text/javascript" language="javascript1.2">
  20. <!--
  21. function reload_window(db) {
  22.     if (typeof(window.parent) != 'undefined'
  23.         && typeof(window.parent.frames['nav']) != 'undefined') {
  24.         window.parent.frames['nav'].goTo('./left.php?<?php echo PMA_generate_common_url('','','&');?>&db=' + db + '&hash=' + <?php echo (($cfg['QueryFrame'] && $cfg['QueryFrameJS']) ? 'window.parent.frames[\'queryframe\'].document.hashform.hash.value' : "'" . md5($cfg['PmaAbsoluteUri']) . "'"); ?>);
  25.     }
  26. }
  27. //-->
  28. </script>
  29.  
  30. <?php
  31.  
  32. /**
  33.  * Sorts the databases array according to the user's choice
  34.  *
  35.  * @param   array    a record associated to a database
  36.  * @param   array    a record associated to a database
  37.  *
  38.  * @return  integer  a value representing whether $a should be before $b in the
  39.  *                   sorted array or not
  40.  *
  41.  * @global  string   the column the array shall be sorted by
  42.  * @global  string   the sorting order ('asc' or 'desc')
  43.  *
  44.  * @access  private
  45.  */
  46. function PMA_dbCmp($a, $b)
  47. {
  48.     global $sort_by, $sort_order;
  49.     if ($GLOBALS['cfg']['NaturalOrder']) {
  50.         $sorter = 'strnatcmp';
  51.     } else {
  52.         $sorter = 'strcasecmp';
  53.     }
  54.     if ($sort_by == 'db_name') {
  55.         return ($sort_order == 'asc' ? 1 : -1) * $sorter($a['db_name'], $b['db_name']);
  56.     } else if ($a[$sort_by] == $b[$sort_by]) {
  57.         return $sorter($a['db_name'], $b['db_name']);
  58.     } else {
  59.         return ($sort_order == 'asc' ? 1 : -1) * ((int)$a[$sort_by] > (int)$b[$sort_by] ? 1 : -1);
  60.     }
  61. } // end of the 'PMA_dbCmp()' function
  62.  
  63.  
  64. /**
  65.  * Gets the databases list - if it has not been built yet
  66.  */
  67. if ($server > 0 && empty($dblist)) {
  68.     PMA_availableDatabases();
  69. }
  70.  
  71.  
  72. /**
  73.  * Drops multiple databases
  74.  */
  75. if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg['AllowUserDropDatabase'])) {
  76.     if (empty($selected_db) && ! (isset($query_type) && !empty($selected))) {
  77.         $message = $strNoDatabasesSelected;
  78.     } else {
  79.         $action = 'server_databases.php';
  80.         $submit_mult = 'drop_db' ;
  81.         $err_url = 'server_databases.php?' . PMA_generate_common_url();
  82.         require('./mult_submits.inc.php');
  83.         $message = sprintf($strDatabasesDropped, count($selected));
  84.         // we need to reload the database list now.
  85.         PMA_availableDatabases();
  86.         $reload = 1;
  87.     }
  88. }
  89.  
  90.  
  91. /**
  92.  * Displays the links
  93.  */
  94. require('./server_links.inc.php');
  95.  
  96.  
  97. /**
  98.  * Displays the sub-page heading
  99.  */
  100. echo '<h2>' . "\n"
  101.    . ($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $pmaThemeImage . 's_db.png" border="0" hsape="2" align="middle" width="16" height="16" />' : '')
  102.    . '    ' . (empty($dbstats) ? $strDatabases : $strDatabasesStats) . "\n"
  103.    . '</h2>' . "\n";
  104.  
  105.  
  106. /**
  107.  * Checks if the user is allowed to do what he tries to...
  108.  */
  109. if (!empty($dbstats) && !$is_superuser) {
  110.     echo $strNoPrivileges . "\n";
  111.     require_once('./footer.inc.php');
  112. }
  113.  
  114.  
  115. /**
  116.  * Prepares the statistics
  117.  */
  118. $statistics = array();
  119. foreach ($dblist AS $current_db) {
  120.     $tmp_array = array(
  121.         'db_name' => $current_db,
  122.         'tbl_cnt' => 0,
  123.         'data_sz' => 0,
  124.         'idx_sz' => 0,
  125.         'tot_sz' => 0
  126.     );
  127.     if (!empty($dbstats)) {
  128.         $res = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($current_db) . ';');
  129.         while ($row = PMA_DBI_fetch_assoc($res)) {
  130.             $tmp_array['tbl_cnt']++;
  131.             $tmp_array['data_sz'] += $row['Data_length'];
  132.             $tmp_array['idx_sz'] += $row['Index_length'];
  133.         }
  134.         PMA_DBI_free_result($res);
  135.         unset($res);
  136.     }
  137.     $tmp_array['tot_sz'] = $tmp_array['data_sz'] + $tmp_array['idx_sz'];
  138.     $statistics[] = $tmp_array;
  139. }
  140.  
  141. // avoids 'undefined index' errors
  142. if (empty($sort_by)) {
  143.     $sort_by = 'db_name';
  144. }
  145. if (empty($sort_order)) {
  146.     if ($sort_by == 'db_name') {
  147.         $sort_order = 'asc';
  148.     } else {
  149.         $sort_order = 'desc';
  150.     }
  151. }
  152.  
  153. // sorts the array
  154. usort($statistics, 'PMA_dbCmp');
  155.  
  156.  
  157. /**
  158.  * Displays the page
  159.  */
  160. if (count($statistics) > 0) {
  161.     echo '<form action="./server_databases.php" method="post" name="dbStatsForm">' . "\n"
  162.        . PMA_generate_common_hidden_inputs('', '', 1)
  163.        . '    <input type="hidden" name="dbstats" value="' . (empty($dbstats) ? '0' : '1') . '" />' . "\n"
  164.        . '    <input type="hidden" name="sort_by" value="' . $sort_by . '" />' . "\n"
  165.        . '    <input type="hidden" name="sort_order" value="' . $sort_order . '" />' . "\n"
  166.        . '    <table border="0" cellpadding="2" cellspacing="1">' . "\n"
  167.        . '        <tr>' . "\n"
  168.        . ($is_superuser || $cfg['AllowUserDropDatabase'] ? '            <th> </th>' . "\n" : '')
  169.        . '            <th>' . "\n"
  170.        . '                <a href="./server_databases.php?' . $url_query . (!empty($dbstats) ? '&dbstats=1' : '') . '&sort_by=db_name&sort_order=' . (($sort_by == 'db_name' && $sort_order == 'asc') ? 'desc' : 'asc') . '">' . "\n"
  171.        . '                    ' . $strDatabase . "\n"
  172.        . ($sort_by == 'db_name' ? '                    <img src="' . $pmaThemeImage . 's_' . $sort_order . '.png" border="0" width="11" height="9"  alt="' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '" />' . "\n" : '')
  173.        . '                </a>' . "\n"
  174.        . '                 ' . "\n"
  175.        . '            </th>' . "\n";
  176.     if (!empty($dbstats)) {
  177.         if (PMA_MYSQL_INT_VERSION >= 40101) {
  178.             echo '            <th>' . "\n"
  179.                . '                 ' . $strCollation . ' ' . "\n"
  180.                . '            </th>' . "\n";
  181.         }
  182.         echo '            <th>' . "\n"
  183.            . '                 ' . "\n"
  184.            . '                <a href="./server_databases.php?' . $url_query . '&dbstats=1&sort_by=tbl_cnt&sort_order=' . (($sort_by == 'tbl_cnt' && $sort_order == 'desc') ? 'asc' : 'desc') . '">' . "\n"
  185.            . '                    ' . $strNumTables . "\n"
  186.            . ($sort_by == 'tbl_cnt' ? '                    <img src="' . $pmaThemeImage . 's_' . $sort_order . '.png" border="0" width="11" height="9"  alt="' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '" />' . "\n" : '')
  187.            . '                </a>' . "\n"
  188.            . '                 ' . "\n"
  189.            . '            </th>' . "\n"
  190.            . '            <th colspan="2">' . "\n"
  191.            . '                 ' . "\n"
  192.            . '                <a href="./server_databases.php?' . $url_query . '&dbstats=1&sort_by=data_sz&sort_order=' . (($sort_by == 'data_sz' && $sort_order == 'desc') ? 'asc' : 'desc') . '">' . "\n"
  193.            . '                    ' . $strData . "\n"
  194.            . ($sort_by == 'data_sz' ? '                    <img src="' . $pmaThemeImage . 's_' . $sort_order . '.png" border="0" width="11" height="9"  alt="' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '" />' . "\n" : '')
  195.            . '                </a>' . "\n"
  196.            . '                 ' . "\n"
  197.            . '            </th>' . "\n"
  198.            . '            <th colspan="2">' . "\n"
  199.            . '                 ' . "\n"
  200.            . '                <a href="./server_databases.php?' . $url_query . '&dbstats=1&sort_by=idx_sz&sort_order=' . (($sort_by == 'idx_sz' && $sort_order == 'desc') ? 'asc' : 'desc') . '">' . "\n"
  201.            . '                    ' . $strIndexes . "\n"
  202.            . ($sort_by == 'idx_sz' ? '                    <img src="' . $pmaThemeImage . 's_' . $sort_order . '.png" border="0" width="11" height="9"  alt="' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '" />' . "\n" : '')
  203.            . '                </a>' . "\n"
  204.            . '                 ' . "\n"
  205.            . '            </th>' . "\n"
  206.            . '            <th colspan="2">' . "\n"
  207.            . '                 ' . "\n"
  208.            . '                <a href="./server_databases.php?' . $url_query . '&dbstats=1&sort_by=tot_sz&sort_order=' . (($sort_by == 'tot_sz' && $sort_order == 'desc') ? 'asc' : 'desc') . '">' . "\n"
  209.            . '                    ' . $strTotalUC . "\n"
  210.            . ($sort_by == 'tot_sz' ? '                    <img src="' . $pmaThemeImage . 's_' . $sort_order . '.png" border="0" width="11" height="9"  alt="' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '" />' . "\n" : '')
  211.            . '                </a>' . "\n"
  212.            . '                 ' . "\n"
  213.            . '            </th>' . "\n";
  214.     }
  215.     if ($is_superuser) {
  216.         echo '            <th>' . "\n"
  217.            . '                 ' . ($cfg['PropertiesIconic'] ? '' : $strAction . ' ') . "\n"
  218.            . '            </th>' . "\n";
  219.     }
  220.     echo '        </tr>' . "\n";
  221.     $useBgcolorOne = TRUE;
  222.     $total_calc = array(
  223.         'db_cnt' => 0,
  224.         'tbl_cnt' => 0,
  225.         'data_sz' => 0,
  226.         'idx_sz' => 0,
  227.         'tot_sz' => 0
  228.     );
  229.     foreach ($statistics as $current) {
  230.         list($data_size, $data_unit) = PMA_formatByteDown($current['data_sz'], 3, 1);
  231.         list($idx_size, $idx_unit)   = PMA_formatByteDown($current['idx_sz'], 3, 1);
  232.         list($tot_size, $tot_unit)   = PMA_formatByteDown($current['tot_sz'], 3, 1);
  233.         $total_calc['db_cnt']++;
  234.         $total_calc['tbl_cnt'] += $current['tbl_cnt'];
  235.         $total_calc['data_sz'] += $current['data_sz'];
  236.         $total_calc['idx_sz']  += $current['idx_sz'];
  237.         $total_calc['tot_sz']  += $current['tot_sz'];
  238.         echo '        <tr>' . "\n";
  239.         if ($is_superuser || $cfg['AllowUserDropDatabase']) {
  240.             echo '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  241.                . '                <input type="checkbox" name="selected_db[]" title="' . htmlspecialchars($current['db_name']) . '" value="' . htmlspecialchars($current['db_name']) . '" ' . (empty($checkall) ? '' : 'checked="checked" ') . '/>' . "\n"
  242.                . '            </td>' . "\n";
  243.         }
  244.         echo '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  245.            . '                <a onclick="reload_window(\'' . urlencode($current['db_name']) . '\'); return true;" href="' . $cfg['DefaultTabDatabase'] . '?' . $url_query . '&db=' . urlencode($current['db_name']) . '" title="' . sprintf($strJumpToDB, htmlspecialchars($current['db_name'])) . '">' . "\n"
  246.            . '                    ' . htmlspecialchars($current['db_name']) . "\n"
  247.            . '                </a>' . "\n"
  248.            . '            </td>' . "\n";
  249.         if (!empty($dbstats)) {
  250.             if (PMA_MYSQL_INT_VERSION >= 40101) {
  251.                 $current_collation = PMA_getDbCollation($current['db_name']);
  252.                 echo '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  253.                    . '                <dfn title="' . htmlspecialchars(PMA_getCollationDescr($current_collation)) . '">' . "\n"
  254.                    . '                    ' . htmlspecialchars($current_collation) . "\n"
  255.                    . '                </dfn>' . "\n"
  256.                    . '            </td>' . "\n";
  257.             }
  258.             echo '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '" align="right">' . "\n"
  259.                . '                ' . $current['tbl_cnt'] . "\n"
  260.                . '            </td>' . "\n"
  261.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '" align="right">' . "\n"
  262.                . '                ' . $data_size . "\n"
  263.                . '            </td>' . "\n"
  264.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  265.                . '                ' . $data_unit . "\n"
  266.                . '            </td>' . "\n"
  267.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '" align="right">' . "\n"
  268.                . '                ' . $idx_size . "\n"
  269.                . '            </td>' . "\n"
  270.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  271.                . '                ' . $idx_unit . "\n"
  272.                . '            </td>' . "\n"
  273.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '" align="right">' . "\n"
  274.                . '                <b>' . "\n"
  275.                . '                    ' . $tot_size . "\n"
  276.                . '                </b>' . "\n"
  277.                . '            </td>' . "\n"
  278.                . '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  279.                . '                <b>' . "\n"
  280.                . '                    ' . $tot_unit . "\n"
  281.                . '                </b>' . "\n"
  282.                . '            </td>' . "\n";
  283.         }
  284.         if ($is_superuser) {
  285.             echo '            <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '" align="center">' . "\n"
  286.                . '                <a onclick="reload_window(\'' . urlencode($current['db_name']) . '\'); return true;" href="./server_privileges.php?' . $url_query . '&checkprivs=' . urlencode($current['db_name']) . '" title="' . sprintf($strCheckPrivsLong, htmlspecialchars($current['db_name'])) . '">'. "\n"
  287.                . '                    ' .($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 's_rights.png" width="16" height="16" hspace="2" border="0" alt=" ' .$strCheckPrivs . '" /> ' : $strCheckPrivs ). "\n"
  288.                . '                </a>' . "\n"
  289.                . '            </td>' . "\n";
  290.         }
  291.         echo '        </tr>' . "\n";
  292.         $useBgcolorOne = !$useBgcolorOne;
  293.     } // end while
  294.     if (!empty($dbstats)) {
  295.         list($data_size, $data_unit) = PMA_formatByteDown($total_calc['data_sz'], 3, 1);
  296.         list($idx_size, $idx_unit)   = PMA_formatByteDown($total_calc['idx_sz'], 3, 1);
  297.         list($tot_size, $tot_unit)   = PMA_formatByteDown($total_calc['tot_sz'], 3, 1);
  298.         echo '        <tr>' . "\n"
  299.            . '            <th> </th>' . "\n"
  300.            . '            <th>' . "\n"
  301.            . '                 ' . $strTotalUC . ': ' . $total_calc['db_cnt'] . ' ' . "\n"
  302.            . '            </th>' . "\n";
  303.         if (PMA_MYSQL_INT_VERSION >= 40101) {
  304.             echo '            <th> </th>' . "\n";
  305.         }
  306.         echo '            <th align="right">' . "\n"
  307.            . '                 ' . $total_calc['tbl_cnt'] . ' ' . "\n"
  308.            . '            </th>' . "\n"
  309.            . '            <th align="right">' . "\n"
  310.            . '                 ' . $data_size . "\n"
  311.            . '            </th>' . "\n"
  312.            . '            <th align="left">' . "\n"
  313.            . '                ' . $data_unit . ' ' . "\n"
  314.            . '            </th>' . "\n"
  315.            . '            <th align="right">' . "\n"
  316.            . '                 ' . $idx_size . "\n"
  317.            . '            </th>' . "\n"
  318.            . '            <th align="left">' . "\n"
  319.            . '                ' . $idx_unit . ' ' . "\n"
  320.            . '            </th>' . "\n"
  321.            . '            <th align="right">' . "\n"
  322.            . '                 ' . $tot_size . "\n"
  323.            . '            </th>' . "\n"
  324.            . '            <th align="left">' . "\n"
  325.            . '                ' . $tot_unit . ' ' . "\n"
  326.            . '            </th>' . "\n"
  327.            . '            <th> </th>' . "\n"
  328.            . '        </tr>' . "\n";
  329.     }
  330.     if ($is_superuser || $cfg['AllowUserDropDatabase']) {
  331.         $common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . (empty($dbstats) ? '10' : '3');
  332.         echo '    <tr>' . "\n"
  333.            . '        <td colspan="' . (empty($dbstats) ? '10' : '3') . '">' . "\n"
  334.            . '            <img src="' . $pmaThemeImage . 'arrow_' . $text_dir . '.png" border="0" width="38" height="22" alt="' . $strWithChecked . '" />' . "\n"
  335.            . '            <a href="./server_databases.php?' . $common_url_query . '&checkall=1" onclick="setCheckboxes(\'dbStatsForm\', true); return false;">' . "\n"
  336.            . '                ' . $strCheckAll
  337.            . '            </a>' . "\n"
  338.            . '             / ' . "\n"
  339.            . '            <a href="./server_databases.php?' . $common_url_query . '" onclick="setCheckboxes(\'dbStatsForm\', false); return false;">' . "\n"
  340.            . '                ' . $strUncheckAll
  341.            . '            </a>' . "\n"
  342.            . '        </td>' . "\n"
  343.            . '    </tr>' . "\n";
  344.     }
  345.     echo '    </table>' . "\n";
  346.     unset($data_size);
  347.     unset($data_unit);
  348.     unset($idx_size);
  349.     unset($idx_unit);
  350.     unset($tot_size);
  351.     unset($tot_unit);
  352.     if ($is_superuser || $cfg['AllowUserDropDatabase']) {
  353.         echo '       ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<br /><table border="0" cellpadding="2" cellspacing="0">' : '<ul>') . "\n";
  354.     }
  355.     if ($is_superuser && empty($dbstats)) {
  356.         echo '        ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<tr><td colspan="2">' : '<li>') . "\n"
  357.            . '            <b>' . "\n"
  358.            . '                <a href="./server_databases.php?' . $url_query . '&dbstats=1" title="' . $strDatabasesStatsEnable . '">' . "\n"
  359.            . '                    ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<img src="' .$pmaThemeImage . 'b_dbstatistics.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '') . "\n"
  360.            . '                    ' . $strDatabasesStatsEnable . "\n"
  361.            . '                </a>' . "\n"
  362.            . '            </b>' . "\n"
  363.            . '           ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '</td></tr><tr><td width="20" nowrap="nowrap"> </td><td>' : '<br />') . "\n"
  364.            . '            ' . $strDatabasesStatsHeavyTraffic . "\n"
  365.            . '        ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<br /> </td></tr>' : '</li>') . "\n";
  366.     } else if ($is_superuser && !empty($dbstats)) {
  367.         echo '        ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<tr><td colspan="2">' : '<li>') . "\n"
  368.            . '            <b>' . "\n"
  369.            . '                <a href="./server_databases.php?' . $url_query . '" title="' . $strDatabasesStatsDisable . '">' . "\n"
  370.            . '                    ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<img src="' .$pmaThemeImage . 'b_dbstatistics.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '') . "\n"
  371.            . '                    ' . $strDatabasesStatsDisable . "\n"
  372.            . '                </a>' . "\n"
  373.            . '            </b>' . "\n"
  374.            . '           ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<br /> </td></tr>' : '<br /></li>') . "\n";
  375.     }
  376.     if ($is_superuser || $cfg['AllowUserDropDatabase']) {
  377.         echo '        ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<tr><td colspan="2">' : '<li>') . "\n"
  378.            . '            <b>' . "\n"
  379.            . '                ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<img src="' .$pmaThemeImage . 'b_deltbl.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '') . "\n"
  380.            . '                ' . $strDropSelectedDatabases . "\n"
  381.            . '            </b>' . "\n"
  382.            . '           ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '</td></tr><tr><td width="20" nowrap="nowrap"> </td><td nowrap="nowrap" align="left" width="400">' : '<br />') . "\n"
  383.            . '            <input type="submit" name="drop_selected_dbs" value="' . $strDrop . '" id="buttonNo" />' . "\n"
  384.            . '           ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '<br /> </td></tr>' : '</li>') . "\n"
  385.            . '    ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '</table>' : '</ul>') . "\n";
  386.     }
  387.     echo '</form>' . "\n";
  388. } else {
  389.     echo $strNoDatabases . "\n";
  390. }
  391.  
  392. /**
  393.  * Create new database.
  394.  */
  395. ?>
  396.  
  397. <form method="post" action="db_create.php"><b>
  398.     <?php echo $strCreateNewDatabase . ' ' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE'); ?></b><br />
  399.     <?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
  400.     <input type="hidden" name="reload" value="1" />
  401.     <input type="text" name="db" value="" maxlength="64" class="textfield" />
  402.     <?php
  403. if (PMA_MYSQL_INT_VERSION >= 40101) {
  404.     require_once('./libraries/mysql_charsets.lib.php');
  405.     echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', NULL, NULL, TRUE, 5);
  406. }
  407.     ?>
  408.     <input type="submit" value="<?php echo $strCreate; ?>" id="buttonGo" />
  409. </form>
  410.  
  411. <?php
  412.  
  413. /**
  414.  * Sends the footer
  415.  */
  416. require_once('./footer.inc.php');
  417.  
  418. ?>
  419.