Removed a dublicate message.
[phpmyadmin/crack.git] / tbl_properties_structure.php3
blob9368623d54240fd6d0ef3ac9819df9516994b72d
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 if (PMA_MYSQL_INT_VERSION >= 40100 && (
144 substr($type, 0, 4) == 'char'
145 || substr($type, 0, 7) == 'varchar'
146 || substr($type, 0, 4) == 'text'
147 || substr($type, 0, 8) == 'tinytext'
148 || substr($type, 0, 10) == 'mediumtext'
149 || substr($type, 0, 8) == 'longtext'
150 ) && !$binary) {
151 if (strpos($type, ' character set ')) {
152 $type = substr($type, 0, strpos($type, ' character set '));
154 if (!empty($row['Collation'])) {
155 $field_charset = $row['Collation'];
159 // garvin: Display basic mimetype [MIME]
160 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
161 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
162 } else {
163 $type_mime = '';
166 $strAttribute = '&nbsp;';
167 if ($binary) {
168 $strAttribute = 'BINARY';
170 if ($unsigned) {
171 $strAttribute = 'UNSIGNED';
173 if ($zerofill) {
174 $strAttribute = 'UNSIGNED ZEROFILL';
176 if (!isset($row['Default'])) {
177 if ($row['Null'] != '') {
178 $row['Default'] = '<i>NULL</i>';
180 } else {
181 $row['Default'] = htmlspecialchars($row['Default']);
184 $field_encoded = urlencode($row['Field']);
185 $field_name = htmlspecialchars($row['Field']);
187 // garvin: underline commented fields and display a hover-title (CSS only)
189 $comment_style = '';
190 if (isset($comments_map[$row['Field']])) {
191 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
194 if (isset($pk_array[$row['Field']])) {
195 $field_name = '<u>' . $field_name . '</u>';
197 echo "\n";
200 <tr>
201 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
202 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
203 </td>
204 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
205 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
206 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '&nbsp;' : $field_charset) . '</td>' . "\n" : '' ?>
207 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
208 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
209 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
210 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
211 <td bgcolor="<?php echo $bgcolor; ?>">
212 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
213 <?php echo $strChange; ?></a>
214 </td>
215 <td bgcolor="<?php echo $bgcolor; ?>">
216 <?php
217 // loic1: Drop field only if there is more than one field in the table
218 if ($fields_cnt > 1) {
219 echo "\n";
221 <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']))); ?>"
222 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
223 <?php echo $strDrop; ?></a>
224 <?php
225 } else {
226 echo "\n" . ' ' . $strDrop;
228 echo "\n";
230 </td>
231 <td bgcolor="<?php echo $bgcolor; ?>">
232 <?php
233 if ($type == 'text' || $type == 'blob') {
234 echo $strPrimary . "\n";
235 } else {
236 echo "\n";
238 <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']))); ?>"
239 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
240 <?php echo $strPrimary; ?></a>
241 <?php
243 echo "\n";
245 </td>
246 <td bgcolor="<?php echo $bgcolor; ?>">
247 <?php
248 if ($type == 'text' || $type == 'blob') {
249 echo $strIndex . "\n";
250 } else {
251 echo "\n";
253 <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']))); ?>">
254 <?php echo $strIndex; ?></a>
255 <?php
257 echo "\n";
259 </td>
260 <td bgcolor="<?php echo $bgcolor; ?>">
261 <?php
262 if ($type == 'text' || $type == 'blob') {
263 echo $strUnique . "\n";
264 } else {
265 echo "\n";
267 <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']))); ?>">
268 <?php echo $strUnique; ?></a>
269 <?php
271 echo "\n";
273 </td>
274 <?php
275 if (PMA_MYSQL_INT_VERSION >= 32323) {
276 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
277 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
278 echo "\n";
280 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
281 <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']))); ?>">
282 <?php echo $strIdxFulltext; ?></a>
283 </td>
284 <?php
285 } else {
286 echo "\n";
288 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
289 <?php echo $strIdxFulltext . "\n"; ?>
290 </td>
291 <?php
292 } // end if... else...
293 } // end if
294 echo "\n"
296 </tr>
297 <?php
298 unset($field_charset);
299 } // end while
301 echo "\n";
303 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
306 <tr>
307 <td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : (PMA_MYSQL_INT_VERSION >= 32323 ? '13' : '12'); ?>">
308 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
309 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
310 <?php echo $strCheckAll; ?></a>
311 &nbsp;/&nbsp;
312 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
313 <?php echo $strUncheckAll; ?></a>
314 &nbsp;&nbsp;&nbsp;
315 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
316 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
317 <?php
318 // Drop button if there is at least two fields
319 if ($fields_cnt > 1) {
321 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
322 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
323 <?php
325 echo "\n";
327 </td>
328 </tr>
329 </table>
331 </form>
334 <?php
336 * If there are more than 20 rows, displays browse/select/insert/empty/drop
337 * links again
339 if ($fields_cnt > 20) {
341 <!-- Browse links -->
342 <?php
343 echo "\n";
344 include('./tbl_properties_links.php3');
345 } // end if ($fields_cnt > 20)
346 echo "\n\n";
350 * Displays indexes
353 <!-- Indexes, space usage and row statistics -->
354 <br />
355 <table border="0" cellspacing="0" cellpadding="0">
356 <tr>
357 <td valign="top">
358 <?php
359 define('PMA_IDX_INCLUDED', 1);
360 require ('./tbl_indexes.php3');
362 </td>
364 <?php
366 * Displays Space usage and row statistics
368 // BEGIN - Calc Table Space - staybyte - 9 June 2001
369 // loic1, 22 feb. 2002: updated with patch from
370 // Joshua Nye <josh at boxcarmedia.com> to get valid
371 // statistics whatever is the table type
372 if ($cfg['ShowStats']) {
373 $nonisam = FALSE;
374 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
375 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
376 $nonisam = TRUE;
378 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
379 // Gets some sizes
380 $mergetable = FALSE;
381 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
382 $mergetable = TRUE;
384 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
385 if ($mergetable == FALSE) {
386 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
388 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
389 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
390 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
391 } else {
392 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
394 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
395 if ($table_info_num_rows > 0) {
396 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
399 // Displays them
402 <!-- Space usage -->
403 <td width="20">&nbsp;</td>
404 <td valign="top">
405 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
406 <a name="showusage"></a>
407 <table border="<?php echo $cfg['Border']; ?>">
408 <tr>
409 <th><?php echo $strType; ?></th>
410 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
411 </tr>
412 <tr>
413 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
414 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
415 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
416 </tr>
417 <?php
418 if (isset($index_size)) {
419 echo "\n";
421 <tr>
422 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
423 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
424 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
425 </tr>
426 <?php
428 if (isset($free_size)) {
429 echo "\n";
431 <tr style="color: #bb0000">
432 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
433 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
434 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
435 </tr>
436 <tr>
437 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
438 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
439 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
440 </tr>
441 <?php
443 if (isset($tot_size) && $mergetable == FALSE) {
444 echo "\n";
446 <tr>
447 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
448 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
449 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
450 </tr>
451 <?php
453 // Optimize link if overhead
454 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
455 echo "\n";
457 <tr>
458 <td colspan="3" align="center">
459 [<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>]
460 </td>
461 </tr>
462 <?php
464 echo "\n";
466 </table>
467 </td>
469 <!-- Rows Statistic -->
470 <td width="20">&nbsp;</td>
471 <td valign="top">
472 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
473 <table border="<?php echo $cfg['Border']; ?>">
474 <tr>
475 <th><?php echo $strStatement; ?></th>
476 <th align="center"><?php echo $strValue; ?></th>
477 </tr>
478 <?php
479 $i = 0;
480 if (isset($showtable['Row_format'])) {
481 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
482 echo "\n";
484 <tr>
485 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
486 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
487 <?php
488 echo ' ';
489 if ($showtable['Row_format'] == 'Fixed') {
490 echo $strFixed;
492 else if ($showtable['Row_format'] == 'Dynamic') {
493 echo $strDynamic;
495 else {
496 echo $showtable['Row_format'];
498 echo "\n";
500 </td>
501 </tr>
502 <?php
504 if (PMA_MYSQL_INT_VERSION >= 40100) {
505 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
507 <tr>
508 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCharset; ?></td>
509 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
510 <?php
511 echo $showtable['Charset'];
513 </td>
514 </tr>
515 <?php
517 if (!$is_innodb && isset($showtable['Rows'])) {
518 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
519 echo "\n";
521 <tr>
522 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
523 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
524 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
525 </td>
526 </tr>
527 <?php
529 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
530 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
531 echo "\n";
533 <tr>
534 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
535 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
536 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
537 </td>
538 </tr>
539 <?php
541 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
542 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
543 echo "\n";
545 <tr>
546 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
547 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
548 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
549 </td>
550 </tr>
551 <?php
553 if (isset($showtable['Auto_increment'])) {
554 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
555 echo "\n";
557 <tr>
558 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
559 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
560 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
561 </td>
562 </tr>
563 <?php
565 echo "\n";
567 if (isset($showtable['Create_time'])) {
568 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
569 echo "\n";
571 <tr>
572 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
573 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
574 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
575 </td>
576 </tr>
577 <?php
579 echo "\n";
581 if (isset($showtable['Update_time'])) {
582 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
583 echo "\n";
585 <tr>
586 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
587 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
588 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
589 </td>
590 </tr>
591 <?php
593 echo "\n";
595 if (isset($showtable['Check_time'])) {
596 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
597 echo "\n";
599 <tr>
600 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
601 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
602 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
603 </td>
604 </tr>
605 <?php
607 echo "\n";
609 </table>
610 </td>
611 <?php
614 // END - Calc Table Space
615 echo "\n";
617 </tr>
618 </table>
619 <hr />
622 <?php
624 * Work on the table
627 <!-- TABLE WORK -->
628 <ul>
630 <!-- Printable view of the table -->
631 <li>
632 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
633 </li>
635 <!-- Add some new fields -->
636 <li>
637 <form method="post" action="tbl_addfield.php3"
638 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
639 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
640 <?php echo $strAddNewField; ?>&nbsp;:
641 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
642 <select name="after_field" style="vertical-align: middle">
643 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
644 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
645 <?php
646 reset($aryFields);
647 while (list($junk, $fieldname) = each($aryFields)) {
648 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
650 unset($aryFields);
652 </select>
653 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
654 </form>
655 </li>
657 <?php
658 if ($cfg['Server']['relation']) {
660 <!-- Work on Relations -->
661 <li>
662 <div style="margin-bottom: 10px">
663 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
664 </div>
665 </li>
666 <?php
668 echo "\n";
671 <!-- Let MySQL propose the optimal structure -->
672 <li>
673 <div style="margin-bottom: 10px">
674 <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()'); ?>">
675 <?php echo $strStructPropose; ?></a>
676 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
677 </div>
678 </li>
680 <?php
682 * Query box, bookmark, insert data from textfile
684 $goto = 'tbl_properties_structure.php3';
685 require('./tbl_query_box.php3');
688 </ul>
691 <?php
693 * Displays the footer
695 echo "\n";
696 require('./footer.inc.php3');