bug 780793
[phpmyadmin/crack.git] / server_collations.php3
blob10a5dedc96c7e73cbb0219dec6436ea5aa00af3a
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Does the common work
8 */
9 require('./server_common.inc.php3');
12 /**
13 * Displays the links
15 require('./server_links.inc.php3');
18 /**
19 * Displays the sub-page heading
21 echo '<h2>' . "\n"
22 . ' ' . $strCharsetsAndCollations . "\n"
23 . '</h2>' . "\n";
26 /**
27 * Checks the MySQL version
29 if (PMA_MYSQL_INT_VERSION < 40100) {
30 // TODO: Some nice Message :-)
31 include('./footer.inc.php3');
32 exit;
36 /**
37 * Includes the required charset library
39 require('./libraries/mysql_charsets.lib.php3');
42 /**
43 * Outputs the result
45 echo '<table border="0">' . "\n"
46 . ' <tr>' . "\n"
47 . ' <td valign="top">' . "\n"
48 . ' <table border="0">' . "\n"
49 . ' <tr>' . "\n"
50 . ' <th>' . "\n"
51 . ' ' . $strCollation . "\n"
52 . ' </th>' . "\n"
53 . ' <th>' . "\n"
54 . ' ' . $strDescription . "\n"
55 . ' </th>' . "\n"
56 . ' </tr>' . "\n";
58 reset($mysql_charsets);
59 reset($mysql_collations);
60 $i = 0;
61 $table_row_count = count($mysql_charsets) + $mysql_collations_count;
63 while (list(, $current_charset) = each($mysql_charsets)) {
64 if ($i > $table_row_count / 2) {
65 $i = 0;
66 echo ' </table>' . "\n"
67 . ' </td>' . "\n"
68 . ' <td valign="top">' . "\n"
69 . ' <table border="0">' . "\n"
70 . ' <tr>' . "\n"
71 . ' <th>' . "\n"
72 . ' ' . $strCollation . "\n"
73 . ' </th>' . "\n"
74 . ' <th>' . "\n"
75 . ' ' . $strDescription . "\n"
76 . ' </th>' . "\n"
77 . ' </tr>' . "\n";
79 $i++;
80 echo ' <tr>' . "\n"
81 . ' <td colspan="2" bgcolor="' . $cfg['ThBgcolor'] . '" align="right">' . "\n"
82 . ' &nbsp;<b>' . htmlspecialchars($current_charset) . '</b>' . "\n"
83 . ' (<i>' . htmlspecialchars($mysql_charsets_descriptions[$current_charset]) . '</i>)&nbsp;' . "\n"
84 . ' </td>' . "\n"
85 . ' </tr>' . "\n";
86 $useBgcolorOne = TRUE;
87 reset($mysql_collations[$current_charset]);
88 while (list(, $current_collation) = each($mysql_collations[$current_charset])) {
89 $i++;
90 echo ' <tr>' . "\n"
91 . ' <td bgcolor="' . ($mysql_default_collations[$current_charset] == $current_collation ? $cfg['BrowseMarkerColor'] : ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'])) . '">' . "\n"
92 . ' &nbsp;' . htmlspecialchars($current_collation) . '&nbsp;' . "\n"
93 . ' </td>' . "\n"
94 . ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
95 . ' &nbsp;' . PMA_getCollationDescr($current_collation) . '&nbsp;' . "\n"
96 . ' </td>' . "\n"
97 . ' </tr>' . "\n";
98 $useBgcolorOne = !$useBgcolorOne;
101 unset($table_row_count);
102 echo ' </table>' . "\n"
103 . ' </td>' . "\n"
104 . ' </tr>' . "\n"
105 . '</table>' . "\n";
107 require('./footer.inc.php3');