lang
[phpmyadmin/crack.git] / tbl_properties_structure.php3
blob990a09a707bb984bd8acb304a96d5a7b43674e2b
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 <th><?php echo $strAttr; ?></th>
81 <th><?php echo $strNull; ?></th>
82 <th><?php echo $strDefault; ?></th>
83 <th><?php echo $strExtra; ?></th>
84 <th colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '6' : '5'); ?>"><?php echo $strAction; ?></th>
85 </tr>
87 <?php
88 $comments_map = array();
89 $mime_map = array();
91 if ($GLOBALS['cfg']['ShowPropertyComments']) {
92 require('./libraries/relation.lib.php3');
93 require('./libraries/transformations.lib.php3');
95 $cfgRelation = PMA_getRelationsParam();
98 if ($cfgRelation['commwork']) {
99 $comments_map = PMA_getComments($db, $table);
101 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
102 $mime_map = PMA_getMIME($db, $table, true);
107 $i = 0;
108 $aryFields = array();
109 $checked = (!empty($checkall) ? ' checked="checked"' : '');
111 while ($row = PMA_mysql_fetch_array($fields_rs)) {
112 $i++;
113 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
114 $aryFields[] = $row['Field'];
116 $type = $row['Type'];
117 // reformat mysql query output - staybyte - 9. June 2001
118 // loic1: set or enum types: slashes single quotes inside options
119 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
120 $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
121 $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
122 $type_nowrap = '';
124 $binary = 0;
125 $unsigned = 0;
126 $zerofill = 0;
127 } else {
128 $type_nowrap = ' nowrap="nowrap"';
129 $type = eregi_replace('BINARY', '', $type);
130 $type = eregi_replace('ZEROFILL', '', $type);
131 $type = eregi_replace('UNSIGNED', '', $type);
132 if (empty($type)) {
133 $type = '&nbsp;';
136 $binary = eregi('BINARY', $row['Type'], $test);
137 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
138 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
141 // garvin: Display basic mimetype [MIME]
142 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
143 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
144 } else {
145 $type_mime = '';
148 $strAttribute = '&nbsp;';
149 if ($binary) {
150 $strAttribute = 'BINARY';
152 if ($unsigned) {
153 $strAttribute = 'UNSIGNED';
155 if ($zerofill) {
156 $strAttribute = 'UNSIGNED ZEROFILL';
158 if (!isset($row['Default'])) {
159 if ($row['Null'] != '') {
160 $row['Default'] = '<i>NULL</i>';
162 } else {
163 $row['Default'] = htmlspecialchars($row['Default']);
166 $field_encoded = urlencode($row['Field']);
167 $field_name = htmlspecialchars($row['Field']);
169 // garvin: underline commented fields and display a hover-title (CSS only)
171 $comment_style = '';
172 if (isset($comments_map[$row['Field']])) {
173 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
176 if (isset($pk_array[$row['Field']])) {
177 $field_name = '<u>' . $field_name . '</u>';
179 echo "\n";
182 <tr>
183 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
184 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
185 </td>
186 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
187 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
188 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
189 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
190 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
191 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
192 <td bgcolor="<?php echo $bgcolor; ?>">
193 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
194 <?php echo $strChange; ?></a>
195 </td>
196 <td bgcolor="<?php echo $bgcolor; ?>">
197 <?php
198 // loic1: Drop field only if there is more than one field in the table
199 if ($fields_cnt > 1) {
200 echo "\n";
202 <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']))); ?>"
203 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
204 <?php echo $strDrop; ?></a>
205 <?php
206 } else {
207 echo "\n" . ' ' . $strDrop;
209 echo "\n";
211 </td>
212 <td bgcolor="<?php echo $bgcolor; ?>">
213 <?php
214 if ($type == 'text' || $type == 'blob') {
215 echo $strPrimary . "\n";
216 } else {
217 echo "\n";
219 <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']))); ?>"
220 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
221 <?php echo $strPrimary; ?></a>
222 <?php
224 echo "\n";
226 </td>
227 <td bgcolor="<?php echo $bgcolor; ?>">
228 <?php
229 if ($type == 'text' || $type == 'blob') {
230 echo $strIndex . "\n";
231 } else {
232 echo "\n";
234 <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']))); ?>">
235 <?php echo $strIndex; ?></a>
236 <?php
238 echo "\n";
240 </td>
241 <td bgcolor="<?php echo $bgcolor; ?>">
242 <?php
243 if ($type == 'text' || $type == 'blob') {
244 echo $strUnique . "\n";
245 } else {
246 echo "\n";
248 <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']))); ?>">
249 <?php echo $strUnique; ?></a>
250 <?php
252 echo "\n";
254 </td>
255 <?php
256 if (PMA_MYSQL_INT_VERSION >= 32323) {
257 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
258 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
259 echo "\n";
261 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
262 <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']))); ?>">
263 <?php echo $strIdxFulltext; ?></a>
264 </td>
265 <?php
266 } else {
267 echo "\n";
269 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
270 <?php echo $strIdxFulltext . "\n"; ?>
271 </td>
272 <?php
273 } // end if... else...
274 } // end if
275 echo "\n"
277 </tr>
278 <?php
279 } // end while
281 echo "\n";
283 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
286 <tr>
287 <td colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '13' : '12'); ?>">
288 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
289 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
290 <?php echo $strCheckAll; ?></a>
291 &nbsp;/&nbsp;
292 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
293 <?php echo $strUncheckAll; ?></a>
294 &nbsp;&nbsp;&nbsp;
295 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
296 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
297 <?php
298 // Drop button if there is at least two fields
299 if ($fields_cnt > 1) {
301 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
302 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
303 <?php
305 echo "\n";
307 </td>
308 </tr>
309 </table>
311 </form>
314 <?php
316 * If there are more than 20 rows, displays browse/select/insert/empty/drop
317 * links again
319 if ($fields_cnt > 20) {
321 <!-- Browse links -->
322 <?php
323 echo "\n";
324 include('./tbl_properties_links.php3');
325 } // end if ($fields_cnt > 20)
326 echo "\n\n";
330 * Displays indexes
333 <!-- Indexes, space usage and row statistics -->
334 <br />
335 <table border="0" cellspacing="0" cellpadding="0">
336 <tr>
337 <td>
338 <?php
339 define('PMA_IDX_INCLUDED', 1);
340 require ('./tbl_indexes.php3');
342 </td>
344 <?php
346 * Displays Space usage and row statistics
348 // BEGIN - Calc Table Space - staybyte - 9 June 2001
349 // loic1, 22 feb. 2002: updated with patch from
350 // Joshua Nye <josh at boxcarmedia.com> to get valid
351 // statistics whatever is the table type
352 if ($cfg['ShowStats']) {
353 $nonisam = FALSE;
354 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
355 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
356 $nonisam = TRUE;
358 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
359 // Gets some sizes
360 $mergetable = FALSE;
361 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
362 $mergetable = TRUE;
364 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
365 if ($mergetable == FALSE) {
366 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
368 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
369 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
370 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
371 } else {
372 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
374 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
375 if ($table_info_num_rows > 0) {
376 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
379 // Displays them
382 <!-- Space usage -->
383 <td width="20">&nbsp;</td>
384 <td valign="top">
385 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
386 <a name="showusage"></a>
387 <table border="<?php echo $cfg['Border']; ?>">
388 <tr>
389 <th><?php echo $strType; ?></th>
390 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
391 </tr>
392 <tr>
393 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
394 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
395 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
396 </tr>
397 <?php
398 if (isset($index_size)) {
399 echo "\n";
401 <tr>
402 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
403 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
404 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
405 </tr>
406 <?php
408 if (isset($free_size)) {
409 echo "\n";
411 <tr style="color: #bb0000">
412 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
413 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
414 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
415 </tr>
416 <tr>
417 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
418 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
419 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
420 </tr>
421 <?php
423 if (isset($tot_size) && $mergetable == FALSE) {
424 echo "\n";
426 <tr>
427 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
428 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
429 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
430 </tr>
431 <?php
433 // Optimize link if overhead
434 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
435 echo "\n";
437 <tr>
438 <td colspan="3" align="center">
439 [<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>]
440 </td>
441 </tr>
442 <?php
444 echo "\n";
446 </table>
447 </td>
449 <!-- Rows Statistic -->
450 <td width="20">&nbsp;</td>
451 <td valign="top">
452 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
453 <table border="<?php echo $cfg['Border']; ?>">
454 <tr>
455 <th><?php echo $strStatement; ?></th>
456 <th align="center"><?php echo $strValue; ?></th>
457 </tr>
458 <?php
459 $i = 0;
460 if (isset($showtable['Row_format'])) {
461 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
462 echo "\n";
464 <tr>
465 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
466 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
467 <?php
468 echo ' ';
469 if ($showtable['Row_format'] == 'Fixed') {
470 echo $strFixed;
472 else if ($showtable['Row_format'] == 'Dynamic') {
473 echo $strDynamic;
475 else {
476 echo $showtable['Row_format'];
478 echo "\n";
480 </td>
481 </tr>
482 <?php
484 if (!$is_innodb && isset($showtable['Rows'])) {
485 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
486 echo "\n";
488 <tr>
489 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
490 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
491 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
492 </td>
493 </tr>
494 <?php
496 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
497 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
498 echo "\n";
500 <tr>
501 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
502 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
503 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
504 </td>
505 </tr>
506 <?php
508 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
509 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
510 echo "\n";
512 <tr>
513 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
514 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
515 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
516 </td>
517 </tr>
518 <?php
520 if (isset($showtable['Auto_increment'])) {
521 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
522 echo "\n";
524 <tr>
525 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
526 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
527 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
528 </td>
529 </tr>
530 <?php
532 echo "\n";
534 if (isset($showtable['Create_time'])) {
535 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
536 echo "\n";
538 <tr>
539 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
540 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
541 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
542 </td>
543 </tr>
544 <?php
546 echo "\n";
548 if (isset($showtable['Update_time'])) {
549 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
550 echo "\n";
552 <tr>
553 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
554 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
555 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
556 </td>
557 </tr>
558 <?php
560 echo "\n";
562 if (isset($showtable['Check_time'])) {
563 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
564 echo "\n";
566 <tr>
567 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
568 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
569 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
570 </td>
571 </tr>
572 <?php
574 echo "\n";
576 </table>
577 </td>
578 <?php
581 // END - Calc Table Space
582 echo "\n";
584 </tr>
585 </table>
586 <hr />
589 <?php
591 * Work on the table
594 <!-- TABLE WORK -->
595 <ul>
597 <!-- Printable view of the table -->
598 <li>
599 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
600 </li>
602 <!-- Add some new fields -->
603 <li>
604 <form method="post" action="tbl_addfield.php3"
605 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
606 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
607 <?php echo $strAddNewField; ?>&nbsp;:
608 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
609 <select name="after_field" style="vertical-align: middle">
610 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
611 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
612 <?php
613 reset($aryFields);
614 while (list($junk, $fieldname) = each($aryFields)) {
615 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
617 unset($aryFields);
619 </select>
620 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
621 </form>
622 </li>
624 <?php
625 if ($cfg['Server']['relation']) {
627 <!-- Work on Relations -->
628 <li>
629 <div style="margin-bottom: 10px">
630 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
631 </div>
632 </li>
633 <?php
635 echo "\n";
638 <!-- Let MySQL propose the optimal structure -->
639 <li>
640 <div style="margin-bottom: 10px">
641 <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()'); ?>">
642 <?php echo $strStructPropose; ?></a>
643 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
644 </div>
645 </li>
647 <?php
649 * Query box, bookmark, insert data from textfile
651 $goto = 'tbl_properties_structure.php3';
652 require('./tbl_query_box.php3');
655 </ul>
658 <?php
660 * Displays the footer
662 echo "\n";
663 require('./footer.inc.php3');