sorry, wrong version checked in
[phpmyadmin/arisferyanto.git] / libraries / display_export.lib.php
blob6409b15fd0558083044244898b35537c6761021e
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 // Get relations & co. status
6 require_once('./libraries/relation.lib.php');
7 $cfgRelation = PMA_getRelationsParam();
9 // Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writer
10 if (!empty($GLOBALS['cfg']['TempDir'])) {
11 @include_once('Spreadsheet/Excel/Writer.php');
12 if (class_exists('Spreadsheet_Excel_Writer')) {
13 $xls = TRUE;
14 } else {
15 $xls = FALSE;
17 } else {
18 $xls = FALSE;
21 function PMA_exportCheckboxCheck($str) {
22 if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
23 echo ' checked="checked"';
27 function PMA_exportIsActive($what, $val) {
28 if (isset($GLOBALS['cfg']['Export'][$what]) && $GLOBALS['cfg']['Export'][$what] == $val) {
29 echo ' checked="checked"';
34 <form method="post" action="export.php" name="dump">
36 <?php
37 $hide_structure = false;
38 $hide_sql = false;
39 $hide_xml = empty($db);
40 if ($export_type == 'server') {
41 echo PMA_generate_common_hidden_inputs('', '', 1);
42 } elseif ($export_type == 'database') {
43 echo PMA_generate_common_hidden_inputs($db, '', 1);
44 } else {
45 echo PMA_generate_common_hidden_inputs($db, $table, 1);
46 if (!isset($single_table)) {
47 $hide_structure = true;
48 $hide_sql = true;
49 } else {
50 // just to keep this value for possible next display of this form after saving on server
51 echo '<input type="hidden" name="single_table" value="TRUE" />' . "\n";
54 echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' . "\n";
56 if (isset($sql_query)) {
57 echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
61 <script type="text/javascript">
62 <!--
63 function hide_them_all() {
64 document.getElementById("csv_options").style.display = 'none';
65 document.getElementById("excel_options").style.display = 'none';
66 document.getElementById("latex_options").style.display = 'none';
67 document.getElementById("htmlexcel_options").style.display = 'none';
68 document.getElementById("htmlword_options").style.display = 'none';
69 <?php if ($xls) { ?>
70 document.getElementById("xls_options").style.display = 'none';
71 <?php } ?>
72 <?php if (!$hide_sql) { ?>
73 document.getElementById("sql_options").style.display = 'none';
74 <?php } ?>
75 document.getElementById("none_options").style.display = 'none';
78 function show_checked_option() {
79 hide_them_all();
80 if (document.getElementById('radio_dump_latex').checked) {
81 document.getElementById('latex_options').style.display = 'block';
82 } else if (document.getElementById('radio_dump_htmlexcel').checked) {
83 document.getElementById('htmlexcel_options').style.display = 'block';
84 } else if (document.getElementById('radio_dump_htmlword').checked) {
85 document.getElementById('htmlword_options').style.display = 'block';
86 <?php if ($xls) { ?>
87 } else if (document.getElementById('radio_dump_xls').checked) {
88 document.getElementById('xls_options').style.display = 'block';
89 <?php } ?>
90 <?php if (!$hide_sql) { ?>
91 } else if (document.getElementById('radio_dump_sql').checked) {
92 document.getElementById('sql_options').style.display = 'block';
93 <?php } ?>
94 <?php if (!$hide_xml) { ?>
95 } else if (document.getElementById('radio_dump_xml').checked) {
96 document.getElementById('none_options').style.display = 'block';
97 <?php } ?>
98 } else if (document.getElementById('radio_dump_csv').checked) {
99 document.getElementById('csv_options').style.display = 'block';
100 } else if (document.getElementById('radio_dump_excel').checked) {
101 document.getElementById('excel_options').style.display = 'block';
102 } else {
103 if (document.getElementById('radio_dump_sql')) {
104 document.getElementById('radio_dump_sql').checked = true;
105 document.getElementById('sql_options').style.display = 'block';
106 } else if (document.getElementById('radio_dump_csv')) {
107 document.getElementById('radio_dump_csv').checked = true;
108 document.getElementById('csv_options').style.display = 'block';
109 } else {
110 document.getElementById('none_options').style.display = 'block';
114 //-->
115 </script>
117 <fieldset id="fieldsetexport">
118 <legend><?php echo $export_page_title; ?></legend>
120 <fieldset id="exportoptions">
121 <legend><?php echo $strExport; ?></legend>
123 <?php if ( ! empty( $multi_values ) ) { ?>
124 <div class="formelementrow">
125 <?php echo $multi_values; ?>
126 </div>
127 <?php } ?>
129 <?php if ( ! $hide_sql ) { /* SQL */ ?>
130 <div class="formelementrow">
131 <input type="radio" name="what" value="sql" id="radio_dump_sql"
132 onclick="
133 if (this.checked) {
134 hide_them_all();
135 document.getElementById('sql_options').style.display = 'block';
136 }; return true"
137 <?php PMA_exportIsActive('format', 'sql'); ?> />
138 <label for="radio_dump_sql"><?php echo $strSQL; ?></label>
139 </div>
140 <?php } /* LaTeX table */ ?>
141 <div class="formelementrow">
142 <input type="radio" name="what" value="latex" id="radio_dump_latex"
143 onclick="
144 if (this.checked) {
145 hide_them_all();
146 document.getElementById('latex_options').style.display = 'block';
147 }; return true"
148 <?php PMA_exportIsActive('format', 'latex'); ?> />
149 <label for="radio_dump_latex"><?php echo $strLaTeX; ?></label>
150 </div>
151 <?php /* HTML Excel */ ?>
152 <div class="formelementrow">
153 <input type="radio" name="what" value="htmlexcel" id="radio_dump_htmlexcel"
154 onclick="
155 if (this.checked) {
156 hide_them_all();
157 document.getElementById('htmlexcel_options').style.display = 'block';
158 document.getElementById('checkbox_dump_asfile').checked = true;
159 }; return true"
160 <?php PMA_exportIsActive('format', 'htmlexcel'); ?> />
161 <label for="radio_dump_htmlexcel"><?php echo $strHTMLExcel; ?></label>
162 </div>
163 <?php /* HTML Word */ ?>
164 <div class="formelementrow">
165 <input type="radio" name="what" value="htmlword" id="radio_dump_htmlword"
166 onclick="
167 if (this.checked) {
168 hide_them_all();
169 document.getElementById('htmlword_options').style.display = 'block';
170 document.getElementById('checkbox_dump_asfile').checked = true;
171 }; return true"
172 <?php PMA_exportIsActive('format', 'htmlword'); ?> />
173 <label for="radio_dump_htmlword"><?php echo $strHTMLWord; ?></label>
174 </div>
175 <?php if ($xls) { /* Native Excel */ ?>
176 <div class="formelementrow">
177 <input type="radio" name="what" value="xls" id="radio_dump_xls"
178 onclick="
179 if (this.checked) {
180 hide_them_all();
181 document.getElementById('xls_options').style.display = 'block';
182 document.getElementById('checkbox_dump_asfile').checked = true;
183 }; return true"
184 <?php PMA_exportIsActive('format', 'xls'); ?> />
185 <label for="radio_dump_xls"><?php echo $strStrucNativeExcel; ?></label>
186 </div>
187 <?php } /* Excel CSV */ ?>
188 <div class="formelementrow">
189 <input type="radio" name="what" value="excel" id="radio_dump_excel"
190 onclick="
191 if (this.checked) {
192 hide_them_all();
193 document.getElementById('excel_options').style.display = 'block';
194 }; return true"
195 <?php PMA_exportIsActive('format', 'excel'); ?> />
196 <label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label>
197 </div>
198 <?php /* General CSV */ ?>
199 <div class="formelementrow">
200 <input type="radio" name="what" value="csv" id="radio_dump_csv"
201 onclick="if
202 (this.checked) {
203 hide_them_all();
204 document.getElementById('csv_options').style.display = 'block';
205 }; return true"
206 <?php PMA_exportIsActive('format', 'csv'); ?> />
207 <label for="radio_dump_csv"><?php echo $strStrucCSV;?></label>
208 </div>
209 <?php if (!$hide_xml) { /* XML */ ?>
210 <div class="formelementrow">
211 <input type="radio" name="what" value="xml" id="radio_dump_xml"
212 onclick="
213 if (this.checked) {
214 hide_them_all();
215 document.getElementById('none_options').style.display = 'block';
216 }; return true"
217 <?php PMA_exportIsActive('format', 'xml'); ?> />
218 <label for="radio_dump_xml"><?php echo $strXML; ?></label>
219 </div>
220 <?php } ?>
222 </fieldset>
224 <?php if ( ! $hide_sql ) { /* SQL options */ ?>
225 <fieldset id="sql_options">
226 <legend>
227 <?php
228 echo $strSQLOptions;
229 $goto_documentation = '<a href="./Documentation.html#faqexport" target="documentation">';
230 echo ( $cfg['ReplaceHelpImg'] ? '' : '(' )
231 . $goto_documentation
232 . ( $cfg['ReplaceHelpImg'] ?
233 '<img class="icon" src="' . $pmaThemeImage . 'b_help.png" alt="'
234 .$strDocu . '" width="11" height="11" />'
235 : $strDocu )
236 . '</a>' . ($cfg['ReplaceHelpImg'] ? '' : ')');
238 </legend>
239 <div class="formelementrow">
240 <?php echo $strAddHeaderComment; ?>:
241 <input type="text" name="header_comment" size="30"
242 value="<?php echo $cfg['Export']['sql_header_comment']; ?>" />
243 </div>
245 <div class="formelementrow">
246 <input type="checkbox" name="use_transaction" value="yes"
247 id="checkbox_use_transaction"
248 <?php PMA_exportCheckboxCheck('sql_use_transaction'); ?> />
249 <label for="checkbox_use_transaction">
250 <?php echo $strEncloseInTransaction; ?></label>
251 </div>
253 <div class="formelementrow">
254 <input type="checkbox" name="disable_fk" value="yes"
255 id="checkbox_disable_fk"
256 <?php PMA_exportCheckboxCheck('sql_disable_fk'); ?> />
257 <label for="checkbox_disable_fk">
258 <?php echo $strDisableForeignChecks; ?></label>
259 </div>
260 <?php if (PMA_MYSQL_INT_VERSION >= 40100) { ?>
261 <label for="select_sql_compat">
262 <?php echo $strSQLExportCompatibility; ?>:</label>
263 <select name="sql_compat" id="select_sql_compat">
264 <?php
265 $compats = array('NONE');
266 if (PMA_MYSQL_INT_VERSION >= 40101) {
267 $compats[] = 'ANSI';
268 $compats[] = 'DB2';
269 $compats[] = 'MAXDB';
270 $compats[] = 'MYSQL323';
271 $compats[] = 'MYSQL40';
272 $compats[] = 'MSSQL';
273 $compats[] = 'ORACLE';
274 $compats[] = 'POSTGRESQL';
275 if (PMA_MYSQL_INT_VERSION >= 50001) {
276 $compats[] = 'TRADITIONAL';
279 foreach ($compats as $x) {
280 echo '<option value="' . $x . '"'
281 . ($cfg['Export']['sql_compat'] == $x ? ' selected="selected"' : '' )
282 . '>' . $x . '</option>' . "\n";
285 </select>
286 <?php echo PMA_showMySQLDocu('manual_MySQL_Database_Administration',
287 'Server_SQL_mode') . "\n";
288 } ?>
289 <?php if ( $export_type == 'server' ) { /* For databases */ ?>
290 <fieldset>
291 <legend><?php echo $strDatabaseExportOptions; ?></legend>
292 <input type="checkbox" name="drop_database" value="yes"
293 id="checkbox_drop_database"
294 <?php PMA_exportCheckboxCheck('sql_drop_database'); ?> />
295 <label for="checkbox_drop_database">
296 <?php echo $strAddDropDatabase; ?></label>
297 </fieldset>
298 <?php } if ( ! $hide_structure ) { /* SQL structure */ ?>
299 <fieldset>
300 <legend>
301 <input type="checkbox" name="sql_structure" value="structure"
302 id="checkbox_sql_structure"
303 <?php PMA_exportCheckboxCheck('sql_structure'); ?>
304 onclick="
305 if (!this.checked &amp;&amp; !document.getElementById('checkbox_sql_data').checked)
306 return false;
307 else return true;" />
308 <label for="checkbox_sql_structure">
309 <?php echo $strStructure; ?></label>
310 </legend>
312 <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop"
313 <?php PMA_exportCheckboxCheck('sql_drop_table'); ?> />
314 <label for="checkbox_dump_drop">
315 <?php echo $strStrucDrop; ?></label><br />
317 <input type="checkbox" name="if_not_exists" value="1"
318 id="checkbox_dump_if_not_exists"
319 <?php PMA_exportCheckboxCheck('sql_if_not_exists'); ?> />
320 <label for="checkbox_dump_if_not_exists">
321 <?php echo $strAddIfNotExists; ?></label><br />
323 <input type="checkbox" name="sql_auto_increment" value="1"
324 id="checkbox_auto_increment"
325 <?php PMA_exportCheckboxCheck('sql_auto_increment'); ?> />
326 <label for="checkbox_auto_increment">
327 <?php echo $strAddAutoIncrement; ?></label><br />
329 <input type="checkbox" name="use_backquotes" value="1"
330 id="checkbox_dump_use_backquotes"
331 <?php PMA_exportCheckboxCheck('sql_backquotes'); ?> />
332 <label for="checkbox_dump_use_backquotes">
333 <?php echo $strUseBackquotes; ?></label><br />
335 <b><?php echo $strAddIntoComments; ?>:</b><br />
337 <input type="checkbox" name="sql_dates" value="yes"
338 id="checkbox_sql_dates"
339 <?php PMA_exportCheckboxCheck('sql_dates'); ?> />
340 <label for="checkbox_sql_dates">
341 <?php echo $strCreationDates; ?></label><br />
342 <?php if (!empty($cfgRelation['relation'])) { ?>
343 <input type="checkbox" name="sql_relation" value="yes"
344 id="checkbox_sql_use_relation"
345 <?php PMA_exportCheckboxCheck('sql_relation'); ?> />
346 <label for="checkbox_sql_use_relation"><?php echo $strRelations; ?></label><br />
347 <?php } if (!empty($cfgRelation['commwork']) && PMA_MYSQL_INT_VERSION < 40100) { ?>
348 <input type="checkbox" name="sql_comments" value="yes"
349 id="checkbox_sql_use_comments"
350 <?php PMA_exportCheckboxCheck('sql_comments'); ?> />
351 <label for="checkbox_sql_use_comments"><?php echo $strComments; ?></label><br />
352 <?php } if ($cfgRelation['mimework']) { ?>
353 <input type="checkbox" name="sql_mime" value="yes"
354 id="checkbox_sql_use_mime"
355 <?php PMA_exportCheckboxCheck('sql_mime'); ?> />
356 <label for="checkbox_sql_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
357 <?php } ?>
358 </fieldset>
359 <?php
360 } /* end SQL STRUCTURE */
361 /* SQL data */
363 <fieldset>
364 <legend>
365 <input type="checkbox" name="sql_data" value="data"
366 id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?>
367 onclick="
368 if (!this.checked &amp;&amp; (!document.getElementById('checkbox_sql_structure') || !document.getElementById('checkbox_sql_structure').checked))
369 return false;
370 else return true;" />
371 <label for="checkbox_sql_data">
372 <?php echo $strData; ?></label>
373 </legend>
374 <input type="checkbox" name="showcolumns" value="yes"
375 id="checkbox_dump_showcolumns"
376 <?php PMA_exportCheckboxCheck('sql_columns'); ?> />
377 <label for="checkbox_dump_showcolumns">
378 <?php echo $strCompleteInserts; ?></label><br />
380 <input type="checkbox" name="extended_ins" value="yes"
381 id="checkbox_dump_extended_ins"
382 <?php PMA_exportCheckboxCheck('sql_extended'); ?> />
383 <label for="checkbox_dump_extended_ins">
384 <?php echo $strExtendedInserts; ?></label><br />
386 <label for="input_max_query_size">
387 <?php echo $strMaximalQueryLength; ?>:</label>
388 <input type="text" name="max_query_size" id="input_max_query_size"
389 value="<?php echo $cfg['Export']['sql_max_query_size'];?>" /><br />
391 <input type="checkbox" name="delayed" value="yes"
392 id="checkbox_dump_delayed"
393 <?php PMA_exportCheckboxCheck('sql_delayed'); ?> />
394 <label for="checkbox_dump_delayed">
395 <?php echo $strDelayedInserts; ?></label><br />
397 <input type="checkbox" name="sql_ignore" value="yes"
398 id="checkbox_dump_ignore"
399 <?php PMA_exportCheckboxCheck('sql_ignore'); ?> />
400 <label for="checkbox_dump_ignore">
401 <?php echo $strIgnoreInserts; ?></label><br />
403 <input type="checkbox" name="hexforbinary" value="yes"
404 id="checkbox_hexforbinary"
405 <?php PMA_exportCheckboxCheck('sql_hex_for_binary'); ?> />
406 <label for="checkbox_hexforbinary">
407 <?php echo $strHexForBinary; ?></label><br />
409 <label for="select_sql_type">
410 <?php echo $strSQLExportType; ?>:</label>
411 <select name="sql_type" id="select_sql_type">
412 <option value="insert"<?php echo $cfg['Export']['sql_type'] == 'insert' ? ' selected="selected"' : ''; ?>>INSERT</option>
413 <option value="update"<?php echo $cfg['Export']['sql_type'] == 'update' ? ' selected="selected"' : ''; ?>>UPDATE</option>
414 <option value="replace"<?php echo $cfg['Export']['sql_type'] == 'replace' ? ' selected="selected"' : ''; ?>>REPLACE</option>
415 </select>
416 </fieldset>
417 </fieldset>
418 <?php
419 } // end SQL-OPTIONS
422 <?php /* LaTeX options */ ?>
423 <fieldset id="latex_options">
424 <legend><?php echo $strLaTeXOptions; ?></legend>
426 <div class="formelementrow">
427 <input type="checkbox" name="latex_caption" value="yes"
428 id="checkbox_latex_show_caption"
429 <?php PMA_exportCheckboxCheck('latex_caption'); ?> />
430 <label for="checkbox_latex_show_caption">
431 <?php echo $strLatexIncludeCaption; ?></label>
432 </div>
434 <?php if ( ! $hide_structure ) { /* LaTeX structure */ ?>
435 <fieldset>
436 <legend>
437 <input type="checkbox" name="latex_structure" value="structure"
438 id="checkbox_latex_structure"
439 <?php PMA_exportCheckboxCheck('latex_structure'); ?>
440 onclick="
441 if (!this.checked &amp;&amp; !document.getElementById('checkbox_latex_data').checked)
442 return false;
443 else return true;" />
444 <label for="checkbox_latex_structure">
445 <?php echo $strStructure; ?></label>
446 </legend>
448 <table>
449 <tr><td><label for="latex_structure_caption">
450 <?php echo $strLatexCaption; ?></label></td>
451 <td><input type="text" name="latex_structure_caption" size="30"
452 value="<?php echo $strLatexStructure; ?>"
453 id="latex_structure_caption" />
454 </td>
455 </tr>
456 <tr><td><label for="latex_structure_continued_caption">
457 <?php echo $strLatexContinuedCaption; ?></label></td>
458 <td><input type="text" name="latex_structure_continued_caption"
459 value="<?php echo $strLatexStructure . ' ' . $strLatexContinued; ?>"
460 size="30" id="latex_structure_continued_caption" />
461 </td>
462 </tr>
463 <tr><td><label for="latex_structure_label">
464 <?php echo $strLatexLabel; ?></label></td>
465 <td><input type="text" name="latex_structure_label" size="30"
466 value="<?php echo $cfg['Export']['latex_structure_label']; ?>"
467 id="latex_structure_label" />
468 </td>
469 </tr>
470 </table>
472 <?php if ( ! empty( $cfgRelation['relation']) ) { ?>
473 <input type="checkbox" name="latex_relation" value="yes"
474 id="checkbox_latex_use_relation"
475 <?php PMA_exportCheckboxCheck('latex_relation'); ?> />
476 <label for="checkbox_latex_use_relation">
477 <?php echo $strRelations; ?></label><br />
478 <?php } if ( $cfgRelation['commwork'] ) { ?>
479 <input type="checkbox" name="latex_comments" value="yes"
480 id="checkbox_latex_use_comments"
481 <?php PMA_exportCheckboxCheck('latex_comments'); ?> />
482 <label for="checkbox_latex_use_comments">
483 <?php echo $strComments; ?></label><br />
484 <?php } if ( $cfgRelation['mimework'] ) { ?>
485 <input type="checkbox" name="latex_mime" value="yes"
486 id="checkbox_latex_use_mime"
487 <?php PMA_exportCheckboxCheck('latex_mime'); ?> />
488 <label for="checkbox_latex_use_mime">
489 <?php echo $strMIME_MIMEtype; ?></label><br />
490 <?php } ?>
491 </fieldset>
492 <?php
493 } // end LaTeX STRUCTURE
494 /* LaTeX data */
496 <fieldset>
497 <legend>
498 <input type="checkbox" name="latex_data" value="data"
499 id="checkbox_latex_data"
500 <?php PMA_exportCheckboxCheck('latex_data'); ?>
501 onclick="
502 if (!this.checked &amp;&amp; (!document.getElementById('checkbox_latex_structure') || !document.getElementById('checkbox_latex_structure').checked))
503 return false;
504 else return true;" />
505 <label for="checkbox_latex_data">
506 <?php echo $strData; ?></label>
507 </legend>
508 <input type="checkbox" name="latex_showcolumns" value="yes"
509 id="ch_latex_showcolumns"
510 <?php PMA_exportCheckboxCheck('latex_columns'); ?> />
511 <label for="ch_latex_showcolumns">
512 <?php echo $strColumnNames; ?></label><br />
513 <table>
514 <tr><td><label for="latex_data_caption">
515 <?php echo $strLatexCaption; ?></label></td>
516 <td><input type="text" name="latex_data_caption" size="30"
517 value="<?php echo $strLatexContent; ?>"
518 id="latex_data_caption" />
519 </td>
520 </tr>
521 <tr><td><label for="latex_data_continued_caption">
522 <?php echo $strLatexContinuedCaption; ?></label></td>
523 <td><input type="text" name="latex_data_continued_caption" size="30"
524 value="<?php echo $strLatexContent . ' ' . $strLatexContinued; ?>"
525 id="latex_data_continued_caption" />
526 </td>
527 </tr>
528 <tr><td><label for="latex_data_label">
529 <?php echo $strLatexLabel; ?></label></td>
530 <td><input type="text" name="latex_data_label" size="30"
531 value="<?php echo $cfg['Export']['latex_data_label']; ?>"
532 id="latex_data_label" />
533 </td>
534 </tr>
535 <tr><td><label for="latex_replace_null">
536 <?php echo $strReplaceNULLBy; ?></label></td>
537 <td><input type="text" name="latex_replace_null" size="20"
538 value="<?php echo $cfg['Export']['latex_null']; ?>"
539 id="latex_replace_null" />
540 </td>
541 </tr>
542 </table>
543 </fieldset>
544 </fieldset>
546 <?php /* CSV options */ ?>
547 <fieldset id="csv_options">
548 <input type="hidden" name="csv_data" value="csv_data" />
549 <legend><?php echo $strCSVOptions; ?></legend>
551 <table>
552 <tr><td><label for="export_separator">
553 <?php echo $strFieldsTerminatedBy; ?></label></td>
554 <td><input type="text" name="export_separator" size="2"
555 id="export_separator"
556 value="<?php echo $cfg['Export']['csv_separator']; ?>" />
557 </td>
558 </tr>
559 <tr><td><label for="enclosed">
560 <?php echo $strFieldsEnclosedBy; ?></label></td>
561 <td><input type="text" name="enclosed" size="2"
562 id="enclosed"
563 value="<?php echo $cfg['Export']['csv_enclosed']; ?>" />
564 </td>
565 </tr>
566 <tr><td><label for="escaped">
567 <?php echo $strFieldsEscapedBy; ?></label></td>
568 <td><input type="text" name="escaped" size="2"
569 id="escaped"
570 value="<?php echo $cfg['Export']['csv_escaped']; ?>" />
571 </td>
572 </tr>
573 <tr><td><label for="add_character">
574 <?php echo $strLinesTerminatedBy; ?></label></td>
575 <td><input type="text" name="add_character" size="2"
576 id="add_character"
577 value="<?php if ($cfg['Export']['csv_terminated'] == 'AUTO') echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); else echo $cfg['Export']['csv_terminated']; ?>" />
578 </td>
579 </tr>
580 <tr><td><label for="csv_replace_null">
581 <?php echo $strReplaceNULLBy; ?></label></td>
582 <td><input type="text" name="csv_replace_null" size="20"
583 id="csv_replace_null"
584 value="<?php echo $cfg['Export']['csv_null']; ?>" />
585 </td>
586 </tr>
587 </table>
588 <input type="checkbox" name="showcsvnames" value="yes"
589 id="checkbox_dump_showcsvnames"
590 <?php PMA_exportCheckboxCheck('csv_columns'); ?> />
591 <label for="checkbox_dump_showcsvnames">
592 <?php echo $strPutColNames; ?></label>
593 </fieldset>
595 <?php /* Excel options */ ?>
596 <fieldset id="excel_options">
597 <input type="hidden" name="excel_data" value="excel_data" />
598 <legend><?php echo $strExcelOptions; ?></legend>
600 <table>
601 <tr><td><label for="excel_replace_null">
602 <?php echo $strReplaceNULLBy; ?></label>
603 </td>
604 <td><input type="text" name="excel_replace_null" size="20"
605 id="excel_replace_null"
606 value="<?php echo $cfg['Export']['excel_null']; ?>" />
607 </td>
608 </tr>
609 <tr><td><label for="select_excel_edition">
610 <?php echo $strExcelEdition; ?>:
611 </label>
612 </td>
613 <td><select name="excel_edition" id="select_excel_edition">
614 <option value="win"<?php echo $cfg['Export']['excel_edition'] == 'win' ? ' selected="selected"' : ''; ?>>Windows</option>
615 <option value="mac"<?php echo $cfg['Export']['excel_edition'] == 'mac' ? ' selected="selected"' : ''; ?>>Excel 2003 / Macintosh</option>
616 </select>
617 </td>
618 </tr>
619 </table>
621 <input type="checkbox" name="showexcelnames" value="yes"
622 id="checkbox_dump_showexcelnames"
623 <?php PMA_exportCheckboxCheck('excel_columns'); ?> />
624 <label for="checkbox_dump_showexcelnames">
625 <?php echo $strPutColNames; ?></label>
626 </fieldset>
628 <?php /* HTML Excel options */ ?>
629 <fieldset id="htmlexcel_options">
630 <input type="hidden" name="htmlexcel_data" value="htmlexcel_data" />
631 <legend><?php echo $strHTMLExcelOptions; ?></legend>
633 <div class="formelementrow">
634 <label for="htmlexcel_replace_null"><?php echo $strReplaceNULLBy; ?></label>
635 <input type="text" name="htmlexcel_replace_null" size="20"
636 value="<?php echo $cfg['Export']['htmlexcel_null']; ?>"
637 id="htmlexcel_replace_null" />
638 </div>
640 <div class="formelementrow">
641 <input type="checkbox" name="htmlexcel_shownames" value="yes"
642 id="checkbox_dump_htmlexcel_shownames"
643 <?php PMA_exportCheckboxCheck('htmlexcel_columns'); ?> />
644 <label for="checkbox_dump_htmlexcel_shownames">
645 <?php echo $strPutColNames; ?></label>
646 </div>
647 </fieldset>
649 <?php /* HTML Word options */ ?>
650 <fieldset id="htmlword_options">
651 <legend><?php echo $strHTMLWordOptions; ?></legend>
653 <div class="formelementrow">
654 <input type="checkbox" name="htmlword_structure" value="structure"
655 id="checkbox_htmlword_structure"
656 <?php PMA_exportCheckboxCheck('htmlword_structure'); ?>
657 onclick="
658 if (!this.checked &amp;&amp; (!document.getElementById('checkbox_htmlword_data') || !document.getElementById('checkbox_htmlword_data').checked))
659 return false;
660 else return true;" />
661 <label for="checkbox_htmlword_structure">
662 <?php echo $strStructure; ?></label>
663 </div>
665 <fieldset>
666 <legend>
667 <input type="checkbox" name="htmlword_data" value="data"
668 id="checkbox_htmlword_data"
669 <?php PMA_exportCheckboxCheck('htmlword_data'); ?>
670 onclick="
671 if (!this.checked &amp;&amp; (!document.getElementById('checkbox_htmlword_structure') || !document.getElementById('checkbox_htmlword_structure').checked))
672 return false;
673 else return true;" />
674 <label for="checkbox_htmlword_data">
675 <?php echo $strData; ?></label>
676 </legend>
678 <div class="formelementrow">
679 <label for="htmlword_replace_null">
680 <?php echo $strReplaceNULLBy; ?></label>
681 <input id="htmlword_replace_null" type="text" size="20"
682 name="htmlword_replace_null"
683 value="<?php echo $cfg['Export']['htmlword_null']; ?>" />
684 </div>
686 <div class="formelementrow">
687 <input type="checkbox" name="htmlword_shownames" value="yes"
688 id="checkbox_dump_htmlword_shownames"
689 <?php PMA_exportCheckboxCheck('htmlword_columns'); ?> />
690 <label for="checkbox_dump_htmlword_shownames">
691 <?php echo $strPutColNames; ?></label>
692 </div>
693 </fieldset>
694 </fieldset>
696 <?php if ( $xls ) { /* Native Excel options */ ?>
697 <fieldset id="xls_options">
698 <input type="hidden" name="xls_data" value="xls_data" />
699 <legend><?php echo $strExcelOptions; ?></legend>
701 <div class="formelementrow">
702 <label for="xls_replace_null"><?php echo $strReplaceNULLBy; ?></label>
703 <input type="text" name="xls_replace_null" size="20"
704 value="<?php echo $cfg['Export']['xls_null']; ?>"
705 id="xls_replace_null" />
706 </div>
708 <div class="formelementrow">
709 <input type="checkbox" name="xls_shownames" value="yes"
710 id="checkbox_dump_xls_shownames"
711 <?php PMA_exportCheckboxCheck('xls_columns'); ?> />
712 <label for="checkbox_dump_xls_shownames">
713 <?php echo $strPutColNames; ?></label>
714 </div>
715 </fieldset>
716 <?php } /* end if ( $xls ) */ ?>
718 <fieldset id="none_options">
719 <legend><?php echo $strXML; ?></legend>
720 <?php echo $strNoOptions; ?>
721 <input type="hidden" name="xml_data" value="xml_data" />
722 </fieldset>
724 <script type="text/javascript">
725 <!--
726 show_checked_option();
727 //-->
728 </script>
730 <?php if ( ! empty( $table ) && ! isset( $num_tables ) ) { ?>
731 <div class="formelementrow">
732 <?php
733 echo sprintf( $strDumpXRows,
734 '<input type="text" name="limit_to" size="5" value="'
735 . ( isset( $unlim_num_rows ) ? $unlim_num_rows : PMA_countRecords( $db, $table, TRUE ) )
736 . '" onfocus="this.select()" />',
737 '<input type="text" name="limit_from" value="0" size="5"'
738 .' onfocus="this.select()" /> ');
740 </div>
741 <?php } ?>
742 </fieldset>
744 <fieldset>
745 <legend>
746 <input type="checkbox" name="asfile" value="sendit"
747 id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> />
748 <label for="checkbox_dump_asfile"><?php echo $strSend; ?></label>
749 </legend>
751 <?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
752 <input type="checkbox" name="onserver" value="saveit"
753 id="checkbox_dump_onserver"
754 onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
755 <?php PMA_exportCheckboxCheck('onserver'); ?> />
756 <label for="checkbox_dump_onserver">
757 <?php echo sprintf($strSaveOnServer, htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
758 </label>,<br />
759 <input type="checkbox" name="onserverover" value="saveitover"
760 id="checkbox_dump_onserverover"
761 onclick="document.getElementById('checkbox_dump_onserver').checked = true;
762 document.getElementById('checkbox_dump_asfile').checked = true;"
763 <?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
764 <label for="checkbox_dump_onserverover">
765 <?php echo $strOverwriteExisting; ?></label>
766 <br />
767 <?php } ?>
769 <label for="filename_template">
770 <?php echo $strFileNameTemplate; ?>
771 <sup>(1)</sup></label>:
772 <input type="text" name="filename_template" id="filename_template"
773 <?php
774 echo ' value="';
775 if ($export_type == 'database') {
776 if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
777 echo $_COOKIE['pma_db_filename_template'];
778 } else {
779 echo $GLOBALS['cfg']['Export']['file_template_database'];
781 } elseif ($export_type == 'table') {
782 if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
783 echo $_COOKIE['pma_table_filename_template'];
784 } else {
785 echo $GLOBALS['cfg']['Export']['file_template_table'];
787 } else {
788 if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
789 echo $_COOKIE['pma_server_filename_template'];
790 } else {
791 echo $GLOBALS['cfg']['Export']['file_template_server'];
794 echo '" />';
798 <input type="checkbox" name="remember_template"
799 id="checkbox_remember_template"
800 <?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
801 <label for="checkbox_remember_template">
802 <?php echo $strFileNameTemplateRemember; ?></label>
805 <div class="formelementrow">
806 <?php
807 // charset of file
808 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
809 echo ' <label for="select_charset_of_file">'
810 . $strCharsetOfFile . '</label>' . "\n";
812 $temp_charset = reset($cfg['AvailableCharsets']);
813 echo ' <select id="select_charset_of_file" name="charset_of_file" size="1">' . "\n";
814 foreach($cfg['AvailableCharsets'] as $key => $temp_charset) {
815 echo ' <option value="' . $temp_charset . '"';
816 if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
817 || $temp_charset == $cfg['Export']['charset']) {
818 echo ' selected="selected"';
820 echo '>' . $temp_charset . '</option>' . "\n";
821 } // end foreach
822 echo ' </select>';
823 } // end if
825 </div>
827 <?php
828 // zip, gzip and bzip2 encode features
829 $is_zip = ( $cfg['ZipDump'] && @function_exists('gzcompress') );
830 $is_gzip = ( $cfg['GZipDump'] && @function_exists('gzencode') );
831 $is_bzip = ( $cfg['BZipDump'] && @function_exists('bzcompress') );
833 if ( $is_zip || $is_gzip || $is_bzip ) { ?>
834 <div class="formelementrow">
835 <?php echo $strCompression; ?>:
836 <input type="radio" name="compression" value="none"
837 id="radio_compression_none"
838 onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
839 <?php PMA_exportIsActive('compression', 'none'); ?> />
840 <label for="radio_compression_none"><?php echo $strNone; ?></label>
841 <?php
842 if ($is_zip) { ?>
843 <input type="radio" name="compression" value="zip"
844 id="radio_compression_zip"
845 onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
846 <?php PMA_exportIsActive('compression', 'zip'); ?> />
847 <label for="radio_compression_zip"><?php echo $strZip; ?></label>
848 <?php } if ($is_gzip) { ?>
849 <input type="radio" name="compression" value="gzip"
850 id="radio_compression_gzip"
851 onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
852 <?php PMA_exportIsActive('compression', 'gzip'); ?> />
853 <label for="radio_compression_gzip"><?php echo $strGzip; ?></label>
854 <?php } if ($is_bzip) { ?>
855 <input type="radio" name="compression" value="bzip"
856 id="radio_compression_bzip"
857 onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
858 <?php PMA_exportIsActive('compression', 'bzip2'); ?> />
859 <label for="radio_compression_bzip"><?php echo $strBzip; ?></label>
860 <?php } ?>
861 </div>
862 <?php } else { ?>
863 <input type="hidden" name="compression" value="none" />
864 <?php } ?>
865 </fieldset>
867 <?php if (function_exists('PMA_set_enc_form')) { ?>
868 <!-- Encoding setting form appended by Y.Kawada -->
869 <!-- Japanese encoding setting -->
870 <fieldset>
871 <?php echo PMA_set_enc_form(' '); ?>
872 </fieldset>
873 <?php } ?>
875 <fieldset class="tblFooters">
876 <input type="submit" value="<?php echo $strGo; ?>" id="buttonGo" />
877 </fieldset>
878 </form>
880 <div class="notice">
881 <sup id="FileNameTemplateHelp" name="FileNameTemplateHelp">(1)</sup> <?php echo sprintf($strFileNameTemplateHelp,
882 '<a href="http://www.php.net/strftime" target="documentation" title="'
883 . $strDocu . '">', '</a>'); ?>
884 </div>