showtable undefined after table creation
[phpmyadmin/crack.git] / db_structure.php
blob8d484b21c1c3af9f3feceb0e4e2b0544a3b35069
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><td></td>' . "\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 ($is_show_stats) {
292 $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
293 $sum_size += $tblsize;
294 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
295 if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) {
296 list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0);
297 $overhead_size += $each_table['Data_free'];
300 break;
301 case 'InnoDB' :
302 // InnoDB table: Row count is not accurate but data and index
303 // sizes are.
305 if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
306 $each_table['COUNTED'] = true;
307 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
308 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
309 $is_view = false);
310 } else {
311 $each_table['COUNTED'] = false;
314 if ($is_show_stats) {
315 $tblsize = $each_table['Data_length'] + $each_table['Index_length'];
316 $sum_size += $tblsize;
317 list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
319 //$display_rows = ' - ';
320 break;
321 case 'MRG_MyISAM' :
322 case 'BerkeleyDB' :
323 // Merge or BerkleyDB table: Only row count is accurate.
324 if ($is_show_stats) {
325 $formatted_size = ' - ';
326 $unit = '';
328 break;
329 // for a view, the ENGINE is null
330 case null :
331 case 'SYSTEM VIEW' :
332 // countRecords() takes care of $cfg['MaxExactCountViews']
333 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
334 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
335 $is_view = true);
336 $table_is_view = true;
337 break;
338 default :
339 // Unknown table type.
340 if ($is_show_stats) {
341 $formatted_size = 'unknown';
342 $unit = '';
344 } // end switch
345 $sum_entries += $each_table['TABLE_ROWS'];
347 if (isset($each_table['Collation'])) {
348 $collation = '<dfn title="'
349 . PMA_getCollationDescr($each_table['Collation']) . '">'
350 . $each_table['Collation'] . '</dfn>';
351 } else {
352 $collation = '---';
355 if ($is_show_stats) {
356 if (isset($formatted_overhead)) {
357 $overhead = '<a href="tbl_structure.php?'
358 . $tbl_url_query . '#showusage">' . $formatted_overhead
359 . ' ' . $overhead_unit . '</a>' . "\n";
360 unset($formatted_overhead);
361 $overhead_check .=
362 "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;";
363 } else {
364 $overhead = '-';
366 } // end if
368 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
369 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
370 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
371 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
372 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
373 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
375 $i++;
377 $row_count++;
378 if ($table_is_view) {
379 $hidden_fields[] = '<input type="hidden" name="views[]" value="' . $each_table['TABLE_NAME'] . '" />';
382 if ($each_table['TABLE_ROWS'] > 0) {
383 $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
384 $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
385 } else {
386 $browse_table = $titles['NoBrowse'];
387 $search_table = $titles['NoSearch'];
390 if (! $db_is_information_schema) {
391 if (! empty($each_table['TABLE_ROWS'])) {
392 $empty_table = '<a href="sql.php?' . $tbl_url_query
393 . '&amp;sql_query=';
394 $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
395 . '&amp;zero_rows='
396 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
397 . '" onclick="return confirmLink(this, \'TRUNCATE ';
398 $empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
399 } else {
400 $empty_table = $titles['NoEmpty'];
402 $drop_query = 'DROP '
403 . ($table_is_view ? 'VIEW' : 'TABLE')
404 . ' ' . PMA_backquote($each_table['TABLE_NAME']);
405 $drop_message = sprintf(
406 $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,
407 str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));
410 if ($num_columns > 0 && $num_tables > $num_columns
411 && (($row_count % $num_columns) == 0)) {
412 $row_count = 1;
413 $odd_row = true;
415 </tr>
416 </tbody>
417 </table>
418 <?php
419 PMA_TableHeader();
422 <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
423 <td align="center">
424 <input type="checkbox" name="selected_tbl[]"
425 value="<?php echo $each_table['TABLE_NAME']; ?>"
426 id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
427 <th><label for="checkbox_tbl_<?php echo $i; ?>"
428 title="<?php echo $alias; ?>"><?php echo $truename; ?></label>
429 </th>
430 <td align="center"><?php echo $browse_table; ?></td>
431 <td align="center">
432 <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
433 <?php echo $titles['Structure']; ?></a></td>
434 <td align="center"><?php echo $search_table; ?></td>
435 <?php if (! $db_is_information_schema) { ?>
436 <td align="center">
437 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
438 <?php echo $titles['Insert']; ?></a></td>
439 <td align="center"><?php echo $empty_table; ?></td>
440 <td align="center">
441 <a href="sql.php?<?php echo $tbl_url_query;
442 ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
443 echo urlencode($drop_query); ?>&amp;zero_rows=<?php
444 echo urlencode($drop_message); ?>"
445 onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">
446 <?php echo $titles['Drop']; ?></a></td>
447 <?php } // end if (! $db_is_information_schema)
449 // there is a null value in the ENGINE
450 // - when the table needs to be repaired, or
451 // - when it's a view
452 // so ensure that we'll display "in use" below for a table
453 // that needs to be repaired
454 if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
455 if ($table_is_view) {
456 if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']){
457 $row_count_pre = '~';
458 $sum_row_count_pre = '~';
459 $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
461 } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
462 // InnoDB table: we did not get an accurate row count
463 $row_count_pre = '~';
464 $sum_row_count_pre = '~';
465 $show_superscript = '';
466 } else {
467 $row_count_pre = '';
468 $show_superscript = '';
471 <td class="value"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
472 <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
473 <td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>
474 <?php if (isset($collation)) { ?>
475 <td nowrap="nowrap"><?php echo $collation ?></td>
476 <?php } ?>
477 <?php } ?>
479 <?php if ($is_show_stats) { ?>
480 <td class="value"><a
481 href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
482 ><?php echo $formatted_size . ' ' . $unit; ?></a></td>
483 <td class="value"><?php echo $overhead; ?></td>
484 <?php } // end if ?>
485 <?php } elseif ($table_is_view) { ?>
486 <td class="value">-</td>
487 <td><?php echo $strView; ?></td>
488 <td>---</td>
489 <?php if ($is_show_stats) { ?>
490 <td class="value">-</td>
491 <td class="value">-</td>
492 <?php } ?>
493 <?php } else { ?>
494 <td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"
495 align="center">
496 <?php echo $strInUse; ?></td>
497 <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
498 </tr>
499 <?php
500 } // end foreach
502 // Show Summary
503 if ($is_show_stats) {
504 list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
505 list($overhead_formatted, $overhead_unit) =
506 PMA_formatByteDown($overhead_size, 3, 1);
509 </tbody>
510 <tbody>
511 <tr><td></td>
512 <th align="center" nowrap="nowrap">
513 <?php
514 // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0
515 // (we don't want negative numbers here) - rajk
516 if ($num_tables == 0)
517 $tableReductionCount = 0;
519 echo sprintf($strTables, PMA_formatNumber($num_tables - $tableReductionCount, 0));
521 </th>
522 <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">
523 <?php echo $strSum; ?></th>
524 <th class="value"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th>
525 <?php
526 if (!($cfg['PropertiesNumColumns'] > 1)) {
527 $default_engine = PMA_DBI_get_default_engine();
528 echo ' <th align="center">' . "\n"
529 . ' <dfn title="'
530 . sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";
531 // we got a case where $db_collation was empty
532 echo ' <th align="center">' . "\n";
533 if (! empty($db_collation)) {
534 echo ' <dfn title="'
535 . PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
536 . '</dfn>';
538 echo '</th>';
541 if ($is_show_stats) {
543 <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
544 <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
545 <?php
548 </tr>
549 </tbody>
550 </table>
552 <div class="clearfloat">
553 <?php
554 // Check all tables url
555 $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
557 <img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
558 width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
559 <a href="<?php echo $checkall_url; ?>&amp;checkall=1"
560 onclick="if (markAllRows('tablesForm')) return false;">
561 <?php echo $strCheckAll; ?></a>
563 <a href="<?php echo $checkall_url; ?>"
564 onclick="if (unMarkAllRows('tablesForm')) return false;">
565 <?php echo $strUncheckAll; ?></a>
566 <?php if ($overhead_check != '') { ?>
568 <a href="#" onclick="unMarkAllRows('tablesForm');
569 <?php echo $overhead_check; ?> return false;">
570 <?php echo $strCheckOverhead; ?></a>
571 <?php } ?>
573 <select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;">
574 <?php
575 echo ' <option value="' . $strWithChecked . '" selected="selected">'
576 . $strWithChecked . '</option>' . "\n";
577 echo ' <option value="' . $strEmpty . '" >'
578 . $strEmpty . '</option>' . "\n";
579 echo ' <option value="' . $strDrop . '" >'
580 . $strDrop . '</option>' . "\n";
581 echo ' <option value="' . $strPrintView . '" >'
582 . $strPrintView . '</option>' . "\n";
583 echo ' <option value="' . $strCheckTable . '" >'
584 . $strCheckTable . '</option>' . "\n";
585 echo ' <option value="' . $strOptimizeTable . '" >'
586 . $strOptimizeTable . '</option>' . "\n";
587 echo ' <option value="' . $strRepairTable . '" >'
588 . $strRepairTable . '</option>' . "\n";
589 echo ' <option value="' . $strAnalyzeTable . '" >'
590 . $strAnalyzeTable . '</option>' . "\n";
592 </select>
593 <script type="text/javascript">
594 <!--
595 // Fake js to allow the use of the <noscript> tag
596 //-->
597 </script>
598 <noscript>
599 <input type="submit" value="<?php echo $strGo; ?>" />
600 </noscript>
601 <?php echo implode("\n", $hidden_fields) . "\n"; ?>
602 </div>
603 </form>
604 <?php
605 // display again the table list navigator
606 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
608 <hr />
610 <?php
611 // Routines
612 require './libraries/db_routines.inc.php';
614 // Events
615 if (PMA_MYSQL_INT_VERSION > 50100) {
616 require './libraries/db_events.inc.php';
620 * Work on the database
621 * redesigned 2004-05-08 by mkkeck
623 /* DATABASE WORK */
624 /* Printable view of a table */
625 echo '<p>';
626 echo '<a href="db_printview.php?' . $url_query . '">';
627 if ($cfg['PropertiesIconic']) {
628 echo '<img class="icon" src="' . $pmaThemeImage
629 .'b_print.png" width="16" height="16" alt="" />';
631 echo $strPrintView . '</a> ';
633 echo '<a href="./db_datadict.php?' . $url_query . '">';
634 if ($cfg['PropertiesIconic']) {
635 echo '<img class="icon" src="' . $pmaThemeImage
636 .'b_tblanalyse.png" width="16" height="16" alt="" />';
638 echo $strDataDict . '</a>';
639 echo '</p>';
641 if (empty($db_is_information_schema)) {
642 require './libraries/display_create_table.lib.php';
643 } // end if (Create Table dialog)
646 * Displays the footer
648 require_once './libraries/footer.inc.php';