RFE #1177459, BOOL column type
[phpmyadmin/crack.git] / db_details_structure.php
blob4ec005b6cc85058cb325e376923f18416b82c05e
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 require_once('./libraries/grab_globals.lib.php');
6 require_once('./libraries/common.lib.php');
7 require_once('./libraries/mysql_charsets.lib.php');
9 /**
10 * Prepares the tables list if the user where not redirected to this script
11 * because there is no table in the database ($is_info is TRUE)
13 if (empty($is_info)) {
14 // Drops/deletes/etc. multiple tables if required
15 if ((!empty($submit_mult) && isset($selected_tbl))
16 || isset($mult_btn)) {
17 $action = 'db_details_structure.php';
18 $err_url = 'db_details_structure.php?'. PMA_generate_common_url($db);
19 require('./mult_submits.inc.php');
20 $message = $strSuccess;
22 require('./db_details_common.php');
23 $url_query .= '&amp;goto=db_details_structure.php';
25 // Gets the database structure
26 $sub_part = '_structure';
27 require('./db_details_db_info.php');
28 echo "\n";
31 if (PMA_MYSQL_INT_VERSION >= 40101) {
32 $db_collation = PMA_getDbCollation($db);
36 // Display function
37 function pma_TableHeader($alternate = FALSE, $record_count = TRUE) {
38 $cnt = 0; // Let's count the columns...
39 echo ' <table border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1">' . "\n"
40 . ' <tr>' . "\n"
41 . ' <td></td>' . "\n"
42 . ' <th>' . "\n"
43 . ' &nbsp;' . $GLOBALS['strTable'] . '&nbsp;' . "\n"
44 . ' </th>' . "\n"
45 . ' <th colspan="6">' . "\n"
46 . ' &nbsp;' . $GLOBALS['strAction'] . '&nbsp;' . "\n"
47 . ' </th>' . "\n";
48 $cnt += 3;
49 if ($record_count) {
50 echo ' <th>' . "\n"
51 . ' &nbsp;' . $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . '&nbsp;' . "\n"
52 . ' </th>' . "\n";
53 $cnt++;
55 if (!$alternate) {
56 if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
57 echo ' <th>' . "\n"
58 . ' &nbsp;' . $GLOBALS['strType'] . '&nbsp;' . "\n"
59 . ' </th>' . "\n";
60 $cnt++;
61 if (PMA_MYSQL_INT_VERSION >= 40100) {
62 echo ' <th>' . "\n"
63 . ' &nbsp;' . $GLOBALS['strCollation'] . '&nbsp;' . "\n"
64 . ' </th>' . "\n";
65 $cnt++;
68 if ($GLOBALS['cfg']['ShowStats']) {
69 echo ' <th>' . "\n"
70 . ' &nbsp;' . $GLOBALS['strSize'] . '&nbsp;' . "\n"
71 . ' </th>' . "\n"
72 . ' <th>' . "\n"
73 . ' &nbsp;' . $GLOBALS['strOverhead'] . '&nbsp;' . "\n"
74 . ' </th>' . "\n";
75 $cnt += 2;
77 echo "\n";
79 echo ' </tr>' . "\n";
80 $GLOBALS['structure_tbl_col_cnt'] = $cnt;
84 /**
85 * Displays the tables list
89 <!-- TABLE LIST -->
91 <?php
92 $titles = array();
93 if ($cfg['PropertiesIconic'] == true) {
94 // We need to copy the value or else the == 'both' check will always return true
95 $propicon = (string)$cfg['PropertiesIconic'];
97 if ($propicon == 'both') {
98 $iconic_spacer = '<div class="nowrap">';
99 } else {
100 $iconic_spacer = '';
103 $titles['Browse'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
104 $titles['NoBrowse'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
105 $titles['Search'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
106 $titles['NoSearch'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
107 $titles['Insert'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
108 $titles['NoInsert'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
109 $titles['Structure'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" border="0" />';
110 $titles['Drop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
111 $titles['NoDrop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
112 $titles['Empty'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
113 $titles['NoEmpty'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
115 if ($propicon == 'both') {
116 $titles['Browse'] .= '&nbsp;' . $strBrowse . '</div>';
117 $titles['Search'] .= '&nbsp;' . $strSearch . '</div>';
118 $titles['NoBrowse'] .= '&nbsp;' . $strBrowse . '</div>';
119 $titles['NoSearch'] .= '&nbsp;' . $strSearch . '</div>';
120 $titles['Insert'] .= '&nbsp;' . $strInsert . '</div>';
121 $titles['NoInsert'] .= '&nbsp;' . $strInsert . '</div>';
122 $titles['Structure'] .= '&nbsp;' . $strStructure . '</div>';
123 $titles['Drop'] .= '&nbsp;' . $strDrop . '</div>';
124 $titles['NoDrop'] .= '&nbsp;' . $strDrop . '</div>';
125 $titles['Empty'] .= '&nbsp;' . $strEmpty . '</div>';
126 $titles['NoEmpty'] .= '&nbsp;' . $strEmpty . '</div>';
128 } else {
129 $titles['Browse'] = $strBrowse;
130 $titles['Search'] = $strSearch;
131 $titles['NoBrowse'] = $strBrowse;
132 $titles['NoSearch'] = $strSearch;
133 $titles['Insert'] = $strInsert;
134 $titles['NoInsert'] = $strInsert;
135 $titles['Structure'] = $strStructure;
136 $titles['Drop'] = $strDrop;
137 $titles['NoDrop'] = $strDrop;
138 $titles['Empty'] = $strEmpty;
139 $titles['NoEmpty'] = $strEmpty;
142 // 1. No tables
143 if ($num_tables == 0) {
144 echo $strNoTablesFound . "\n";
146 // 2. Shows table informations - staybyte - 11 June 2001
147 else {
149 <form method="post" action="db_details_structure.php" name="tablesForm">
150 <?php echo PMA_generate_common_hidden_inputs($db); ?>
152 <?php
153 if ($cfg['PropertiesNumColumns'] > 1) {
155 <table cellspacing="0" cellpadding="0" border="0">
156 <tr>
157 <td valign="top">
158 <?php
161 // rabus: disable statistics for information_schema.
162 if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
163 $cfg['ShowStats'] = FALSE;
164 pma_TableHeader(FALSE, FALSE);
165 } else {
166 pma_TableHeader();
169 $i = $sum_entries = 0;
170 (double) $sum_size = 0;
171 (double) $overhead_size = 0;
172 $overhead_check = '';
173 $checked = (!empty($checkall) ? ' checked="checked"' : '');
174 $num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
175 $row_count = 0;
177 if ($cfg['NaturalOrder']) {
178 $tables_temp = $tables;
179 foreach (array_keys($tables_temp) as $each) {
180 $tables_sort[$each] = $tables_temp[$each]['Name'];
182 natsort($tables_sort);
183 $sort_i = 0;
184 foreach (array_keys($tables_sort) as $each) {
185 $tables_temp[$sort_i] = $tables[$each];
186 $sort_i++;
188 $tables = $tables_temp;
191 foreach ($tables AS $keyname => $sts_data) {
192 $table = $sts_data['Name'];
193 $table_encoded = urlencode($table);
194 $table_name = htmlspecialchars($table);
195 $is_view = (PMA_MYSQL_INT_VERSION >= 50000
196 && !isset($sts_data['Type'])
197 && $sts_data['Comment'] == 'view');
199 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$table]))
200 ? htmlspecialchars($tooltip_aliasname[$table])
201 : htmlspecialchars($sts_data['Name']);
202 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$table]))
203 ? htmlspecialchars($tooltip_truename[$table])
204 : htmlspecialchars($sts_data['Name']);
206 // Sets parameters for links
207 $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
208 $bgcolor = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
209 echo "\n";
211 if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
212 $on_mouse = ' onmouseover="setPointer(this, ' . $i . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
213 . ' onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
214 } else {
215 $on_mouse = '';
217 if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
218 $on_mouse .= ' onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
221 $click_mouse = ' onmousedown="document.getElementById(\'checkbox_tbl_' . $i . '\').checked = (document.getElementById(\'checkbox_tbl_' . $i . '\').checked ? false : true);" ';
223 $row_count++;
224 if ($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
225 $bgcolor = $cfg['BgcolorTwo'];
226 $row_count = 1;
228 </tr>
229 </table>
230 </td>
231 <td><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="10" height="1" alt="" /></td>
232 <td valign="top">
233 <?php
234 pma_TableHeader(FALSE, !(PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema'));
237 <tr <?php echo $on_mouse; ?>>
238 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
239 <input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
240 <?php
241 if ($is_view) {
243 <input type="hidden" name="views[]" value="<?php echo $table_encoded; ?>" />
244 <?php
247 </td>
248 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
249 &nbsp;<b><label onclick="javascript: return (document.getElementById('checkbox_tbl_<?php echo $i; ?>') ? false : true)" for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label>&nbsp;</b>&nbsp;
250 </td>
251 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
252 <?php
253 require_once('./libraries/bookmark.lib.php');
254 $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
256 if (!empty($sts_data['Rows']) || $is_view || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
257 echo '<a href="sql.php?' . $tbl_url_query . '&amp;sql_query='
258 . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
259 . '&amp;pos=0">' . $titles['Browse'] . '</a>';
260 } else {
261 echo $titles['NoBrowse'];
264 </td>
265 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
266 <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>">
267 <?php echo $titles['Structure']; ?></a>
268 </td>
269 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
270 <?php
271 if (!empty($sts_data['Rows']) || $is_view || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
272 echo '<a href="tbl_select.php?' . $tbl_url_query . '">'
273 . $titles['Search'] . '</a>';
274 } else {
275 echo $titles['NoSearch'];
278 </td>
279 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
280 <?php
281 if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
282 // rabus: We cannot insert into information_schema tables!
283 echo $titles['NoInsert'];
284 } else {
286 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
287 <?php echo $titles['Insert']; ?></a>
288 <?php
291 </td>
292 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
293 <?php
294 if (!empty($sts_data['Rows'])) {
295 echo '<a href="sql.php?' . $tbl_url_query
296 . '&amp;sql_query=';
297 if (PMA_MYSQL_INT_VERSION >= 40000) {
298 echo urlencode('TRUNCATE ' . PMA_backquote($table))
299 . '&amp;zero_rows='
300 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
301 . '" onclick="return confirmLink(this, \'TRUNCATE ';
302 } else {
303 echo urlencode('DELETE FROM ' . PMA_backquote($table))
304 . '&amp;zero_rows='
305 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
306 . '" onclick="return confirmLink(this, \'DELETE FROM ';
308 echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
309 } else {
310 echo $titles['NoEmpty'];
313 $drop_query = 'DROP '
314 . ($is_view ? 'VIEW' : 'TABLE')
315 . ' ' . PMA_backquote($table);
316 $drop_message = sprintf(($is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped), htmlspecialchars($table));
318 </td>
319 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
320 <?php
321 // rabus: We cannot drop information_schema tables!
322 if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
323 echo $titles['NoDrop'];
324 } else {
326 <a href="sql.php?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode($drop_query); ?>&amp;zero_rows=<?php echo urlencode($drop_message); ?>"
327 onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, FALSE); ?>')">
328 <?php echo $titles['Drop']; ?></a>
329 <?php
332 </td>
333 <?php
334 unset($drop_query, $drop_message);
335 echo "\n";
337 // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
338 // statistics whatever is the table type
339 if (isset($sts_data['Rows']) || (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
340 // MyISAM, ISAM or Heap table: Row count, data size and index size
341 // is accurate.
342 if (isset($sts_data['Type']) && preg_match('@^(MyISAM|ISAM|HEAP)$@', $sts_data['Type'])) {
343 if ($cfg['ShowStats']) {
344 $tblsize = doubleval($sts_data['Data_length']) + doubleval($sts_data['Index_length']);
345 $sum_size += $tblsize;
346 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
347 if (isset($sts_data['Data_free']) && $sts_data['Data_free'] > 0) {
348 list($formated_overhead, $overhead_unit) = PMA_formatByteDown($sts_data['Data_free']);
349 $overhead_size += $sts_data['Data_free'];
352 $sum_entries += $sts_data['Rows'];
353 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
356 // InnoDB table: Row count is not accurate but data and index
357 // sizes are.
358 else if (isset($sts_data['Type']) && $sts_data['Type'] == 'InnoDB') {
359 if ($cfg['ShowStats']) {
360 $tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
361 $sum_size += $tblsize;
362 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
364 //$display_rows = '&nbsp;-&nbsp;';
365 // get row count with another method
366 if ($sts_data['Rows'] < $cfg['MaxExactCount']) {
367 $local_query = 'SELECT COUNT(*) AS count FROM '
368 . PMA_backquote($db) . '.'
369 . PMA_backquote($table);
370 $table_info_result = PMA_DBI_query($local_query);
371 list($row_count) = PMA_DBI_fetch_row($table_info_result);
372 PMA_DBI_free_result($table_info_result);
373 unset($table_info_result);
374 $sum_entries += $row_count;
375 } else {
376 $row_count = $sts_data['Rows'];
377 $sum_entries += $sts_data['Rows'];
379 $display_rows = number_format($row_count, 0, $number_decimal_separator, $number_thousands_separator);
382 // Merge or BerkleyDB table: Only row count is accurate.
383 else if (isset($sts_data['Type']) && preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $sts_data['Type'])) {
384 if ($cfg['ShowStats']) {
385 $formated_size = '&nbsp;-&nbsp;';
386 $unit = '';
388 $sum_entries += $sts_data['Rows'];
389 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
392 // Unknown table type.
393 else {
394 if ($cfg['ShowStats']) {
395 $formated_size = 'unknown';
396 $unit = '';
398 $display_rows = 'unknown';
400 // Don't display number of rows for information_schema tables.
401 if (!(PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema')) {
403 <td align="right" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
404 <?php
405 echo "\n" . ' ' . $display_rows . "\n";
407 </td>
408 <?php
410 if (!($cfg['PropertiesNumColumns'] > 1)) {
411 echo ' <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
412 . ' &nbsp;' . (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;') . '&nbsp;' . "\n"
413 . ' </td>' . "\n";
414 if (PMA_MYSQL_INT_VERSION >= 40100) {
415 echo ' <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
416 . ' &nbsp;' . (isset($sts_data['Collation']) ? '<dfn title="' . PMA_getCollationDescr($sts_data['Collation']) . '">' . $sts_data['Collation'] . '</dfn>' : '---') . '&nbsp;' . "\n"
417 . ' </td>' . "\n";
421 if ($cfg['ShowStats']) {
422 echo "\n";
424 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
425 &nbsp;&nbsp;
426 <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
427 </td>
428 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" <?php echo $click_mouse; ?>>
429 &nbsp;&nbsp;
430 <?php
431 if (isset($formated_overhead)) {
432 echo '<a href="tbl_properties_structure.php?' . $tbl_url_query . '#showusage">' . $formated_overhead . ' ' . $overhead_unit . '</a>' . "\n";
433 unset($formated_overhead);
434 $overhead_check .= "document.getElementById('checkbox_tbl_$i').checked = true;";
435 } else {
436 echo "&nbsp;-&nbsp;\n";
439 </td>
440 <?php
441 echo "\n";
442 } // end if
443 } else if (PMA_MYSQL_INT_VERSION >= 50000 && $sts_data['Comment'] == 'view') {
444 // rabus: We've found a view
446 <td align="right" bgcolor="<?php echo $bgcolor; ?>">
447 &nbsp;-&nbsp;
448 </td>
449 <td bgcolor="<?php echo $bgcolor; ?>">
450 &nbsp;<?php echo $strView ; ?>&nbsp;
451 </td>
452 <td bgcolor="<?php echo $bgcolor; ?>">
453 &nbsp;---&nbsp;
454 </td>
455 <?php
456 if ($cfg['ShowStats']) {
458 <td align="right" bgcolor="<?php echo $bgcolor; ?>">
459 &nbsp;-&nbsp;
460 </td>
461 <td align="right" bgcolor="<?php echo $bgcolor; ?>">
462 &nbsp;-&nbsp;
463 </td>
464 <?php
466 } else {
468 <td colspan="<?php echo ($structure_tbl_col_cnt - 8) ?>" align="center" bgcolor="<?php echo $bgcolor; ?>" <?php echo $click_mouse; ?>>
469 <?php echo $strInUse . "\n"; ?>
470 </td>
471 <?php
473 echo "\n";
475 </tr>
476 <?php
478 // Show Summary
479 if ($cfg['ShowStats']) {
480 list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
481 list($overhead_formated, $overhead_unit) = PMA_formatByteDown($overhead_size, 3, 1);
483 echo "\n";
485 <tr>
486 <td></td>
487 <th align="center" nowrap="nowrap">
488 &nbsp;<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>&nbsp;
489 </th>
490 <?php
491 if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
493 <th colspan="6">&nbsp;</th>
494 <?php
495 } else {
497 <th colspan="6" align="center">
498 <b><?php echo $strSum; ?></b>
499 </th>
500 <th align="right" nowrap="nowrap">
501 <b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
502 </th>
503 <?php
505 if (!($cfg['PropertiesNumColumns'] > 1)) {
506 echo ' <th align="center">' . "\n"
507 . ' <b>--</b>' . "\n"
508 . ' </th>' . "\n";
509 if (PMA_MYSQL_INT_VERSION >= 40101) {
510 echo ' <th align="center">' . "\n"
511 . ' &nbsp;<b><dfn title="' . PMA_getCollationDescr($db_collation) . '">' . $db_collation . '</dfn></b>&nbsp;' . "\n"
512 . ' </th>' . "\n";
516 if ($cfg['ShowStats']) {
517 echo "\n";
519 <th align="right" nowrap="nowrap">
520 &nbsp;
521 <b><?php echo $sum_formated . ' ' . $unit; ?></b>
522 </th>
523 <th align="right" nowrap="nowrap">
524 &nbsp;
525 <b><?php echo $overhead_formated . ' ' . $overhead_unit; ?></b>
526 </th>
527 <?php
529 echo "\n";
531 </tr>
533 <?php
534 // Check all tables url
535 $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
536 echo "\n";
539 <tr>
540 <td colspan="<?php echo $structure_tbl_col_cnt; ?>" valign="bottom">
541 <img src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
542 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
543 <?php echo $strCheckAll; ?></a>
544 &nbsp;/&nbsp;
545 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
546 <?php echo $strUncheckAll; ?></a>
547 <?php if ($overhead_check != '') { ?>
548 &nbsp;/&nbsp;
549 <a href="#" onclick="setCheckboxes('tablesForm', false); <?php echo $overhead_check; ?> return false;">
550 <?php echo $strCheckOverhead; ?></a>
551 <?php } ?>
552 &nbsp;&nbsp;&nbsp;
553 <img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border="0" width="38" height="1" alt="" />
554 <select name="submit_mult" dir="ltr" onchange="this.form.submit();">
555 <?php
556 echo "\n";
557 echo ' <option value="' . $strWithChecked . '" selected="selected">'
558 . $strWithChecked . '</option>' . "\n";
559 echo ' <option value="' . $strDrop . '" >'
560 . $strDrop . '</option>' . "\n";
561 echo ' <option value="' . $strEmpty . '" >'
562 . $strEmpty . '</option>' . "\n";
563 echo ' <option value="' . $strPrintView . '" >'
564 . $strPrintView . '</option>' . "\n";
565 echo ' <option value="' . $strCheckTable . '" >'
566 . $strCheckTable . '</option>' . "\n";
567 echo ' <option value="' . $strOptimizeTable . '" >'
568 . $strOptimizeTable . '</option>' . "\n";
569 echo ' <option value="' . $strRepairTable . '" >'
570 . $strRepairTable . '</option>' . "\n";
571 echo ' <option value="' . $strAnalyzeTable . '" >'
572 . $strAnalyzeTable . '</option>' . "\n";
574 </select>
575 <script type="text/javascript" language="javascript">
576 <!--
577 // Fake js to allow the use of the <noscript> tag
578 //-->
579 </script>
580 <noscript>
581 <input type="submit" value="<?php echo $strGo; ?>" />
582 </noscript>
583 </td>
584 </tr>
585 </table>
586 <?php
587 if ($cfg['PropertiesNumColumns'] > 1) {
589 </td>
590 </tr>
591 </table>
592 <?php
595 </form>
596 <?php
597 } // end if more than one table
599 echo "\n";
601 <hr />
603 <?php
605 * Work on the database
606 * redesigned 2004-05-08 by mkkeck
609 <!-- DATABASE WORK -->
611 <?php
612 if ($num_tables > 0) {
614 <!-- Printable view of a table -->
615 <table border="0" cellpadding="2" cellspacing="0">
616 <tr><td nowrap="nowrap" colspan="3"><?php
617 echo '<a href="db_printview.php?' . $url_query . '">';
618 if ($cfg['PropertiesIconic']) {
619 echo '<img src="' . $pmaThemeImage . 'b_print.png" border="0" width="16" height="16" hspace="2" align="middle" />';
621 echo $strPrintView . '</a>';
622 ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
623 <?php
624 echo '<a href="./db_datadict.php?' . $url_query . '">';
625 if($cfg['PropertiesIconic']){
626 echo '<img src="' . $pmaThemeImage . 'b_tblanalyse.png" border="0" width="16" height="16" hspace="2" align="middle" />';
628 echo $strDataDict . '</a>';
629 ?></td></tr>
630 <tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr></table>
631 <?php
632 } // end if
634 if (PMA_MYSQL_INT_VERSION < 50002 || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
636 <!-- Create a new table -->
637 <form method="post" action="tbl_create.php" onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldCount']); ?>', 1))">
638 <table border="0" cellpadding="2" cellspacing="0">
639 <tr>
640 <td class="tblHeaders" colspan="3" nowrap="nowrap"><?php
641 echo PMA_generate_common_hidden_inputs($db);
642 if($cfg['PropertiesIconic']){ echo '<img src="' . $pmaThemeImage . 'b_newtbl.png" border="0" width="16" height="16" hspace="2" align="middle" />'; }
643 // if you want navigation:
644 $strDBLink = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url() . '&amp;db=' . urlencode($GLOBALS['db']) . '">'
645 . htmlspecialchars($GLOBALS['db']) . '</a>';
646 // else use
647 // $strDBLink = htmlspecialchars($db);
648 echo ' ' . sprintf($strCreateNewTable, $strDBLink) . ':&nbsp;' . "\n";
649 echo ' </td></tr>';
650 echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
651 echo ' ' . $strName . ':&nbsp;' . "\n";
652 echo ' </td>';
653 echo ' <td nowrap="nowrap">';
654 echo ' ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
655 echo ' </td><td>&nbsp;</td></tr>';
656 echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
657 if (!isset($strNumberOfFields)) {
658 $strNumberOfFields = $strFields;
660 echo ' ' . $strNumberOfFields . ':&nbsp;' . "\n";
661 echo ' </td>';
662 echo ' <td nowrap="nowrap">';
663 echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
664 echo ' </td>';
665 echo ' <td align="right">';
666 echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
667 echo ' </td> </tr>';
668 echo ' </table>';
669 echo '</form>';
670 } // end if (Create Table dialog)
673 * Displays the footer
675 echo "\n";
676 require_once('./footer.inc.php');