path disclosure
[phpmyadmin/crack.git] / tbl_properties.inc.php3
blob33212485caca4ce4a8569e6ec396890431e7efad
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 // Check parameters
7 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
8 include('./libraries/common.lib.php3');
11 PMA_checkParameters(array('db','table','action','num_fields'));
14 // Get available character sets (MySQL >= 4.1)
15 if (PMA_MYSQL_INT_VERSION >= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) {
16 include('./libraries/mysql_charsets.lib.php3');
20 <?php if ($cfg['CtrlArrowsMoving']) { ?>
21 <!-- Set on key handler for moving using by Ctrl+arrows -->
22 <script type="text/javascript" language="javascript">
23 <!--
24 document.onkeydown = onKeyDownArrowsHandler;
25 // -->
26 </script>
27 <?php } ?>
29 <form method="post" action="<?php echo $action; ?>" onsubmit="return checkTableEditForm(this, <?php echo $num_fields; ?>)" >
30 <?php
31 echo PMA_generate_common_hidden_inputs($db, $table);
32 if ($action == 'tbl_create.php3') {
34 <input type="hidden" name="reload" value="1" />
35 <?php
37 else if ($action == 'tbl_addfield.php3') {
38 echo "\n";
40 <input type="hidden" name="after_field" value="<?php echo $after_field; ?>" />
41 <?php
43 echo "\n";
45 if (isset($num_fields)) {
47 <input type="hidden" name="orig_num_fields" value="<?php echo $num_fields; ?>" />
48 <?php
51 if (isset($after_field)) {
53 <input type="hidden" name="orig_after_field" value="<?php echo $after_field; ?>" />
54 <?php
57 if (isset($selected) && is_array($selected)) {
58 @reset($selected);
59 while(list($o_fld_nr, $o_fld_val) = each($selected)) {
61 <input type="hidden" name="selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
62 <?php
63 if (!isset($true_selected)) {
65 <input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
66 <?php
71 if (isset($true_selected) && is_array($true_selected)) {
72 @reset($true_selected);
73 while(list($o_fld_nr, $o_fld_val) = each($true_selected)) {
75 <input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
76 <?php
80 } elseif (isset($field)) {
82 <input type="hidden" name="orig_field" value="<?php echo urlencode($field); ?>" />
83 <input type="hidden" name="true_selected[] value="<?php echo (isset($orig_field) ? $orig_field : urlencode($field)); ?>" />
84 <?php
87 $is_backup = ($action != 'tbl_create.php3' && $action != 'tbl_addfield.php3');
89 $header_cells = array();
90 $content_cells = array();
92 $header_cells[] = $strField;
93 $header_cells[] = $strType . '<br /><span style="font-weight: normal">' . PMA_showMySQLDocu('Reference', 'Column_types') . '</span>';
94 $header_cells[] = $strLengthSet;
95 if (PMA_MYSQL_INT_VERSION >= 40100) {
96 $header_cells[] = $strCharset;
98 $header_cells[] = $strAttr;
99 $header_cells[] = $strNull;
100 $header_cells[] = $strDefault . '**';
101 $header_cells[] = $strExtra;
103 require('./libraries/relation.lib.php3');
104 require('./libraries/transformations.lib.php3');
105 $cfgRelation = PMA_getRelationsParam();
107 $comments_map = array();
108 $mime_map = array();
109 $available_mime = array();
111 if ($cfgRelation['commwork']) {
112 $comments_map = PMA_getComments($db, $table);
113 $header_cells[] = $strComments;
115 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
116 $mime_map = PMA_getMIME($db, $table);
117 $available_mime = PMA_getAvailableMIMEtypes();
119 $header_cells[] = $strMIME_MIMEtype;
120 $header_cells[] = $strMIME_transformation;
121 $header_cells[] = $strMIME_transformation_options . '***';
126 // lem9: We could remove this 'if' and let the key information be shown and
127 // editable. However, for this to work, tbl_alter must be modified to use the
128 // key fields, as tbl_addfield does.
130 if (!$is_backup) {
131 $header_cells[] = $strPrimary;
132 $header_cells[] = $strIndex;
133 $header_cells[] = $strUnique;
134 $header_cells[] = '---';
135 $header_cells[] = $strIdxFulltext;
138 // garvin: workaround for field_fulltext, because its submitted indizes contain
139 // the index as a value, not a key. Inserted here for easier maintaineance
140 // and less code to change in existing files.
141 if (isset($field_fulltext) && is_array($field_fulltext)) {
142 @reset($field_fulltext);
143 while(list($fulltext_nr, $fulltext_indexkey) = each($field_fulltext)) {
144 $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
148 for ($i = 0 ; $i < $num_fields; $i++) {
149 $submit_null = FALSE;
150 if (isset($regenerate) && $regenerate == TRUE) {
151 // An error happened with previous inputs, so we will restore the data
152 // to embed it once again in this form.
154 $row['Field'] = (isset($field_name) && isset($field_name[$i]) ? $field_name[$i] : FALSE);
155 $row['Type'] = (isset($field_type) && isset($field_type[$i]) ? $field_type[$i] : FALSE);
156 $row['Null'] = (isset($field_null) && isset($field_null[$i]) ? $field_null[$i] : '');
157 if ($row['Null'] == '') {
158 $submit_null = TRUE;
161 if (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'primary_' . $i) {
162 $row['Key'] = 'PRI';
163 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'index_' . $i) {
164 $row['Key'] = 'MUL';
165 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'unique_' . $i) {
166 $row['Key'] = 'UNI';
167 } else {
168 $row['Key'] = '';
171 $row['Default'] = (isset($field_default) && isset($field_default[$i]) ? $field_default[$i] : FALSE);
172 $row['Extra'] = (isset($field_extra) && isset($field_extra[$i]) ? $field_extra[$i] : FALSE);
173 $row['Comment'] = (isset($submit_fulltext) && isset($submit_fulltext[$i]) && ($submit_fulltext[$i] == $i) ? 'FULLTEXT' : FALSE);
175 $submit_length = (isset($field_length) && isset($field_length[$i]) ? $field_length[$i] : FALSE);
176 $submit_attribute = (isset($field_attribute) && isset($field_attribute[$i]) ? $field_attribute[$i] : FALSE);
178 if (isset($field_comments) && isset($field_comments[$i])) {
179 $comments_map[$row['Field']] = $field_comments[$i];
182 if (isset($field_mimetype) && isset($field_mimetype[$i])) {
183 $mime_map[$row['Field']]['mimetype'] = $field_mimetype[$i];
186 if (isset($field_transformation) && isset($field_transformation[$i])) {
187 $mime_map[$row['Field']]['transformation'] = $field_transformation[$i];
190 if (isset($field_transformation_options) && isset($field_transformation_options[$i])) {
191 $mime_map[$row['Field']]['transformation_options'] = $field_transformation_options[$i];
194 } elseif (isset($fields_meta)) {
195 $row = $fields_meta[$i];
198 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
200 // Cell index: If certain fields get left out, the counter shouldn't chage.
201 $ci = 0;
202 // Everytime a cell shall be left out the STRG-jumping feature, $ci_offset
203 // has to be incremented ($ci_offset++)
204 $ci_offset = -1;
206 if ($is_backup) {
207 $backup_field = (isset($true_selected) && $true_selected[$i] ? $true_selected[$i] : (isset($row) && isset($row['Field']) ? urlencode($row['Field']) : ''));
208 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_orig[]" value="' . $backup_field . '" />' . "\n";
209 } else {
210 $content_cells[$i][$ci] = '';
213 $content_cells[$i][$ci] .= "\n" . '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_name[]" size="10" maxlength="64" value="' . (isset($row) && isset($row['Field']) ? str_replace('"', '&quot;', $row['Field']) : '') . '" class="textfield" />';
214 $ci++;
215 $content_cells[$i][$ci] = '<select name="field_type[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n";
217 if (empty($row['Type'])) {
218 $row['Type'] = '';
219 $type = '';
221 else {
222 $type = $row['Type'];
224 // set or enum types: slashes single quotes inside options
225 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
226 $type = $tmp[1];
227 $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
228 } else {
229 $type = eregi_replace('BINARY', '', $type);
230 $type = eregi_replace('ZEROFILL', '', $type);
231 $type = eregi_replace('UNSIGNED', '', $type);
233 if (strpos($type, '(')) {
234 $length = chop(substr($type, (strpos($type, '(') + 1), (strpos($type, ')') - strpos($type, '(') - 1)));
235 $type = chop(substr($type, 0, strpos($type, '(')));
236 } else {
237 $length = '';
239 } // end if else
241 // some types, for example longtext, are reported as
242 // "longtext character set latin7" when not latin1
243 if (PMA_MYSQL_INT_VERSION >= 40100) {
244 $tmp = strpos($type, 'character set');
245 if ($tmp) {
246 $type = substr($type,0,$tmp-1);
250 if (isset($submit_length) && $submit_length != FALSE) {
251 $length = $submit_length;
254 for ($j = 0; $j < count($cfg['ColumnTypes']); $j++) {
255 $content_cells[$i][$ci] .= ' <option value="'. $cfg['ColumnTypes'][$j] . '"';
256 if (strtoupper($type) == strtoupper($cfg['ColumnTypes'][$j])) {
257 $content_cells[$i][$ci] .= ' selected="selected"';
259 $content_cells[$i][$ci] .= '>' . $cfg['ColumnTypes'][$j] . '</option>' . "\n";
260 } // end for
262 $content_cells[$i][$ci] .= ' </select>';
263 $ci++;
265 if ($is_backup) {
266 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_length_orig[]" value="' . urlencode($length) . '" />';
267 } else {
268 $content_cells[$i][$ci] = '';
271 $content_cells[$i][$ci] .= "\n" . '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_length[]" size="8" value="' . str_replace('"', '&quot;', $length) . '" class="textfield" />' . "\n";
272 $ci++;
274 if (eregi('^(set|enum)$', $type)) {
275 $binary = 0;
276 $unsigned = 0;
277 $zerofill = 0;
278 } else {
279 $binary = eregi('BINARY', $row['Type'], $test_attribute1);
280 $unsigned = eregi('UNSIGNED', $row['Type'], $test_attribute2);
281 $zerofill = eregi('ZEROFILL', $row['Type'], $test_attribute3);
284 if (PMA_MYSQL_INT_VERSION >= 40100) {
285 $content_cells[$i][$ci] = '<select name="field_charset[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n"
286 . ' <option value=""></option>' . "\n";
287 if (!empty($row['Collation']) && (
288 strtolower(substr($type, 0, 4)) == 'char'
289 || strtolower(substr($type, 0, 7)) == 'varchar'
290 || strtolower(substr($type, 0, 4)) == 'text'
291 || strtolower(substr($type, 0, 8)) == 'tinytext'
292 || strtolower(substr($type, 0, 10)) == 'mediumtext'
293 || strtolower(substr($type, 0, 8)) == 'longtext'
294 || strtolower(substr($type, 0, 3)) == 'set'
295 || strtolower(substr($type, 0, 4)) == 'enum'
296 ) && !$binary) {
297 $real_charset = strpos($row['Collation'], '_') ? substr($row['Collation'], 0, strpos($row['Collation'], '_')) : $row['Collation'];
298 } else {
299 $real_charset = '';
301 for ($j = 0; isset($mysql_charsets[$j]); $j++) {
302 $content_cells[$i][$ci] .= ' <option value="' . $mysql_charsets[$j] . '"' . ($mysql_charsets[$j] == $real_charset ? ' selected="selected"' : '') . '>' . $mysql_charsets[$j] . '</option>' . "\n";
304 unset($j);
305 unset($real_charset);
306 $content_cells[$i][$ci] .= '</select>' . "\n";
307 $ci++;
310 $content_cells[$i][$ci] = '<select name="field_attribute[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n";
312 $strAttribute = '';
313 if ($binary) {
314 $strAttribute = 'BINARY';
316 if ($unsigned) {
317 $strAttribute = 'UNSIGNED';
319 if ($zerofill) {
320 $strAttribute = 'UNSIGNED ZEROFILL';
323 if (isset($submit_attribute) && $submit_attribute != FALSE) {
324 $strAttribute = $submit_attribute;
327 for ($j = 0;$j < count($cfg['AttributeTypes']); $j++) {
328 $content_cells[$i][$ci] .= ' <option value="'. $cfg['AttributeTypes'][$j] . '"';
329 if (strtoupper($strAttribute) == strtoupper($cfg['AttributeTypes'][$j])) {
330 $content_cells[$i][$ci] .= ' selected="selected"';
332 $content_cells[$i][$ci] .= '>' . $cfg['AttributeTypes'][$j] . '</option>' . "\n";
335 $content_cells[$i][$ci] .= '</select>';
336 $ci++;
338 $content_cells[$i][$ci] = '<select name="field_null[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
340 if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) {
341 $content_cells[$i][$ci] .= "\n";
342 $content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
343 $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
344 } else {
345 $content_cells[$i][$ci] .= "\n";
346 $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
347 $content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
350 $content_cells[$i][$ci] .= "\n" . '</select>';
351 $ci++;
353 if (isset($row)
354 && !isset($row['Default']) && !empty($row['Null'])) {
355 $row['Default'] = 'NULL';
358 if ($is_backup) {
359 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_default_orig[]" size="8" value="' . (isset($row) && isset($row['Default']) ? urlencode($row['Default']) : '') . '" />';
360 } else {
361 $content_cells[$i][$ci] = "\n";
364 $content_cells[$i][$ci] .= '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_default[]" size="8" value="' . (isset($row) && isset($row['Default']) ? str_replace('"', '&quot;', $row['Default']) : '') . '" class="textfield" />';
365 $ci++;
367 $content_cells[$i][$ci] = '<select name="field_extra[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
369 if(!isset($row) || empty($row['Extra'])) {
370 $content_cells[$i][$ci] .= "\n";
371 $content_cells[$i][$ci] .= '<option value=""></option>' . "\n";
372 $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n";
373 } else {
374 $content_cells[$i][$ci] .= "\n";
375 $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n";
376 $content_cells[$i][$ci] .= '<option value=""></option>' . "\n";
379 $content_cells[$i][$ci] .= "\n" . '</select>';
380 $ci++;
382 // garvin: comments
383 if ($cfgRelation['commwork']) {
384 $content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_comments[]" size="8" value="' . (isset($row) && isset($row['Field']) && is_array($comments_map) && isset($comments_map[$row['Field']]) ? htmlspecialchars($comments_map[$row['Field']]) : '') . '" class="textfield" />';
385 $ci++;
388 // garvin: MIME-types
389 if ($cfgRelation['mimework'] && $cfg['BrowseMIME'] && $cfgRelation['commwork']) {
390 $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_mimetype[]">' . "\n";
391 $content_cells[$i][$ci] .= ' <option value=""></option>' . "\n";
392 $content_cells[$i][$ci] .= ' <option value="auto">auto-detect</option>' . "\n";
394 if (is_array($available_mime['mimetype'])) {
395 @reset($available_mime['mimetype']);
396 while(list($mimekey, $mimetype) = each($available_mime['mimetype'])) {
397 $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['mimetype']) && ($mime_map[$row['Field']]['mimetype'] == str_replace('/', '_', $mimetype)) ? 'selected ' : '');
398 $content_cells[$i][$ci] .= ' <option value="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option>';
402 $content_cells[$i][$ci] .= '</select>';
403 $ci++;
405 $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_transformation[]">' . "\n";
406 $content_cells[$i][$ci] .= ' <option value="" title="' . $strNone . '"></option>' . "\n";
407 if (is_array($available_mime['transformation'])) {
408 @reset($available_mime['transformation']);
409 while(list($mimekey, $transform) = each($available_mime['transformation'])) {
410 $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation']) && ($mime_map[$row['Field']]['transformation'] == $available_mime['transformation_file'][$mimekey]) ? 'selected ' : '');
411 $tooltip = 'strTransformation_' . strtolower(str_replace('.inc.php3', '', $available_mime['transformation_file'][$mimekey]));
412 $tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', $strMIME_nodescription), 'PMA_transformation_' . $tooltip . '()');
413 $content_cells[$i][$ci] .= '<option value="' . $available_mime['transformation_file'][$mimekey] . '" ' . $checked . ' title="' . $tooltip . '">' . htmlspecialchars($transform) . '</option>' . "\n";
417 $content_cells[$i][$ci] .= '</select>';
418 $ci++;
420 $content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_transformation_options[]" size="8" value="' . (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation_options']) ? htmlspecialchars($mime_map[$row['Field']]['transformation_options']) : '') . '" class="textfield" />';
421 $ci++;
424 // lem9: See my other comment about removing this 'if'.
425 if (!$is_backup) {
426 if (isset($row) && isset($row['Key']) && $row['Key'] == 'PRI') {
427 $checked_primary = ' checked="checked"';
428 } else {
429 $checked_primary = '';
431 if (isset($row) && isset($row['Key']) && $row['Key'] == 'MUL') {
432 $checked_index = ' checked="checked"';
433 } else {
434 $checked_index = '';
436 if (isset($row) && isset($row['Key']) && $row['Key'] == 'UNI') {
437 $checked_unique = ' checked="checked"';
438 } else {
439 $checked_unique = '';
441 if (empty($checked_primary)
442 && empty($checked_index)
443 && empty($checked_unique)) {
444 $checked_none = ' checked="checked"';
445 } else {
446 $checked_none = '';
449 if (PMA_MYSQL_INT_VERSION >= 32323
450 &&(isset($row) && isset($row['Comment']) && $row['Comment'] == 'FULLTEXT')) {
451 $checked_fulltext = ' checked="checked"';
452 } else {
453 $checked_fulltext = '';
456 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="primary_' . $i . '"' . $checked_primary . ' />';
457 $ci++;
459 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="index_' . $i . '"' . $checked_index . ' />';
460 $ci++;
462 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="unique_' . $i . '"' . $checked_unique . ' />';
463 $ci++;
465 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="none_' . $i . '"' . $checked_none . ' />';
466 $ci++;
468 if (PMA_MYSQL_INT_VERSION >= 32323) {
469 $content_cells[$i][$ci] = '<input type="checkbox" name="field_fulltext[]" value="' . $i . '"' . $checked_fulltext . ' />';
470 } // end if (PMA_MYSQL_INT_VERSION >= 32323)
471 } // end if ($action ==...)
472 } // end for
474 if ($cfg['DefaultPropDisplay'] == 'horizontal') {
476 <table border="<?php echo $cfg['Border']; ?>">
477 <tr>
478 <?php
479 @reset($header_cells);
480 while(@list($header_nr, $header_val) = @each($header_cells)) {
482 <th><?php echo $header_val; ?></th>
483 <?php
486 </tr>
487 <?php
488 @reset($content_cells);
489 $i = 0;
490 while(@list($content_nr, $content_row) = @each($content_cells)) {
491 $i++;
492 echo "\n" . '<tr>' . "\n";
494 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
496 while(list($content_row_nr, $content_row_val) = @each($content_row)) {
498 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_row_val; ?></td>
499 <?php
501 echo "\n" . '</tr>' . "\n";
504 </table>
505 <br />
506 <?php
507 } else {
509 <table border="<?php echo $cfg['Border']; ?>">
510 <?php
511 @reset($header_cells);
512 $i = 0;
513 while(@list($header_nr, $header_val) = @each($header_cells)) {
514 echo "\n" . '<tr>' . "\n";
516 <th align="right"><?php echo $header_val; ?></th>
517 <?php
518 for ($j = 0; $j < count($content_cells); $j++) {
519 if (isset($content_cells[$j][$i]) && $content_cells[$j][$i] != '') {
520 $bgcolor = ($j % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
522 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_cells[$j][$i]; ?></td>
523 <?php
527 echo "\n" . '</tr>' . "\n";
528 $i++;
531 </table>
532 <br />
533 <?php
536 if ($action == 'tbl_create.php3' && PMA_MYSQL_INT_VERSION >= 32300) {
537 echo "\n";
539 <table>
540 <tr valign="top">
541 <td><?php echo $strTableComments; ?>&nbsp;:</td>
542 <?php
543 if ($action == 'tbl_create.php3') {
544 echo "\n";
546 <td width="25">&nbsp;</td>
547 <td><?php echo $strTableType; ?>&nbsp;:</td>
548 <?php
549 if (PMA_MYSQL_INT_VERSION >= 40100) {
550 echo ' <td width="25">&nbsp;</td>' . "\n"
551 . ' <td>' . $strCharset . '&nbsp;:</td>' . "\n";
554 echo "\n";
556 </tr>
557 <tr>
558 <td>
559 <input type="text" name="comment" size="40" maxlength="80" value="<?php echo (isset($comment) ? $comment : ''); ?>" class="textfield" />
560 </td>
561 <?php
562 // BEGIN - Table Type - 2 May 2001 - Robbat2
563 // change by staybyte - 11 June 2001
564 if ($action == 'tbl_create.php3') {
565 // find mysql capability - staybyte - 11. June 2001
566 $query = 'SHOW VARIABLES LIKE \'have_%\'';
567 $result = PMA_mysql_query($query);
568 if ($result != FALSE && mysql_num_rows($result) > 0) {
569 while ($tmp = PMA_mysql_fetch_array($result)) {
570 if (isset($tmp['Variable_name'])) {
571 switch ($tmp['Variable_name']) {
572 case 'have_bdb':
573 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
574 $tbl_bdb = TRUE;
576 break;
577 case 'have_gemini':
578 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
579 $tbl_gemini = TRUE;
581 break;
582 case 'have_innodb':
583 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
584 $tbl_innodb = TRUE;
586 break;
587 case 'have_isam':
588 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
589 $tbl_isam = TRUE;
591 break;
592 } // end switch
593 } // end if
594 } // end while
595 } // end if
596 mysql_free_result($result);
598 echo "\n";
600 <td width="25">&nbsp;</td>
601 <td>
602 <select name="tbl_type">
603 <option <?php echo (isset($tbl_type) && $tbl_type == 'Default' ? 'selected="checked"' : ''); ?> value="Default"><?php echo $strDefault; ?></option>
604 <option <?php echo (isset($tbl_type) && $tbl_type == 'MYISAM' ? 'selected="checked"' : ''); ?> value="MYISAM">MyISAM</option>
605 <option <?php echo (isset($tbl_type) && $tbl_type == 'HEAP' ? 'selected="checked"' : ''); ?> value="HEAP">Heap</option>
606 <option <?php echo (isset($tbl_type) && $tbl_type == 'MERGE' ? 'selected="checked"' : ''); ?> value="MERGE">Merge</option>
607 <?php if (isset($tbl_bdb)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'BDB' ? 'selected="checked"' : ''); ?> value="BDB">Berkeley DB</option><?php } ?>
608 <?php if (isset($tbl_gemini)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'GEMINI' ? 'selected="checked"' : ''); ?> value="GEMINI">Gemini</option><?php } ?>
609 <?php if (isset($tbl_innodb)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'INNO DB' ? 'selected="checked"' : ''); ?> value="InnoDB">INNO DB</option><?php } ?>
610 <?php if (isset($tbl_isam)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'ISAM' ? 'selected="checked"' : ''); ?> value="ISAM">ISAM</option><?php } ?>
611 </select>
612 </td>
613 <?php
614 if (PMA_MYSQL_INT_VERSION >= 40100) {
615 echo ' <td width="25">&nbsp;</td>' . "\n"
616 . ' <td>' . "\n"
617 . ' <select name="tbl_charset">' . "\n";
618 for ($i = 0; isset($mysql_charsets[$i]); $i++) {
619 echo ' <option value="' . $mysql_charsets[$i] . '"' . ($mysql_charsets[$i] == 'latin1' ? ' selected="selected"' : '') . '>' . $mysql_charsets[$i] . '</option>' . "\n";
621 unset($i);
622 echo ' </select>' . "\n"
623 . ' </td>' . "\n";
626 echo "\n";
628 </tr>
629 </table>
630 <br />
631 <?php
633 echo "\n";
634 // END - Table Type - 2 May 2001 - Robbat2
637 <input type="submit" name="submit" value="<?php echo $strSave; ?>" />
638 </form>
640 <table>
641 <tr>
642 <td valign="top">*&nbsp;</td>
643 <td>
644 <?php echo $strSetEnumVal . "\n"; ?>
645 </td>
646 </tr>
647 <tr>
648 <td valign="top">**&nbsp;</td>
649 <td>
650 <?php echo $strDefaultValueHelp . "\n"; ?>
651 </td>
652 </tr>
654 <?php
655 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
657 <tr>
658 <td valign="top" rowspan="2">***&nbsp;</td>
659 <td>
660 <?php echo $strMIME_transformation_options_note . "\n"; ?>
661 </td>
662 </tr>
664 <tr>
665 <td>
666 <?php echo sprintf($strMIME_transformation_note, '<a href="libraries/transformations/overview.php3?' . PMA_generate_common_url($db, $table) . '" target="_blank">', '</a>') . "\n"; ?>
667 </td>
668 </tr>
669 <?php
673 </table>
674 <br />
676 <center><?php echo PMA_showMySQLDocu('Reference', 'CREATE_TABLE'); ?></center>