xhtml typo
[phpmyadmin/crack.git] / tbl_properties_structure.php3
blobc491363cf2fbd7f9542f4471a73a42d20b0ba5b7
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Runs common work
8 */
9 require('./tbl_properties_common.php3');
10 $url_query .= '&amp;goto=tbl_properties_structure.php3&amp;back=tbl_properties_structure.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');
23 /**
24 * Prepares the table structure display
26 // 1. Get table information
27 require('./tbl_properties_table_info.php3');
29 // 2. Gets table keys and retains them
30 $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
31 $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
32 $primary = '';
33 $ret_keys = array();
34 $pk_array = array(); // will be use to emphasis prim. keys in the table view
35 while ($row = PMA_mysql_fetch_array($result)) {
36 $ret_keys[] = $row;
37 // Backups the list of primary keys
38 if ($row['Key_name'] == 'PRIMARY') {
39 $primary .= $row['Column_name'] . ', ';
40 $pk_array[$row['Column_name']] = 1;
42 } // end while
43 mysql_free_result($result);
45 // 3. Get fields
46 $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
47 $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
48 $fields_cnt = mysql_num_rows($fields_rs);
52 /**
53 * Displays the table structure ('show table' works correct since 3.23.03)
57 <!-- TABLE INFORMATIONS -->
59 <form action="tbl_properties_structure.php3" name="fieldsForm">
60 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
62 <table border="<?php echo $cfg['Border']; ?>">
63 <tr>
64 <td></td>
65 <th>&nbsp;<?php echo $strField; ?>&nbsp;</th>
66 <th><?php echo $strType; ?></th>
67 <th><?php echo $strAttr; ?></th>
68 <th><?php echo $strNull; ?></th>
69 <th><?php echo $strDefault; ?></th>
70 <th><?php echo $strExtra; ?></th>
71 <th colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '6' : '5'); ?>"><?php echo $strAction; ?></th>
72 </tr>
74 <?php
75 $comments_map = array();
76 $mime_map = array();
78 if ($GLOBALS['cfg']['ShowPropertyComments']) {
79 require('./libraries/relation.lib.php3');
80 require('./libraries/transformations.lib.php3');
82 $cfgRelation = PMA_getRelationsParam();
85 if ($cfgRelation['commwork']) {
86 $comments_map = PMA_getComments($db, $table);
88 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
89 $mime_map = PMA_getMIME($db, $table, true);
94 $i = 0;
95 $aryFields = array();
96 $checked = (!empty($checkall) ? ' checked="checked"' : '');
98 while ($row = PMA_mysql_fetch_array($fields_rs)) {
99 $i++;
100 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
101 $aryFields[] = $row['Field'];
103 $type = $row['Type'];
104 // reformat mysql query output - staybyte - 9. June 2001
105 // loic1: set or enum types: slashes single quotes inside options
106 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
107 $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
108 $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
109 $type_nowrap = '';
111 $binary = 0;
112 $unsigned = 0;
113 $zerofill = 0;
114 } else {
115 $type_nowrap = ' nowrap="nowrap"';
116 $type = eregi_replace('BINARY', '', $type);
117 $type = eregi_replace('ZEROFILL', '', $type);
118 $type = eregi_replace('UNSIGNED', '', $type);
119 if (empty($type)) {
120 $type = '&nbsp;';
123 $binary = eregi('BINARY', $row['Type'], $test);
124 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
125 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
128 // garvin: Display basic mimetype [MIME]
129 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
130 $type .= '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
133 $strAttribute = '&nbsp;';
134 if ($binary) {
135 $strAttribute = 'BINARY';
137 if ($unsigned) {
138 $strAttribute = 'UNSIGNED';
140 if ($zerofill) {
141 $strAttribute = 'UNSIGNED ZEROFILL';
143 if (!isset($row['Default'])) {
144 if ($row['Null'] != '') {
145 $row['Default'] = '<i>NULL</i>';
147 } else {
148 $row['Default'] = htmlspecialchars($row['Default']);
151 $field_encoded = urlencode($row['Field']);
152 $field_name = htmlspecialchars($row['Field']);
154 // garvin: underline commented fields and display a hover-title (CSS only)
156 $comment_style = '';
157 if (isset($comments_map[$row['Field']])) {
158 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
161 if (isset($pk_array[$row['Field']])) {
162 $field_name = '<u>' . $field_name . '</u>';
164 echo "\n";
167 <tr>
168 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
169 <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
170 </td>
171 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
172 <td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
173 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
174 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
175 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
176 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
177 <td bgcolor="<?php echo $bgcolor; ?>">
178 <a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
179 <?php echo $strChange; ?></a>
180 </td>
181 <td bgcolor="<?php echo $bgcolor; ?>">
182 <?php
183 // loic1: Drop field only if there is more than one field in the table
184 if ($fields_cnt > 1) {
185 echo "\n";
187 <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']))); ?>"
188 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
189 <?php echo $strDrop; ?></a>
190 <?php
191 } else {
192 echo "\n" . ' ' . $strDrop;
194 echo "\n";
196 </td>
197 <td bgcolor="<?php echo $bgcolor; ?>">
198 <?php
199 if ($type == 'text' || $type == 'blob') {
200 echo $strPrimary . "\n";
201 } else {
202 echo "\n";
204 <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']))); ?>"
205 onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
206 <?php echo $strPrimary; ?></a>
207 <?php
209 echo "\n";
211 </td>
212 <td bgcolor="<?php echo $bgcolor; ?>">
213 <?php
214 if ($type == 'text' || $type == 'blob') {
215 echo $strIndex . "\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) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex ,htmlspecialchars($row['Field']))); ?>">
220 <?php echo $strIndex; ?></a>
221 <?php
223 echo "\n";
225 </td>
226 <td bgcolor="<?php echo $bgcolor; ?>">
227 <?php
228 if ($type == 'text' || $type == 'blob') {
229 echo $strUnique . "\n";
230 } else {
231 echo "\n";
233 <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']))); ?>">
234 <?php echo $strUnique; ?></a>
235 <?php
237 echo "\n";
239 </td>
240 <?php
241 if (PMA_MYSQL_INT_VERSION >= 32323) {
242 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
243 && ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
244 echo "\n";
246 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
247 <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']))); ?>">
248 <?php echo $strIdxFulltext; ?></a>
249 </td>
250 <?php
251 } else {
252 echo "\n";
254 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
255 <?php echo $strIdxFulltext . "\n"; ?>
256 </td>
257 <?php
258 } // end if... else...
259 } // end if
260 echo "\n"
262 </tr>
263 <?php
264 } // end while
266 echo "\n";
268 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
271 <tr>
272 <td colspan="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '13' : '12'); ?>">
273 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
274 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;">
275 <?php echo $strCheckAll; ?></a>
276 &nbsp;/&nbsp;
277 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;">
278 <?php echo $strUncheckAll; ?></a>
279 &nbsp;&nbsp;&nbsp;
280 <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
281 <input type="submit" name="submit_mult" value="<?php echo $strChange; ?>" />
282 <?php
283 // Drop button if there is at least two fields
284 if ($fields_cnt > 1) {
286 &nbsp;<i><?php echo $strOr; ?></i>&nbsp;
287 <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
288 <?php
290 echo "\n";
292 </td>
293 </tr>
294 </table>
296 </form>
299 <?php
301 * If there are more than 20 rows, displays browse/select/insert/empty/drop
302 * links again
304 if ($fields_cnt > 20) {
306 <!-- Browse links -->
307 <?php
308 echo "\n";
309 include('./tbl_properties_links.php3');
310 } // end if ($fields_cnt > 20)
311 echo "\n\n";
315 * Displays indexes
318 <!-- Indexes, space usage and row statistics -->
319 <br />
320 <table border="0" cellspacing="0" cellpadding="0">
321 <tr>
322 <td>
323 <?php
324 define('PMA_IDX_INCLUDED', 1);
325 require ('./tbl_indexes.php3');
327 </td>
329 <?php
331 * Displays Space usage and row statistics
333 // BEGIN - Calc Table Space - staybyte - 9 June 2001
334 // loic1, 22 feb. 2002: updated with patch from
335 // Joshua Nye <josh at boxcarmedia.com> to get valid
336 // statistics whatever is the table type
337 if ($cfg['ShowStats']) {
338 $nonisam = FALSE;
339 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
340 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
341 $nonisam = TRUE;
343 if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) {
344 // Gets some sizes
345 $mergetable = FALSE;
346 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
347 $mergetable = TRUE;
349 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
350 if ($mergetable == FALSE) {
351 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
353 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
354 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
355 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
356 } else {
357 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
359 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']);
360 if ($table_info_num_rows > 0) {
361 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
364 // Displays them
367 <!-- Space usage -->
368 <td width="20">&nbsp;</td>
369 <td valign="top">
370 <?php echo $strSpaceUsage . '&nbsp;:' . "\n"; ?>
371 <a name="showusage"></a>
372 <table border="<?php echo $cfg['Border']; ?>">
373 <tr>
374 <th><?php echo $strType; ?></th>
375 <th colspan="2" align="center"><?php echo $strUsage; ?></th>
376 </tr>
377 <tr>
378 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strData; ?></td>
379 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
380 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
381 </tr>
382 <?php
383 if (isset($index_size)) {
384 echo "\n";
386 <tr>
387 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
388 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
389 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
390 </tr>
391 <?php
393 if (isset($free_size)) {
394 echo "\n";
396 <tr style="color: #bb0000">
397 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
398 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
399 <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $free_unit; ?></td>
400 </tr>
401 <tr>
402 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strEffective; ?></td>
403 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
404 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
405 </tr>
406 <?php
408 if (isset($tot_size) && $mergetable == FALSE) {
409 echo "\n";
411 <tr>
412 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
413 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
414 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
415 </tr>
416 <?php
418 // Optimize link if overhead
419 if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
420 echo "\n";
422 <tr>
423 <td colspan="3" align="center">
424 [<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>]
425 </td>
426 </tr>
427 <?php
429 echo "\n";
431 </table>
432 </td>
434 <!-- Rows Statistic -->
435 <td width="20">&nbsp;</td>
436 <td valign="top">
437 <?php echo $strRowsStatistic . '&nbsp;:' . "\n"; ?>
438 <table border="<?php echo $cfg['Border']; ?>">
439 <tr>
440 <th><?php echo $strStatement; ?></th>
441 <th align="center"><?php echo $strValue; ?></th>
442 </tr>
443 <?php
444 $i = 0;
445 if (isset($showtable['Row_format'])) {
446 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
447 echo "\n";
449 <tr>
450 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
451 <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
452 <?php
453 echo ' ';
454 if ($showtable['Row_format'] == 'Fixed') {
455 echo $strFixed;
457 else if ($showtable['Row_format'] == 'Dynamic') {
458 echo $strDynamic;
460 else {
461 echo $showtable['Row_format'];
463 echo "\n";
465 </td>
466 </tr>
467 <?php
469 if (!$is_innodb && isset($showtable['Rows'])) {
470 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
471 echo "\n";
473 <tr>
474 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
475 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
476 <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
477 </td>
478 </tr>
479 <?php
481 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
482 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
483 echo "\n";
485 <tr>
486 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
487 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
488 <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
489 </td>
490 </tr>
491 <?php
493 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
494 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
495 echo "\n";
497 <tr>
498 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
499 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
500 <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
501 </td>
502 </tr>
503 <?php
505 if (isset($showtable['Auto_increment'])) {
506 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
507 echo "\n";
509 <tr>
510 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
511 <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
512 <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
513 </td>
514 </tr>
515 <?php
517 echo "\n";
519 if (isset($showtable['Create_time'])) {
520 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
521 echo "\n";
523 <tr>
524 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
525 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
526 <?php echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?>
527 </td>
528 </tr>
529 <?php
531 echo "\n";
533 if (isset($showtable['Update_time'])) {
534 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
535 echo "\n";
537 <tr>
538 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
539 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
540 <?php echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?>
541 </td>
542 </tr>
543 <?php
545 echo "\n";
547 if (isset($showtable['Check_time'])) {
548 $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
549 echo "\n";
551 <tr>
552 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
553 <td style="font-size: <?php echo $font_smaller; ?>" align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
554 <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
555 </td>
556 </tr>
557 <?php
559 echo "\n";
561 </table>
562 </td>
563 <?php
566 // END - Calc Table Space
567 echo "\n";
569 </tr>
570 </table>
571 <hr />
574 <?php
576 * Work on the table
579 <!-- TABLE WORK -->
580 <ul>
582 <!-- Printable view of the table -->
583 <li>
584 <div style="margin-bottom: 10px"><a href="tbl_printview.php3?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
585 </li>
587 <!-- Add some new fields -->
588 <li>
589 <form method="post" action="tbl_addfield.php3"
590 onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
591 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
592 <?php echo $strAddNewField; ?>&nbsp;:
593 <input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
594 <select name="after_field" style="vertical-align: middle">
595 <option value="--end--"><?php echo $strAtEndOfTable; ?></option>
596 <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
597 <?php
598 reset($aryFields);
599 while (list($junk, $fieldname) = each($aryFields)) {
600 echo ' <option value="' . urlencode($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
602 unset($aryFields);
604 </select>
605 <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
606 </form>
607 </li>
609 <?php
610 if ($cfg['Server']['relation']) {
612 <!-- Work on Relations -->
613 <li>
614 <div style="margin-bottom: 10px">
615 <a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
616 </div>
617 </li>
618 <?php
620 echo "\n";
623 <!-- Let MySQL propose the optimal structure -->
624 <li>
625 <div style="margin-bottom: 10px">
626 <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()'); ?>">
627 <?php echo $strStructPropose; ?></a>
628 <?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
629 </div>
630 </li>
632 <?php
634 * Query box, bookmark, insert data from textfile
636 $goto = 'tbl_properties_structure.php3';
637 require('./tbl_query_box.php3');
640 </ul>
643 <?php
645 * Displays the footer
647 echo "\n";
648 require('./footer.inc.php3');