Better descriptions for Drizzle column types
[phpmyadmin.git] / db_structure.php
blob5a36a76d9bb755772c44c2abf5518c79f8028cd1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
11 require_once 'libraries/common.inc.php';
13 $GLOBALS['js_include'][] = 'db_structure.js';
14 $GLOBALS['js_include'][] = 'tbl_change.js';
15 $GLOBALS['js_include'][] = 'jquery/timepicker.js';
17 /**
18 * Sets globals from $_POST
20 $post_params = array(
21 'error',
22 'is_info',
23 'message',
24 'mult_btn',
25 'selected_tbl',
26 'submit_mult'
29 foreach ($post_params as $one_post_param) {
30 if (isset($_POST[$one_post_param])) {
31 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
35 /**
36 * Prepares the tables list if the user where not redirected to this script
37 * because there is no table in the database ($is_info is true)
39 if (empty($is_info)) {
40 // Drops/deletes/etc. multiple tables if required
41 if ((!empty($submit_mult) && isset($selected_tbl))
42 || isset($mult_btn)
43 ) {
44 $action = 'db_structure.php';
45 $err_url = 'db_structure.php?'. PMA_generate_common_url($db);
47 // see bug #2794840; in this case, code path is:
48 // db_structure.php -> libraries/mult_submits.inc.php -> sql.php
49 // -> db_structure.php and if we got an error on the multi submit,
50 // we must display it here and not call again mult_submits.inc.php
51 if (! isset($error) || false === $error) {
52 include 'libraries/mult_submits.inc.php';
54 if (empty($message)) {
55 $message = PMA_Message::success();
58 include 'libraries/db_common.inc.php';
59 $url_query .= '&amp;goto=db_structure.php';
61 // Gets the database structure
62 $sub_part = '_structure';
63 include 'libraries/db_info.inc.php';
65 if (!PMA_DRIZZLE) {
66 include_once 'libraries/replication.inc.php';
67 } else {
68 $server_slave_status = false;
72 require_once 'libraries/bookmark.lib.php';
74 require_once 'libraries/mysql_charsets.lib.php';
75 $db_collation = PMA_getDbCollation($db);
77 // in a separate file to avoid redeclaration of functions in some code paths
78 require_once 'libraries/db_structure.lib.php';
79 $titles = PMA_buildActionTitles();
81 // 1. No tables
83 if ($num_tables == 0) {
84 echo '<p>' . __('No tables found in database') . '</p>' . "\n";
86 if (empty($db_is_information_schema)) {
87 include 'libraries/display_create_table.lib.php';
88 } // end if (Create Table dialog)
90 /**
91 * Displays the footer
93 include_once 'libraries/footer.inc.php';
94 exit;
97 // else
98 // 2. Shows table informations
101 * Displays the tables list
103 echo '<div id="tableslistcontainer">';
104 $_url_params = array(
105 'pos' => $pos,
106 'db' => $db);
108 // Add the sort options if they exists
109 if (isset($_REQUEST['sort'])) {
110 $_url_params['sort'] = $_REQUEST['sort'];
113 if (isset($_REQUEST['sort_order'])) {
114 $_url_params['sort_order'] = $_REQUEST['sort_order'];
117 PMA_listNavigator(
118 $total_num_tables, $pos, $_url_params, 'db_structure.php',
119 'frame_content', $GLOBALS['cfg']['MaxTableList']
123 <form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
124 <?php
125 echo PMA_generate_common_hidden_inputs($db);
127 PMA_TableHeader($db_is_information_schema, $server_slave_status);
129 $i = $sum_entries = 0;
130 $sum_size = (double) 0;
131 $overhead_size = (double) 0;
132 $overhead_check = '';
133 $create_time_all = '';
134 $update_time_all = '';
135 $check_time_all = '';
136 $checked = !empty($checkall) ? ' checked="checked"' : '';
137 $num_columns = $cfg['PropertiesNumColumns'] > 1
138 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1
139 : 0;
140 $row_count = 0;
143 $hidden_fields = array();
144 $odd_row = true;
145 $sum_row_count_pre = '';
147 foreach ($tables as $keyname => $each_table) {
148 // Get valid statistics whatever is the table type
150 $table_is_view = false;
151 $table_encoded = urlencode($each_table['TABLE_NAME']);
152 // Sets parameters for links
153 $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
154 // do not list the previous table's size info for a view
155 $formatted_size = '-';
156 $unit = '';
158 switch ( $each_table['ENGINE']) {
159 // MyISAM, ISAM or Heap table: Row count, data size and index size
160 // are accurate; data size is accurate for ARCHIVE
161 case 'MyISAM' :
162 case 'ISAM' :
163 case 'HEAP' :
164 case 'MEMORY' :
165 case 'ARCHIVE' :
166 case 'Aria' :
167 case 'Maria' :
168 if ($db_is_information_schema) {
169 $each_table['Rows'] = PMA_Table::countRecords(
170 $db, $each_table['Name']
174 if ($is_show_stats) {
175 $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
176 $sum_size += $tblsize;
177 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
178 if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) {
179 list($formatted_overhead, $overhead_unit) = PMA_formatByteDown(
180 $each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0
182 $overhead_size += $each_table['Data_free'];
185 break;
186 case 'InnoDB' :
187 case 'PBMS' :
188 // InnoDB table: Row count is not accurate but data and index sizes are.
189 // PBMS table in Drizzle: TABLE_ROWS is taken from table cache, so it may be unavailable
191 if (($each_table['ENGINE'] == 'InnoDB'
192 && $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount'])
193 || !isset($each_table['TABLE_ROWS'])
195 $each_table['COUNTED'] = true;
196 $each_table['TABLE_ROWS'] = PMA_Table::countRecords(
197 $db, $each_table['TABLE_NAME'],
198 $force_exact = true, $is_view = false
200 } else {
201 $each_table['COUNTED'] = false;
204 // Drizzle doesn't provide data and index length, check for null
205 if ($is_show_stats && $each_table['Data_length'] !== null) {
206 $tblsize = $each_table['Data_length'] + $each_table['Index_length'];
207 $sum_size += $tblsize;
208 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
210 //$display_rows = ' - ';
211 break;
212 // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM
213 // Both are aliases for MERGE
214 case 'MRG_MyISAM' :
215 case 'MRG_MYISAM' :
216 case 'MERGE' :
217 case 'BerkeleyDB' :
218 // Merge or BerkleyDB table: Only row count is accurate.
219 if ($is_show_stats) {
220 $formatted_size = ' - ';
221 $unit = '';
223 break;
224 // for a view, the ENGINE is sometimes reported as null,
225 // or on some servers it's reported as "SYSTEM VIEW"
226 case null :
227 case 'SYSTEM VIEW' :
228 case 'FunctionEngine' :
229 // if table is broken, Engine is reported as null, so one more test
230 if ($each_table['TABLE_TYPE'] == 'VIEW') {
231 // countRecords() takes care of $cfg['MaxExactCountViews']
232 $each_table['TABLE_ROWS'] = PMA_Table::countRecords(
233 $db, $each_table['TABLE_NAME'],
234 $force_exact = true, $is_view = true
236 $table_is_view = true;
238 break;
239 default :
240 // Unknown table type.
241 if ($is_show_stats) {
242 $formatted_size = __('unknown');
243 $unit = '';
245 } // end switch
247 if (! PMA_Table::isMerge($db, $each_table['TABLE_NAME'])) {
248 $sum_entries += $each_table['TABLE_ROWS'];
251 if (isset($each_table['Collation'])) {
252 $collation = '<dfn title="'
253 . PMA_getCollationDescr($each_table['Collation']) . '">'
254 . $each_table['Collation'] . '</dfn>';
255 } else {
256 $collation = '---';
259 if ($is_show_stats) {
260 if (isset($formatted_overhead)) {
261 $overhead = '<a href="tbl_structure.php?'
262 . $tbl_url_query . '#showusage"><span>' . $formatted_overhead
263 . '</span> <span class="unit">' . $overhead_unit . '</span></a>' . "\n";
264 unset($formatted_overhead);
265 $overhead_check .=
266 "markAllRows('row_tbl_" . ($i + 1) . "');";
267 } else {
268 $overhead = '-';
270 } // end if
272 unset($showtable);
274 if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
275 $showtable = PMA_Table::sGetStatusInfo($db, $each_table['TABLE_NAME'], null, true);
276 $create_time = isset($showtable['Create_time']) ? $showtable['Create_time'] : false;
278 // show oldest creation date in summary row
279 if ($create_time && (!$create_time_all || $create_time < $create_time_all)) {
280 $create_time_all = $create_time;
284 if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) {
285 // $showtable might already be set from ShowDbStructureCreation, see above
286 if (! isset($showtable)) {
287 $showtable = PMA_Table::sGetStatusInfo($db, $each_table['TABLE_NAME'], null, true);
289 $update_time = isset($showtable['Update_time']) ? $showtable['Update_time'] : false;
291 // show newest update date in summary row
292 if ($update_time && $update_time > $update_time_all) {
293 $update_time_all = $update_time;
297 if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) {
298 // $showtable might already be set from ShowDbStructureCreation, see above
299 if (! isset($showtable)) {
300 $showtable = PMA_Table::sGetStatusInfo($db, $each_table['TABLE_NAME'], null, true);
302 $check_time = isset($showtable['Check_time']) ? $showtable['Check_time'] : false;
304 // show newest check date in summary row
305 if ($check_time && $check_time > $check_time_all) {
306 $check_time_all = $check_time;
310 $alias = (! empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
311 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
312 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
313 $truename = (! empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
314 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
315 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
317 $i++;
319 $row_count++;
320 if ($table_is_view) {
321 $hidden_fields[] = '<input type="hidden" name="views[]" value="'
322 . htmlspecialchars($each_table['TABLE_NAME']) . '" />';
326 * Always activate links for Browse, Search and Empty, even if
327 * the icons are greyed, because
328 * 1. for views, we don't know the number of rows at this point
329 * 2. for tables, another source could have populated them since the
330 * page was generated
332 * I could have used the PHP ternary conditional operator but I find
333 * the code easier to read without this operator.
335 if ($each_table['TABLE_ROWS'] > 0 || $table_is_view) {
336 $may_have_rows = true;
337 } else {
338 $may_have_rows = false;
340 $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">';
341 if ($may_have_rows) {
342 $browse_table .= $titles['Browse'];
343 } else {
344 $browse_table .= $titles['NoBrowse'];
346 $browse_table .= '</a>';
348 $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">';
349 if ($may_have_rows) {
350 $search_table .= $titles['Search'];
351 } else {
352 $search_table .= $titles['NoSearch'];
354 $search_table .= '</a>';
356 $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $truename . '</a>';
358 if (! $db_is_information_schema) {
359 $empty_table = '<a ';
360 if ($GLOBALS['cfg']['AjaxEnable']) {
361 $empty_table .= 'class="truncate_table_anchor"';
363 $empty_table .= ' href="sql.php?' . $tbl_url_query
364 . '&amp;sql_query=';
365 $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
366 . '&amp;message_to_show='
367 . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
368 .'">';
369 if ($may_have_rows) {
370 $empty_table .= $titles['Empty'];
371 } else {
372 $empty_table .= $titles['NoEmpty'];
374 $empty_table .= '</a>';
375 // truncating views doesn't work
376 if ($table_is_view) {
377 $empty_table = '&nbsp;';
380 $drop_query = 'DROP '
381 . (($table_is_view || $each_table['ENGINE'] == null) ? 'VIEW' : 'TABLE')
382 . ' ' . PMA_backquote($each_table['TABLE_NAME']);
383 $drop_message = sprintf(
384 ($table_is_view || $each_table['ENGINE'] == null)? __('View %s has been dropped') : __('Table %s has been dropped'),
385 str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']))
389 $tracking_icon = '';
390 if (PMA_Tracker::isActive()) {
391 if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
392 $tracking_icon = '<a href="tbl_tracking.php?' . $url_query
393 . '&amp;table=' . $truename . '">'
394 . PMA_getImage('eye.png', __('Tracking is active.'))
395 . '</a>';
396 } elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
397 $tracking_icon = '<a href="tbl_tracking.php?' . $url_query
398 . '&amp;table=' . $truename . '">'
399 . PMA_getImage('eye.png', __('Tracking is not active.'))
400 . '</a>';
404 if ($num_columns > 0
405 && $num_tables > $num_columns
406 && ($row_count % $num_columns) == 0
408 $row_count = 1;
409 $odd_row = true;
411 </tr>
412 </tbody>
413 </table>
414 <?php
415 PMA_TableHeader(false, $server_slave_status);
418 $ignored = false;
419 $do = false;
421 if ($server_slave_status) {
422 if ((strlen(array_search($truename, $server_slave_Do_Table)) > 0)
423 || (strlen(array_search($db, $server_slave_Do_DB)) > 0)
424 || (count($server_slave_Do_DB) == 1 && count($server_slave_Ignore_DB) == 1)
426 $do = true;
428 foreach ($server_slave_Wild_Do_Table as $db_table) {
429 $table_part = PMA_extract_db_or_table($db_table, 'table');
430 if (($db == PMA_extract_db_or_table($db_table, 'db'))
431 && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))
433 $do = true;
437 if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0)
438 || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)
440 $ignored = true;
442 foreach ($server_slave_Wild_Ignore_Table as $db_table) {
443 $table_part = PMA_extract_db_or_table($db_table, 'table');
444 if (($db == PMA_extract_db_or_table($db_table))
445 && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))
447 $ignored = true;
450 unset($table_part);
453 <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row;
454 echo $table_is_view ? ' is_view' : '';
456 id="row_tbl_<?php echo $i; ?>">
457 <td class="center">
458 <input type="checkbox" name="selected_tbl[]"
459 value="<?php echo htmlspecialchars($each_table['TABLE_NAME']); ?>"
460 id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
461 <th><?php echo $browse_table_label; ?>
462 <?php echo (! empty($tracking_icon) ? $tracking_icon : ''); ?>
463 </th>
464 <?php if ($server_slave_status) { ?><td class="center"><?php
465 echo $ignored
466 ? PMA_getImage('s_cancel.png', 'NOT REPLICATED')
467 : ''.
469 ? PMA_getImage('s_success.png', 'REPLICATED')
470 : ''; ?></td><?php } ?>
471 <td class="center"><?php echo $browse_table; ?></td>
472 <td class="center">
473 <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
474 <?php echo $titles['Structure']; ?></a></td>
475 <td class="center"><?php echo $search_table; ?></td>
476 <?php if (! $db_is_information_schema) { ?>
477 <td class="insert_table center">
478 <a <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax"' : ''); ?> href="tbl_change.php?<?php echo $tbl_url_query; ?>">
479 <?php echo $titles['Insert']; ?></a></td>
480 <td class="center"><?php echo $empty_table; ?></td>
481 <td class="center">
483 <?php if ($GLOBALS['cfg']['AjaxEnable']) {
484 echo 'class="drop_table_anchor';
485 if ($table_is_view || $each_table['ENGINE'] == null) {
486 // this class is used in db_structure.js to display the
487 // correct confirmation message
488 echo ' view';
490 echo '"';
492 ?> href="sql.php?<?php echo $tbl_url_query;
493 ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
494 echo urlencode($drop_query); ?>&amp;message_to_show=<?php
495 echo urlencode($drop_message); ?>" >
496 <?php echo $titles['Drop']; ?></a></td>
497 <?php } // end if (! $db_is_information_schema)
499 // there is a null value in the ENGINE
500 // - when the table needs to be repaired, or
501 // - when it's a view
502 // so ensure that we'll display "in use" below for a table
503 // that needs to be repaired
504 if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
505 $row_count_pre = '';
506 $show_superscript = '';
507 if ($table_is_view) {
508 // Drizzle views use FunctionEngine, and the only place where they are
509 // available are I_S and D_D schemas, where we do exact counting
510 if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']
511 && $each_table['ENGINE'] != 'FunctionEngine'
513 $row_count_pre = '~';
514 $sum_row_count_pre = '~';
515 $show_superscript = PMA_showHint(
516 PMA_sanitize(
517 sprintf(
518 __('This view has at least this number of rows. Please refer to %sdocumentation%s.'),
519 '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]',
520 '[/a]'
525 } elseif ($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
526 // InnoDB table: we did not get an accurate row count
527 $row_count_pre = '~';
528 $sum_row_count_pre = '~';
529 $show_superscript = '';
532 <td class="value tbl_rows"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
533 <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
534 <td class="nowrap"><?php echo ($table_is_view ? __('View') : $each_table['ENGINE']); ?></td>
535 <?php if (isset($collation)) { ?>
536 <td class="nowrap"><?php echo $collation ?></td>
537 <?php } ?>
538 <?php } ?>
540 <?php if ($is_show_stats) { ?>
541 <td class="value tbl_size"><a
542 href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
543 ><?php echo '<span>' . $formatted_size . '</span> <span class="unit">' . $unit . '</span>'; ?></a></td>
544 <td class="value tbl_overhead"><?php echo $overhead; ?></td>
545 <?php } // end if
546 if ($GLOBALS['cfg']['ShowDbStructureCreation']) { ?>
547 <td class="value tbl_creation"><?php echo $create_time ? PMA_localisedDate(strtotime($create_time)) : '-'; ?></td>
548 <?php } // end if
549 if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) { ?>
550 <td class="value tbl_last_update"><?php echo $update_time ? PMA_localisedDate(strtotime($update_time)) : '-'; ?></td>
551 <?php } // end if
552 if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) { ?>
553 <td class="value tbl_last_check"><?php echo $check_time ? PMA_localisedDate(strtotime($check_time)) : '-'; ?></td>
554 <?php } // end if ?>
555 <?php } elseif ($table_is_view) { ?>
556 <td class="value">-</td>
557 <td><?php echo __('View'); ?></td>
558 <td>---</td>
559 <?php if ($is_show_stats) { ?>
560 <td class="value">-</td>
561 <td class="value">-</td>
562 <?php } ?>
563 <?php } else { ?>
564 <td colspan="<?php echo ($colspan_for_structure - ($db_is_information_schema ? 5 : 8)) ?>"
565 class="center">
566 <?php echo __('in use'); ?></td>
567 <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
568 </tr>
569 <?php
570 } // end foreach
572 // Show Summary
573 if ($is_show_stats) {
574 list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
575 list($overhead_formatted, $overhead_unit)
576 = PMA_formatByteDown($overhead_size, 3, 1);
579 </tbody>
580 <tbody id="tbl_summary_row">
581 <tr><th></th>
582 <th class="tbl_num nowrap">
583 <?php
584 echo sprintf(
585 _ngettext('%s table', '%s tables', $num_tables),
586 PMA_formatNumber($num_tables, 0)
589 </th>
590 <?php
591 if ($server_slave_status) {
592 echo ' <th>' . __('Replication') . '</th>' . "\n";
595 <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>">
596 <?php echo __('Sum'); ?></th>
597 <th class="value tbl_rows"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th>
598 <?php
599 if (!($cfg['PropertiesNumColumns'] > 1)) {
600 $default_engine = PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'storage_engine\';', 0, 1);
601 echo ' <th class="center">' . "\n"
602 . ' <dfn title="'
603 . sprintf(__('%s is the default storage engine on this MySQL server.'), $default_engine)
604 . '">' .$default_engine . '</dfn></th>' . "\n";
605 // we got a case where $db_collation was empty
606 echo ' <th>' . "\n";
607 if (! empty($db_collation)) {
608 echo ' <dfn title="'
609 . PMA_getCollationDescr($db_collation) . ' (' . __('Default') . ')">' . $db_collation
610 . '</dfn>';
612 echo '</th>';
615 if ($is_show_stats) {
617 <th class="value tbl_size"><?php echo $sum_formatted . ' ' . $unit; ?></th>
618 <th class="value tbl_overhead"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
619 <?php
622 if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
623 echo ' <th class="value tbl_creation">' . "\n"
624 . ' ' . ($create_time_all ? PMA_localisedDate(strtotime($create_time_all)) : '-')
625 . ' </th>';
628 if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) {
629 echo ' <th class="value tbl_last_update">' . "\n"
630 . ' ' . ($update_time_all ? PMA_localisedDate(strtotime($update_time_all)) : '-')
631 . ' </th>';
634 if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) {
635 echo ' <th class="value tbl_last_check">' . "\n"
636 . ' ' . ($check_time_all ? PMA_localisedDate(strtotime($check_time_all)) : '-')
637 . ' </th>';
641 </tr>
642 </tbody>
643 </table>
645 <div class="clearfloat">
646 <?php
647 // Check all tables url
648 $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
650 <img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
651 width="38" height="22" alt="<?php echo __('With selected:'); ?>" />
652 <a href="<?php echo $checkall_url; ?>&amp;checkall=1"
653 onclick="if (markAllRows('tablesForm')) return false;">
654 <?php echo __('Check All'); ?></a>
656 <a href="<?php echo $checkall_url; ?>"
657 onclick="if (unMarkAllRows('tablesForm')) return false;">
658 <?php echo __('Uncheck All'); ?></a>
659 <?php if ($overhead_check != '') { ?>
661 <a href="#" onclick="unMarkAllRows('tablesForm');
662 <?php echo $overhead_check; ?> return false;">
663 <?php echo __('Check tables having overhead'); ?></a>
664 <?php } ?>
666 <select name="submit_mult" class="autosubmit" style="margin: 0 3em 0 3em;">
667 <?php
668 echo ' <option value="' . __('With selected:') . '" selected="selected">'
669 . __('With selected:') . '</option>' . "\n";
670 echo ' <option value="export" >'
671 . __('Export') . '</option>' . "\n";
672 echo ' <option value="print" >'
673 . __('Print view') . '</option>' . "\n";
675 if (!$db_is_information_schema && !$cfg['DisableMultiTableMaintenance']) {
676 echo ' <option value="empty_tbl" >'
677 . __('Empty') . '</option>' . "\n";
678 echo ' <option value="drop_tbl" >'
679 . __('Drop') . '</option>' . "\n";
680 echo ' <option value="check_tbl" >'
681 . __('Check table') . '</option>' . "\n";
682 if (!PMA_DRIZZLE) {
683 echo ' <option value="optimize_tbl" >'
684 . __('Optimize table') . '</option>' . "\n";
685 echo ' <option value="repair_tbl" >'
686 . __('Repair table') . '</option>' . "\n";
688 echo ' <option value="analyze_tbl" >'
689 . __('Analyze table') . '</option>' . "\n";
690 echo ' <option value="add_prefix_tbl" >'
691 . __('Add prefix to table') . '</option>' . "\n";
692 echo ' <option value="replace_prefix_tbl" >'
693 . __('Replace table prefix') . '</option>' . "\n";
694 echo ' <option value="copy_tbl_change_prefix" >'
695 . __('Copy table with prefix') . '</option>' . "\n";
698 </select>
699 <?php echo implode("\n", $hidden_fields) . "\n"; ?>
700 </div>
701 </form>
702 <?php
703 // display again the table list navigator
704 PMA_listNavigator(
705 $total_num_tables, $pos, $_url_params, 'db_structure.php',
706 'frame_content', $GLOBALS['cfg']['MaxTableList']
709 </div>
710 <hr />
712 <?php
715 * Work on the database
717 /* DATABASE WORK */
718 /* Printable view of a table */
719 echo '<p>';
720 echo '<a href="db_printview.php?' . $url_query . '">';
721 echo PMA_getIcon('b_print.png', __('Print view'), true) . '</a>';
723 echo '<a href="db_datadict.php?' . $url_query . '">';
724 echo PMA_getIcon('b_tblanalyse.png', __('Data Dictionary'), true) . '</a>';
725 echo '</p>';
727 if (empty($db_is_information_schema)) {
728 include 'libraries/display_create_table.lib.php';
729 } // end if (Create Table dialog)
732 * Displays the footer
734 require 'libraries/footer.inc.php';