3 // vim: expandtab sw=4 ts=4 sts=4:
7 * Prepares the tables list if the user where not redirected to this script
8 * because there is no table in the database ($is_info is TRUE)
10 if (empty($is_info)) {
11 if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
12 include('./libraries/grab_globals.lib.php3');
14 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
15 include('./libraries/common.lib.php3');
18 // Drops/deletes/etc. multiple tables if required
19 if ((!empty($submit_mult) && isset($selected_tbl))
20 ||
isset($mult_btn)) {
21 $action = 'db_details_structure.php3';
22 $err_url = 'db_details_structure.php3?'. PMA_generate_common_url($db);
23 include('./mult_submits.inc.php3');
25 include('./db_details_common.php3');
26 $url_query .= '&goto=db_details_structure.php3';
28 // Gets the database structure
29 $sub_part = '_structure';
30 include('./db_details_db_info.php3');
34 * Show result of multi submit operation
36 if ((!empty($submit_mult) && isset($selected_tbl))
37 ||
isset($mult_btn)) {
38 PMA_showMessage($strSuccess);
43 function pma_TableHeader($alternate = FALSE) {
46 <table border
="<?php echo $GLOBALS['cfg']['Border']; ?>">
49 <th
> 
;<?php
echo $GLOBALS['strTable']; ?
> 
;</th
>
50 <th colspan
="6"><?php
echo $GLOBALS['strAction']; ?
></th
>
51 <th
><?php
echo $GLOBALS['strRecords']; ?
></th
>
56 <table border
="<?php echo $GLOBALS['cfg']['Border']; ?>">
59 <th
> 
;<?php
echo $GLOBALS['strTable']; ?
> 
;</th
>
60 <th colspan
="6"><?php
echo $GLOBALS['strAction']; ?
></th
>
61 <th
><?php
echo $GLOBALS['strRecords']; ?
></th
>
63 if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
65 <th
><?php
echo $GLOBALS['strType']; ?
></th
>
70 if ($GLOBALS['cfg']['ShowStats']) {
71 echo '<th>' . $GLOBALS['strSize'] . '</th>';
82 * Settings for relations stuff
84 require('./libraries/relation.lib.php3');
85 $cfgRelation = PMA_getRelationsParam();
88 * Check if comments were updated
90 if ($cfgRelation['commwork'] && isset($db_comment) && $db_comment == 'true') {
91 PMA_SetComment($db, '', '(db_comment)', $comment);
95 * Displays the tables list
103 if ($cfg['PropertiesIconic'] == true) {
104 // We need to copy the value or else the == 'both' check will always return true
105 $propicon = (string)$cfg['PropertiesIconic'];
107 if ($propicon == 'both') {
108 $iconic_spacer = '<nobr>';
113 $titles['Browse'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
114 $titles['Select'] = $iconic_spacer . '<img hspace="7" width="14" height="13" src="images/button_select.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
115 $titles['NoBrowse'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_nobrowse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
116 $titles['NoSelect'] = $iconic_spacer . '<img hspace="7" width="14" height="13" src="images/button_noselect.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
117 $titles['Insert'] = $iconic_spacer . '<img hspace="7" width="13" height="13" src="images/button_insert.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
118 $titles['Properties'] = $iconic_spacer . '<img hspace="7" width="18" height="13" src="images/button_properties.png" alt="' . $strProperties . '" title="' . $strProperties . '" border="0" />';
119 $titles['Drop'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
120 $titles['Empty'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
121 $titles['NoEmpty'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noempty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
123 if ($propicon == 'both') {
124 $titles['Browse'] .= ' ' . $strBrowse . '</nobr>';
125 $titles['Select'] .= ' ' . $strSelect . '</nobr>';
126 $titles['NoBrowse'] .= ' ' . $strBrowse . '</nobr>';
127 $titles['NoSelect'] .= ' ' . $strSelect . '</nobr>';
128 $titles['Insert'] .= ' ' . $strInsert . '</nobr>';
129 $titles['Properties'] .= ' ' . $strProperties . '</nobr>';
130 $titles['Drop'] .= ' ' . $strDrop . '</nobr>';
131 $titles['Empty'] .= ' ' . $strEmpty . '</nobr>';
132 $titles['NoEmpty'] .= ' ' . $strEmpty . '</nobr>';
135 $titles['Browse'] = $strBrowse;
136 $titles['Select'] = $strSelect;
137 $titles['NoBrowse'] = $strBrowse;
138 $titles['NoSelect'] = $strSelect;
139 $titles['Insert'] = $strInsert;
140 $titles['Properties'] = $strProperties;
141 $titles['Drop'] = $strDrop;
142 $titles['Empty'] = $strEmpty;
143 $titles['NoEmpty'] = $strEmpty;
147 if ($num_tables == 0) {
148 echo $strNoTablesFound . "\n";
150 // 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001
151 else if (PMA_MYSQL_INT_VERSION
>= 32303) {
152 // Get additional information about tables for tooltip
153 if ($cfg['ShowTooltip']) {
154 $tooltip_truename = array();
155 $tooltip_aliasname = array();
157 $result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
158 while ($tmp = PMA_mysql_fetch_array($result)) {
159 $tooltip_truename[$tmp['Name']] = ($cfg['ShowTooltipAliasTB'] ?
(!empty($tmp['Comment']) ?
$tmp['Comment'] . ' ' : $tmp['Name']) : $tmp['Name']);
160 $tooltip_aliasname[$tmp['Name']] = ($cfg['ShowTooltipAliasTB'] ?
$tmp['Name'] : (!empty($tmp['Comment']) ?
$tmp['Comment'] . ' ' : ''));
161 if (isset($tmp['Create_time']) && !empty($tmp['Create_time'])) {
162 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatCreateTime . ': ' . PMA_localisedDate(strtotime($tmp['Create_time']));
165 if (isset($tmp['Update_time']) && !empty($tmp['Update_time'])) {
166 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatUpdateTime . ': ' . PMA_localisedDate(strtotime($tmp['Update_time']));
169 if (isset($tmp['Check_time']) && !empty($tmp['Check_time'])) {
170 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatCheckTime . ': ' . PMA_localisedDate(strtotime($tmp['Check_time']));
176 if ($cfgRelation['commwork']) {
177 $comment = PMA_getComments($db);
180 * Displays table comment
182 if (is_array($comment)) {
186 <?php
echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?
>
192 <form method
="post" action
="db_details_structure.php3" name
="tablesForm">
193 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
196 if ($cfg['PropertiesNumColumns'] > 1) {
198 <table cellspacing
="0" cellpadding
="0" border
="0">
206 $i = $sum_entries = 0;
207 (double) $sum_size = 0;
208 $checked = (!empty($checkall) ?
' checked="checked"' : '');
209 $num_columns = ($cfg['PropertiesNumColumns'] > 1 ?
(ceil($num_tables / $cfg['PropertiesNumColumns']) +
1) : 0);
211 while (list($keyname, $sts_data) = each($tables)) {
212 $table = $sts_data['Name'];
213 $table_encoded = urlencode($table);
214 $table_name = htmlspecialchars($table);
216 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$table]))
217 ?
htmlspecialchars($tooltip_aliasname[$table])
218 : htmlspecialchars($sts_data['Name']);
219 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$table]))
220 ?
htmlspecialchars($tooltip_truename[$table])
221 : htmlspecialchars($sts_data['Name']);
223 // Sets parameters for links
224 $tbl_url_query = $url_query . '&table=' . $table_encoded;
225 $bgcolor = ($i++ %
2) ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
229 if($num_columns > 0 && $num_tables > $num_columns && (($row_count %
($num_columns)) == 0)) {
230 $bgcolor = $cfg['BgcolorTwo'];
236 <td
><img src
="./images/spacer.gif" border
="0" width
="10" height
="1" alt
="" /></td
>
243 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
244 <input type
="checkbox" name
="selected_tbl[]" value
="<?php echo $table_encoded; ?>" id
="checkbox_tbl_<?php echo $i; ?>"<?php
echo $checked; ?
> />
246 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
247  
;<b
><label
for="checkbox_tbl_<?php echo $i; ?>" title
="<?php echo $alias; ?>"><?php
echo $truename; ?
></label
> 
;</b
> 
;
249 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
251 include('./libraries/bookmark.lib.php3');
252 $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
254 if (!empty($sts_data['Rows'])) {
255 echo '<a href="sql.php3?' . $tbl_url_query . '&sql_query='
256 . (isset($book_sql_query) && $book_sql_query != FALSE ?
urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
257 . '&pos=0">' . $titles['Browse'] . '</a>';
259 echo $titles['NoBrowse'];
263 <td bgcolor
="<?php echo $bgcolor; ?>">
265 if (!empty($sts_data['Rows'])) {
266 echo '<a href="tbl_select.php3?' . $tbl_url_query . '">'
267 . $titles['Select'] . '</a>';
269 echo $titles['NoSelect'];
273 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
274 <a href
="tbl_change.php3?<?php echo $tbl_url_query; ?>">
275 <?php
echo $titles['Insert']; ?
></a
>
277 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
278 <a href
="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>">
279 <?php
echo $titles['Properties']; ?
></a
>
281 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
282 <a href
="sql.php3?<?php echo $tbl_url_query; ?>&reload=1&purge=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
283 onclick
="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
284 <?php
echo $titles['Drop']; ?
></a
>
286 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
288 if (!empty($sts_data['Rows'])) {
289 echo '<a href="sql.php3?' . $tbl_url_query
291 if (PMA_MYSQL_INT_VERSION
>= 40000) {
292 echo urlencode('TRUNCATE ' . PMA_backquote($table))
294 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
295 . '" onclick="return confirmLink(this, \'TRUNCATE ';
297 echo urlencode('DELETE FROM ' . PMA_backquote($table))
299 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
300 . '" onclick="return confirmLink(this, \'DELETE FROM ';
302 echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
304 echo $titles['NoEmpty'];
311 // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
312 // statistics whatever is the table type
313 if (isset($sts_data['Rows'])) {
314 // MyISAM, ISAM or Heap table: Row count, data size and index size
316 if (isset($sts_data['Type']) && ereg('^(MyISAM|ISAM|HEAP)$', $sts_data['Type'])) {
317 if ($cfg['ShowStats']) {
318 $tblsize = doubleval($sts_data['Data_length']) +
doubleval($sts_data['Index_length']);
319 $sum_size +
= $tblsize;
320 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ?
1 : 0);
322 $sum_entries +
= $sts_data['Rows'];
323 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
326 // InnoDB table: Row count is not accurate but data and index
328 else if (isset($sts_data['Type']) && $sts_data['Type'] == 'InnoDB') {
329 if ($cfg['ShowStats']) {
330 $tblsize = $sts_data['Data_length'] +
$sts_data['Index_length'];
331 $sum_size +
= $tblsize;
332 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ?
1 : 0);
334 //$display_rows = ' - ';
335 // get row count with another method
336 if ($sts_data['Rows'] < $cfg['MaxExactCount']) {
337 $local_query = 'SELECT COUNT(*) AS count FROM '
338 . PMA_backquote($db) . '.'
339 . PMA_backquote($table);
340 $table_info_result = PMA_mysql_query($local_query)
341 or PMA_mysqlDie('', $local_query, '', $err_url_0);
342 $row_count = PMA_mysql_result($table_info_result, 0, 'count');
343 $sum_entries +
= $row_count;
345 $row_count = $sts_data['Rows'];
346 $sum_entries +
= $sts_data['Rows'];
348 $display_rows = number_format($row_count, 0, $number_decimal_separator, $number_thousands_separator);
351 // Merge or BerkleyDB table: Only row count is accurate.
352 else if (isset($sts_data['Type']) && ereg('^(MRG_MyISAM|BerkeleyDB)$', $sts_data['Type'])) {
353 if ($cfg['ShowStats']) {
354 $formated_size = ' - ';
357 $sum_entries +
= $sts_data['Rows'];
358 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
361 // Unknown table type.
363 if ($cfg['ShowStats']) {
364 $formated_size = 'unknown';
367 $display_rows = 'unknown';
370 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
372 echo "\n" . ' ' . $display_rows . "\n";
376 if (!($cfg['PropertiesNumColumns'] > 1)) {
378 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
379  
;<?php
echo (isset($sts_data['Type']) ?
$sts_data['Type'] : ' '); ?
> 
;
384 if ($cfg['ShowStats']) {
387 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
389 <a href
="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>#showusage"><?php
echo $formated_size . ' ' . $unit; ?
></a
>
396 <td colspan
="3" align
="center" bgcolor
="<?php echo $bgcolor; ?>">
397 <?php
echo $strInUse . "\n"; ?
>
407 if ($cfg['ShowStats']) {
408 list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
414 <th align
="center" nowrap
="nowrap">
415  
;<b
><?php
echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?
></b
> 
;
417 <th colspan
="6" align
="center">
418 <b
><?php
echo $strSum; ?
></b
>
420 <th align
="right" nowrap
="nowrap">
421 <b
><?php
echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?
></b
>
424 if (!($cfg['PropertiesNumColumns'] > 1)) {
432 if ($cfg['ShowStats']) {
435 <th align
="right" nowrap
="nowrap">
437 <b
><?php
echo $sum_formated . ' ' . $unit; ?
></b
>
446 // Check all tables url
447 $checkall_url = 'db_details_structure.php3?' . PMA_generate_common_url($db);
451 <td colspan
="<?php echo (($cfg['ShowStats']) ? '11' : '10'); ?>" valign
="bottom">
452 <img src
="./images/arrow_<?php echo $text_dir; ?>.gif" border
="0" width
="38" height
="22" alt
="<?php echo $strWithChecked; ?>" />
453 <a href
="<?php echo $checkall_url; ?>&checkall=1" onclick
="setCheckboxes('tablesForm', true); return false;">
454 <?php
echo $strCheckAll; ?
></a
>
456 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('tablesForm', false); return false;">
457 <?php
echo $strUncheckAll; ?
></a
>
459 <img src
="./images/spacer.gif" border
="0" width
="38" height
="1" alt
="" />
460 <select name
="submit_mult" dir
="ltr" onchange
="this.form.submit();">
463 echo ' <option value="' . $strWithChecked . '" selected="selected">'
464 . $strWithChecked . '</option>' . "\n";
465 echo ' <option value="' . $strDrop . '" >'
466 . $strDrop . '</option>' . "\n";
467 echo ' <option value="' . $strEmpty . '" >'
468 . $strEmpty . '</option>' . "\n";
469 echo ' <option value="' . $strPrintView . '" >'
470 . $strPrintView . '</option>' . "\n";
471 echo ' <option value="' . $strCheckTable . '" >'
472 . $strCheckTable . '</option>' . "\n";
473 echo ' <option value="' . $strOptimizeTable . '" >'
474 . $strOptimizeTable . '</option>' . "\n";
475 echo ' <option value="' . $strRepairTable . '" >'
476 . $strRepairTable . '</option>' . "\n";
477 echo ' <option value="' . $strAnalyzeTable . '" >'
478 . $strAnalyzeTable . '</option>' . "\n";
481 <script type
="text/javascript" language
="javascript">
483 // Fake js to allow the use of the <noscript> tag
487 <input type
="submit" value
="<?php echo $strGo; ?>" />
493 if ($cfg['PropertiesNumColumns'] > 1) {
503 } // end case mysql >= 3.23.03
505 // 3. Shows tables list mysql < 3.23.03
507 if ($cfgRelation['commwork']) {
508 $comment = PMA_getComments($db);
511 * Displays table comment
513 if (is_array($comment)) {
517 <?php
echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?
>
526 <form action
="db_details_structure.php3">
527 <?php
PMA_generate_common_hidden_inputs($db); ?
>
530 if ($cfg['PropertiesNumColumns'] > 1) {
532 <table cellspacing
="0" cellpadding
="0" border
="0">
538 pma_TableHeader(true);
540 $checked = (!empty($checkall) ?
' checked="checked"' : '');
541 $num_columns = ($cfg['PropertiesNumColumns'] > 1 ?
(ceil($num_tables / $cfg['PropertiesNumColumns']) +
1) : 0);
543 while ($i < $num_tables) {
544 $table = $tables[$i];
545 $table_encoded = urlencode($table);
546 $table_name = htmlspecialchars($table);
548 // Sets parameters for links
549 $tbl_url_query = $url_query . '&table=' . $table_encoded;
550 $bgcolor = ($i %
2) ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
553 if($num_columns > 0 && $num_tables > $num_columns && (($row_count %
($num_columns)) == 0)) {
554 $bgcolor = $cfg['BgcolorTwo'];
560 <td
><img src
="./images/spacer.gif" border
="0" width
="10" height
="1" alt
="" /></td
>
563 pma_TableHeader(true);
567 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
568 <input type
="checkbox" name
="selected_tbl[]" value
="<?php echo $table_encoded; ?>" id
="checkbox_tbl_<?php echo $i; ?>"<?php
echo $checked; ?
> />
570 <td bgcolor
="<?php echo $bgcolor; ?>" class="data">
571 <b
> 
;<label
for="checkbox_tbl_<?php echo $i; ?>"><?php
echo $table_name; ?
></label
> 
;</b
>
573 <td bgcolor
="<?php echo $bgcolor; ?>">
574 <a href
="sql.php3?<?php echo $tbl_url_query; ?>&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&pos=0"><?php
echo $strBrowse; ?
></a
>
576 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
577 <a href
="tbl_select.php3?<?php echo $tbl_url_query; ?>"><?php
echo $titles['Select']; ?
></a
>
579 <td bgcolor
="<?php echo $bgcolor; ?>">
580 <a href
="tbl_change.php3?<?php echo $tbl_url_query; ?>"><?php
echo $titles['Insert']; ?
></a
>
582 <td bgcolor
="<?php echo $bgcolor; ?>">
583 <a href
="tbl_properties.php3?<?php echo $tbl_url_query; ?>"><?php
echo $titles['Properties']; ?
></a
>
585 <td bgcolor
="<?php echo $bgcolor; ?>">
586 <a href
="sql.php3?<?php echo $tbl_url_query; ?>&reload=1&purge=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, $table_name)); ?>"><?php
echo $titles['Drop']; ?
></a
>
588 <td bgcolor
="<?php echo $bgcolor; ?>">
589 <a href
="sql.php3?<?php echo $tbl_url_query; ?>&sql_query=<?php echo urlencode('DELETE FROM ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenEmptied, $table_name)); ?>"><?php
echo $titles['Empty']; ?
></a
>
591 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
592 <?php
PMA_countRecords($db, $table); echo "\n"; ?
>
600 // Check all tables url
601 $checkall_url = 'db_details_structure.php3?' . PMA_generate_common_url($db);
605 <img src
="./images/arrow_<?php echo $text_dir; ?>.gif" border
="0" width
="38" height
="22" alt
="<?php echo $strWithChecked; ?>" />
606 <a href
="<?php echo $checkall_url; ?>&checkall=1" onclick
="setCheckboxes('tablesForm', true); return false;">
607 <?php
echo $strCheckAll; ?
></a
>
609 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('tablesForm', false); return false;">
610 <?php
echo $strUncheckAll; ?
></a
>
616 <img src
="./images/spacer.gif" border
="0" width
="38" height
="1" alt
="" />
617 <i
><?php
echo $strWithChecked; ?
></i
> 
; 
;
618 <input type
="submit" name
="submit_mult" value
="<?php echo $strDrop; ?>" />
619  
;<?php
$strOr . "\n"; ?
> 
;
620 <input type
="submit" name
="submit_mult" value
="<?php echo $strEmpty; ?>" />
625 if ($cfg['PropertiesNumColumns'] > 1) {
635 } // end case mysql < 3.23.03
644 * Work on the database
647 <!-- DATABASE WORK
-->
651 if ($num_tables > 0) {
653 <!-- Printable view of a table
-->
655 <div style
="margin-bottom: 10px"><a href
="db_printview.php3?<?php echo $url_query; ?>"><?php
echo $strPrintView; ?
></a
></div
>
658 <div style
="margin-bottom: 10px"><a href
="./db_datadict.php3?<?php echo $url_query; ?>"><?php
echo $strDataDict; ?
></a
></div
>
665 if ($cfgRelation['commwork']) {
667 <!-- Alter
/Enter db
-comment
-->
669 <form method
="post" action
="db_details_structure.php3">
670 <?php
echo $strDBComment; ?
>
671 <input type
="hidden" name
="db_comment" value
="true" />
672 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
673 <input type
="text" name
="comment" class="textfield" value
="<?php echo (isset($comment) && is_array($comment) ? htmlspecialchars(implode(' ', $comment)) : ''); ?>" />
674 <input type
="submit" value
="<?php echo $strGo; ?>" />
681 <!-- Create a
new table
-->
683 <form method
="post" action
="tbl_create.php3"
684 onsubmit
="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', 1))">
685 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
687 echo ' ' . sprintf($strCreateNewTable, htmlspecialchars($db)) . ' :<br />' . "\n";
688 echo ' ' . $strName . ' : ' . "\n";
689 echo ' ' . '<input type="text" name="table" maxlength="64" class="textfield" />' . "\n";
690 echo ' ' . '<br />' . "\n";
691 echo ' ' . $strFields . ' : ' . "\n";
692 echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
693 echo ' ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
700 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
702 echo ' <div style="margin-bottom: 10px">' . "\n";
703 echo ' <font color="red">' . $strError . '</font><br />' . "\n";
704 $url_to_goto = '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php3?' . $url_query . '">';
705 echo ' ' . sprintf($strRelationNotWorking, $url_to_goto, '</a>') . "\n";
706 echo ' </div>' . "\n";
707 echo ' </li>' . "\n";
710 // is this OK to check for 'class' support?
711 if ($num_tables > 0) {
712 $takeaway = $url_query . '&table=' . urlencode($table);
715 if ($cfgRelation['pdfwork'] && $num_tables > 0) {
717 <!-- Work on PDF Pages
-->
719 <div style
="margin-bottom: 10px"><a href
="pdf_pages.php3?<?php echo $takeaway; ?>"><?php
echo $strEditPDFPages; ?
></a
></div
>
724 // We only show this if we find something in the new pdf_pages table
726 $test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
727 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
728 $test_rs = PMA_query_as_cu($test_query);
729 if ($test_rs && mysql_num_rows($test_rs) > 0) {
733 <form method
="post" action
="pdf_schema.php3">
734 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
735 <?php
echo $strDisplayPDF; ?
> 
;:<br
/>
736 <?php
echo $strPageNumber; ?
> 
;
737 <select name
="pdf_page_number">
739 while ($pages = @PMA_mysql_fetch_array
($test_rs)) {
741 . '<option value="' . $pages['page_nr'] . '">' . $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>';
746 <input type
="checkbox" name
="show_grid" id
="show_grid_opt" />
747 <label
for="show_grid_opt"><?php
echo $strShowGrid; ?
></label
><br
/>
748 <input type
="checkbox" name
="show_color" id
="show_color_opt" checked
="checked" />
749 <label
for="show_color_opt"><?php
echo $strShowColor; ?
></label
><br
/>
750 <input type
="checkbox" name
="show_table_dimension" id
="show_table_dim_opt" />
751 <label
for="show_table_dim_opt"><?php
echo $strShowTableDimension; ?
></label
><br
/>
752 <input type
="checkbox" name
="all_tab_same_wide" id
="all_tab_same_wide" />
753 <label
for="all_tab_same_wide"><?php
echo $strAllTableSameWidth; ?
></label
> <br
/>
754 <input type
="checkbox" name
="with_doc" id
="with_doc" checked
="checked" />
755 <label
for="with_doc"><?php
echo $strDataDict; ?
></label
> <br
/>
756 <?php
echo $strShowDatadictAs; ?
>
757 <select name
="orientation">
758 <option value
="L"><?php
echo $strLandscape;?
></option
>
759 <option value
="P"><?php
echo $strPortrait;?
></option
>
761 <?php
echo $strPaperSize; ?
>
762 <select name
="paper">
764 while (list($key,$val) = each($cfg['PDFPageSizes'])) {
765 echo '<option value="' . $val . '"';
766 if ($val == $cfg['PDFDefaultPageSize']) {
767 echo ' selected="selected"';
769 echo ' >' . $val . '</option>' . "\n";
773  
; 
;<input type
="submit" value
="<?php echo $strGo; ?>" />
781 && $cfgRelation['relwork'] && $cfgRelation['commwork']) {
783 <!-- import docSQL files
-->
785 <div style
="margin-bottom: 10px"><a href
="db_details_importdocsql.php3?<?php echo $takeaway . '">' . $strImportDocSQL; ?></a></div>
793 * Displays the footer
796 require('./footer
.inc
.php3
');