path disclosure
[phpmyadmin/crack.git] / tbl_properties_structure.php3
blob13709529fc5eb0a36b80ac57abc2ec8436c183bf
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
7 include('./libraries/grab_globals.lib.php3');
9 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
10 include('./libraries/common.lib.php3');
13 /**
14 * Drop multiple fields if required
16 if ((!empty($submit_mult) && isset($selected_fld))
17 || isset($mult_btn)) {
18 $action = 'tbl_properties_structure.php3';
19 $err_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db, $table);
20 include('./mult_submits.inc.php3');
23 /**
24 * Runs common work
26 require('./tbl_properties_common.php3');
27 $url_query .= '&amp;goto=tbl_properties_structure.php3&amp;back=tbl_properties_structure.php3';
29 /**
30 * Prepares the table structure display
32 // 1. Get table information/display tabs
33 require('./tbl_properties_table_info.php3');
35 /**
36 * Show result of multi submit operation
38 if ((!empty($submit_mult) && isset($selected_fld))
39 || isset($mult_btn)) {
40 PMA_showMessage($strSuccess);
43 // 2. Gets table keys and retains them
44 $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
45 $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
46 $primary = '';
47 $ret_keys = array();
48 $pk_array = array(); // will be use to emphasis prim. keys in the table view
49 while ($row = PMA_mysql_fetch_array($result)) {
50 $ret_keys[] = $row;
51 // Backups the list of primary keys
52 if ($row['Key_name'] == 'PRIMARY') {
53 $primary .= $row['Column_name'] . ', ';
54 $pk_array[$row['Column_name']] = 1;
56 } // end while
57 mysql_free_result($result);
59 // 3. Get fields
60 $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
61 $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
62 $fields_cnt = mysql_num_rows($fields_rs);
66 /**
67 * Displays the table structure ('show table' works correct since 3.23.03)
71 <!-- TABLE INFORMATIONS -->
73 <form action="tbl_properties_structure.php3" name="fieldsForm">
74 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
76 <table border="<?php echo $cfg['Border']; ?>">
77 <tr>
78 <td></td>
79 <th>&nbsp;<?php echo $strField; ?>&nbsp;</th>
80 <th><?php echo $strType; ?></th>
81 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th>' . $strCharset . '</th>' . "\n" : ''; ?>
82 <th><?php echo $strAttr; ?></th>
83 <th><?php echo $strNull; ?></th>
84 <th><?php echo $strDefault; ?></th>
85 <th><?php echo $strExtra; ?></th>
86 <th colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '6' : '5'); ?>"><?php echo $strAction; ?></th>
87 </tr>
89 <?php
90 $comments_map = array();
91 $mime_map = array();
93 if ($GLOBALS['cfg']['ShowPropertyComments']) {
94 require('./libraries/relation.lib.php3');
95 require('./libraries/transformations.lib.php3');
97 $cfgRelation = PMA_getRelationsParam();
100 if ($cfgRelation['commwork']) {
101 $comments_map = PMA_getComments($db, $table);
103 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
104 $mime_map = PMA_getMIME($db, $table, true);
109 $i = 0;
110 $aryFields = array();
111 $checked = (!empty($checkall) ? ' checked="checked"' : '');
113 while ($row = PMA_mysql_fetch_array($fields_rs)) {
114 $i++;
115 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
116 $aryFields[] = $row['Field'];
118 $type = $row['Type'];
119 // reformat mysql query output - staybyte - 9. June 2001
120 // loic1: set or enum types: slashes single quotes inside options
121 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
122 $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
123 $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
124 $type_nowrap = '';
126 $binary = 0;
127 $unsigned = 0;
128 $zerofill = 0;
129 } else {
130 $type_nowrap = ' nowrap="nowrap"';
131 $type = eregi_replace('BINARY', '', $type);
132 $type = eregi_replace('ZEROFILL', '', $type);
133 $type = eregi_replace('UNSIGNED', '', $type);
134 if (empty($type)) {
135 $type = '&nbsp;';
138 $binary = eregi('BLOB', $row['Type'], $test) || eregi('BINARY', $row['Type'], $test);
139 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
140 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
143 // rabus: Devide charset from the rest of the type definition (MySQL >= 4.1)
144 unset($field_charset);
145 if (PMA_MYSQL_INT_VERSION >= 40100) {
146 if ((substr($type, 0, 4) == 'char'
147 || substr($type, 0, 7) == 'varchar'
148 || substr($type, 0, 4) == 'text'
149 || substr($type, 0, 8) == 'tinytext'
150 || substr($type, 0, 10) == 'mediumtext'
151 || substr($type, 0, 8) == 'longtext'
152 || substr($type, 0, 3) == 'set'
153 || substr($type, 0, 4) == 'enum'
154 ) && !$binary) {
155 if (strpos($type, ' character set ')) {
156 $type = substr($type, 0, strpos($type, ' character set '));
158 if (!empty($row['Collation'])) {
159 $field_charset = $row['Collation'];
160 } else {
161 $field_charset = '';
163 } else {
164 $field_charset = '';
168 // garvin: Display basic mimetype [MIME]
169 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
170 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
171 } else {
172 $type_mime = '';
175 $strAttribute = '&nbsp;';
176 if ($binary) {
177 $strAttribute = 'BINARY';
179 if ($unsigned) {
180 $strAttribute = 'UNSIGNED';
182 if ($zerofill) {
183 $strAttribute = 'UNSIGNED ZEROFILL';
185 if (!isset($row['Default'])) {
186 if ($row['Null'] != '') {
187 $row['Default'] = '<i>NULL</i>';
189 } else {
190 $row['Default'] = htmlspecialchars($row['Default']);
193 $field_encoded = urlencode($row['Field']);
194 $field_name = htmlspecialchars($row['Field']);
196 // garvin: underline commented fields and display a hover-title (CSS only)
198 $comment_style = '';
199 if (isset($comments_map[$row['Field']])) {
200 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
203 if (isset($pk_array[$row['Field']])) {
204 $field_name = '<u>' . $field_name . '</u>';
206 echo "\n";
209 <tr>
210 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
211 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
212 </td>
213 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
214 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
215 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '&nbsp;' : $field_charset) . '</td>' . "\n" : '' ?>
216 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
217 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
218 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
219 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
220 <td bgcolor="<?php echo $bgcolor; ?>">
221 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
222 <?php echo $strChange; ?></a>
223 </td>
224 <td bgcolor="<?php echo $bgcolor; ?>">
225 <?php
226 // loic1: Drop field only if there is more than one field in the table
227 if ($fields_cnt > 1) {
228 echo "\n";
230 <a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&amp;cpurge=1&amp;purgekey=<?php echo urlencode($row['Field']); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
231 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
232 <?php echo $strDrop; ?></a>
233 <?php
234 } else {
235 echo "\n" . ' ' . $strDrop;
237 echo "\n";
239 </td>
240 <td bgcolor="<?php echo $bgcolor; ?>">
241 <?php
242 if ($type == 'text' || $type == 'blob') {
243 echo $strPrimary . "\n";
244 } else {
245 echo "\n";
247 <a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY, ADD PRIMARY KEY(' . $primary . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAPrimaryKey, htmlspecialchars($row['Field']))); ?>"
248 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
249 <?php echo $strPrimary; ?></a>
250 <?php
252 echo "\n";
254 </td>
255 <td bgcolor="<?php echo $bgcolor; ?>">
256 <?php
257 if ($type == 'text' || $type == 'blob') {
258 echo $strIndex . "\n";
259 } else {
260 echo "\n";
262 <a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex ,htmlspecialchars($row['Field']))); ?>">
263 <?php echo $strIndex; ?></a>
264 <?php
266 echo "\n";
268 </td>
269 <td bgcolor="<?php echo $bgcolor; ?>">
270 <?php
271 if ($type == 'text' || $type == 'blob') {
272 echo $strUnique . "\n";
273 } else {
274 echo "\n";
276 <a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
277 <?php echo $strUnique; ?></a>
278 <?php
280 echo "\n";
282 </td>
283 <?php
284 if (PMA_MYSQL_INT_VERSION >= 32323) {
285 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
286 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
287 echo "\n";
289 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
290 <a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
291 <?php echo $strIdxFulltext; ?></a>
292 </td>
293 <?php
294 } else {
295 echo "\n";
297 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
298 <?php echo $strIdxFulltext . "\n"; ?>
299 </td>
300 <?php
301 } // end if... else...
302 } // end if
303 echo "\n"
305 </tr>
306 <?php
307 unset($field_charset);
308 } // end while
310 echo "\n";
312 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
315 <tr>
316 <td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : (PMA_MYSQL_INT_VERSION >= 32323 ? '13' : '12'); ?>">
317 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
318 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
319 <?php echo $strCheckAll; ?></a>
320 &nbsp;/&nbsp;
321 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
322 <?php echo $strUncheckAll; ?></a>
323 &nbsp;&nbsp;&nbsp;
324 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
325 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
326 <?php
327 // Drop button if there is at least two fields
328 if ($fields_cnt > 1) {
330 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
331 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
332 <?php
334 echo "\n";
336 </td>
337 </tr>
338 </table>
340 </form>
343 <?php
345 * If there are more than 20 rows, displays browse/select/insert/empty/drop
346 * links again
348 if ($fields_cnt > 20) {
350 <!-- Browse links -->
351 <?php
352 echo "\n";
353 include('./tbl_properties_links.php3');
354 } // end if ($fields_cnt > 20)
355 echo "\n\n";
359 * Displays indexes
362 <!-- Indexes, space usage and row statistics -->
363 <br />
364 <table border="0" cellspacing="0" cellpadding="0">
365 <tr>
366 <td valign="top">
367 <?php
368 define('PMA_IDX_INCLUDED', 1);
369 require ('./tbl_indexes.php3');
371 </td>
373 <?php
375 * Displays Space usage and row statistics
377 // BEGIN - Calc Table Space - staybyte - 9 June 2001
378 // loic1, 22 feb. 2002: updated with patch from
379 // Joshua Nye <josh at boxcarmedia.com> to get valid
380 // statistics whatever is the table type
381 if ($cfg['ShowStats']) {
382 $nonisam = FALSE;
383 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
384 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
385 $nonisam = TRUE;
387 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
388 // Gets some sizes
389 $mergetable = FALSE;
390 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
391 $mergetable = TRUE;
393 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
394 if ($mergetable == FALSE) {
395 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
397 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
398 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
399 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
400 } else {
401 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
403 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
404 if ($table_info_num_rows > 0) {
405 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
408 // Displays them
411 <!-- Space usage -->
412 <td width="20">&nbsp;</td>
413 <td valign="top">
414 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
415 <a name="showusage"></a>
416 <table border="<?php echo $cfg['Border']; ?>">
417 <tr>
418 <th><?php echo $strType; ?></th>
419 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
420 </tr>
421 <tr>
422 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
423 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
424 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
425 </tr>
426 <?php
427 if (isset($index_size)) {
428 echo "\n";
430 <tr>
431 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
432 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
433 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
434 </tr>
435 <?php
437 if (isset($free_size)) {
438 echo "\n";
440 <tr style="color: #bb0000">
441 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
442 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
443 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
444 </tr>
445 <tr>
446 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
447 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
448 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
449 </tr>
450 <?php
452 if (isset($tot_size) && $mergetable == FALSE) {
453 echo "\n";
455 <tr>
456 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
457 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
458 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
459 </tr>
460 <?php
462 // Optimize link if overhead
463 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
464 echo "\n";
466 <tr>
467 <td colspan="3" align="center">
468 [<a href="sql.php3?<?php echo $url_query; ?>&amp;pos=0&amp;sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>"><?php echo $strOptimizeTable; ?></a>]
469 </td>
470 </tr>
471 <?php
473 echo "\n";
475 </table>
476 </td>
478 <!-- Rows Statistic -->
479 <td width="20">&nbsp;</td>
480 <td valign="top">
481 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
482 <table border="<?php echo $cfg['Border']; ?>">
483 <tr>
484 <th><?php echo $strStatement; ?></th>
485 <th align="center"><?php echo $strValue; ?></th>
486 </tr>
487 <?php
488 $i = 0;
489 if (isset($showtable['Row_format'])) {
490 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
491 echo "\n";
493 <tr>
494 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
495 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
496 <?php
497 echo ' ';
498 if ($showtable['Row_format'] == 'Fixed') {
499 echo $strFixed;
501 else if ($showtable['Row_format'] == 'Dynamic') {
502 echo $strDynamic;
504 else {
505 echo $showtable['Row_format'];
507 echo "\n";
509 </td>
510 </tr>
511 <?php
513 if (PMA_MYSQL_INT_VERSION >= 40100) {
514 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
516 <tr>
517 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCharset; ?></td>
518 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
519 <?php
520 echo $tbl_charset;
522 </td>
523 </tr>
524 <?php
526 if (!$is_innodb && isset($showtable['Rows'])) {
527 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
528 echo "\n";
530 <tr>
531 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
532 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
533 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
534 </td>
535 </tr>
536 <?php
538 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
539 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
540 echo "\n";
542 <tr>
543 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
544 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
545 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
546 </td>
547 </tr>
548 <?php
550 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
551 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
552 echo "\n";
554 <tr>
555 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
556 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
557 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
558 </td>
559 </tr>
560 <?php
562 if (isset($showtable['Auto_increment'])) {
563 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
564 echo "\n";
566 <tr>
567 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
568 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
569 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
570 </td>
571 </tr>
572 <?php
574 echo "\n";
576 if (isset($showtable['Create_time'])) {
577 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
578 echo "\n";
580 <tr>
581 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
582 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
583 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
584 </td>
585 </tr>
586 <?php
588 echo "\n";
590 if (isset($showtable['Update_time'])) {
591 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
592 echo "\n";
594 <tr>
595 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
596 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
597 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
598 </td>
599 </tr>
600 <?php
602 echo "\n";
604 if (isset($showtable['Check_time'])) {
605 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
606 echo "\n";
608 <tr>
609 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
610 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
611 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
612 </td>
613 </tr>
614 <?php
616 echo "\n";
618 </table>
619 </td>
620 <?php
623 // END - Calc Table Space
624 echo "\n";
626 </tr>
627 </table>
628 <hr />
631 <?php
633 * Work on the table
636 <!-- TABLE WORK -->
637 <ul>
639 <!-- Printable view of the table -->
640 <li>
641 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
642 </li>
644 <!-- Add some new fields -->
645 <li>
646 <form method="post" action="tbl_addfield.php3"
647 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
648 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
649 <?php echo $strAddNewField; ?>&nbsp;:
650 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
651 <select name="after_field" style="vertical-align: middle">
652 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
653 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
654 <?php
655 reset($aryFields);
656 while (list($junk, $fieldname) = each($aryFields)) {
657 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
659 unset($aryFields);
661 </select>
662 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
663 </form>
664 </li>
666 <?php
667 if ($cfg['Server']['relation']) {
669 <!-- Work on Relations -->
670 <li>
671 <div style="margin-bottom: 10px">
672 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
673 </div>
674 </li>
675 <?php
677 echo "\n";
680 <!-- Let MySQL propose the optimal structure -->
681 <li>
682 <div style="margin-bottom: 10px">
683 <a href="sql.php3?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>">
684 <?php echo $strStructPropose; ?></a>
685 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
686 </div>
687 </li>
689 <?php
691 * Query box, bookmark, insert data from textfile
693 $goto = 'tbl_properties_structure.php3';
694 require('./tbl_query_box.php3');
697 </ul>
700 <?php
702 * Displays the footer
704 echo "\n";
705 require('./footer.inc.php3');