fixed inactivity timeout failure
[openemr.git] / interface / main / myadmin / db_details_structure.php
blob4b2915b8ab8bd0012498bc9e83e5e3201d41efc3
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
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)
9 */
10 if (empty($is_info)) {
11 require_once('./libraries/grab_globals.lib.php');
12 require_once('./libraries/common.lib.php');
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');
21 require('./db_details_common.php');
22 $url_query .= '&amp;goto=db_details_structure.php';
24 // Gets the database structure
25 $sub_part = '_structure';
26 require('./db_details_db_info.php');
27 echo "\n";
29 /**
30 * Show result of multi submit operation
32 if ((!empty($submit_mult) && isset($selected_tbl))
33 || isset($mult_btn)) {
34 PMA_showMessage($strSuccess);
38 // Display function
39 function pma_TableHeader($alternate = FALSE) {
40 if ($alternate) {
42 <table border="<?php echo $GLOBALS['cfg']['Border']; ?>">
43 <tr>
44 <td></td>
45 <th>&nbsp;<?php echo $GLOBALS['strTable']; ?>&nbsp;</th>
46 <th colspan="6"><?php echo $GLOBALS['strAction']; ?></th>
47 <th><?php echo $GLOBALS['strRecords']; ?></th>
48 </tr>
49 <?php
50 } else {
52 <table border="<?php echo $GLOBALS['cfg']['Border']; ?>">
53 <tr>
54 <td></td>
55 <th>&nbsp;<?php echo $GLOBALS['strTable']; ?>&nbsp;</th>
56 <th colspan="6"><?php echo $GLOBALS['strAction']; ?></th>
57 <th><?php echo $GLOBALS['strRecords']; ?></th>
58 <?php
59 if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
61 <th><?php echo $GLOBALS['strType']; ?></th>
62 <?php
65 <?php
66 if ($GLOBALS['cfg']['ShowStats']) {
67 echo '<th>' . $GLOBALS['strSize'] . '</th>';
68 echo '<th>' . $GLOBALS['strOverhead'] . '</th>';
70 echo "\n";
72 </tr>
73 <?php
78 /**
79 * Settings for relations stuff
81 require_once('./libraries/relation.lib.php');
82 $cfgRelation = PMA_getRelationsParam();
84 /**
85 * Check if comments were updated
87 if ($cfgRelation['commwork'] && isset($db_comment) && $db_comment == 'true') {
88 PMA_SetComment($db, '', '(db_comment)', $comment);
91 /**
92 * Displays the tables list
96 <!-- TABLE LIST -->
98 <?php
99 $titles = array();
100 if ($cfg['PropertiesIconic'] == true) {
101 // We need to copy the value or else the == 'both' check will always return true
102 $propicon = (string)$cfg['PropertiesIconic'];
104 if ($propicon == 'both') {
105 $iconic_spacer = '<nobr>';
106 } else {
107 $iconic_spacer = '';
110 $titles['Browse'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
111 $titles['Search'] = $iconic_spacer . '<img hspace="7" width="14" height="13" src="images/button_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
112 $titles['NoBrowse'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_nobrowse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
113 $titles['NoSearch'] = $iconic_spacer . '<img hspace="7" width="14" height="13" src="images/button_noselect.png" alt="' . $strSearch . '" title="' . $strSearch . '" border="0" />';
114 $titles['Insert'] = $iconic_spacer . '<img hspace="7" width="13" height="13" src="images/button_insert.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
115 $titles['Properties'] = $iconic_spacer . '<img hspace="7" width="18" height="13" src="images/button_properties.png" alt="' . $strProperties . '" title="' . $strProperties . '" border="0" />';
116 $titles['Drop'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
117 $titles['Empty'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
118 $titles['NoEmpty'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noempty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
120 if ($propicon == 'both') {
121 $titles['Browse'] .= '&nbsp;' . $strBrowse . '</nobr>';
122 $titles['Search'] .= '&nbsp;' . $strSearch . '</nobr>';
123 $titles['NoBrowse'] .= '&nbsp;' . $strBrowse . '</nobr>';
124 $titles['NoSearch'] .= '&nbsp;' . $strSearch . '</nobr>';
125 $titles['Insert'] .= '&nbsp;' . $strInsert . '</nobr>';
126 $titles['Properties'] .= '&nbsp;' . $strProperties . '</nobr>';
127 $titles['Drop'] .= '&nbsp;' . $strDrop . '</nobr>';
128 $titles['Empty'] .= '&nbsp;' . $strEmpty . '</nobr>';
129 $titles['NoEmpty'] .= '&nbsp;' . $strEmpty . '</nobr>';
131 } else {
132 $titles['Browse'] = $strBrowse;
133 $titles['Search'] = $strSearch;
134 $titles['NoBrowse'] = $strBrowse;
135 $titles['NoSearch'] = $strSearch;
136 $titles['Insert'] = $strInsert;
137 $titles['Properties'] = $strProperties;
138 $titles['Drop'] = $strDrop;
139 $titles['Empty'] = $strEmpty;
140 $titles['NoEmpty'] = $strEmpty;
143 // 1. No tables
144 if ($num_tables == 0) {
145 echo $strNoTablesFound . "\n";
147 // 2. Shows table informations - staybyte - 11 June 2001
148 else {
149 // Get additional information about tables for tooltip
150 if ($cfg['ShowTooltip']) {
151 $tooltip_truename = array();
152 $tooltip_aliasname = array();
154 $result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
155 while ($tmp = PMA_mysql_fetch_array($result)) {
156 $tooltip_truename[$tmp['Name']] = ($cfg['ShowTooltipAliasTB'] ? (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : $tmp['Name']) : $tmp['Name']);
157 $tooltip_aliasname[$tmp['Name']] = ($cfg['ShowTooltipAliasTB'] ? $tmp['Name'] : (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : ''));
158 if (isset($tmp['Create_time']) && !empty($tmp['Create_time'])) {
159 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatCreateTime . ': ' . PMA_localisedDate(strtotime($tmp['Create_time']));
162 if (isset($tmp['Update_time']) && !empty($tmp['Update_time'])) {
163 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatUpdateTime . ': ' . PMA_localisedDate(strtotime($tmp['Update_time']));
166 if (isset($tmp['Check_time']) && !empty($tmp['Check_time'])) {
167 $tooltip_aliasname[$tmp['Name']] .= ', ' . $strStatCheckTime . ': ' . PMA_localisedDate(strtotime($tmp['Check_time']));
170 } // end while
171 } // end if
173 if ($cfgRelation['commwork']) {
174 $comment = PMA_getComments($db);
177 * Displays table comment
179 if (is_array($comment)) {
181 <!-- DB comment -->
182 <p><i>
183 <?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
184 </i></p>
185 <?php
186 } // end if
189 <form method="post" action="db_details_structure.php" name="tablesForm">
190 <?php echo PMA_generate_common_hidden_inputs($db); ?>
192 <?php
193 if ($cfg['PropertiesNumColumns'] > 1) {
195 <table cellspacing="0" cellpadding="0" border="0">
196 <tr>
197 <td valign="top">
198 <?php
201 pma_TableHeader();
203 $i = $sum_entries = 0;
204 (double) $sum_size = 0;
205 (double) $overhead_size = 0;
206 $overhead_check = '';
207 $checked = (!empty($checkall) ? ' checked="checked"' : '');
208 $num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
209 $row_count = 0;
210 foreach($tables AS $keyname => $sts_data) {
211 $table = $sts_data['Name'];
212 $table_encoded = urlencode($table);
213 $table_name = htmlspecialchars($table);
215 $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$table]))
216 ? htmlspecialchars($tooltip_aliasname[$table])
217 : htmlspecialchars($sts_data['Name']);
218 $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$table]))
219 ? htmlspecialchars($tooltip_truename[$table])
220 : htmlspecialchars($sts_data['Name']);
222 // Sets parameters for links
223 $tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
224 $bgcolor = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
225 echo "\n";
227 $row_count++;
228 if($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
229 $bgcolor = $cfg['BgcolorTwo'];
230 $row_count = 1;
232 </tr>
233 </table>
234 </td>
235 <td><img src="./images/spacer.gif" border="0" width="10" height="1" alt="" /></td>
236 <td valign="top">
237 <?php
238 pma_TableHeader();
241 <tr>
242 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
243 <input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
244 </td>
245 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
246 &nbsp;<b><label for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label>&nbsp;</b>&nbsp;
247 </td>
248 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
249 <?php
250 require_once('./libraries/bookmark.lib.php');
251 $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
253 if (!empty($sts_data['Rows'])) {
254 echo '<a href="sql.php?' . $tbl_url_query . '&amp;sql_query='
255 . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
256 . '&amp;pos=0">' . $titles['Browse'] . '</a>';
257 } else {
258 echo $titles['NoBrowse'];
261 </td>
262 <td bgcolor="<?php echo $bgcolor; ?>">
263 <?php
264 if (!empty($sts_data['Rows'])) {
265 echo '<a href="tbl_select.php?' . $tbl_url_query . '">'
266 . $titles['Search'] . '</a>';
267 } else {
268 echo $titles['NoSearch'];
271 </td>
272 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
273 <a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
274 <?php echo $titles['Insert']; ?></a>
275 </td>
276 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
277 <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>">
278 <?php echo $titles['Properties']; ?></a>
279 </td>
280 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
281 <a href="sql.php?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
282 onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
283 <?php echo $titles['Drop']; ?></a>
284 </td>
285 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
286 <?php
287 if (!empty($sts_data['Rows'])) {
288 echo '<a href="sql.php?' . $tbl_url_query
289 . '&amp;sql_query=';
290 if (PMA_MYSQL_INT_VERSION >= 40000) {
291 echo urlencode('TRUNCATE ' . PMA_backquote($table))
292 . '&amp;zero_rows='
293 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
294 . '" onclick="return confirmLink(this, \'TRUNCATE ';
295 } else {
296 echo urlencode('DELETE FROM ' . PMA_backquote($table))
297 . '&amp;zero_rows='
298 . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
299 . '" onclick="return confirmLink(this, \'DELETE FROM ';
301 echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
302 } else {
303 echo $titles['NoEmpty'];
306 </td>
307 <?php
308 echo "\n";
310 // loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
311 // statistics whatever is the table type
312 if (isset($sts_data['Rows'])) {
313 // MyISAM, ISAM or Heap table: Row count, data size and index size
314 // is accurate.
315 if (isset($sts_data['Type']) && preg_match('@^(MyISAM|ISAM|HEAP)$@', $sts_data['Type'])) {
316 if ($cfg['ShowStats']) {
317 $tblsize = doubleval($sts_data['Data_length']) + doubleval($sts_data['Index_length']);
318 $sum_size += $tblsize;
319 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
320 if (isset($sts_data['Data_free']) && $sts_data['Data_free'] > 0) {
321 list($formated_overhead, $overhead_unit) = PMA_formatByteDown($sts_data['Data_free']);
322 $overhead_size += $sts_data['Data_free'];
325 $sum_entries += $sts_data['Rows'];
326 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
329 // InnoDB table: Row count is not accurate but data and index
330 // sizes are.
331 else if (isset($sts_data['Type']) && $sts_data['Type'] == 'InnoDB') {
332 if ($cfg['ShowStats']) {
333 $tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
334 $sum_size += $tblsize;
335 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
337 //$display_rows = '&nbsp;-&nbsp;';
338 // get row count with another method
339 if ($sts_data['Rows'] < $cfg['MaxExactCount']) {
340 $local_query = 'SELECT COUNT(*) AS count FROM '
341 . PMA_backquote($db) . '.'
342 . PMA_backquote($table);
343 $table_info_result = PMA_mysql_query($local_query)
344 or PMA_mysqlDie('', $local_query, '', $err_url_0);
345 $row_count = PMA_mysql_result($table_info_result, 0, 'count');
346 $sum_entries += $row_count;
347 } else {
348 $row_count = $sts_data['Rows'];
349 $sum_entries += $sts_data['Rows'];
351 $display_rows = number_format($row_count, 0, $number_decimal_separator, $number_thousands_separator);
354 // Merge or BerkleyDB table: Only row count is accurate.
355 else if (isset($sts_data['Type']) && preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $sts_data['Type'])) {
356 if ($cfg['ShowStats']) {
357 $formated_size = '&nbsp;-&nbsp;';
358 $unit = '';
360 $sum_entries += $sts_data['Rows'];
361 $display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator);
364 // Unknown table type.
365 else {
366 if ($cfg['ShowStats']) {
367 $formated_size = 'unknown';
368 $unit = '';
370 $display_rows = 'unknown';
373 <td align="right" bgcolor="<?php echo $bgcolor; ?>">
374 <?php
375 echo "\n" . ' ' . $display_rows . "\n";
377 </td>
378 <?php
379 if (!($cfg['PropertiesNumColumns'] > 1)) {
381 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
382 &nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
383 </td>
384 <?php
387 if ($cfg['ShowStats']) {
388 echo "\n";
390 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
391 &nbsp;&nbsp;
392 <a href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
393 </td>
394 <td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
395 &nbsp;&nbsp;
396 <?php
397 if (isset($formated_overhead)) {
398 echo '<a href="tbl_properties_structure.php?' . $tbl_url_query . '#showusage">' . $formated_overhead . ' ' . $overhead_unit . '</a>' . "\n";
399 unset($formated_overhead);
400 $overhead_check .= "document.getElementById('checkbox_tbl_$i').checked = true;";
401 } else {
402 echo "&nbsp;-&nbsp;\n";
405 </td>
406 <?php
407 echo "\n";
408 } // end if
409 } else {
411 <td colspan="3" align="center" bgcolor="<?php echo $bgcolor; ?>">
412 <?php echo $strInUse . "\n"; ?>
413 </td>
414 <?php
416 echo "\n";
418 </tr>
419 <?php
421 // Show Summary
422 if ($cfg['ShowStats']) {
423 list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
424 list($overhead_formated, $overhead_unit) = PMA_formatByteDown($overhead_size, 3, 1);
426 echo "\n";
428 <tr>
429 <td></td>
430 <th align="center" nowrap="nowrap">
431 &nbsp;<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>&nbsp;
432 </th>
433 <th colspan="6" align="center">
434 <b><?php echo $strSum; ?></b>
435 </th>
436 <th align="right" nowrap="nowrap">
437 <b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
438 </th>
439 <?php
440 if (!($cfg['PropertiesNumColumns'] > 1)) {
442 <th align="center">
443 <b>--</b>
444 </th>
445 <?php
448 if ($cfg['ShowStats']) {
449 echo "\n";
451 <th align="right" nowrap="nowrap">
452 &nbsp;
453 <b><?php echo $sum_formated . ' ' . $unit; ?></b>
454 </th>
455 <th align="right" nowrap="nowrap">
456 &nbsp;
457 <b><?php echo $overhead_formated . ' ' . $overhead_unit; ?></b>
458 </th>
459 <?php
461 echo "\n";
463 </tr>
465 <?php
466 // Check all tables url
467 $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
468 echo "\n";
470 <tr>
471 <td colspan="<?php echo (($cfg['ShowStats']) ? '11' : '10'); ?>" valign="bottom">
472 <img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
473 <a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
474 <?php echo $strCheckAll; ?></a>
475 &nbsp;/&nbsp;
476 <a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
477 <?php echo $strUncheckAll; ?></a>
478 <?php if ($overhead_check != '') { ?>
479 &nbsp;/&nbsp;
480 <a href="#" onclick="setCheckboxes('tablesForm', false); <?php echo $overhead_check; ?> return false;">
481 <?php echo $strCheckOverhead; ?></a>
482 <?php } ?>
483 &nbsp;&nbsp;&nbsp;
484 <img src="./images/spacer.gif" border="0" width="38" height="1" alt="" />
485 <select name="submit_mult" dir="ltr" onchange="this.form.submit();">
486 <?php
487 echo "\n";
488 echo ' <option value="' . $strWithChecked . '" selected="selected">'
489 . $strWithChecked . '</option>' . "\n";
490 echo ' <option value="' . $strDrop . '" >'
491 . $strDrop . '</option>' . "\n";
492 echo ' <option value="' . $strEmpty . '" >'
493 . $strEmpty . '</option>' . "\n";
494 echo ' <option value="' . $strPrintView . '" >'
495 . $strPrintView . '</option>' . "\n";
496 echo ' <option value="' . $strCheckTable . '" >'
497 . $strCheckTable . '</option>' . "\n";
498 echo ' <option value="' . $strOptimizeTable . '" >'
499 . $strOptimizeTable . '</option>' . "\n";
500 echo ' <option value="' . $strRepairTable . '" >'
501 . $strRepairTable . '</option>' . "\n";
502 echo ' <option value="' . $strAnalyzeTable . '" >'
503 . $strAnalyzeTable . '</option>' . "\n";
505 </select>
506 <script type="text/javascript" language="javascript">
507 <!--
508 // Fake js to allow the use of the <noscript> tag
509 //-->
510 </script>
511 <noscript>
512 <input type="submit" value="<?php echo $strGo; ?>" />
513 </noscript>
514 </td>
515 </tr>
516 </table>
517 <?php
518 if ($cfg['PropertiesNumColumns'] > 1) {
520 </td>
521 </tr>
522 </table>
523 <?php
526 </form>
527 <?php
528 } // end if more than one table
530 echo "\n";
532 <hr />
534 <?php
536 * Work on the database
539 <!-- DATABASE WORK -->
540 <ul>
542 <?php
543 if ($num_tables > 0) {
545 <!-- Printable view of a table -->
546 <li>
547 <div style="margin-bottom: 10px"><a href="db_printview.php?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
548 </li>
549 <li>
550 <div style="margin-bottom: 10px"><a href="./db_datadict.php?<?php echo $url_query; ?>"><?php echo $strDataDict; ?></a></div>
551 </li>
552 <?php
553 } // end if
556 <?php
557 if ($cfgRelation['commwork']) {
559 <!-- Alter/Enter db-comment -->
560 <li>
561 <form method="post" action="db_details_structure.php">
562 <?php echo $strDBComment; ?>
563 <input type="hidden" name="db_comment" value="true" />
564 <?php echo PMA_generate_common_hidden_inputs($db); ?>
565 <input type="text" name="comment" class="textfield" value="<?php echo (isset($comment) && is_array($comment) ? htmlspecialchars(implode(' ', $comment)) : ''); ?>" />
566 <input type="submit" value="<?php echo $strGo; ?>" />
567 </form>
568 </li>
569 <?php
573 <!-- Create a new table -->
574 <li>
575 <form method="post" action="tbl_create.php"
576 onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', 1))">
577 <?php echo PMA_generate_common_hidden_inputs($db); ?>
578 <?php
579 echo ' ' . sprintf($strCreateNewTable, htmlspecialchars($db)) . '&nbsp;:<br />' . "\n";
580 echo ' ' . $strName . '&nbsp;:&nbsp;' . "\n";
581 echo ' ' . '<input type="text" name="table" maxlength="64" class="textfield" />' . "\n";
582 echo ' ' . '<br />' . "\n";
583 echo ' ' . $strFields . '&nbsp;:&nbsp;' . "\n";
584 echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
585 echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
587 </form>
588 </li>
590 <?php
591 if ($num_tables > 0
592 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
593 echo ' <li>' . "\n";
594 echo ' <div style="margin-bottom: 10px">' . "\n";
595 echo ' <font color="red">' . $strError . '</font><br />' . "\n";
596 $url_to_goto = '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">';
597 echo ' ' . sprintf($strRelationNotWorking, $url_to_goto, '</a>') . "\n";
598 echo ' </div>' . "\n";
599 echo ' </li>' . "\n";
600 } // end if
602 // is this OK to check for 'class' support?
603 if ($num_tables > 0) {
604 $takeaway = $url_query . '&amp;table=' . urlencode($table);
607 if ($cfgRelation['pdfwork'] && $num_tables > 0) {
609 <!-- Work on PDF Pages -->
610 <li>
611 <div style="margin-bottom: 10px"><a href="pdf_pages.php?<?php echo $takeaway; ?>"><?php echo $strEditPDFPages; ?></a></div>
612 </li>
614 <!-- PDF schema -->
615 <?php
616 // We only show this if we find something in the new pdf_pages table
618 $test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
619 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
620 $test_rs = PMA_query_as_cu($test_query);
621 if ($test_rs && mysql_num_rows($test_rs) > 0) {
622 echo "\n";
624 <li>
625 <form method="post" action="pdf_schema.php">
626 <?php echo PMA_generate_common_hidden_inputs($db); ?>
627 <?php echo $strDisplayPDF; ?>&nbsp;:<br />
628 <?php echo $strPageNumber; ?>&nbsp;
629 <select name="pdf_page_number">
630 <?php
631 while ($pages = @PMA_mysql_fetch_array($test_rs)) {
632 echo "\n" . ' '
633 . '<option value="' . $pages['page_nr'] . '">' . $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>';
634 } // end while
635 echo "\n";
637 </select><br />
638 <input type="checkbox" name="show_grid" id="show_grid_opt" />
639 <label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
640 <input type="checkbox" name="show_color" id="show_color_opt" checked="checked" />
641 <label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
642 <input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
643 <label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?></label><br />
644 <input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" />
645 <label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?></label> <br />
646 <input type="checkbox" name="with_doc" id="with_doc" checked="checked" />
647 <label for="with_doc"><?php echo $strDataDict; ?></label> <br />
648 <?php echo $strShowDatadictAs; ?>
649 <select name="orientation">
650 <option value="L"><?php echo $strLandscape;?></option>
651 <option value="P"><?php echo $strPortrait;?></option>
652 </select><br />
653 <?php echo $strPaperSize; ?>
654 <select name="paper">
655 <?php
656 foreach($cfg['PDFPageSizes'] AS $key => $val) {
657 echo '<option value="' . $val . '"';
658 if ($val == $cfg['PDFDefaultPageSize']) {
659 echo ' selected="selected"';
661 echo ' >' . $val . '</option>' . "\n";
664 </select><br />
665 &nbsp;&nbsp;<input type="submit" value="<?php echo $strGo; ?>" />
666 </form>
667 </li>
668 <?php
669 } // end if
670 } // end if
672 if ($num_tables > 0
673 && $cfgRelation['relwork'] && $cfgRelation['commwork']
674 && isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])
677 <!-- import docSQL files -->
678 <li>
679 <div style="margin-bottom: 10px"><a href="db_details_importdocsql.php?<?php echo $takeaway . '">' . $strImportDocSQL; ?></a></div>
680 </li>
681 <?php
683 echo "\n" . '</ul>';
687 * Displays the footer
689 echo "\n";
690 require_once('./footer.inc.php');