Bugfixing, better defaults for query window.
[phpmyadmin/crack.git] / tbl_properties_export.php3
blob78d589b44576d06f3939f930aaf55923a1910c05
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Gets tables informations and displays top links
8 */
9 require('./tbl_properties_common.php3');
10 $url_query .= '&amp;goto=tbl_properties_export.php3&amp;back=tbl_properties_export.php3';
11 require('./tbl_properties_table_info.php3');
14 <!-- Dump of a table -->
15 <p align="center">
16 <?php echo $strViewDump . "\n"; ?>
17 </p>
19 <?php
20 if (isset($sql_query)) {
21 $sql_query = stripslashes($sql_query);
22 PMA_showMessage($GLOBALS['strSQLQuery']);
25 <form method="post" action="tbl_dump.php3" name="tbl_dump">
26 <?php
27 echo ' ' . PMA_generate_common_hidden_inputs($db, $table);
28 if (isset($sql_query)) {
29 echo ' <input type="hidden" name="sql_query" value="' . urlencode($sql_query) . '" />';
32 <table cellpadding="5" border="2" align="center">
33 <tr>
35 <!-- Formats to export to -->
36 <td nowrap="nowrap">
37 <!-- SQL -->
38 <input type="radio" name="what" value="structure" id="radio_dump_structure" checked="checked" />
39 <label for="radio_dump_structure"><?php echo $strStrucOnly; ?></label>&nbsp;&nbsp;<br />
40 <input type="radio" name="what" value="data" id="radio_dump_data" />
41 <label for="radio_dump_data"><?php echo $strStrucData; ?></label>&nbsp;&nbsp;<br />
42 <input type="radio" name="what" value="dataonly" id="radio_dump_dataonly" />
43 <label for="radio_dump_dataonly"><?php echo $strDataOnly; ?></label>&nbsp;&nbsp;<br />
44 <br />
46 <!-- LaTeX table -->
47 <input type="radio" name="what" value="latex" id="radio_dump_latex" />
48 <label for="radio_dump_latex"><?php echo $strLaTeX; ?></label> &nbsp; &nbsp;
49 <!-- for now we have only one environment supported -->
50 <input type="hidden" name="environment" value="longtable" />
51 <?php /*
52 <select name="environment">
53 <option value="longtable" selected><?php echo $strLaTeXMultipageTable; ?></option>
54 <option value="sideways"><?php echo $strLaTeXSidewaysTable; ?></option>
55 <option value="table"><?php echo $strLaTeXStandardTable; ?></option>
56 </select>
57 */ ?>
58 <br /><br />
60 <!-- Excel CSV -->
61 <input type="radio" name="what" value="excel" id="radio_dump_excel" />
62 <label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label>&nbsp;&nbsp;<br />
63 <br />
64 <!-- General CSV -->
65 <input type="radio" name="what" value="csv" id="radio_dump_csv" />
66 <label for="radio_dump_csv"><?php echo $strStrucCSV;?></label>&nbsp;:<br />
67 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strFieldsTerminatedBy; ?>&nbsp;
68 <input type="text" name="separator" size="2" value=";" class="textfield" />&nbsp;&nbsp;<br />
69 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strFieldsEnclosedBy; ?>&nbsp;
70 <input type="text" name="enclosed" size="1" value="&quot;" class="textfield" />&nbsp;&nbsp;<br />
71 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strFieldsEscapedBy; ?>&nbsp;
72 <input type="text" name="escaped" size="2" value="\" class="textfield" />&nbsp;&nbsp;<br />
73 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strLinesTerminatedBy; ?>&nbsp;
74 <input type="text" name="add_character" size="2" value="<?php echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); ?>" class="textfield" />&nbsp;&nbsp;<br />
75 <br />
76 <!-- XML -->
77 <input type="radio" name="what" value="xml" id="radio_dump_xml" />
78 <label for="radio_dump_xml"><?php echo $strExportToXML; ?></label>&nbsp;&nbsp;
79 </td>
81 <!-- Options -->
82 <td valign="middle">
83 <!-- For structure -->
84 <?php echo $strStructure; ?><br />
85 &nbsp;&nbsp;
86 <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop" />
87 <label for="checkbox_dump_drop"><?php echo $strStrucDrop; ?></label><br />
88 <?php
89 // Add backquotes checkbox
90 if (PMA_MYSQL_INT_VERSION >= 32306) {
92 &nbsp;&nbsp;
93 <input type="checkbox" name="use_backquotes" value="1" id="checkbox_dump_use_backquotes" />
94 <label for="checkbox_dump_use_backquotes"><?php echo $strUseBackquotes; ?></label><br />
95 <?php
96 } // end backquotes feature
97 echo "\n";
99 // garvin: whether to show column comments
100 require('./libraries/relation.lib.php3');
101 $cfgRelation = PMA_getRelationsParam();
103 if ($cfgRelation['commwork']) {
105 &nbsp;&nbsp;
106 <input type="checkbox" name="use_comments" value="1" id="checkbox_dump_use_comments" />
107 <label for="checkbox_dump_use_comments"><?php echo $strDumpComments; ?></label><br />
108 <?php
109 } // end dump comments
110 echo "\n";
113 <br />
114 <!-- For data -->
115 <?php echo $strData; ?><br />
116 &nbsp;&nbsp;
117 <input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" />
118 <label for="checkbox_dump_showcolumns"><?php echo $strCompleteInserts; ?></label><br />
119 &nbsp;&nbsp;
120 <input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" />
121 <label for="checkbox_dump_extended_ins"><?php echo $strExtendedInserts; ?></label><br />
122 &nbsp;&nbsp;
123 <?php echo sprintf($strDumpXRows , '<input type="text" name="limit_to" size="5" value="' . (isset($unlim_num_rows)?$unlim_num_rows: PMA_countRecords($db, $table, TRUE)) . '" class="textfield" style="vertical-align: middle" onfocus="this.select()" />' , '<input type="text" name="limit_from" value="0" size="5" class="textfield" style="vertical-align: middle" onfocus="this.select()" />') . "\n"; ?>
124 <br /><br />
125 <!-- For CSV data -->
126 <?php echo $strStrucCSV; ?><br />
127 &nbsp;&nbsp;
128 <input type="checkbox" name="showcsvnames" value="yes" id="checkbox_dump_showcsvnames" />
129 <label for="checkbox_dump_showcsvnames"><?php echo $strPutColNames; ?></label>
130 </td>
131 </tr>
133 <tr>
134 <!-- Export to screen or to file -->
135 <td colspan="2" align="center">
136 <input type="checkbox" name="asfile" value="sendit" id="checkbox_dump_asfile" onclick="return checkTransmitDump(this.form, 'transmit')" />
137 <label for="checkbox_dump_asfile"><?php echo $strSend; ?></label>
138 <?php
139 // charset of file
140 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
141 $temp_charset = reset($cfg['AvailableCharsets']);
142 echo "\n" . ' , ' . $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";
155 } // end while
156 echo ' </select>';
157 } // end if
158 echo "\n";
160 // zip, gzip and bzip2 encode features
161 if (PMA_PHP_INT_VERSION >= 40004) {
162 $is_zip = (isset($cfg['ZipDump']) && $cfg['ZipDump'] && @function_exists('gzcompress'));
163 $is_gzip = (isset($cfg['GZipDump']) && $cfg['GZipDump'] && @function_exists('gzencode'));
164 $is_bzip = (isset($cfg['BZipDump']) && $cfg['BZipDump'] && @function_exists('bzcompress'));
165 if ($is_zip || $is_gzip || $is_bzip) {
166 echo "\n" . ' (' . "\n";
167 if ($is_zip) {
169 <input type="checkbox" name="zip" value="zip" id="checkbox_dump_zip" onclick="return checkTransmitDump(this.form, 'zip')" />
170 <?php echo '<label for="checkbox_dump_zip">' . $strZip . '</label>' . (($is_gzip || $is_bzip) ? '&nbsp;' : '') . "\n"; ?>
171 <?php
173 if ($is_gzip) {
174 echo "\n"
176 <input type="checkbox" name="gzip" value="gzip" id="checkbox_dump_gzip" onclick="return checkTransmitDump(this.form, 'gzip')" />
177 <?php echo '<label for="checkbox_dump_gzip">' . $strGzip . '</label>' . (($is_bzip) ? '&nbsp;' : '') . "\n"; ?>
178 <?php
180 if ($is_bzip) {
181 echo "\n"
183 <input type="checkbox" name="bzip" value="bzip" id="checkbox_dump_bzip" onclick="return checkTransmitDump(this.form, 'bzip')" />
184 <?php echo '<label for="checkbox_dump_bzip">' . $strBzip . '</label>' . "\n"; ?>
185 <?php
187 echo "\n" . ' )';
190 echo "\n";
192 </td>
193 </tr>
195 <?php
196 // Encoding setting form appended by Y.Kawada
197 if (function_exists('PMA_set_enc_form')) {
199 <tr>
200 <!-- Japanese encoding setting -->
201 <td colspan="2" align="center">
202 <?php
203 echo PMA_set_enc_form(' ');
205 </td>
206 </tr>
207 <?php
209 echo "\n";
212 <tr>
213 <td colspan="2" align="center">
214 <input type="submit" value="<?php echo $strGo; ?>" />
215 </td>
216 </tr>
217 </table>
218 </form>
220 <p align="center">
221 <a href="./Documentation.html#faqexport" target="documentation"><?php echo $strDocu; ?></a>
222 </p>
225 <?php
227 * Displays the footer
229 require('./footer.inc.php3');