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');
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 .= '&goto=db_details_structure.php';
25 // Gets the database structure
26 $sub_part = '_structure';
27 require('./db_details_db_info.php');
31 if (PMA_MYSQL_INT_VERSION
>= 40101) {
32 $db_collation = PMA_getDbCollation($db);
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"
43 . ' ' . $GLOBALS['strTable'] . ' ' . "\n"
45 . ' <th colspan="6">' . "\n"
46 . ' ' . $GLOBALS['strAction'] . ' ' . "\n"
51 . ' ' . $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . ' ' . "\n"
56 if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
58 . ' ' . $GLOBALS['strType'] . ' ' . "\n"
61 if (PMA_MYSQL_INT_VERSION
>= 40100) {
63 . ' ' . $GLOBALS['strCollation'] . ' ' . "\n"
68 if ($GLOBALS['cfg']['ShowStats']) {
70 . ' ' . $GLOBALS['strSize'] . ' ' . "\n"
73 . ' ' . $GLOBALS['strOverhead'] . ' ' . "\n"
80 $GLOBALS['structure_tbl_col_cnt'] = $cnt;
85 * Displays the tables list
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">';
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'] .= ' ' . $strBrowse . '</div>';
117 $titles['Search'] .= ' ' . $strSearch . '</div>';
118 $titles['NoBrowse'] .= ' ' . $strBrowse . '</div>';
119 $titles['NoSearch'] .= ' ' . $strSearch . '</div>';
120 $titles['Insert'] .= ' ' . $strInsert . '</div>';
121 $titles['NoInsert'] .= ' ' . $strInsert . '</div>';
122 $titles['Structure'] .= ' ' . $strStructure . '</div>';
123 $titles['Drop'] .= ' ' . $strDrop . '</div>';
124 $titles['NoDrop'] .= ' ' . $strDrop . '</div>';
125 $titles['Empty'] .= ' ' . $strEmpty . '</div>';
126 $titles['NoEmpty'] .= ' ' . $strEmpty . '</div>';
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;
143 if ($num_tables == 0) {
144 echo $strNoTablesFound . "\n";
146 // 2. Shows table informations - staybyte - 11 June 2001
149 <form method
="post" action
="db_details_structure.php" name
="tablesForm">
150 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
153 if ($cfg['PropertiesNumColumns'] > 1) {
155 <table cellspacing
="0" cellpadding
="0" border
="0">
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);
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);
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);
184 foreach (array_keys($tables_sort) as $each) {
185 $tables_temp[$sort_i] = $tables[$each];
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 . '&table=' . $table_encoded;
208 $bgcolor = ($i++ %
2) ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
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'] . '\');"';
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);" ';
224 if ($num_columns > 0 && $num_tables > $num_columns && (($row_count %
($num_columns)) == 0)) {
225 $bgcolor = $cfg['BgcolorTwo'];
231 <td
><img src
="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border
="0" width
="10" height
="1" alt
="" /></td
>
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; ?
> />
243 <input type
="hidden" name
="views[]" value
="<?php echo $table_encoded; ?>" />
248 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap" <?php
echo $click_mouse; ?
>>
249  
;<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
> 
;</b
> 
;
251 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
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 . '&sql_query='
258 . (isset($book_sql_query) && $book_sql_query != FALSE ?
urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
259 . '&pos=0">' . $titles['Browse'] . '</a>';
261 echo $titles['NoBrowse'];
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
>
269 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
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>';
275 echo $titles['NoSearch'];
279 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
281 if (PMA_MYSQL_INT_VERSION
>= 50000 && $db == 'information_schema') {
282 // rabus: We cannot insert into information_schema tables!
283 echo $titles['NoInsert'];
286 <a href
="tbl_change.php?<?php echo $tbl_url_query; ?>">
287 <?php
echo $titles['Insert']; ?
></a
>
292 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
294 if (!empty($sts_data['Rows'])) {
295 echo '<a href="sql.php?' . $tbl_url_query
297 if (PMA_MYSQL_INT_VERSION
>= 40000) {
298 echo urlencode('TRUNCATE ' . PMA_backquote($table))
300 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
301 . '" onclick="return confirmLink(this, \'TRUNCATE ';
303 echo urlencode('DELETE FROM ' . PMA_backquote($table))
305 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
306 . '" onclick="return confirmLink(this, \'DELETE FROM ';
308 echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
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));
319 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
321 // rabus: We cannot drop information_schema tables!
322 if (PMA_MYSQL_INT_VERSION
>= 50000 && $db == 'information_schema') {
323 echo $titles['NoDrop'];
326 <a href
="sql.php?<?php echo $tbl_url_query; ?>&reload=1&purge=1&sql_query=<?php echo urlencode($drop_query); ?>&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
>
334 unset($drop_query, $drop_message);
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
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
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 = ' - ';
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;
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 = ' - ';
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.
394 if ($cfg['ShowStats']) {
395 $formated_size = 'unknown';
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; ?
>>
405 echo "\n" . ' ' . $display_rows . "\n";
410 if (!($cfg['PropertiesNumColumns'] > 1)) {
411 echo ' <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
412 . ' ' . (isset($sts_data['Type']) ?
$sts_data['Type'] : ' ') . ' ' . "\n"
414 if (PMA_MYSQL_INT_VERSION
>= 40100) {
415 echo ' <td bgcolor="' . $bgcolor . '" nowrap="nowrap" ' . $click_mouse . '>' . "\n"
416 . ' ' . (isset($sts_data['Collation']) ?
'<dfn title="' . PMA_getCollationDescr($sts_data['Collation']) . '">' . $sts_data['Collation'] . '</dfn>' : '---') . ' ' . "\n"
421 if ($cfg['ShowStats']) {
424 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap" <?php
echo $click_mouse; ?
>>
426 <a href
="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"><?php
echo $formated_size . ' ' . $unit; ?
></a
>
428 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap" <?php
echo $click_mouse; ?
>>
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;";
436 echo " - \n";
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; ?>">
449 <td bgcolor
="<?php echo $bgcolor; ?>">
450  
;<?php
echo $strView ; ?
> 
;
452 <td bgcolor
="<?php echo $bgcolor; ?>">
456 if ($cfg['ShowStats']) {
458 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
461 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
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"; ?
>
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);
487 <th align
="center" nowrap
="nowrap">
488  
;<b
><?php
echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?
></b
> 
;
491 if (PMA_MYSQL_INT_VERSION
>= 50000 && $db == 'information_schema') {
493 <th colspan
="6"> 
;</th
>
497 <th colspan
="6" align
="center">
498 <b
><?php
echo $strSum; ?
></b
>
500 <th align
="right" nowrap
="nowrap">
501 <b
><?php
echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?
></b
>
505 if (!($cfg['PropertiesNumColumns'] > 1)) {
506 echo ' <th align="center">' . "\n"
507 . ' <b>--</b>' . "\n"
509 if (PMA_MYSQL_INT_VERSION
>= 40101) {
510 echo ' <th align="center">' . "\n"
511 . ' <b><dfn title="' . PMA_getCollationDescr($db_collation) . '">' . $db_collation . '</dfn></b> ' . "\n"
516 if ($cfg['ShowStats']) {
519 <th align
="right" nowrap
="nowrap">
521 <b
><?php
echo $sum_formated . ' ' . $unit; ?
></b
>
523 <th align
="right" nowrap
="nowrap">
525 <b
><?php
echo $overhead_formated . ' ' . $overhead_unit; ?
></b
>
534 // Check all tables url
535 $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
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; ?>&checkall=1" onclick
="setCheckboxes('tablesForm', true); return false;">
543 <?php
echo $strCheckAll; ?
></a
>
545 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('tablesForm', false); return false;">
546 <?php
echo $strUncheckAll; ?
></a
>
547 <?php
if ($overhead_check != '') { ?
>
549 <a href
="#" onclick
="setCheckboxes('tablesForm', false); <?php echo $overhead_check; ?> return false;">
550 <?php
echo $strCheckOverhead; ?
></a
>
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();">
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";
575 <script type
="text/javascript" language
="javascript">
577 // Fake js to allow the use of the <noscript> tag
581 <input type
="submit" value
="<?php echo $strGo; ?>" />
587 if ($cfg['PropertiesNumColumns'] > 1) {
597 } // end if more than one table
605 * Work on the database
606 * redesigned 2004-05-08 by mkkeck
609 <!-- DATABASE WORK
-->
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 ?
> 
; 
; 
; 
; 
; 
;
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>';
630 <tr
><td colspan
="3"><img src
="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width
="1" height
="1" border
="0" alt
="" /></td
></tr
></table
>
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">
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() . '&db=' . urlencode($GLOBALS['db']) . '">'
645 . htmlspecialchars($GLOBALS['db']) . '</a>';
647 // $strDBLink = htmlspecialchars($db);
648 echo ' ' . sprintf($strCreateNewTable, $strDBLink) . ': ' . "\n";
650 echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
651 echo ' ' . $strName . ': ' . "\n";
653 echo ' <td nowrap="nowrap">';
654 echo ' ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
655 echo ' </td><td> </td></tr>';
656 echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
657 if (!isset($strNumberOfFields)) {
658 $strNumberOfFields = $strFields;
660 echo ' ' . $strNumberOfFields . ': ' . "\n";
662 echo ' <td nowrap="nowrap">';
663 echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
665 echo ' <td align="right">';
666 echo ' ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
670 } // end if (Create Table dialog)
673 * Displays the footer
676 require_once('./footer.inc.php');