Lithuanian update
[phpmyadmin/crack.git] / db_structure.php
blobf2a246a558d73574f06b9ef926d05cb3e0faa91c
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin
7 */
9 /**
12 require_once './libraries/common.inc.php';
13 require_once './libraries/Table.class.php';
15 $GLOBALS['js_include'][] = 'mootools.js';
17 /**
18 * Prepares the tables list if the user where not redirected to this script
19 * because there is no table in the database ($is_info is true)
21 if (empty($is_info)) {
22 // Drops/deletes/etc. multiple tables if required
23 if ((!empty($submit_mult) && isset($selected_tbl))
24 || isset($mult_btn)) {
25 $action = 'db_structure.php';
26 $err_url = 'db_structure.php?'. PMA_generate_common_url($db);
27 require './libraries/mult_submits.inc.php';
28 if (empty($message)) {
29 $message = PMA_Message::success();
32 require './libraries/db_common.inc.php';
33 $url_query .= '&amp;goto=db_structure.php';
35 // Gets the database structure
36 $sub_part = '_structure';
37 require './libraries/db_info.inc.php';
40 // 1. No tables
41 if ($num_tables == 0) {
42 echo '<p>' . $strNoTablesFound . '</p>' . "\n";
44 if (empty($db_is_information_schema)) {
45 require './libraries/display_create_table.lib.php';
46 } // end if (Create Table dialog)
48 /**
49 * Displays the footer
51 require_once './libraries/footer.inc.php';
52 exit;
55 // else
56 // 2. Shows table informations - staybyte - 11 June 2001
58 require_once './libraries/bookmark.lib.php';
60 require_once './libraries/mysql_charsets.lib.php';
61 $db_collation = PMA_getDbCollation($db);
63 // Display function
64 /**
65 * void PMA_TableHeader([bool $db_is_information_schema = false])
66 * display table header (<table><thead>...</thead><tbody>)
68 * @uses PMA_showHint()
69 * @uses $GLOBALS['cfg']['PropertiesNumColumns']
70 * @uses $GLOBALS['is_show_stats']
71 * @uses $GLOBALS['strTable']
72 * @uses $GLOBALS['strAction']
73 * @uses $GLOBALS['strRecords']
74 * @uses $GLOBALS['strApproximateCount']
75 * @uses $GLOBALS['strType']
76 * @uses $GLOBALS['strCollation']
77 * @uses $GLOBALS['strSize']
78 * @uses $GLOBALS['strOverhead']
79 * @uses $GLOBALS['structure_tbl_col_cnt']
80 * @uses PMA_SortableTableHeader()
81 * @param boolean $db_is_information_schema
83 function PMA_TableHeader($db_is_information_schema = false)
85 $cnt = 0; // Let's count the columns...
87 if ($db_is_information_schema) {
88 $action_colspan = 3;
89 } else {
90 $action_colspan = 6;
93 echo '<table class="data" style="float: left;">' . "\n"
94 .'<thead>' . "\n"
95 .'<tr><th></th>' . "\n"
96 .' <th>' . PMA_SortableTableHeader($GLOBALS['strTable'], 'table') . '</th>' . "\n"
97 .' <th colspan="' . $action_colspan . '">' . "\n"
98 .' ' . $GLOBALS['strAction'] . "\n"
99 .' </th>'
100 .' <th>' . PMA_SortableTableHeader($GLOBALS['strRecords'], 'records')
101 .PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount'])) . "\n"
102 .' </th>' . "\n";
103 if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
104 echo ' <th>' . PMA_SortableTableHeader($GLOBALS['strType'], 'type') . '</th>' . "\n";
105 $cnt++;
106 echo ' <th>' . PMA_SortableTableHeader($GLOBALS['strCollation'], 'collation') . '</th>' . "\n";
107 $cnt++;
109 if ($GLOBALS['is_show_stats']) {
110 echo ' <th>' . PMA_SortableTableHeader($GLOBALS['strSize'], 'size') . '</th>' . "\n"
111 . ' <th>' . PMA_SortableTableHeader($GLOBALS['strOverhead'], 'overhead') . '</th>' . "\n";
112 $cnt += 2;
114 echo '</tr>' . "\n";
115 echo '</thead>' . "\n";
116 echo '<tbody>' . "\n";
117 $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
118 } // end function PMA_TableHeader()
122 * Creates a clickable column header for table information
124 * @param string title to use for the link
125 * @param string corresponds to sortable data name mapped in libraries/db_info.inc.php
126 * @returns string link to be displayed in the table header
128 function PMA_SortableTableHeader($title, $sort)
130 // Set some defaults
131 $requested_sort = 'table';
132 $requested_sort_order = 'ASC';
133 $sort_order = 'ASC';
135 // If the user requested a sort
136 if (isset($_REQUEST['sort'])) {
137 $requested_sort = $_REQUEST['sort'];
139 if (isset($_REQUEST['sort_order'])) {
140 $requested_sort_order = $_REQUEST['sort_order'];
144 $order_img = '';
145 $order_link_params = array();
146 $order_link_params['title'] = $GLOBALS['strSort'];
148 // If this column was requested to be sorted.
149 if ($requested_sort == $sort) {
150 if ($requested_sort_order == 'ASC') {
151 $sort_order = 'DESC';
152 $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="sort_arrow" />';
153 $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
154 $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
155 } else {
156 $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="sort_arrow" />';
157 $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
158 $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
162 $_url_params = array(
163 'db' => $_REQUEST['db'],
166 $url = 'db_structure.php'.PMA_generate_common_url($_url_params);
167 // We set the position back to 0 every time they sort.
168 $url .= "&amp;pos=0&amp;sort=$sort&amp;sort_order=$sort_order";
170 return PMA_linkOrButton($url, $title . $order_img, $order_link_params);
173 $titles = array();
174 if (true == $cfg['PropertiesIconic']) {
175 $titles['Browse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
176 $titles['NoBrowse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
177 $titles['Search'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
178 $titles['NoSearch'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
179 $titles['Insert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
180 $titles['NoInsert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
181 $titles['Structure'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" />';
182 $titles['Drop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
183 $titles['NoDrop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
184 $titles['Empty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
185 $titles['NoEmpty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
187 if ('both' === $cfg['PropertiesIconic']) {
188 $titles['Browse'] .= $strBrowse;
189 $titles['Search'] .= $strSearch;
190 $titles['NoBrowse'] .= $strBrowse;
191 $titles['NoSearch'] .= $strSearch;
192 $titles['Insert'] .= $strInsert;
193 $titles['NoInsert'] .= $strInsert;
194 $titles['Structure'] .= $strStructure;
195 $titles['Drop'] .= $strDrop;
196 $titles['NoDrop'] .= $strDrop;
197 $titles['Empty'] .= $strEmpty;
198 $titles['NoEmpty'] .= $strEmpty;
200 } else {
201 $titles['Browse'] = $strBrowse;
202 $titles['Search'] = $strSearch;
203 $titles['NoBrowse'] = $strBrowse;
204 $titles['NoSearch'] = $strSearch;
205 $titles['Insert'] = $strInsert;
206 $titles['NoInsert'] = $strInsert;
207 $titles['Structure'] = $strStructure;
208 $titles['Drop'] = $strDrop;
209 $titles['NoDrop'] = $strDrop;
210 $titles['Empty'] = $strEmpty;
211 $titles['NoEmpty'] = $strEmpty;
215 * Displays the tables list
217 $_url_params = array(
218 'pos' => $pos,
219 'db' => $db);
221 // Add the sort options if they exists
222 if (isset($_REQUEST['sort'])) {
223 $_url_params['sort'] = $_REQUEST['sort'];
226 if (isset($_REQUEST['sort_order'])) {
227 $_url_params['sort_order'] = $_REQUEST['sort_order'];
230 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
233 <form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
234 <?php
235 echo PMA_generate_common_hidden_inputs($db);
237 PMA_TableHeader($db_is_information_schema);
239 $i = $sum_entries = 0;
240 $sum_size = (double) 0;
241 $overhead_size = (double) 0;
242 $overhead_check = '';
243 $checked = !empty($checkall) ? ' checked="checked"' : '';
244 $num_columns = $cfg['PropertiesNumColumns'] > 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0;
245 $row_count = 0;
248 $hidden_fields = array();
249 $odd_row = true;
250 $sum_row_count_pre = '';
252 // added by rajk - for blobstreaming
253 $PMA_Config = $_SESSION['PMA_Config'];
255 if (!empty($PMA_Config))
256 $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables
258 $tableReductionCount = 0; // the amount to reduce the table count by
260 foreach ($tables as $keyname => $each_table) {
261 if (isset($session_bs_tables))
263 // compare table name against blobstreaming tables
264 foreach ($session_bs_tables as $table_key=>$table_val)
265 // if the table is a blobstreaming table, reduce table count and skip outer foreach loop
266 if ($table_key == $keyname)
268 $tableReductionCount++;
269 continue 2;
273 // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
274 // statistics whatever is the table type
276 $table_is_view = false;
277 $table_encoded = urlencode($each_table['TABLE_NAME']);
278 // Sets parameters for links
279 $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
280 // do not list the previous table's size info for a view
281 $formatted_size = '-';
282 $unit = '';
284 switch ( $each_table['ENGINE']) {
285 // MyISAM, ISAM or Heap table: Row count, data size and index size
286 // are accurate.
287 case 'MyISAM' :
288 case 'ISAM' :
289 case 'HEAP' :
290 case 'MEMORY' :
291 if ($db_is_information_schema) {
292 $each_table['Rows'] = PMA_Table::countRecords($db,
293 $each_table['Name'], $return = true);
296 if ($is_show_stats) {
297 $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
298 $sum_size += $tblsize;
299 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
300 if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) {
301 list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0);
302 $overhead_size += $each_table['Data_free'];
305 break;
306 case 'InnoDB' :
307 // InnoDB table: Row count is not accurate but data and index
308 // sizes are.
310 if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
311 $each_table['COUNTED'] = true;
312 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
313 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
314 $is_view = false);
315 } else {
316 $each_table['COUNTED'] = false;
319 if ($is_show_stats) {
320 $tblsize = $each_table['Data_length'] + $each_table['Index_length'];
321 $sum_size += $tblsize;
322 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
324 //$display_rows = ' - ';
325 break;
326 case 'MRG_MyISAM' :
327 case 'BerkeleyDB' :
328 // Merge or BerkleyDB table: Only row count is accurate.
329 if ($is_show_stats) {
330 $formatted_size = ' - ';
331 $unit = '';
333 break;
334 // for a view, the ENGINE is null
335 case null :
336 case 'SYSTEM VIEW' :
337 // countRecords() takes care of $cfg['MaxExactCountViews']
338 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
339 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
340 $is_view = true);
341 $table_is_view = true;
342 break;
343 default :
344 // Unknown table type.
345 if ($is_show_stats) {
346 $formatted_size = 'unknown';
347 $unit = '';
349 } // end switch
350 $sum_entries += $each_table['TABLE_ROWS'];
352 if (isset($each_table['Collation'])) {
353 $collation = '<dfn title="'
354 . PMA_getCollationDescr($each_table['Collation']) . '">'
355 . $each_table['Collation'] . '</dfn>';
356 } else {
357 $collation = '---';
360 if ($is_show_stats) {
361 if (isset($formatted_overhead)) {
362 $overhead = '<a href="tbl_structure.php?'
363 . $tbl_url_query . '#showusage">' . $formatted_overhead
364 . ' ' . $overhead_unit . '</a>' . "\n";
365 unset($formatted_overhead);
366 $overhead_check .=
367 "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;";
368 } else {
369 $overhead = '-';
371 } // end if
373 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
374 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
375 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
376 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
377 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
378 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
380 $i++;
382 $row_count++;
383 if ($table_is_view) {
384 $hidden_fields[] = '<input type="hidden" name="views[]" value="' . $each_table['TABLE_NAME'] . '" />';
387 if ($each_table['TABLE_ROWS'] > 0) {
388 $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
389 $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
390 } else {
391 $browse_table = $titles['NoBrowse'];
392 $search_table = $titles['NoSearch'];
395 if (! $db_is_information_schema) {
396 if (! empty($each_table['TABLE_ROWS'])) {
397 $empty_table = '<a href="sql.php?' . $tbl_url_query
398 . '&amp;sql_query=';
399 $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
400 . '&amp;zero_rows='
401 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
402 . '" onclick="return confirmLink(this, \'TRUNCATE ';
403 $empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
404 } else {
405 $empty_table = $titles['NoEmpty'];
407 $drop_query = 'DROP '
408 . ($table_is_view ? 'VIEW' : 'TABLE')
409 . ' ' . PMA_backquote($each_table['TABLE_NAME']);
410 $drop_message = sprintf(
411 $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,
412 str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));
415 if ($num_columns > 0 && $num_tables > $num_columns
416 && (($row_count % $num_columns) == 0)) {
417 $row_count = 1;
418 $odd_row = true;
420 </tr>
421 </tbody>
422 </table>
423 <?php
424 PMA_TableHeader();
427 <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
428 <td align="center">
429 <input type="checkbox" name="selected_tbl[]"
430 value="<?php echo $each_table['TABLE_NAME']; ?>"
431 id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
432 <th><label for="checkbox_tbl_<?php echo $i; ?>"
433 title="<?php echo $alias; ?>"><?php echo $truename; ?></label>
434 </th>
435 <td align="center"><?php echo $browse_table; ?></td>
436 <td align="center">
437 <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
438 <?php echo $titles['Structure']; ?></a></td>
439 <td align="center"><?php echo $search_table; ?></td>
440 <?php if (! $db_is_information_schema) { ?>
441 <td align="center">
442 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
443 <?php echo $titles['Insert']; ?></a></td>
444 <td align="center"><?php echo $empty_table; ?></td>
445 <td align="center">
446 <a href="sql.php?<?php echo $tbl_url_query;
447 ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
448 echo urlencode($drop_query); ?>&amp;zero_rows=<?php
449 echo urlencode($drop_message); ?>"
450 onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">
451 <?php echo $titles['Drop']; ?></a></td>
452 <?php } // end if (! $db_is_information_schema)
454 // there is a null value in the ENGINE
455 // - when the table needs to be repaired, or
456 // - when it's a view
457 // so ensure that we'll display "in use" below for a table
458 // that needs to be repaired
459 if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
460 if ($table_is_view) {
461 if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']){
462 $row_count_pre = '~';
463 $sum_row_count_pre = '~';
464 $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
466 } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
467 // InnoDB table: we did not get an accurate row count
468 $row_count_pre = '~';
469 $sum_row_count_pre = '~';
470 $show_superscript = '';
471 } else {
472 $row_count_pre = '';
473 $show_superscript = '';
476 <td class="value"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
477 <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
478 <td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>
479 <?php if (isset($collation)) { ?>
480 <td nowrap="nowrap"><?php echo $collation ?></td>
481 <?php } ?>
482 <?php } ?>
484 <?php if ($is_show_stats) { ?>
485 <td class="value"><a
486 href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
487 ><?php echo $formatted_size . ' ' . $unit; ?></a></td>
488 <td class="value"><?php echo $overhead; ?></td>
489 <?php } // end if ?>
490 <?php } elseif ($table_is_view) { ?>
491 <td class="value">-</td>
492 <td><?php echo $strView; ?></td>
493 <td>---</td>
494 <?php if ($is_show_stats) { ?>
495 <td class="value">-</td>
496 <td class="value">-</td>
497 <?php } ?>
498 <?php } else { ?>
499 <td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"
500 align="center">
501 <?php echo $strInUse; ?></td>
502 <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
503 </tr>
504 <?php
505 } // end foreach
507 // Show Summary
508 if ($is_show_stats) {
509 list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
510 list($overhead_formatted, $overhead_unit) =
511 PMA_formatByteDown($overhead_size, 3, 1);
514 </tbody>
515 <tbody>
516 <tr><th></th>
517 <th align="center" nowrap="nowrap">
518 <?php
519 // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0
520 // (we don't want negative numbers here) - rajk
521 if ($num_tables == 0)
522 $tableReductionCount = 0;
524 echo sprintf($strTables, PMA_formatNumber($num_tables - $tableReductionCount, 0));
526 </th>
527 <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">
528 <?php echo $strSum; ?></th>
529 <th class="value"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th>
530 <?php
531 if (!($cfg['PropertiesNumColumns'] > 1)) {
532 $default_engine = PMA_DBI_get_default_engine();
533 echo ' <th align="center">' . "\n"
534 . ' <dfn title="'
535 . sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";
536 // we got a case where $db_collation was empty
537 echo ' <th align="center">' . "\n";
538 if (! empty($db_collation)) {
539 echo ' <dfn title="'
540 . PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
541 . '</dfn>';
543 echo '</th>';
546 if ($is_show_stats) {
548 <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
549 <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
550 <?php
553 </tr>
554 </tbody>
555 </table>
557 <div class="clearfloat">
558 <?php
559 // Check all tables url
560 $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
562 <img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
563 width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
564 <a href="<?php echo $checkall_url; ?>&amp;checkall=1"
565 onclick="if (markAllRows('tablesForm')) return false;">
566 <?php echo $strCheckAll; ?></a>
568 <a href="<?php echo $checkall_url; ?>"
569 onclick="if (unMarkAllRows('tablesForm')) return false;">
570 <?php echo $strUncheckAll; ?></a>
571 <?php if ($overhead_check != '') { ?>
573 <a href="#" onclick="unMarkAllRows('tablesForm');
574 <?php echo $overhead_check; ?> return false;">
575 <?php echo $strCheckOverhead; ?></a>
576 <?php } ?>
578 <select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;">
579 <?php
580 echo ' <option value="' . $strWithChecked . '" selected="selected">'
581 . $strWithChecked . '</option>' . "\n";
582 echo ' <option value="' . $strEmpty . '" >'
583 . $strEmpty . '</option>' . "\n";
584 echo ' <option value="' . $strDrop . '" >'
585 . $strDrop . '</option>' . "\n";
586 echo ' <option value="' . $strPrintView . '" >'
587 . $strPrintView . '</option>' . "\n";
588 echo ' <option value="' . $strCheckTable . '" >'
589 . $strCheckTable . '</option>' . "\n";
590 echo ' <option value="' . $strOptimizeTable . '" >'
591 . $strOptimizeTable . '</option>' . "\n";
592 echo ' <option value="' . $strRepairTable . '" >'
593 . $strRepairTable . '</option>' . "\n";
594 echo ' <option value="' . $strAnalyzeTable . '" >'
595 . $strAnalyzeTable . '</option>' . "\n";
597 </select>
598 <script type="text/javascript">
599 <!--
600 // Fake js to allow the use of the <noscript> tag
601 //-->
602 </script>
603 <noscript>
604 <input type="submit" value="<?php echo $strGo; ?>" />
605 </noscript>
606 <?php echo implode("\n", $hidden_fields) . "\n"; ?>
607 </div>
608 </form>
609 <?php
610 // display again the table list navigator
611 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
613 <hr />
615 <?php
616 // Routines
617 require './libraries/db_routines.inc.php';
619 // Events
620 if (PMA_MYSQL_INT_VERSION > 50100) {
621 require './libraries/db_events.inc.php';
625 * Work on the database
626 * redesigned 2004-05-08 by mkkeck
628 /* DATABASE WORK */
629 /* Printable view of a table */
630 echo '<p>';
631 echo '<a href="db_printview.php?' . $url_query . '">';
632 if ($cfg['PropertiesIconic']) {
633 echo '<img class="icon" src="' . $pmaThemeImage
634 .'b_print.png" width="16" height="16" alt="" />';
636 echo $strPrintView . '</a> ';
638 echo '<a href="./db_datadict.php?' . $url_query . '">';
639 if ($cfg['PropertiesIconic']) {
640 echo '<img class="icon" src="' . $pmaThemeImage
641 .'b_tblanalyse.png" width="16" height="16" alt="" />';
643 echo $strDataDict . '</a>';
644 echo '</p>';
646 if (empty($db_is_information_schema)) {
647 require './libraries/display_create_table.lib.php';
648 } // end if (Create Table dialog)
651 * Displays the footer
653 require_once './libraries/footer.inc.php';