bug [structure] Missing validation for BINARY and VARBINARY
[phpmyadmin/crack.git] / db_structure.php
blob4a06801ae444a5ab0ae184a1d8888b8bd7771761
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 null
341 case null :
342 case 'SYSTEM VIEW' :
343 // countRecords() takes care of $cfg['MaxExactCountViews']
344 $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
345 $each_table['TABLE_NAME'], $return = true, $force_exact = true,
346 $is_view = true);
347 $table_is_view = true;
348 break;
349 default :
350 // Unknown table type.
351 if ($is_show_stats) {
352 $formatted_size = 'unknown';
353 $unit = '';
355 } // end switch
356 $sum_entries += $each_table['TABLE_ROWS'];
358 if (isset($each_table['Collation'])) {
359 $collation = '<dfn title="'
360 . PMA_getCollationDescr($each_table['Collation']) . '">'
361 . $each_table['Collation'] . '</dfn>';
362 } else {
363 $collation = '---';
366 if ($is_show_stats) {
367 if (isset($formatted_overhead)) {
368 $overhead = '<a href="tbl_structure.php?'
369 . $tbl_url_query . '#showusage">' . $formatted_overhead
370 . ' ' . $overhead_unit . '</a>' . "\n";
371 unset($formatted_overhead);
372 $overhead_check .=
373 "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;";
374 } else {
375 $overhead = '-';
377 } // end if
379 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
380 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
381 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
382 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
383 ? str_replace(' ', '&nbsp;', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']]))
384 : str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME']));
386 $i++;
388 $row_count++;
389 if ($table_is_view) {
390 $hidden_fields[] = '<input type="hidden" name="views[]" value="' . $each_table['TABLE_NAME'] . '" />';
393 if ($each_table['TABLE_ROWS'] > 0) {
394 $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
395 $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
396 } else {
397 $browse_table = $titles['NoBrowse'];
398 $search_table = $titles['NoSearch'];
401 if (! $db_is_information_schema) {
402 if (! empty($each_table['TABLE_ROWS'])) {
403 $empty_table = '<a href="sql.php?' . $tbl_url_query
404 . '&amp;sql_query=';
405 $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
406 . '&amp;zero_rows='
407 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
408 . '" onclick="return confirmLink(this, \'TRUNCATE ';
409 $empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
410 } else {
411 $empty_table = $titles['NoEmpty'];
413 $drop_query = 'DROP '
414 . ($table_is_view ? 'VIEW' : 'TABLE')
415 . ' ' . PMA_backquote($each_table['TABLE_NAME']);
416 $drop_message = sprintf(
417 $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,
418 str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));
421 if ($num_columns > 0 && $num_tables > $num_columns
422 && (($row_count % $num_columns) == 0)) {
423 $row_count = 1;
424 $odd_row = true;
426 </tr>
427 </tbody>
428 </table>
429 <?php
430 PMA_TableHeader();
433 <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
434 <td align="center">
435 <input type="checkbox" name="selected_tbl[]"
436 value="<?php echo $each_table['TABLE_NAME']; ?>"
437 id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
438 <th><label for="checkbox_tbl_<?php echo $i; ?>"
439 title="<?php echo $alias; ?>"><?php echo $truename; ?></label>
440 </th>
441 <td align="center"><?php echo $browse_table; ?></td>
442 <td align="center">
443 <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
444 <?php echo $titles['Structure']; ?></a></td>
445 <td align="center"><?php echo $search_table; ?></td>
446 <?php if (! $db_is_information_schema) { ?>
447 <td align="center">
448 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
449 <?php echo $titles['Insert']; ?></a></td>
450 <td align="center"><?php echo $empty_table; ?></td>
451 <td align="center">
452 <a href="sql.php?<?php echo $tbl_url_query;
453 ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
454 echo urlencode($drop_query); ?>&amp;zero_rows=<?php
455 echo urlencode($drop_message); ?>"
456 onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">
457 <?php echo $titles['Drop']; ?></a></td>
458 <?php } // end if (! $db_is_information_schema)
460 // there is a null value in the ENGINE
461 // - when the table needs to be repaired, or
462 // - when it's a view
463 // so ensure that we'll display "in use" below for a table
464 // that needs to be repaired
465 if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
466 if ($table_is_view) {
467 if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']){
468 $row_count_pre = '~';
469 $sum_row_count_pre = '~';
470 $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
472 } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
473 // InnoDB table: we did not get an accurate row count
474 $row_count_pre = '~';
475 $sum_row_count_pre = '~';
476 $show_superscript = '';
477 } else {
478 $row_count_pre = '';
479 $show_superscript = '';
482 <td class="value"><?php echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
483 <?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
484 <td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>
485 <?php if (isset($collation)) { ?>
486 <td nowrap="nowrap"><?php echo $collation ?></td>
487 <?php } ?>
488 <?php } ?>
490 <?php if ($is_show_stats) { ?>
491 <td class="value"><a
492 href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
493 ><?php echo $formatted_size . ' ' . $unit; ?></a></td>
494 <td class="value"><?php echo $overhead; ?></td>
495 <?php } // end if ?>
496 <?php } elseif ($table_is_view) { ?>
497 <td class="value">-</td>
498 <td><?php echo $strView; ?></td>
499 <td>---</td>
500 <?php if ($is_show_stats) { ?>
501 <td class="value">-</td>
502 <td class="value">-</td>
503 <?php } ?>
504 <?php } else { ?>
505 <td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"
506 align="center">
507 <?php echo $strInUse; ?></td>
508 <?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
509 </tr>
510 <?php
511 } // end foreach
513 // Show Summary
514 if ($is_show_stats) {
515 list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
516 list($overhead_formatted, $overhead_unit) =
517 PMA_formatByteDown($overhead_size, 3, 1);
520 </tbody>
521 <tbody>
522 <tr><th></th>
523 <th align="center" nowrap="nowrap">
524 <?php
525 // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0
526 // (we don't want negative numbers here) - rajk
527 if ($num_tables == 0)
528 $tableReductionCount = 0;
530 echo sprintf($strTables, PMA_formatNumber($num_tables - $tableReductionCount, 0));
532 </th>
533 <th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">
534 <?php echo $strSum; ?></th>
535 <th class="value"><?php echo $sum_row_count_pre . PMA_formatNumber($sum_entries, 0); ?></th>
536 <?php
537 if (!($cfg['PropertiesNumColumns'] > 1)) {
538 $default_engine = PMA_DBI_get_default_engine();
539 echo ' <th align="center">' . "\n"
540 . ' <dfn title="'
541 . sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";
542 // we got a case where $db_collation was empty
543 echo ' <th align="center">' . "\n";
544 if (! empty($db_collation)) {
545 echo ' <dfn title="'
546 . PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
547 . '</dfn>';
549 echo '</th>';
552 if ($is_show_stats) {
554 <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
555 <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
556 <?php
559 </tr>
560 </tbody>
561 </table>
563 <div class="clearfloat">
564 <?php
565 // Check all tables url
566 $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
568 <img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
569 width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
570 <a href="<?php echo $checkall_url; ?>&amp;checkall=1"
571 onclick="if (markAllRows('tablesForm')) return false;">
572 <?php echo $strCheckAll; ?></a>
574 <a href="<?php echo $checkall_url; ?>"
575 onclick="if (unMarkAllRows('tablesForm')) return false;">
576 <?php echo $strUncheckAll; ?></a>
577 <?php if ($overhead_check != '') { ?>
579 <a href="#" onclick="unMarkAllRows('tablesForm');
580 <?php echo $overhead_check; ?> return false;">
581 <?php echo $strCheckOverhead; ?></a>
582 <?php } ?>
584 <select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;">
585 <?php
586 echo ' <option value="' . $strWithChecked . '" selected="selected">'
587 . $strWithChecked . '</option>' . "\n";
588 echo ' <option value="' . $strEmpty . '" >'
589 . $strEmpty . '</option>' . "\n";
590 echo ' <option value="' . $strDrop . '" >'
591 . $strDrop . '</option>' . "\n";
592 echo ' <option value="' . $strPrintView . '" >'
593 . $strPrintView . '</option>' . "\n";
594 echo ' <option value="' . $strCheckTable . '" >'
595 . $strCheckTable . '</option>' . "\n";
596 echo ' <option value="' . $strOptimizeTable . '" >'
597 . $strOptimizeTable . '</option>' . "\n";
598 echo ' <option value="' . $strRepairTable . '" >'
599 . $strRepairTable . '</option>' . "\n";
600 echo ' <option value="' . $strAnalyzeTable . '" >'
601 . $strAnalyzeTable . '</option>' . "\n";
603 </select>
604 <script type="text/javascript">
605 <!--
606 // Fake js to allow the use of the <noscript> tag
607 //-->
608 </script>
609 <noscript>
610 <input type="submit" value="<?php echo $strGo; ?>" />
611 </noscript>
612 <?php echo implode("\n", $hidden_fields) . "\n"; ?>
613 </div>
614 </form>
615 <?php
616 // display again the table list navigator
617 PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
619 <hr />
621 <?php
622 // Routines
623 require './libraries/db_routines.inc.php';
625 // Events
626 if (PMA_MYSQL_INT_VERSION > 50100) {
627 require './libraries/db_events.inc.php';
631 * Work on the database
632 * redesigned 2004-05-08 by mkkeck
634 /* DATABASE WORK */
635 /* Printable view of a table */
636 echo '<p>';
637 echo '<a href="db_printview.php?' . $url_query . '">';
638 if ($cfg['PropertiesIconic']) {
639 echo '<img class="icon" src="' . $pmaThemeImage
640 .'b_print.png" width="16" height="16" alt="" />';
642 echo $strPrintView . '</a> ';
644 echo '<a href="./db_datadict.php?' . $url_query . '">';
645 if ($cfg['PropertiesIconic']) {
646 echo '<img class="icon" src="' . $pmaThemeImage
647 .'b_tblanalyse.png" width="16" height="16" alt="" />';
649 echo $strDataDict . '</a>';
650 echo '</p>';
652 if (empty($db_is_information_schema)) {
653 require './libraries/display_create_table.lib.php';
654 } // end if (Create Table dialog)
657 * Displays the footer
659 require_once './libraries/footer.inc.php';