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