MSIE russian problem
[phpmyadmin/crack.git] / db_details.php3
blobd40d930fd6678ed0201e677f944dcbb4959d0e35
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Runs common work
8 */
9 require('./db_details_common.php3');
10 $url_query .= '&amp;goto=db_details.php3';
13 /**
14 * Database work
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;
21 // Other cases
22 else {
23 $query_to_display = $sql_query;
25 } else {
26 $query_to_display = '';
30 /**
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
34 $sub_part = '';
35 require('./db_details_db_info.php3');
36 if ($num_tables == 0 && empty($db_query_force)) {
37 $is_info = TRUE;
38 include('./db_details_structure.php3');
39 exit();
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();}"'
50 : '';
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)) ? urlencode($query_to_display) : ''); ?>" />
62 <?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT'); ?>&nbsp;:<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) : ''); ?>
66 </textarea><br />
67 <input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />&nbsp;
68 <label for="checkbox_show_query"><?php echo $strShowThisQuery; ?></label><br />
69 </div>
70 <?php
71 // loic1: displays import dump feature only if file upload available
72 if ($is_upload) {
73 echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . '&nbsp;:<br />' . "\n";
75 <div style="margin-bottom: 5px">
76 <input type="file" name="sql_file" class="textfield" /><br />
77 <?php
78 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
79 $temp_charset = reset($cfg['AvailableCharsets']);
80 echo $strCharsetOfFile . "\n"
81 . ' <select name="charset_of_file" size="1">' . "\n"
82 . ' <option value="' . $temp_charset . '"';
83 if ($temp_charset == $charset) {
84 echo ' selected="selected"';
86 echo '>' . $temp_charset . '</option>' . "\n";
87 while ($temp_charset = next($cfg['AvailableCharsets'])) {
88 echo ' <option value="' . $temp_charset . '"';
89 if ($temp_charset == $charset) {
90 echo ' selected="selected"';
92 echo '>' . $temp_charset . '</option>' . "\n";
94 echo ' </select><br />' . "\n" . ' ';
95 } // end if (recoding)
96 $is_gzip = ($cfg['GZipDump'] && @function_exists('gzopen'));
97 $is_bzip = ($cfg['BZipDump'] && @function_exists('bzdecompress'));
98 if ($is_bzip || $is_gzip) {
99 echo ' ' . $strCompression . ':' . "\n"
100 . ' <input type="radio" id="radio_sql_file_compression_plain" name="sql_file_compression" value="text/plain" checked="checked" />' . "\n"
101 . ' <label for="radio_sql_file_compression_plain">' . $strNone . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
102 if ($is_gzip) {
103 echo ' <input type="radio" id="radio_sql_file_compression_gzip" name="sql_file_compression" value="application/x-gzip" />' . "\n"
104 . ' <label for="radio_sql_file_compression_gzip">' . $strGzip . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
106 if ($is_bzip) {
107 echo ' <input type="radio" id="radio_sql_file_compression_bzip" name="sql_file_compression" value="application/x-bzip" />' . "\n"
108 . ' <label for="radio_sql_file_compression_bzip">' . $strBzip . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
110 } else {
111 echo ' <input type="hidden" name="sql_file_compression" value="text/plain" />' . "\n";
114 </div>
115 <?php
116 } // end if (is upload)
117 echo "\n";
119 // web-server upload directory
120 // (TODO: display the charset selection, even if is_upload == FALSE)
122 if ($cfg['UploadDir'] != '') {
123 if ($handle = @opendir($cfg['UploadDir'])) {
124 $is_first = 0;
125 while ($file = @readdir($handle)) {
126 if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') {
127 if ($is_first == 0) {
128 echo "\n";
129 echo ' <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . '&nbsp;:<br />' . "\n";
130 echo ' <div style="margin-bottom: 5px">' . "\n";
131 echo ' <select size="1" name="sql_localfile">' . "\n";
132 echo ' <option value="" selected="selected"></option>' . "\n";
133 } // end if (is_first)
134 echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
135 $is_first++;
136 } // end if (is_file)
137 } // end while
138 if ($is_first > 0) {
139 echo ' </select>' . "\n"
140 . ' </div>' . "\n\n";
141 } // end if (isfirst > 0)
142 @closedir($handle);
144 else {
145 echo ' <div style="margin-bottom: 5px">' . "\n";
146 echo ' <font color="red">' . $strError . '</font><br />' . "\n";
147 echo ' ' . $strWebServerUploadDirectoryError . "\n";
148 echo ' </div>' . "\n";
150 } // end if (web-server upload directory)
152 // Bookmark Support
153 if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
154 if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
155 echo " <i>$strOr</i> $strBookmarkQuery&nbsp;:<br />\n";
156 echo ' <div style="margin-bottom: 5px">' . "\n";
157 echo ' <select name="id_bookmark">' . "\n";
158 echo ' <option value=""></option>' . "\n";
159 while (list($key, $value) = each($bookmark_list)) {
160 echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
162 echo ' </select>' . "<br />\n";
163 echo ' ' . $strVar . ' (<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>): <input type="text" name="bookmark_variable" class="textfield" size="10" />' . "\n";
164 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";
165 echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
166 echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
167 echo ' <br />' . "\n";
168 echo ' </div>' . "\n";
172 // Encoding setting form appended by Y.Kawada
173 if (function_exists('PMA_set_enc_form')) {
174 echo PMA_set_enc_form(' ');
177 <input type="submit" name="SQL" value="<?php echo $strGo; ?>" />
178 </form>
181 <?php
183 * Displays the footer
185 echo "\n";
186 require('./footer.inc.php3');