3 // vim: expandtab sw=4 ts=4 sts=4:
9 require('./db_details_common.php3');
10 $url_query .= '&goto=db_details.php3';
16 if (isset($show_query) && $show_query == '1') {
17 // This script has been called by read_dump.php3
18 if (isset($sql_query_cpy)) {
19 $query_to_display = $sql_query_cpy;
23 $query_to_display = $sql_query;
26 $query_to_display = '';
31 * Gets informations about the database and, if it is empty, move to the
32 * "db_details_structure.php3" script where table can be created
35 require('./db_details_db_info.php3');
36 if ($num_tables == 0 && empty($db_query_force)) {
38 include('./db_details_structure.php3');
42 // loic1: defines wether file upload is available or not
43 // (now defined in common.lib.php3)
45 $auto_sel = ($cfg['TextareaAutoSelect']
46 // 2003-02-05 rabus: This causes big trouble with Opera 7 for
47 // Windows, so let's disable it there...
48 && !(PMA_USR_OS
== 'Win' && PMA_USR_BROWSER_AGENT
== 'OPERA' && PMA_USR_BROWSER_VER
>= 7))
49 ?
"\n" . ' onfocus="if (typeof(document.layers) == \'undefined\' || typeof(textarea_selected) == \'undefined\') {textarea_selected = 1; this.form.elements[\'sql_query\'].select();}"'
52 <!-- Query box
, sql file loader
and bookmark support
-->
53 <a name
="querybox"></a
>
54 <form method
="post" action
="read_dump.php3"<?php
if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?
>
55 onsubmit
="return checkSqlQuery(this)">
56 <input type
="hidden" name
="is_js_confirmed" value
="0" />
57 <?php
echo PMA_generate_common_hidden_inputs($db); ?
>
58 <input type
="hidden" name
="pos" value
="0" />
59 <input type
="hidden" name
="goto" value
="db_details.php3" />
60 <input type
="hidden" name
="zero_rows" value
="<?php echo htmlspecialchars($strSuccess); ?>" />
61 <input type
="hidden" name
="prev_sql_query" value
="<?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : ''); ?>" />
62 <?php
echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT'); ?
> 
;:<br
/>
63 <div style
="margin-bottom: 5px">
64 <textarea name
="sql_query" cols
="<?php echo $cfg['TextareaCols'] * 2; ?>" rows
="<?php echo $cfg['TextareaRows']; ?>" wrap
="virtual" dir
="<?php echo $text_dir; ?>"<?php
echo $auto_sel; ?
>>
65 <?php
echo ((!empty($query_to_display)) ?
htmlspecialchars($query_to_display) : ''); ?
>
67 <input type
="checkbox" name
="show_query" value
="1" id
="checkbox_show_query" checked
="checked" /> 
;
68 <label
for="checkbox_show_query"><?php
echo $strShowThisQuery; ?
></label
><br
/>
71 // loic1: displays import dump feature only if file upload available
73 echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . ' :<br />' . "\n";
75 <div style
="margin-bottom: 5px">
76 <input type
="file" name
="sql_file" class="textfield" /><br
/>
78 $is_gzip = ($cfg['GZipDump'] && @function_exists
('gzopen'));
79 $is_bzip = ($cfg['BZipDump'] && @function_exists
('bzdecompress'));
80 if ($is_bzip ||
$is_gzip) {
81 echo ' ' . $strCompression . ':' . "\n"
82 . ' <input type="radio" id="radio_sql_file_compression_auto" name="sql_file_compression" value="" checked="checked" />' . "\n"
83 . ' <label for="radio_sql_file_compression_auto">' . $strAutodetect . '</label> ' . "\n"
84 . ' <input type="radio" id="radio_sql_file_compression_plain" name="sql_file_compression" value="text/plain" />' . "\n"
85 . ' <label for="radio_sql_file_compression_plain">' . $strNone . '</label> ' . "\n";
87 echo ' <input type="radio" id="radio_sql_file_compression_gzip" name="sql_file_compression" value="application/x-gzip" />' . "\n"
88 . ' <label for="radio_sql_file_compression_gzip">' . $strGzip . '</label> ' . "\n";
91 echo ' <input type="radio" id="radio_sql_file_compression_bzip" name="sql_file_compression" value="application/x-bzip" />' . "\n"
92 . ' <label for="radio_sql_file_compression_bzip">' . $strBzip . '</label> ' . "\n";
95 echo ' <input type="hidden" name="sql_file_compression" value="text/plain" />' . "\n";
100 } // end if (is upload)
103 // web-server upload directory
105 $is_upload_dir = false;
106 if ($cfg['UploadDir'] != '') {
107 if ($handle = @opendir
($cfg['UploadDir'])) {
109 while ($file = @readdir
($handle)) {
110 if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') {
111 if ($is_first == 0) {
112 $is_upload_dir = true;
114 echo ' <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . ' :<br />' . "\n";
115 echo ' <div style="margin-bottom: 5px">' . "\n";
116 echo ' <select size="1" name="sql_localfile">' . "\n";
117 echo ' <option value="" selected="selected"></option>' . "\n";
118 } // end if (is_first)
119 echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
121 } // end if (is_file)
124 echo ' </select>' . "\n"
125 . ' </div>' . "\n\n";
126 } // end if (isfirst > 0)
130 echo ' <div style="margin-bottom: 5px">' . "\n";
131 echo ' <font color="red">' . $strError . '</font><br />' . "\n";
132 echo ' ' . $strWebServerUploadDirectoryError . "\n";
133 echo ' </div>' . "\n";
135 } // end if (web-server upload directory)
137 // Charset conversion options
138 if ($is_upload ||
$is_upload_dir) {
139 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
140 echo ' <div style="margin-bottom: 5px">' . "\n";
141 $temp_charset = reset($cfg['AvailableCharsets']);
142 echo $strCharsetOfFile . "\n"
143 . ' <select name="charset_of_file" size="1">' . "\n"
144 . ' <option value="' . $temp_charset . '"';
145 if ($temp_charset == $charset) {
146 echo ' selected="selected"';
148 echo '>' . $temp_charset . '</option>' . "\n";
149 while ($temp_charset = next($cfg['AvailableCharsets'])) {
150 echo ' <option value="' . $temp_charset . '"';
151 if ($temp_charset == $charset) {
152 echo ' selected="selected"';
154 echo '>' . $temp_charset . '</option>' . "\n";
156 echo ' </select><br />' . "\n" . ' ';
157 echo ' </div>' . "\n";
158 } // end if (recoding)
162 if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
163 if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
164 echo " <i>$strOr</i> $strBookmarkQuery :<br />\n";
165 echo ' <div style="margin-bottom: 5px">' . "\n";
166 echo ' <select name="id_bookmark">' . "\n";
167 echo ' <option value=""></option>' . "\n";
168 while (list($key, $value) = each($bookmark_list)) {
169 echo ' <option value="' . htmlspecialchars($value) . '">' . htmlspecialchars($key) . '</option>' . "\n";
171 echo ' </select>' . "<br />\n";
172 echo ' ' . $strVar . ' (<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>): <input type="text" name="bookmark_variable" class="textfield" size="10" />' . "\n";
173 echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
174 echo ' <input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
175 echo ' <input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
176 echo ' <br />' . "\n";
177 echo ' </div>' . "\n";
181 // Encoding setting form appended by Y.Kawada
182 if (function_exists('PMA_set_enc_form')) {
183 echo PMA_set_enc_form(' ');
186 <input type
="submit" name
="SQL" value
="<?php echo $strGo; ?>" />
192 * Displays the footer
195 require('./footer.inc.php3');