5 * Gets some core libraries
7 require('./libraries/grab_globals.lib.php3');
8 require('./libraries/common.lib.php3');
9 require('./libraries/bookmark.lib.php3');
13 * Defines the urls to return to in case of error in a sql statement
15 $err_url_0 = 'main.php3'
17 . '&server=' . $server;
18 $err_url = 'db_details.php3'
20 . '&server=' . $server
21 . '&db=' . urlencode($db);
25 * Ensures the database exists (else move to the "parent" script) and displays
28 if (!isset($is_db) ||
!$is_db) {
29 // Not a valid db name -> back to the welcome page
31 $is_db = @mysql_select_db
($db);
33 if (empty($db) ||
!$is_db) {
34 header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ?
'&message=' . urlencode($message) : '') . '&reload=1');
37 } // end if (ensures db exists)
40 if (!isset($message)) {
41 $js_to_run = 'functions.js';
42 include('./header.inc.php3');
43 // Reloads the navigation frame via JavaScript if required
44 if (isset($reload) && $reload) {
47 <script type
="text/javascript" language
="javascript1.2">
49 window
.parent
.frames
['nav'].location
.replace('./left.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>&db=<?php echo urlencode($db); ?>');
56 PMA_showMessage($message);
61 * Drop/delete multiple tables if required
63 if ((!empty($submit_mult) && isset($selected_tbl))
64 ||
isset($mult_btn)) {
65 $action = 'db_details.php3';
66 include('./mult_submits.inc.php3');
71 * Gets the list of the table in the current db and informations about these
74 // staybyte: speedup view on locked tables - 11 June 2001
75 if (PMA_MYSQL_INT_VERSION
>= 32303) {
76 // Special speedup for newer MySQL Versions (in 4.0 format changed)
77 if ($cfgSkipLockedTables == TRUE && PMA_MYSQL_INT_VERSION
>= 32330) {
78 $local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
79 $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
80 // Blending out tables in use
81 if ($result != FALSE && mysql_num_rows($result) > 0) {
82 while ($tmp = mysql_fetch_row($result)) {
83 // if in use memorize tablename
84 if (eregi('in_use=[1-9]+', $tmp[1])) {
85 $sot_cache[$tmp[0]] = TRUE;
88 mysql_free_result($result);
90 if (isset($sot_cache)) {
91 $local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
92 $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
93 if ($result != FALSE && mysql_num_rows($result) > 0) {
94 while ($tmp = mysql_fetch_row($result)) {
95 if (!isset($sot_cache[$tmp[0]])) {
96 $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\'';
97 $sts_result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
98 $sts_tmp = mysql_fetch_array($sts_result);
100 } else { // table in use
101 $tables[] = array('Name' => $tmp[0]);
104 mysql_free_result($result);
110 if (!isset($sot_ready)) {
111 $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
112 $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
113 if ($result != FALSE && mysql_num_rows($result) > 0) {
114 while ($sts_tmp = mysql_fetch_array($result)) {
115 $tables[] = $sts_tmp;
117 mysql_free_result($result);
120 $num_tables = (isset($tables) ?
count($tables) : 0);
121 } // end if (PMA_MYSQL_INT_VERSION >= 32303)
123 $result = mysql_list_tables($db);
124 $num_tables = @mysql_numrows
($result);
125 for ($i = 0; $i < $num_tables; $i++
) {
126 $tables[] = mysql_tablename($result, $i);
128 mysql_free_result($result);
133 * Displays an html table with all the tables contained into the current
142 if ($num_tables == 0) {
143 echo $strNoTablesFound . "\n";
146 // 2. Shows table informations on mysql >= 3.23 - staybyte - 11 June 2001
147 else if (PMA_MYSQL_INT_VERSION
>= 32300) {
149 <form method
="post" action
="db_details.php3" name
="tablesForm">
150 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
151 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
152 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
154 <table border
="<?php echo $cfgBorder; ?>">
157 <th
> 
;<?php
echo ucfirst($strTable); ?
> 
;</th
>
158 <th colspan
="6"><?php
echo ucfirst($strAction); ?
></th
>
159 <th
><?php
echo ucfirst($strRecords); ?
></th
>
160 <th
><?php
echo ucfirst($strType); ?
></th
>
163 echo '<th>' . ucfirst($strSize) . '</th>';
169 $i = $sum_entries = $sum_size = 0;
170 $checked = (!empty($checkall) ?
' checked="checked"' : '');
171 while (list($keyname, $sts_data) = each($tables)) {
172 $table = $sts_data['Name'];
173 // Sets parameters for links
174 $url_query = 'lang=' . $lang
175 . '&server=' . $server
176 . '&db=' . urlencode($db)
177 . '&table=' . urlencode($table)
178 . '&goto=db_details.php3';
179 $bgcolor = ($i++ %
2) ?
$cfgBgcolorOne : $cfgBgcolorTwo;
183 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
184 <input type
="checkbox" name
="selected_tbl[]" value
="<?php echo urlencode($table); ?>"<?php
echo $checked; ?
> />
186 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
187  
;<b
><?php
echo htmlspecialchars($table); ?
> 
;</b
> 
;
189 <td bgcolor
="<?php echo $bgcolor; ?>">
191 if ($sts_data['Rows']>0) {
192 echo '<a href="sql.php3?' . $url_query . '&sql_query='
193 . urlencode('SELECT * FROM ' . PMA_backquote($table))
194 . '&pos=0">' . $strBrowse . '</a>';
200 <td bgcolor
="<?php echo $bgcolor; ?>">
202 if ($sts_data['Rows']>0) {
203 echo '<a href="tbl_select.php3?' . $url_query . '">'
204 . $strSelect . '</a>';
210 <td bgcolor
="<?php echo $bgcolor; ?>">
211 <a href
="tbl_change.php3?<?php echo $url_query; ?>">
212 <?php
echo $strInsert; ?
></a
>
214 <td bgcolor
="<?php echo $bgcolor; ?>">
215 <a href
="tbl_properties.php3?<?php echo $url_query; ?>">
216 <?php
echo $strProperties; ?
></a
>
218 <td bgcolor
="<?php echo $bgcolor; ?>">
219 <a href
="sql.php3?<?php echo $url_query; ?>&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
220 onclick
="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
221 <?php
echo $strDrop; ?
></a
>
223 <td bgcolor
="<?php echo $bgcolor; ?>">
225 if ($sts_data['Rows']>0) {
226 echo '<a href="sql.php3?' . $url_query
228 . urlencode('DELETE FROM ' . PMA_backquote($table))
230 . urlencode(sprintf($strTableHasBeenEmptied,
231 htmlspecialchars($table)))
232 . '" onclick="return confirmLink(this, \'DELETE FROM ' . PMA_jsFormat($table) . '\')">' . $strEmpty . '</a>';
242 if (isset($sts_data['Type'])) {
243 if ($sts_data['Type'] == 'MRG_MyISAM') {
245 } else if (!eregi('ISAM|HEAP', $sts_data['Type'])) {
250 if (isset($sts_data['Rows'])) {
251 if ($mergetable == FALSE) {
252 if ($cfgShowStats && $nonisam == FALSE) {
253 $tblsize = $sts_data['Data_length'] +
$sts_data['Index_length'];
254 $sum_size +
= $tblsize;
256 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 1);
258 list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 0);
260 } else if ($cfgShowStats) {
261 $formated_size = ' - ';
264 $sum_entries +
= $sts_data['Rows'];
266 // MyISAM MERGE Table
267 else if ($cfgShowStats && $mergetable == TRUE) {
268 $formated_size = ' - ';
271 else if ($cfgShowStats) {
272 $formated_size = 'unknown';
276 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
279 if ($mergetable == TRUE) {
280 echo '<i>' . number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . '</i>' . "\n";
282 echo number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n";
286 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
287  
;<?php
echo (isset($sts_data['Type']) ?
$sts_data['Type'] : ' '); ?
> 
;
293 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
295 <a href
="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php
echo $formated_size . ' ' . $unit; ?
></a
>
302 <td colspan
="3" align
="center" bgcolor
="<?php echo $bgcolor; ?>">
303 <?php
echo $strInUse . "\n"; ?
>
314 list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
320 <th align
="center" nowrap
="nowrap">
321  
;<b
><?php
echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?
></b
> 
;
323 <th colspan
="6" align
="center">
324 <b
><?php
echo $strSum; ?
></b
>
326 <th align
="right" nowrap
="nowrap">
327 <b
><?php
echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?
></b
>
336 <th align
="right" nowrap
="nowrap">
338 <b
><?php
echo $sum_formated . ' ' . $unit; ?
></b
>
347 // Check all tables url
348 $checkall_url = 'db_details.php3'
350 . '&server=' . $server
351 . '&db=' . urlencode($db);
355 <td colspan
="<?php echo (($cfgShowStats) ? '11' : '10'); ?>" valign
="bottom">
356 <img src
="./images/arrow_<?php echo $text_dir; ?>.gif" border
="0" width
="38" height
="22" alt
="<?php echo $strWithChecked; ?>" />
357 <a href
="<?php echo $checkall_url; ?>&checkall=1" onclick
="setCheckboxes('tablesForm', true); return false;">
358 <?php
echo $strCheckAll; ?
></a
>
360 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('tablesForm', false); return false;">
361 <?php
echo $strUncheckAll; ?
></a
>
363 <img src
="./images/spacer.gif" border
="0" width
="38" height
="1" alt
="" />
364 <select name
="submit_mult" dir
="ltr" onchange
="this.form.submit();">
367 echo ' <option value="' . $strWithChecked . '" selected="selected">'
368 . $strWithChecked . '</option>' . "\n";
369 echo ' <option value="' . $strDrop . '" >'
370 . $strDrop . '</option>' . "\n";
371 echo ' <option value="' . $strEmpty . '" >'
372 . $strEmpty . '</option>' . "\n";
373 echo ' <option value="' . $strPrintView . '" >'
374 . $strPrintView . '</option>' . "\n";
375 echo ' <option value="' . $strOptimizeTable . '" >'
376 . $strOptimizeTable . '</option>' . "\n";
379 <input type
="submit" value
="<?php echo $strGo; ?>" />
386 } // end case mysql >= 3.23
388 // 3. Shows tables list mysql < 3.23
393 <form action
="db_details.php3">
394 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
395 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
396 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
398 <table border
="<?php echo $cfgBorder; ?>">
401 <th
> 
;<?php
echo ucfirst($strTable); ?
> 
;</th
>
402 <th colspan
="6"><?php
echo ucfirst($strAction); ?
></th
>
403 <th
><?php
echo ucfirst($strRecords); ?
></th
>
406 $checked = (!empty($checkall) ?
' checked="checked"' : '');
407 while ($i < $num_tables) {
408 // Sets parameters for links
409 $url_query = 'lang=' . $lang
410 . '&server=' . $server
411 . '&db=' . urlencode($db)
412 . '&table=' . urlencode($tables[$i])
413 . '&goto=db_details.php3';
414 $bgcolor = ($i %
2) ?
$cfgBgcolorOne : $cfgBgcolorTwo;
418 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
419 <input type
="checkbox" name
="selected_tbl[]" value
="<?php echo urlencode($tables[$i]); ?>"<?php
echo $checked; ?
> />
421 <td bgcolor
="<?php echo $bgcolor; ?>" class="data">
422 <b
> 
;<?php
echo $tables[$i]; ?
> 
;</b
>
424 <td bgcolor
="<?php echo $bgcolor; ?>">
425 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($tables[$i])); ?>&pos=0"><?php
echo $strBrowse; ?
></a
>
427 <td bgcolor
="<?php echo $bgcolor; ?>">
428 <a href
="tbl_select.php3?<?php echo $url_query; ?>"><?php
echo $strSelect; ?
></a
>
430 <td bgcolor
="<?php echo $bgcolor; ?>">
431 <a href
="tbl_change.php3?<?php echo $url_query; ?>"><?php
echo $strInsert; ?
></a
>
433 <td bgcolor
="<?php echo $bgcolor; ?>">
434 <a href
="tbl_properties.php3?<?php echo $url_query; ?>"><?php
echo $strProperties; ?
></a
>
436 <td bgcolor
="<?php echo $bgcolor; ?>">
437 <a href
="sql.php3?<?php echo $url_query; ?>&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($tables[$i])); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($tables[$i]))); ?>"><?php
echo $strDrop; ?
></a
>
439 <td bgcolor
="<?php echo $bgcolor; ?>">
440 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('DELETE FROM ' . PMA_backquote($tables[$i])); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($tables[$i]))); ?>"><?php
echo $strEmpty; ?
></a
>
442 <td align
="right" bgcolor
="<?php echo $bgcolor; ?>">
443 <?php
PMA_countRecords($db, $tables[$i]); echo "\n"; ?
>
451 // Check all tables url
452 $checkall_url = 'db_details.php3'
454 . '&server=' . $server
455 . '&db=' . urlencode($db);
459 <img src
="./images/arrow_<?php echo $text_dir; ?>.gif" border
="0" width
="38" height
="22" alt
="<?php echo $strWithChecked; ?>" />
460 <a href
="<?php echo $checkall_url; ?>&checkall=1" onclick
="setCheckboxes('tablesForm', true); return false;">
461 <?php
echo $strCheckAll; ?
></a
>
463 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('tablesForm', false); return false;">
464 <?php
echo $strUncheckAll; ?
></a
>
470 <img src
="./images/spacer.gif" border
="0" width
="38" height
="1" alt
="" />
471 <i
><?php
echo $strWithChecked; ?
></i
> 
; 
;
472 <input type
="submit" name
="submit_mult" value
="<?php echo $strDrop; ?>" />
473  
;<?php
$strOr . "\n"; ?
> 
;
474 <input type
="submit" name
="submit_mult" value
="<?php echo $strEmpty; ?>" />
481 } // end case mysql < 3.23
492 $url_query = 'lang=' . $lang
493 . '&server=' . $server
494 . '&db=' . urlencode($db)
495 . '&goto=db_details.php3';
496 if (isset($show_query) && $show_query == 'y') {
497 // This script has been called by read_dump.php3
498 if (isset($sql_query_cpy)) {
499 $query_to_display = $sql_query_cpy;
502 else if (get_magic_quotes_gpc()) {
503 $query_to_display = stripslashes($sql_query);
506 $query_to_display = $sql_query;
509 $query_to_display = '';
512 <!-- DATABASE WORK
-->
515 if ($num_tables > 0) {
517 <!-- Printable view of a table
-->
519 <div style
="margin-bottom: 10px"><a href
="db_printview.php3?<?php echo $url_query; ?>"><?php
echo $strPrintView; ?
></a
></div
>
524 // loic1: defines wether file upload is available or not
525 $is_upload = (PMA_PHP_INT_VERSION
>= 40000 && function_exists('ini_get'))
526 ?
((strtolower(ini_get('file_uploads')) == 'on' ||
ini_get('file_uploads') == 1) && intval(ini_get('upload_max_filesize')))
527 : (intval(@get_cfg_var
('upload_max_filesize')));
530 <!-- Query box
, sql file loader
and bookmark support
-->
532 <a name
="querybox"></a
>
533 <form method
="post" action
="read_dump.php3"<?php
if ($is_upload) echo ' enctype="multipart/form-data"'; ?
>
534 onsubmit
="return checkSqlQuery(this)">
535 <input type
="hidden" name
="is_js_confirmed" value
="0" />
536 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
537 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
538 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
539 <input type
="hidden" name
="pos" value
="0" />
540 <input type
="hidden" name
="goto" value
="db_details.php3" />
541 <input type
="hidden" name
="zero_rows" value
="<?php echo htmlspecialchars($strSuccess); ?>" />
542 <input type
="hidden" name
="prev_sql_query" value
="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
543 <?php
echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showDocuShort('S/E/SELECT.html'); ?
> 
;:<br
/>
544 <div style
="margin-bottom: 5px">
545 <textarea name
="sql_query" cols
="<?php echo $cfgTextareaCols; ?>" rows
="<?php echo $cfgTextareaRows; ?>" wrap
="virtual" onfocus
="this.select()">
546 <?php
echo ((!empty($query_to_display)) ?
htmlspecialchars($query_to_display) : ''); ?
>
548 <input type
="checkbox" name
="show_query" value
="y" checked
="checked" /> 
;
549 <?php
echo $strShowThisQuery; ?
><br
/>
552 // loic1: displays import dump feature only if file upload available
554 echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . ' :<br />' . "\n";
556 <div style
="margin-bottom: 5px">
557 <input type
="file" name
="sql_file" /><br
/>
564 if ($cfgBookmark['db'] && $cfgBookmark['table']) {
565 if (($bookmark_list = PMA_listBookmarks($db, $cfgBookmark)) && count($bookmark_list) > 0) {
566 echo " <i>$strOr</i> $strBookmarkQuery :<br />\n";
567 echo ' <div style="margin-bottom: 5px">' . "\n";
568 echo ' <select name="id_bookmark">' . "\n";
569 echo ' <option value=""></option>' . "\n";
570 while (list($key, $value) = each($bookmark_list)) {
571 echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
573 echo ' </select>' . "\n";
574 echo ' <input type="radio" name="action_bookmark" value="0" checked="checked" style="vertical-align: middle" />' . $strSubmit . "\n";
575 echo ' <input type="radio" name="action_bookmark" value="1" style="vertical-align: middle" />' . $strBookmarkView . "\n";
576 echo ' <input type="radio" name="action_bookmark" value="2" style="vertical-align: middle" />' . $strDelete . "\n";
577 echo ' <br />' . "\n";
578 echo ' </div>' . "\n";
582 <input type
="submit" name
="SQL" value
="<?php echo $strGo; ?>" />
589 * Query by example and dump of the db
590 * Only displayed if there is at least one table in the db
592 if ($num_tables > 0) {
594 <!-- Query by an example
-->
596 <div style
="margin-bottom: 10px"><a href
="tbl_qbe.php3?<?php echo $url_query; ?>"><?php
echo $strQBE; ?
></a
></div
>
599 <!-- Dump of a database
-->
601 <a name
="dumpdb"></a
>
602 <form method
="post" action
="tbl_dump.php3" name
="db_dump">
603 <?php
echo $strViewDumpDB; ?
><br
/>
608 // loic1: already defined at the top of the script!
609 // $tables = mysql_list_tables($db);
610 // $num_tables = @mysql_numrows($tables);
611 if ($num_tables > 1) {
612 $colspan = ' colspan="2"';
616 <select name
="table_select[]" size
="5" multiple
="multiple">
620 $is_selected = (!empty($selectall) ?
' selected="selected"' : '');
621 while ($i < $num_tables) {
622 $table = ((PMA_MYSQL_INT_VERSION
>= 32300) ?
$tables[$i]['Name'] : $tables[$i]);
623 echo ' <option value="' . $table . '"' . $is_selected . '>' . $table . '</option>' . "\n";
635 <input type
="radio" name
="what" value
="structure" checked
="checked" />
636 <?php
echo $strStrucOnly; ?
><br
/>
637 <input type
="radio" name
="what" value
="data" />
638 <?php
echo $strStrucData; ?
><br
/>
639 <input type
="radio" name
="what" value
="dataonly" />
640 <?php
echo $strDataOnly; ?
>
642 if ($num_tables > 1) {
646 <a href
="<?php echo $checkall_url; ?>&selectall=1#dumpdb" onclick
="setSelectOptions('db_dump', 'table_select[]', true); return false;"><?php
echo $strSelectAll; ?
></a
>
648 <a href
="<?php echo $checkall_url; ?>#dumpdb" onclick
="setSelectOptions('db_dump', 'table_select[]', false); return false;"><?php
echo $strUnselectAll; ?
></a
>
656 <td
<?php
echo $colspan; ?
>>
657 <input type
="checkbox" name
="drop" value
="1" />
658 <?php
echo $strStrucDrop . "\n"; ?
>
662 <td
<?php
echo $colspan; ?
>>
663 <input type
="checkbox" name
="showcolumns" value
="yes" />
664 <?php
echo $strCompleteInserts . "\n"; ?
>
668 <td
<?php
echo $colspan; ?
>>
669 <input type
="checkbox" name
="extended_ins" value
="yes" />
670 <?php
echo $strExtendedInserts . "\n"; ?
>
674 // Add backquotes checkbox
675 if (PMA_MYSQL_INT_VERSION
>= 32306) {
678 <td
<?php
echo $colspan; ?
>>
679 <input type
="checkbox" name
="use_backquotes" value
="1" />
680 <?php
echo $strUseBackquotes . "\n"; ?
>
684 } // end backquotes feature
688 <td
<?php
echo $colspan; ?
>>
689 <input type
="checkbox" name
="asfile" value
="sendit" onclick
="return checkTransmitDump(this.form, 'transmit')" />
690 <?php
echo $strSend . "\n"; ?
>
692 // gzip and bzip2 encode features
693 if (PMA_PHP_INT_VERSION
>= 40004) {
694 $is_zip = (isset($cfgZipDump) && $cfgZipDump && @function_exists
('gzcompress'));
695 $is_gzip = (isset($cfgGZipDump) && $cfgGZipDump && @function_exists
('gzencode'));
696 $is_bzip = (isset($cfgBZipDump) && $cfgBZipDump && @function_exists
('bzcompress'));
697 if ($is_zip ||
$is_gzip ||
$is_bzip) {
698 echo "\n" . ' (' . "\n";
701 <input type
="checkbox" name
="zip" value
="zip" onclick
="return checkTransmitDump(this.form, 'zip')" /><?php
echo $strZip . (($is_gzip ||
$is_bzip) ?
' ' : '') . "\n"; ?
>
707 <input type
="checkbox" name
="gzip" value
="gzip" onclick
="return checkTransmitDump(this.form, 'gzip')" /><?php
echo $strGzip . (($is_bzip) ?
' ' : '') . "\n"; ?
>
713 <input type
="checkbox" name
="bzip" value
="bzip" onclick
="return checkTransmitDump(this.form, 'bzip')" /><?php
echo $strBzip . "\n"; ?
>
724 <td
<?php
echo $colspan; ?
>>
725 <input type
="submit" value
="<?php echo $strGo; ?>" />
729 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
730 <input type
="hidden" name
="lang" value
="<?php echo $lang;?>" />
731 <input type
="hidden" name
="db" value
="<?php echo $db;?>" />
735 } // end of create dump if there is at least one table in the db
738 <!-- Create a
new table
-->
740 <form method
="post" action
="tbl_create.php3"
741 onsubmit
="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', 1))">
742 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
743 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
744 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
746 echo ' ' . $strCreateNewTable . htmlspecialchars($db) . ' :<br />' . "\n";
747 echo ' ' . $strName . ' : ' . "\n";
748 echo ' ' . '<input type="text" name="table" maxlength="64" />' . "\n";
749 echo ' ' . '<br />' . "\n";
750 echo ' ' . $strFields . ' : ' . "\n";
751 echo ' ' . '<input type="text" name="num_fields" size="2" />' . "\n";
752 echo ' ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
758 // Check if the user is a Superuser
759 // TODO: set a global variable with this information
760 // loic1: optimized query
761 $result = @mysql_query
('USE mysql');
762 $is_superuser = (!mysql_error());
764 // Display the DROP DATABASE link only if allowed to do so
765 if ($cfgAllowUserDropDatabase ||
$is_superuser) {
767 <!-- Drop database
-->
769 <a href
="sql.php3?server=<?php echo $server; ?>&lang=<?php echo $lang; ?>&db=<?php echo urlencode($db); ?>&sql_query=<?php echo urlencode('DROP DATABASE ' . PMA_backquote($db)); ?>&zero_rows=<?php echo urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db)))); ?>&goto=main.php3&back=db_details.php3&reload=1"
770 onclick
="return confirmLink(this, 'DROP DATABASE <?php echo PMA_jsFormat($db); ?>')">
771 <?php
echo $strDropDB . ' ' . htmlspecialchars($db); ?
></a
>
772 <?php
echo PMA_showDocuShort('D/R/DROP_DATABASE.html') . "\n"; ?
>
784 * Displays the footer
787 require('./footer.inc.php3');