lang
[phpmyadmin/crack.git] / tbl_properties_options.php3
blob24d453f0ebdcde0d9523a8b0af4787ae8459c7f5
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Runs common work
8 */
9 require('./tbl_properties_common.php3');
10 $url_query .= '&amp;goto=tbl_properties_options.php3&amp;back=tbl_properties_options.php3';
13 /**
14 * Updates table comment, type and options if required
16 if (isset($submitcomment)) {
17 if (get_magic_quotes_gpc()) {
18 $comment = stripslashes($comment);
20 if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
21 $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
22 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
23 $message = $strSuccess;
26 if (isset($submittype)) {
27 $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
28 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
29 $message = $strSuccess;
31 if (isset($submitoptions)) {
32 $sql_query = 'ALTER TABLE ' . PMA_backquote($table)
33 . (isset($pack_keys) ? ' pack_keys=1': ' pack_keys=0')
34 . (isset($checksum) ? ' checksum=1': ' checksum=0')
35 . (isset($delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0');
36 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
37 $message = $strSuccess;
40 // Displays a message if a query had been submitted
41 if (isset($message)) {
42 PMA_showMessage((get_magic_quotes_gpc()) ? addslashes($message) : $message);
46 /**
47 * Gets tables informations and displays top links
49 require('./tbl_properties_table_info.php3');
52 /**
53 * Displays form controls
55 if (PMA_MYSQL_INT_VERSION >= 32322) {
57 <ul>
58 <!-- Table comments -->
59 <li>
60 <form method="post" action="tbl_properties_options.php3">
61 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
62 <?php echo $strTableComments; ?>&nbsp;:&nbsp;
63 <input type="hidden" name="prev_comment" value="<?php echo urlencode($show_comment); ?>" />&nbsp;
64 <input type="text" name="comment" maxlength="60" size="30" value="<?php echo htmlspecialchars($show_comment); ?>" class="textfield" style="vertical-align: middle" onfocus="this.select()" />&nbsp;
65 <input type="submit" name="submitcomment" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
66 </form>
67 </li>
69 <!-- Table type -->
70 <?php
71 // modify robbat2 code - staybyte - 11. June 2001
72 $query = 'SHOW VARIABLES LIKE \'have_%\'';
73 $result = PMA_mysql_query($query);
74 if ($result != FALSE && mysql_num_rows($result) > 0) {
75 while ($tmp = PMA_mysql_fetch_array($result)) {
76 if (isset($tmp['Variable_name'])) {
77 switch ($tmp['Variable_name']) {
78 case 'have_bdb':
79 if ($tmp['Value'] == 'YES') {
80 $tbl_bdb = TRUE;
82 break;
83 case 'have_gemini':
84 if ($tmp['Value'] == 'YES') {
85 $tbl_gemini = TRUE;
87 break;
88 case 'have_innodb':
89 if ($tmp['Value'] == 'YES') {
90 $tbl_innodb = TRUE;
92 break;
93 case 'have_isam':
94 if ($tmp['Value'] == 'YES') {
95 $tbl_isam = TRUE;
97 break;
98 } // end switch
99 } // end if isset($tmp['Variable_name'])
100 } // end while
101 } // end if $result
103 mysql_free_result($result);
104 echo "\n";
106 <li>
107 <form method="post" action="tbl_properties_options.php3">
108 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
109 <?php echo $strTableType; ?>&nbsp;:&nbsp;
110 <select name="tbl_type" style="vertical-align: middle">
111 <option value="MYISAM"<?php if ($tbl_type == 'MYISAM') echo ' selected="selected"'; ?>>MyISAM</option>
112 <option value="HEAP"<?php if ($tbl_type == 'HEAP') echo ' selected="selected"'; ?>>Heap</option>
113 <?php
114 $tbl_types = "\n";
115 if (isset($tbl_bdb)) {
116 $tbl_types .= ' <option value="BDB"'
117 . (($tbl_type == 'BERKELEYDB') ? ' selected="selected"' : '')
118 . '>Berkeley DB</option>' . "\n";
120 if (isset($tbl_gemini)) {
121 $tbl_types .= ' <option value="GEMINI"'
122 . (($tbl_type == 'GEMINI') ? ' selected="selected"' : '')
123 . '>Gemini</option>' . "\n";
125 if (isset($tbl_innodb)) {
126 $tbl_types .= ' <option value="INNODB"'
127 . (($tbl_type == 'INNODB') ? ' selected="selected"' : '')
128 . '>INNO DB</option>' . "\n";
130 if (isset($tbl_isam)) {
131 $tbl_types .= ' <option value="ISAM"'
132 . (($tbl_type == 'ISAM') ? ' selected="selected"' : '')
133 . '>ISAM</option>' . "\n";
136 echo $tbl_types;
138 <option value="MERGE"<?php if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?>>Merge</option>
139 </select>&nbsp;
140 <input type="submit" name="submittype" value="<?php echo $strGo; ?>" style="vertical-align: middle" />&nbsp;
141 <?php echo PMA_showMySQLDocu('Table_types', 'Table_types') . "\n"; ?>
142 </form>
143 </li>
145 <!-- Table options -->
146 <li style="vertical-align: top">
147 <table border="0" cellspacing="0" cellpadding="0" style="vertical-align: top">
148 <tr>
149 <td valign="top">
150 <form method="post" action="tbl_properties_options.php3">
151 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
153 <table border="0" cellspacing="0" cellpadding="0">
154 <tr>
155 <td>
156 <input type="checkbox" name="pack_keys" id="pack_keys_opt"
157 <?php echo (isset($pack_keys) && $pack_keys == 1) ? ' checked="checked"' : ''; ?> />
158 <label for="pack_keys_opt">pack_keys</label>&nbsp;&nbsp;
159 <br />
160 <input type="checkbox" name="checksum" id="checksum_opt"
161 <?php echo (isset($checksum) && $checksum == 1) ? ' checked="checked"' : ''; ?> />
162 <label for="checksum_opt">checksum</label>&nbsp;&nbsp;
163 <br />
164 <input type="checkbox" name="delay_key_write" id="delay_key_write_opt"
165 <?php echo (isset($delay_key_write) && $delay_key_write == 1) ? ' checked="checked"' : ''; ?> />
166 <label for="delay_key_write_opt">delay_key_write</label>&nbsp;&nbsp;
167 &nbsp;&nbsp;
168 </td>
169 <td>
170 <input type="submit" name="submitoptions" value="<?php echo $strGo; ?>" />
171 </td>
172 </tr>
173 </table>
174 </form>
175 </td>
176 </tr>
177 </table>
178 </li>
179 </ul>
180 <?php
181 } // end if (PMA_MYSQL_INT_VERSION >= 32322)
185 * Displays the footer
187 echo "\n";
188 require('./footer.inc.php3');