home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / server_collations.php < prev    next >
Encoding:
PHP Script  |  2003-12-10  |  3.3 KB  |  106 lines

  1. <?php
  2. /* $Id: server_collations.php,v 2.5 2003/12/11 11:37:25 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Does the common work
  8.  */
  9. require('./server_common.inc.php');
  10.  
  11.  
  12. /**
  13.  * Displays the links
  14.  */
  15. require('./server_links.inc.php');
  16.  
  17.  
  18. /**
  19.  * Displays the sub-page heading
  20.  */
  21. echo '<h2>' . "\n"
  22.    . '    ' . $strCharsetsAndCollations . "\n"
  23.    . '</h2>' . "\n";
  24.  
  25.  
  26. /**
  27.  * Checks the MySQL version
  28.  */
  29. if (PMA_MYSQL_INT_VERSION < 40100) {
  30.     // TODO: Some nice Message :-)
  31.     require_once('./footer.inc.php');
  32. }
  33.  
  34.  
  35. /**
  36.  * Includes the required charset library
  37.  */
  38. require_once('./libraries/mysql_charsets.lib.php');
  39.  
  40.  
  41. /**
  42.  * Outputs the result
  43.  */
  44. echo '<table border="0">' . "\n"
  45.    . '    <tr>' . "\n"
  46.    . '        <td valign="top">' . "\n"
  47.    . '            <table border="0">' . "\n"
  48.    . '                <tr>' . "\n"
  49.    . '                <th>' . "\n"
  50.    . '                    ' . $strCollation . "\n"
  51.    . '                </th>' . "\n"
  52.    . '                <th>' . "\n"
  53.    . '                    ' . $strDescription . "\n"
  54.    . '                </th>' . "\n"
  55.    . '            </tr>' . "\n";
  56.  
  57. $i = 0;
  58. $table_row_count = count($mysql_charsets) + $mysql_collations_count;
  59.  
  60. foreach ($mysql_charsets as $current_charset) {
  61.     if ($i >= $table_row_count / 2) {
  62.         $i = 0;
  63.         echo '            </table>' . "\n"
  64.            . '        </td>' . "\n"
  65.            . '        <td valign="top">' . "\n"
  66.            . '            <table border="0">' . "\n"
  67.            . '                <tr>' . "\n"
  68.            . '                <th>' . "\n"
  69.            . '                    ' . $strCollation . "\n"
  70.            . '                </th>' . "\n"
  71.            . '                <th>' . "\n"
  72.            . '                    ' . $strDescription . "\n"
  73.            . '                </th>' . "\n"
  74.            . '            </tr>' . "\n";
  75.     }
  76.     $i++;
  77.     echo '            <tr>' . "\n"
  78.        . '                <td colspan="2" bgcolor="' . $cfg['ThBgcolor'] . '" align="right">' . "\n"
  79.        . '                     <b>' . htmlspecialchars($current_charset) . '</b>' . "\n"
  80.        . (empty($mysql_charsets_descriptions[$current_charset]) ? '' : '                    (<i>' . htmlspecialchars($mysql_charsets_descriptions[$current_charset]) . '</i>) ' . "\n")
  81.        . '                </td>' . "\n"
  82.        . '            </tr>' . "\n";
  83.     $useBgcolorOne = TRUE;
  84.     foreach ($mysql_collations[$current_charset] as $current_collation) {
  85.         $i++;
  86.         echo '            <tr>' . "\n"
  87.            . '                <td bgcolor="' . ($mysql_default_collations[$current_charset] == $current_collation ? $cfg['BrowseMarkerColor'] : ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'])) . '">' . "\n"
  88.            . '                     ' . htmlspecialchars($current_collation) . ' ' . "\n"
  89.            . '                </td>' . "\n"
  90.            . '                <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
  91.            . '                     ' . PMA_getCollationDescr($current_collation) . ' ' . "\n"
  92.            . '                </td>' . "\n"
  93.            . '            </tr>' . "\n";
  94.         $useBgcolorOne = !$useBgcolorOne;
  95.     }
  96. }
  97. unset($table_row_count);
  98. echo '            </table>' . "\n"
  99.    . '        </td>' . "\n"
  100.    . '    </tr>' . "\n"
  101.    . '</table>' . "\n";
  102.  
  103. require_once('./footer.inc.php');
  104.  
  105. ?>
  106.