lang
[phpmyadmin/crack.git] / tbl_properties_structure.php3
bloba33d8488f477be6764bfe1d09ec227dbf4ecf14f
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 include('./mult_submits.inc.php3');
22 /**
23 * Runs common work
25 require('./tbl_properties_common.php3');
26 $url_query .= '&amp;goto=tbl_properties_structure.php3&amp;back=tbl_properties_structure.php3';
28 /**
29 * Prepares the table structure display
31 // 1. Get table information/display tabs
32 require('./tbl_properties_table_info.php3');
34 /**
35 * Show result of multi submit operation
37 if ((!empty($submit_mult) && isset($selected_fld))
38 || isset($mult_btn)) {
39 PMA_showMessage($strSuccess);
42 // 2. Gets table keys and retains them
43 $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
44 $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
45 $primary = '';
46 $ret_keys = array();
47 $pk_array = array(); // will be use to emphasis prim. keys in the table view
48 while ($row = PMA_mysql_fetch_array($result)) {
49 $ret_keys[] = $row;
50 // Backups the list of primary keys
51 if ($row['Key_name'] == 'PRIMARY') {
52 $primary .= $row['Column_name'] . ', ';
53 $pk_array[$row['Column_name']] = 1;
55 } // end while
56 mysql_free_result($result);
58 // 3. Get fields
59 $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
60 $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
61 $fields_cnt = mysql_num_rows($fields_rs);
65 /**
66 * Displays the table structure ('show table' works correct since 3.23.03)
70 <!-- TABLE INFORMATIONS -->
72 <form action="tbl_properties_structure.php3" name="fieldsForm">
73 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
75 <table border="<?php echo $cfg['Border']; ?>">
76 <tr>
77 <td></td>
78 <th>&nbsp;<?php echo $strField; ?>&nbsp;</th>
79 <th><?php echo $strType; ?></th>
80 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th>' . $strCharset . '</th>' . "\n" : ''; ?>
81 <th><?php echo $strAttr; ?></th>
82 <th><?php echo $strNull; ?></th>
83 <th><?php echo $strDefault; ?></th>
84 <th><?php echo $strExtra; ?></th>
85 <th colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '6' : '5'); ?>"><?php echo $strAction; ?></th>
86 </tr>
88 <?php
89 $comments_map = array();
90 $mime_map = array();
92 if ($GLOBALS['cfg']['ShowPropertyComments']) {
93 require('./libraries/relation.lib.php3');
94 require('./libraries/transformations.lib.php3');
96 $cfgRelation = PMA_getRelationsParam();
99 if ($cfgRelation['commwork']) {
100 $comments_map = PMA_getComments($db, $table);
102 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
103 $mime_map = PMA_getMIME($db, $table, true);
108 $i = 0;
109 $aryFields = array();
110 $checked = (!empty($checkall) ? ' checked="checked"' : '');
112 while ($row = PMA_mysql_fetch_array($fields_rs)) {
113 $i++;
114 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
115 $aryFields[] = $row['Field'];
117 $type = $row['Type'];
118 // reformat mysql query output - staybyte - 9. June 2001
119 // loic1: set or enum types: slashes single quotes inside options
120 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
121 $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
122 $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
123 $type_nowrap = '';
125 $binary = 0;
126 $unsigned = 0;
127 $zerofill = 0;
128 } else {
129 $type_nowrap = ' nowrap="nowrap"';
130 $type = eregi_replace('BINARY', '', $type);
131 $type = eregi_replace('ZEROFILL', '', $type);
132 $type = eregi_replace('UNSIGNED', '', $type);
133 if (empty($type)) {
134 $type = '&nbsp;';
137 $binary = eregi('BLOB', $row['Type'], $test) || eregi('BINARY', $row['Type'], $test);
138 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
139 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
142 // rabus: Devide charset from the rest of the type definition (MySQL >= 4.1)
143 unset($field_charset);
144 if (PMA_MYSQL_INT_VERSION >= 40100) {
145 if ((substr($type, 0, 4) == 'char'
146 || substr($type, 0, 7) == 'varchar'
147 || substr($type, 0, 4) == 'text'
148 || substr($type, 0, 8) == 'tinytext'
149 || substr($type, 0, 10) == 'mediumtext'
150 || substr($type, 0, 8) == 'longtext'
151 || substr($type, 0, 3) == 'set'
152 || substr($type, 0, 4) == 'enum'
153 ) && !$binary) {
154 if (strpos($type, ' character set ')) {
155 $type = substr($type, 0, strpos($type, ' character set '));
157 if (!empty($row['Collation'])) {
158 $field_charset = $row['Collation'];
159 } else {
160 $field_charset = '';
162 } else {
163 $field_charset = '';
167 // garvin: Display basic mimetype [MIME]
168 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
169 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
170 } else {
171 $type_mime = '';
174 $strAttribute = '&nbsp;';
175 if ($binary) {
176 $strAttribute = 'BINARY';
178 if ($unsigned) {
179 $strAttribute = 'UNSIGNED';
181 if ($zerofill) {
182 $strAttribute = 'UNSIGNED ZEROFILL';
184 if (!isset($row['Default'])) {
185 if ($row['Null'] != '') {
186 $row['Default'] = '<i>NULL</i>';
188 } else {
189 $row['Default'] = htmlspecialchars($row['Default']);
192 $field_encoded = urlencode($row['Field']);
193 $field_name = htmlspecialchars($row['Field']);
195 // garvin: underline commented fields and display a hover-title (CSS only)
197 $comment_style = '';
198 if (isset($comments_map[$row['Field']])) {
199 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
202 if (isset($pk_array[$row['Field']])) {
203 $field_name = '<u>' . $field_name . '</u>';
205 echo "\n";
208 <tr>
209 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
210 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
211 </td>
212 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
213 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
214 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '&nbsp;' : $field_charset) . '</td>' . "\n" : '' ?>
215 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
216 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
217 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
218 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
219 <td bgcolor="<?php echo $bgcolor; ?>">
220 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
221 <?php echo $strChange; ?></a>
222 </td>
223 <td bgcolor="<?php echo $bgcolor; ?>">
224 <?php
225 // loic1: Drop field only if there is more than one field in the table
226 if ($fields_cnt > 1) {
227 echo "\n";
229 <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']))); ?>"
230 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
231 <?php echo $strDrop; ?></a>
232 <?php
233 } else {
234 echo "\n" . ' ' . $strDrop;
236 echo "\n";
238 </td>
239 <td bgcolor="<?php echo $bgcolor; ?>">
240 <?php
241 if ($type == 'text' || $type == 'blob') {
242 echo $strPrimary . "\n";
243 } else {
244 echo "\n";
246 <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']))); ?>"
247 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
248 <?php echo $strPrimary; ?></a>
249 <?php
251 echo "\n";
253 </td>
254 <td bgcolor="<?php echo $bgcolor; ?>">
255 <?php
256 if ($type == 'text' || $type == 'blob') {
257 echo $strIndex . "\n";
258 } else {
259 echo "\n";
261 <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']))); ?>">
262 <?php echo $strIndex; ?></a>
263 <?php
265 echo "\n";
267 </td>
268 <td bgcolor="<?php echo $bgcolor; ?>">
269 <?php
270 if ($type == 'text' || $type == 'blob') {
271 echo $strUnique . "\n";
272 } else {
273 echo "\n";
275 <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']))); ?>">
276 <?php echo $strUnique; ?></a>
277 <?php
279 echo "\n";
281 </td>
282 <?php
283 if (PMA_MYSQL_INT_VERSION >= 32323) {
284 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
285 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
286 echo "\n";
288 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
289 <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']))); ?>">
290 <?php echo $strIdxFulltext; ?></a>
291 </td>
292 <?php
293 } else {
294 echo "\n";
296 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
297 <?php echo $strIdxFulltext . "\n"; ?>
298 </td>
299 <?php
300 } // end if... else...
301 } // end if
302 echo "\n"
304 </tr>
305 <?php
306 unset($field_charset);
307 } // end while
309 echo "\n";
311 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
314 <tr>
315 <td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : (PMA_MYSQL_INT_VERSION >= 32323 ? '13' : '12'); ?>">
316 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
317 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
318 <?php echo $strCheckAll; ?></a>
319 &nbsp;/&nbsp;
320 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
321 <?php echo $strUncheckAll; ?></a>
322 &nbsp;&nbsp;&nbsp;
323 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
324 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
325 <?php
326 // Drop button if there is at least two fields
327 if ($fields_cnt > 1) {
329 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
330 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
331 <?php
333 echo "\n";
335 </td>
336 </tr>
337 </table>
339 </form>
342 <?php
344 * If there are more than 20 rows, displays browse/select/insert/empty/drop
345 * links again
347 if ($fields_cnt > 20) {
349 <!-- Browse links -->
350 <?php
351 echo "\n";
352 include('./tbl_properties_links.php3');
353 } // end if ($fields_cnt > 20)
354 echo "\n\n";
358 * Displays indexes
361 <!-- Indexes, space usage and row statistics -->
362 <br />
363 <table border="0" cellspacing="0" cellpadding="0">
364 <tr>
365 <td valign="top">
366 <?php
367 define('PMA_IDX_INCLUDED', 1);
368 require ('./tbl_indexes.php3');
370 </td>
372 <?php
374 * Displays Space usage and row statistics
376 // BEGIN - Calc Table Space - staybyte - 9 June 2001
377 // loic1, 22 feb. 2002: updated with patch from
378 // Joshua Nye <josh at boxcarmedia.com> to get valid
379 // statistics whatever is the table type
380 if ($cfg['ShowStats']) {
381 $nonisam = FALSE;
382 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
383 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
384 $nonisam = TRUE;
386 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
387 // Gets some sizes
388 $mergetable = FALSE;
389 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
390 $mergetable = TRUE;
392 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
393 if ($mergetable == FALSE) {
394 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
396 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
397 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
398 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
399 } else {
400 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
402 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
403 if ($table_info_num_rows > 0) {
404 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
407 // Displays them
410 <!-- Space usage -->
411 <td width="20">&nbsp;</td>
412 <td valign="top">
413 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
414 <a name="showusage"></a>
415 <table border="<?php echo $cfg['Border']; ?>">
416 <tr>
417 <th><?php echo $strType; ?></th>
418 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
419 </tr>
420 <tr>
421 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
422 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
423 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
424 </tr>
425 <?php
426 if (isset($index_size)) {
427 echo "\n";
429 <tr>
430 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
431 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
432 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
433 </tr>
434 <?php
436 if (isset($free_size)) {
437 echo "\n";
439 <tr style="color: #bb0000">
440 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
441 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
442 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
443 </tr>
444 <tr>
445 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
446 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
447 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
448 </tr>
449 <?php
451 if (isset($tot_size) && $mergetable == FALSE) {
452 echo "\n";
454 <tr>
455 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
456 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
457 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
458 </tr>
459 <?php
461 // Optimize link if overhead
462 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
463 echo "\n";
465 <tr>
466 <td colspan="3" align="center">
467 [<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>]
468 </td>
469 </tr>
470 <?php
472 echo "\n";
474 </table>
475 </td>
477 <!-- Rows Statistic -->
478 <td width="20">&nbsp;</td>
479 <td valign="top">
480 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
481 <table border="<?php echo $cfg['Border']; ?>">
482 <tr>
483 <th><?php echo $strStatement; ?></th>
484 <th align="center"><?php echo $strValue; ?></th>
485 </tr>
486 <?php
487 $i = 0;
488 if (isset($showtable['Row_format'])) {
489 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
490 echo "\n";
492 <tr>
493 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
494 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
495 <?php
496 echo ' ';
497 if ($showtable['Row_format'] == 'Fixed') {
498 echo $strFixed;
500 else if ($showtable['Row_format'] == 'Dynamic') {
501 echo $strDynamic;
503 else {
504 echo $showtable['Row_format'];
506 echo "\n";
508 </td>
509 </tr>
510 <?php
512 if (PMA_MYSQL_INT_VERSION >= 40100) {
513 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
515 <tr>
516 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCharset; ?></td>
517 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
518 <?php
519 echo $tbl_charset;
521 </td>
522 </tr>
523 <?php
525 if (!$is_innodb && isset($showtable['Rows'])) {
526 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
527 echo "\n";
529 <tr>
530 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
531 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
532 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
533 </td>
534 </tr>
535 <?php
537 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
538 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
539 echo "\n";
541 <tr>
542 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
543 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
544 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
545 </td>
546 </tr>
547 <?php
549 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
550 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
551 echo "\n";
553 <tr>
554 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
555 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
556 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
557 </td>
558 </tr>
559 <?php
561 if (isset($showtable['Auto_increment'])) {
562 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
563 echo "\n";
565 <tr>
566 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
567 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
568 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
569 </td>
570 </tr>
571 <?php
573 echo "\n";
575 if (isset($showtable['Create_time'])) {
576 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
577 echo "\n";
579 <tr>
580 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
581 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
582 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
583 </td>
584 </tr>
585 <?php
587 echo "\n";
589 if (isset($showtable['Update_time'])) {
590 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
591 echo "\n";
593 <tr>
594 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
595 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
596 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
597 </td>
598 </tr>
599 <?php
601 echo "\n";
603 if (isset($showtable['Check_time'])) {
604 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
605 echo "\n";
607 <tr>
608 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
609 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
610 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
611 </td>
612 </tr>
613 <?php
615 echo "\n";
617 </table>
618 </td>
619 <?php
622 // END - Calc Table Space
623 echo "\n";
625 </tr>
626 </table>
627 <hr />
630 <?php
632 * Work on the table
635 <!-- TABLE WORK -->
636 <ul>
638 <!-- Printable view of the table -->
639 <li>
640 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
641 </li>
643 <!-- Add some new fields -->
644 <li>
645 <form method="post" action="tbl_addfield.php3"
646 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
647 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
648 <?php echo $strAddNewField; ?>&nbsp;:
649 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
650 <select name="after_field" style="vertical-align: middle">
651 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
652 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
653 <?php
654 reset($aryFields);
655 while (list($junk, $fieldname) = each($aryFields)) {
656 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
658 unset($aryFields);
660 </select>
661 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
662 </form>
663 </li>
665 <?php
666 if ($cfg['Server']['relation']) {
668 <!-- Work on Relations -->
669 <li>
670 <div style="margin-bottom: 10px">
671 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
672 </div>
673 </li>
674 <?php
676 echo "\n";
679 <!-- Let MySQL propose the optimal structure -->
680 <li>
681 <div style="margin-bottom: 10px">
682 <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()'); ?>">
683 <?php echo $strStructPropose; ?></a>
684 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
685 </div>
686 </li>
688 <?php
690 * Query box, bookmark, insert data from textfile
692 $goto = 'tbl_properties_structure.php3';
693 require('./tbl_query_box.php3');
696 </ul>
699 <?php
701 * Displays the footer
703 echo "\n";
704 require('./footer.inc.php3');