bug #2897536 [parser] Copying table with bit field with default
[phpmyadmin/crack.git] / db_structure.php
blobc757ecbf96746a5e160e1e864d331de74100f564
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()
121 * Creates a clickable column header for table information
123 * @param string title to use for the link
124 * @param string corresponds to sortable data name mapped in libraries/db_info.inc.php
125 * @returns string link to be displayed in the table header
127 function PMA_SortableTableHeader($title, $sort)
129 // Set some defaults
130 $requested_sort = 'table';
131 $requested_sort_order = 'ASC';
132 $future_sort_order = 'ASC';
134 // If the user requested a sort
135 if (isset($_REQUEST['sort'])) {
136 $requested_sort = $_REQUEST['sort'];
138 if (isset($_REQUEST['sort_order'])) {
139 $requested_sort_order = $_REQUEST['sort_order'];
143 $order_img = '';
144 $order_link_params = array();
145 $order_link_params['title'] = $GLOBALS['strSort'];
147 // If this column was requested to be sorted.
148 if ($requested_sort == $sort) {
149 if ($requested_sort_order == 'ASC') {
150 $future_sort_order = 'DESC';
151 // current sort order is ASC
152 $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="sort_arrow" />';
153 // but on mouse over, show the reverse order (DESC)
154 $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
155 // on mouse out, show current sort order (ASC)
156 $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
157 } else {
158 // current sort order is DESC
159 $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="sort_arrow" />';
160 // but on mouse over, show the reverse order (ASC)
161 $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
162 // on mouse out, show current sort order (DESC)
163 $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
167 $_url_params = array(
168 'db' => $_REQUEST['db'],
171 $url = 'db_structure.php'.PMA_generate_common_url($_url_params);
172 // We set the position back to 0 every time they sort.
173 $url .= "&amp;pos=0&amp;sort=$sort&amp;sort_order=$future_sort_order";
175 return PMA_linkOrButton($url, $title . $order_img, $order_link_params);
176 } // end function PMA_SortableTableHeader()
179 $titles = array();
180 if (true == $cfg['PropertiesIconic']) {
181 $titles['Browse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
182 $titles['NoBrowse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
183 $titles['Search'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
184 $titles['NoSearch'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
185 $titles['Insert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
186 $titles['NoInsert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
187 $titles['Structure'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" />';
188 $titles['Drop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
189 $titles['NoDrop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
190 $titles['Empty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
191 $titles['NoEmpty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
193 if ('both' === $cfg['PropertiesIconic']) {
194 $titles['Browse'] .= $strBrowse;
195 $titles['Search'] .= $strSearch;
196 $titles['NoBrowse'] .= $strBrowse;
197 $titles['NoSearch'] .= $strSearch;
198 $titles['Insert'] .= $strInsert;
199 $titles['NoInsert'] .= $strInsert;
200 $titles['Structure'] .= $strStructure;
201 $titles['Drop'] .= $strDrop;
202 $titles['NoDrop'] .= $strDrop;
203 $titles['Empty'] .= $strEmpty;
204 $titles['NoEmpty'] .= $strEmpty;
206 } else {
207 $titles['Browse'] = $strBrowse;
208 $titles['Search'] = $strSearch;
209 $titles['NoBrowse'] = $strBrowse;
210 $titles['NoSearch'] = $strSearch;
211 $titles['Insert'] = $strInsert;
212 $titles['NoInsert'] = $strInsert;
213 $titles['Structure'] = $strStructure;
214 $titles['Drop'] = $strDrop;
215 $titles['NoDrop'] = $strDrop;
216 $titles['Empty'] = $strEmpty;
217 $titles['NoEmpty'] = $strEmpty;
221 * Displays the tables list
223 $_url_params = array(
224 'pos' => $pos,
225 'db' => $db);
227 // Add the sort options if they exists
228 if (isset($_REQUEST['sort'])) {
229 $_url_params['sort'] = $_REQUEST['sort'];
232 if (isset($_REQUEST['sort_order'])) {
233 $_url_params['sort_order'] = $_REQUEST['sort_order'];
236 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
239 <form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
240 <?php
241 echo PMA_generate_common_hidden_inputs($db);
243 PMA_TableHeader($db_is_information_schema);
245 $i = $sum_entries = 0;
246 $sum_size = (double) 0;
247 $overhead_size = (double) 0;
248 $overhead_check = '';
249 $checked = !empty($checkall) ? ' checked="checked"' : '';
250 $num_columns = $cfg['PropertiesNumColumns'] > 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0;
251 $row_count = 0;
254 $hidden_fields = array();
255 $odd_row = true;
256 $sum_row_count_pre = '';
258 // added by rajk - for blobstreaming
259 $PMA_Config = $_SESSION['PMA_Config'];
261 if (!empty($PMA_Config))
262 $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables
264 $tableReductionCount = 0; // the amount to reduce the table count by
266 foreach ($tables as $keyname => $each_table) {
267 if (isset($session_bs_tables))
269 // compare table name against blobstreaming tables
270 foreach ($session_bs_tables as $table_key=>$table_val)
271 // if the table is a blobstreaming table, reduce table count and skip outer foreach loop
272 if ($table_key == $keyname)
274 $tableReductionCount++;
275 continue 2;
279 // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
280 // statistics whatever is the table type
282 $table_is_view = false;
283 $table_encoded = urlencode($each_table['TABLE_NAME']);
284 // Sets parameters for links
285 $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
286 // do not list the previous table's size info for a view
287 $formatted_size = '-';
288 $unit = '';
290 switch ( $each_table['ENGINE']) {
291 // MyISAM, ISAM or Heap table: Row count, data size and index size
292 // are accurate.
293 case 'MyISAM' :
294 case 'ISAM' :
295 case 'HEAP' :
296 case 'MEMORY' :
297 if ($db_is_information_schema) {
298 $each_table['Rows'] = PMA_Table::countRecords($db,
299 $each_table['Name'], $return = true);
302 if ($is_show_stats) {
303 $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
304 $sum_size += $tblsize;
305 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
306 if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) {
307 list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0);
308 $overhead_size += $each_table['Data_free'];
311 break;
312 case 'InnoDB' :
313 // InnoDB table: Row count is not accurate but data and index
314 // sizes are.
316 if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
317 $each_table['COUNTED'] = true;
318 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
319 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
320 $is_view = false);
321 } else {
322 $each_table['COUNTED'] = false;
325 if ($is_show_stats) {
326 $tblsize = $each_table['Data_length'] + $each_table['Index_length'];
327 $sum_size += $tblsize;
328 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
330 //$display_rows = ' - ';
331 break;
332 case 'MRG_MyISAM' :
333 case 'BerkeleyDB' :
334 // Merge or BerkleyDB table: Only row count is accurate.
335 if ($is_show_stats) {
336 $formatted_size = ' - ';
337 $unit = '';
339 break;
340 // for a view, the ENGINE is sometimes reported as null,
341 // or on some servers it's reported as "SYSTEM VIEW"
342 case null :
343 case 'SYSTEM VIEW' :
344 // if table is broken, Engine is reported as null, so one more test
345 if ($each_table['TABLE_TYPE'] == 'VIEW') {
346 // countRecords() takes care of $cfg['MaxExactCountViews']
347 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
348 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
349 $is_view = true);
350 $table_is_view = true;
352 break;
353 default :
354 // Unknown table type.
355 if ($is_show_stats) {
356 $formatted_size = 'unknown';
357 $unit = '';
359 } // end switch
360 $sum_entries += $each_table['TABLE_ROWS'];
362 if (isset($each_table['Collation'])) {
363 $collation = '<dfn title="'
364 . PMA_getCollationDescr($each_table['Collation']) . '">'
365 . $each_table['Collation'] . '</dfn>';
366 } else {
367 $collation = '---';
370 if ($is_show_stats) {
371 if (isset($formatted_overhead)) {
372 $overhead = '<a href="tbl_structure.php?'
373 . $tbl_url_query . '#showusage">' . $formatted_overhead
374 . ' ' . $overhead_unit . '</a>' . "\n";
375 unset($formatted_overhead);
376 $overhead_check .=
377 "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;";
378 } else {
379 $overhead = '-';
381 } // end if
383 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
384 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
385 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
386 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
387 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
388 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
390 $i++;
392 $row_count++;
393 if ($table_is_view) {
394 $hidden_fields[] = '<input type="hidden" name="views[]" value="' . htmlspecialchars($each_table['TABLE_NAME']) . '" />';
397 if ($each_table['TABLE_ROWS'] > 0) {
398 $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
399 $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
400 } else {
401 $browse_table = $titles['NoBrowse'];
402 $search_table = $titles['NoSearch'];
405 if (! $db_is_information_schema) {
406 if (! empty($each_table['TABLE_ROWS'])) {
407 $empty_table = '<a href="sql.php?' . $tbl_url_query
408 . '&amp;sql_query=';
409 $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
410 . '&amp;zero_rows='
411 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
412 . '" onclick="return confirmLink(this, \'TRUNCATE ';
413 $empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
414 } else {
415 $empty_table = $titles['NoEmpty'];
417 $drop_query = 'DROP '
418 . ($table_is_view ? 'VIEW' : 'TABLE')
419 . ' ' . PMA_backquote($each_table['TABLE_NAME']);
420 $drop_message = sprintf(
421 $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,
422 str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));
425 if ($num_columns > 0 && $num_tables > $num_columns
426 && (($row_count % $num_columns) == 0)) {
427 $row_count = 1;
428 $odd_row = true;
430 </tr>
431 </tbody>
432 </table>
433 <?php
434 PMA_TableHeader();
437 <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
438 <td align="center">
439 <input type="checkbox" name="selected_tbl[]"
440 value="<?php echo htmlspecialchars($each_table['TABLE_NAME']); ?>"
441 id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
442 <th><label for="checkbox_tbl_<?php echo $i; ?>"
443 title="<?php echo $alias; ?>"><?php echo $truename; ?></label>
444 </th>
445 <td align="center"><?php echo $browse_table; ?></td>
446 <td align="center">
447 <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
448 <?php echo $titles['Structure']; ?></a></td>
449 <td align="center"><?php echo $search_table; ?></td>
450 <?php if (! $db_is_information_schema) { ?>
451 <td align="center">
452 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
453 <?php echo $titles['Insert']; ?></a></td>
454 <td align="center"><?php echo $empty_table; ?></td>
455 <td align="center">
456 <a href="sql.php?<?php echo $tbl_url_query;
457 ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
458 echo urlencode($drop_query); ?>&amp;zero_rows=<?php
459 echo urlencode($drop_message); ?>"
460 onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">
461 <?php echo $titles['Drop']; ?></a></td>
462 <?php } // end if (! $db_is_information_schema)
464 // there is a null value in the ENGINE
465 // - when the table needs to be repaired, or
466 // - when it's a view
467 // so ensure that we'll display "in use" below for a table
468 // that needs to be repaired
469 if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
470 if ($table_is_view) {
471 if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']){
472 $row_count_pre = '~';
473 $sum_row_count_pre = '~';
474 $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
476 } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
477 // InnoDB table: we did not get an accurate row count
478 $row_count_pre = '~';
479 $sum_row_count_pre = '~';
480 $show_superscript = '';
481 } else {
482 $row_count_pre = '';
483 $show_superscript = '';
486 <td class="value"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
487 <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
488 <td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>
489 <?php if (isset($collation)) { ?>
490 <td nowrap="nowrap"><?php echo $collation ?></td>
491 <?php } ?>
492 <?php } ?>
494 <?php if ($is_show_stats) { ?>
495 <td class="value"><a
496 href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
497 ><?php echo $formatted_size . ' ' . $unit; ?></a></td>
498 <td class="value"><?php echo $overhead; ?></td>
499 <?php } // end if ?>
500 <?php } elseif ($table_is_view) { ?>
501 <td class="value">-</td>
502 <td><?php echo $strView; ?></td>
503 <td>---</td>
504 <?php if ($is_show_stats) { ?>
505 <td class="value">-</td>
506 <td class="value">-</td>
507 <?php } ?>
508 <?php } else { ?>
509 <td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"
510 align="center">
511 <?php echo $strInUse; ?></td>
512 <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
513 </tr>
514 <?php
515 } // end foreach
517 // Show Summary
518 if ($is_show_stats) {
519 list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
520 list($overhead_formatted, $overhead_unit) =
521 PMA_formatByteDown($overhead_size, 3, 1);
524 </tbody>
525 <tbody>
526 <tr><th></th>
527 <th align="center" nowrap="nowrap">
528 <?php
529 // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0
530 // (we don't want negative numbers here) - rajk
531 if ($num_tables == 0)
532 $tableReductionCount = 0;
534 echo sprintf($strTables, PMA_formatNumber($num_tables - $tableReductionCount, 0));
536 </th>
537 <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">
538 <?php echo $strSum; ?></th>
539 <th class="value"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th>
540 <?php
541 if (!($cfg['PropertiesNumColumns'] > 1)) {
542 $default_engine = PMA_DBI_get_default_engine();
543 echo ' <th align="center">' . "\n"
544 . ' <dfn title="'
545 . sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";
546 // we got a case where $db_collation was empty
547 echo ' <th align="center">' . "\n";
548 if (! empty($db_collation)) {
549 echo ' <dfn title="'
550 . PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
551 . '</dfn>';
553 echo '</th>';
556 if ($is_show_stats) {
558 <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
559 <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
560 <?php
563 </tr>
564 </tbody>
565 </table>
567 <div class="clearfloat">
568 <?php
569 // Check all tables url
570 $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
572 <img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
573 width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
574 <a href="<?php echo $checkall_url; ?>&amp;checkall=1"
575 onclick="if (markAllRows('tablesForm')) return false;">
576 <?php echo $strCheckAll; ?></a>
578 <a href="<?php echo $checkall_url; ?>"
579 onclick="if (unMarkAllRows('tablesForm')) return false;">
580 <?php echo $strUncheckAll; ?></a>
581 <?php if ($overhead_check != '') { ?>
583 <a href="#" onclick="unMarkAllRows('tablesForm');
584 <?php echo $overhead_check; ?> return false;">
585 <?php echo $strCheckOverhead; ?></a>
586 <?php } ?>
588 <select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;">
589 <?php
590 echo ' <option value="' . $strWithChecked . '" selected="selected">'
591 . $strWithChecked . '</option>' . "\n";
592 echo ' <option value="' . $strEmpty . '" >'
593 . $strEmpty . '</option>' . "\n";
594 echo ' <option value="' . $strDrop . '" >'
595 . $strDrop . '</option>' . "\n";
596 echo ' <option value="' . $strPrintView . '" >'
597 . $strPrintView . '</option>' . "\n";
598 echo ' <option value="' . $strCheckTable . '" >'
599 . $strCheckTable . '</option>' . "\n";
600 echo ' <option value="' . $strOptimizeTable . '" >'
601 . $strOptimizeTable . '</option>' . "\n";
602 echo ' <option value="' . $strRepairTable . '" >'
603 . $strRepairTable . '</option>' . "\n";
604 echo ' <option value="' . $strAnalyzeTable . '" >'
605 . $strAnalyzeTable . '</option>' . "\n";
607 </select>
608 <script type="text/javascript">
609 <!--
610 // Fake js to allow the use of the <noscript> tag
611 //-->
612 </script>
613 <noscript>
614 <input type="submit" value="<?php echo $strGo; ?>" />
615 </noscript>
616 <?php echo implode("\n", $hidden_fields) . "\n"; ?>
617 </div>
618 </form>
619 <?php
620 // display again the table list navigator
621 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
623 <hr />
625 <?php
626 // Routines
627 require './libraries/db_routines.inc.php';
629 // Events
630 if (PMA_MYSQL_INT_VERSION > 50100) {
631 require './libraries/db_events.inc.php';
635 * Work on the database
636 * redesigned 2004-05-08 by mkkeck
638 /* DATABASE WORK */
639 /* Printable view of a table */
640 echo '<p>';
641 echo '<a href="db_printview.php?' . $url_query . '">';
642 if ($cfg['PropertiesIconic']) {
643 echo '<img class="icon" src="' . $pmaThemeImage
644 .'b_print.png" width="16" height="16" alt="" />';
646 echo $strPrintView . '</a> ';
648 echo '<a href="./db_datadict.php?' . $url_query . '">';
649 if ($cfg['PropertiesIconic']) {
650 echo '<img class="icon" src="' . $pmaThemeImage
651 .'b_tblanalyse.png" width="16" height="16" alt="" />';
653 echo $strDataDict . '</a>';
654 echo '</p>';
656 if (empty($db_is_information_schema)) {
657 require './libraries/display_create_table.lib.php';
658 } // end if (Create Table dialog)
661 * Displays the footer
663 require_once './libraries/footer.inc.php';