bug 696215
[phpmyadmin/crack.git] / tbl_properties_structure.php3
blobcd8f55fcb717dc580bc61bcda59f1a754dba140f
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('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 (strpos($type, ' character set ')) {
144 list($type, $field_charset) = explode(' character set ', $type);
147 // garvin: Display basic mimetype [MIME]
148 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
149 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
150 } else {
151 $type_mime = '';
154 $strAttribute = '&nbsp;';
155 if ($binary) {
156 $strAttribute = 'BINARY';
158 if ($unsigned) {
159 $strAttribute = 'UNSIGNED';
161 if ($zerofill) {
162 $strAttribute = 'UNSIGNED ZEROFILL';
164 if (!isset($row['Default'])) {
165 if ($row['Null'] != '') {
166 $row['Default'] = '<i>NULL</i>';
168 } else {
169 $row['Default'] = htmlspecialchars($row['Default']);
172 $field_encoded = urlencode($row['Field']);
173 $field_name = htmlspecialchars($row['Field']);
175 // garvin: underline commented fields and display a hover-title (CSS only)
177 $comment_style = '';
178 if (isset($comments_map[$row['Field']])) {
179 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
182 if (isset($pk_array[$row['Field']])) {
183 $field_name = '<u>' . $field_name . '</u>';
185 echo "\n";
188 <tr>
189 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
190 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
191 </td>
192 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
193 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
194 <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '---' : $field_charset) . '</td>' . "\n" : '' ?>
195 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
196 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
197 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
198 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
199 <td bgcolor="<?php echo $bgcolor; ?>">
200 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
201 <?php echo $strChange; ?></a>
202 </td>
203 <td bgcolor="<?php echo $bgcolor; ?>">
204 <?php
205 // loic1: Drop field only if there is more than one field in the table
206 if ($fields_cnt > 1) {
207 echo "\n";
209 <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']))); ?>"
210 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
211 <?php echo $strDrop; ?></a>
212 <?php
213 } else {
214 echo "\n" . ' ' . $strDrop;
216 echo "\n";
218 </td>
219 <td bgcolor="<?php echo $bgcolor; ?>">
220 <?php
221 if ($type == 'text' || $type == 'blob') {
222 echo $strPrimary . "\n";
223 } else {
224 echo "\n";
226 <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']))); ?>"
227 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
228 <?php echo $strPrimary; ?></a>
229 <?php
231 echo "\n";
233 </td>
234 <td bgcolor="<?php echo $bgcolor; ?>">
235 <?php
236 if ($type == 'text' || $type == 'blob') {
237 echo $strIndex . "\n";
238 } else {
239 echo "\n";
241 <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']))); ?>">
242 <?php echo $strIndex; ?></a>
243 <?php
245 echo "\n";
247 </td>
248 <td bgcolor="<?php echo $bgcolor; ?>">
249 <?php
250 if ($type == 'text' || $type == 'blob') {
251 echo $strUnique . "\n";
252 } else {
253 echo "\n";
255 <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']))); ?>">
256 <?php echo $strUnique; ?></a>
257 <?php
259 echo "\n";
261 </td>
262 <?php
263 if (PMA_MYSQL_INT_VERSION >= 32323) {
264 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
265 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
266 echo "\n";
268 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
269 <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']))); ?>">
270 <?php echo $strIdxFulltext; ?></a>
271 </td>
272 <?php
273 } else {
274 echo "\n";
276 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
277 <?php echo $strIdxFulltext . "\n"; ?>
278 </td>
279 <?php
280 } // end if... else...
281 } // end if
282 echo "\n"
284 </tr>
285 <?php
286 } // end while
288 echo "\n";
290 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
293 <tr>
294 <td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : (PMA_MYSQL_INT_VERSION >= 32323 ? '13' : '12'); ?>">
295 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
296 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
297 <?php echo $strCheckAll; ?></a>
298 &nbsp;/&nbsp;
299 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
300 <?php echo $strUncheckAll; ?></a>
301 &nbsp;&nbsp;&nbsp;
302 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
303 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
304 <?php
305 // Drop button if there is at least two fields
306 if ($fields_cnt > 1) {
308 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
309 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
310 <?php
312 echo "\n";
314 </td>
315 </tr>
316 </table>
318 </form>
321 <?php
323 * If there are more than 20 rows, displays browse/select/insert/empty/drop
324 * links again
326 if ($fields_cnt > 20) {
328 <!-- Browse links -->
329 <?php
330 echo "\n";
331 include('./tbl_properties_links.php3');
332 } // end if ($fields_cnt > 20)
333 echo "\n\n";
337 * Displays indexes
340 <!-- Indexes, space usage and row statistics -->
341 <br />
342 <table border="0" cellspacing="0" cellpadding="0">
343 <tr>
344 <td>
345 <?php
346 define('PMA_IDX_INCLUDED', 1);
347 require ('./tbl_indexes.php3');
349 </td>
351 <?php
353 * Displays Space usage and row statistics
355 // BEGIN - Calc Table Space - staybyte - 9 June 2001
356 // loic1, 22 feb. 2002: updated with patch from
357 // Joshua Nye <josh at boxcarmedia.com> to get valid
358 // statistics whatever is the table type
359 if ($cfg['ShowStats']) {
360 $nonisam = FALSE;
361 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
362 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
363 $nonisam = TRUE;
365 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
366 // Gets some sizes
367 $mergetable = FALSE;
368 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
369 $mergetable = TRUE;
371 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
372 if ($mergetable == FALSE) {
373 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
375 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
376 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
377 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
378 } else {
379 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
381 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
382 if ($table_info_num_rows > 0) {
383 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
386 // Displays them
389 <!-- Space usage -->
390 <td width="20">&nbsp;</td>
391 <td valign="top">
392 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
393 <a name="showusage"></a>
394 <table border="<?php echo $cfg['Border']; ?>">
395 <tr>
396 <th><?php echo $strType; ?></th>
397 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
398 </tr>
399 <tr>
400 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
401 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
402 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
403 </tr>
404 <?php
405 if (isset($index_size)) {
406 echo "\n";
408 <tr>
409 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
410 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
411 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
412 </tr>
413 <?php
415 if (isset($free_size)) {
416 echo "\n";
418 <tr style="color: #bb0000">
419 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
420 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
421 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
422 </tr>
423 <tr>
424 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
425 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
426 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
427 </tr>
428 <?php
430 if (isset($tot_size) && $mergetable == FALSE) {
431 echo "\n";
433 <tr>
434 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
435 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
436 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
437 </tr>
438 <?php
440 // Optimize link if overhead
441 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
442 echo "\n";
444 <tr>
445 <td colspan="3" align="center">
446 [<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>]
447 </td>
448 </tr>
449 <?php
451 echo "\n";
453 </table>
454 </td>
456 <!-- Rows Statistic -->
457 <td width="20">&nbsp;</td>
458 <td valign="top">
459 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
460 <table border="<?php echo $cfg['Border']; ?>">
461 <tr>
462 <th><?php echo $strStatement; ?></th>
463 <th align="center"><?php echo $strValue; ?></th>
464 </tr>
465 <?php
466 $i = 0;
467 if (isset($showtable['Row_format'])) {
468 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
469 echo "\n";
471 <tr>
472 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
473 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
474 <?php
475 echo ' ';
476 if ($showtable['Row_format'] == 'Fixed') {
477 echo $strFixed;
479 else if ($showtable['Row_format'] == 'Dynamic') {
480 echo $strDynamic;
482 else {
483 echo $showtable['Row_format'];
485 echo "\n";
487 </td>
488 </tr>
489 <?php
491 if (!$is_innodb && isset($showtable['Rows'])) {
492 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
493 echo "\n";
495 <tr>
496 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
497 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
498 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
499 </td>
500 </tr>
501 <?php
503 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
504 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
505 echo "\n";
507 <tr>
508 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
509 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
510 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
511 </td>
512 </tr>
513 <?php
515 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
516 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
517 echo "\n";
519 <tr>
520 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
521 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
522 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
523 </td>
524 </tr>
525 <?php
527 if (isset($showtable['Auto_increment'])) {
528 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
529 echo "\n";
531 <tr>
532 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
533 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
534 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
535 </td>
536 </tr>
537 <?php
539 echo "\n";
541 if (isset($showtable['Create_time'])) {
542 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
543 echo "\n";
545 <tr>
546 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
547 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
548 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
549 </td>
550 </tr>
551 <?php
553 echo "\n";
555 if (isset($showtable['Update_time'])) {
556 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
557 echo "\n";
559 <tr>
560 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
561 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
562 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
563 </td>
564 </tr>
565 <?php
567 echo "\n";
569 if (isset($showtable['Check_time'])) {
570 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
571 echo "\n";
573 <tr>
574 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
575 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
576 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
577 </td>
578 </tr>
579 <?php
581 echo "\n";
583 </table>
584 </td>
585 <?php
588 // END - Calc Table Space
589 echo "\n";
591 </tr>
592 </table>
593 <hr />
596 <?php
598 * Work on the table
601 <!-- TABLE WORK -->
602 <ul>
604 <!-- Printable view of the table -->
605 <li>
606 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
607 </li>
609 <!-- Add some new fields -->
610 <li>
611 <form method="post" action="tbl_addfield.php3"
612 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
613 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
614 <?php echo $strAddNewField; ?>&nbsp;:
615 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
616 <select name="after_field" style="vertical-align: middle">
617 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
618 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
619 <?php
620 reset($aryFields);
621 while (list($junk, $fieldname) = each($aryFields)) {
622 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
624 unset($aryFields);
626 </select>
627 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
628 </form>
629 </li>
631 <?php
632 if ($cfg['Server']['relation']) {
634 <!-- Work on Relations -->
635 <li>
636 <div style="margin-bottom: 10px">
637 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
638 </div>
639 </li>
640 <?php
642 echo "\n";
645 <!-- Let MySQL propose the optimal structure -->
646 <li>
647 <div style="margin-bottom: 10px">
648 <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()'); ?>">
649 <?php echo $strStructPropose; ?></a>
650 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
651 </div>
652 </li>
654 <?php
656 * Query box, bookmark, insert data from textfile
658 $goto = 'tbl_properties_structure.php3';
659 require('./tbl_query_box.php3');
662 </ul>
665 <?php
667 * Displays the footer
669 echo "\n";
670 require('./footer.inc.php3');