home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / display_export.lib.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  28.9 KB  |  589 lines

  1. <?php
  2. /* $Id: display_export.lib.php,v 2.2 2003/11/26 22:52:23 rabus 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. function PMA_exportCheckboxCheck($str) {
  10.     if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
  11.         echo ' checked="checked"';
  12.     }
  13. }
  14.  
  15. function PMA_exportIsActive($what, $val) {
  16.     if (isset($GLOBALS['cfg']['Export'][$what]) &&  $GLOBALS['cfg']['Export'][$what] == $val) {
  17.         echo ' checked="checked"';
  18.     }
  19. }
  20.  
  21. ?>
  22. <form method="post" action="export.php" name="dump">
  23. <?php
  24. $hide_structure = false;
  25. $hide_sql       = false;
  26. $hide_xml       = empty($db);
  27. if ($export_type == 'server') {
  28.     echo PMA_generate_common_hidden_inputs('', '', 1);
  29. } elseif ($export_type == 'database') {
  30.     echo PMA_generate_common_hidden_inputs($db, '', 1);
  31. } else {
  32.     echo PMA_generate_common_hidden_inputs($db, $table, 1);
  33.     if (!isset($single_table)) {
  34.         $hide_structure = true;
  35.         $hide_sql       = true;
  36.     }
  37. }
  38. echo '    <input type="hidden" name="export_type" value="' . $export_type . '" />';
  39.  
  40. if (isset($sql_query)) {
  41.     echo '    <input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';
  42. }
  43.     ?>
  44.  
  45.     <script type="text/javascript">
  46.     <!--
  47.     function hide_them_all() {
  48.         getElement("csv_options").style.display = 'none';
  49.         getElement("excel_options").style.display = 'none';
  50.         getElement("latex_options").style.display = 'none';
  51. <?php if (!$hide_sql) { ?>
  52.         getElement("sql_options").style.display = 'none';
  53. <?php } ?>
  54.         getElement("none_options").style.display = 'none';
  55.     }
  56.  
  57.     function show_checked_option() {
  58.         hide_them_all();
  59.         if (getElement('radio_dump_latex').checked) {
  60.             getElement('latex_options').style.display = 'block';
  61. <?php if (!$hide_sql) { ?>
  62.         } else if (getElement('radio_dump_sql').checked) {
  63.             getElement('sql_options').style.display = 'block';
  64. <?php } ?>
  65. <?php if (!$hide_xml) { ?>
  66.         } else if (getElement('radio_dump_xml').checked) {
  67.             getElement('none_options').style.display = 'block';
  68. <?php } ?>
  69.         } else if (getElement('radio_dump_csv').checked) {
  70.             getElement('csv_options').style.display = 'block';
  71.         } else if (getElement('radio_dump_excel').checked) {
  72.             getElement('excel_options').style.display = 'block';
  73.         } else {
  74.             if (getElement('radio_dump_sql')) {
  75.                 getElement('radio_dump_sql').checked = true;
  76.                 getElement('sql_options').style.display = 'block';
  77.             } else if (getElement('radio_dump_csv')) {
  78.                 getElement('radio_dump_csv').checked = true;
  79.                 getElement('csv_options').style.display = 'block';
  80.             } else {
  81.                 getElement('none_options').style.display = 'block';
  82.             }
  83.         }
  84.     }
  85.     //-->
  86.     </script>
  87.  
  88.     <table cellpadding="5" border="0" cellspacing="0" align="center">
  89.     <tr>
  90.  
  91.         <!-- Formats to export to -->
  92.         <td nowrap="nowrap" valign="top" onclick="if (typeof(window.opera) != 'undefined')setTimeout('show_checked_option()', 1); return true">
  93.             <fieldset <?php echo ((!isset($multi_values) || isset($multi_values) && $multi_values == '') ? 'style="height: 220px;"' : ''); ?>>
  94.             <legend><?php echo $strExport; ?></legend>
  95.             <br>
  96.             <?php
  97.             if (isset($multi_values) && $multi_values != '') {
  98.                 echo $multi_values;
  99.             }
  100.             ?>
  101.  
  102. <?php if (!$hide_sql) { ?>
  103.             <!-- SQL -->
  104.             <input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if(this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> />
  105.             <label for="radio_dump_sql"><?php echo $strSQL; ?></label>
  106.             <br /><br />
  107. <?php } ?>
  108.  
  109.             <!-- LaTeX table -->
  110.             <input type="radio" name="what" value="latex" id="radio_dump_latex"  onclick="if(this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> />
  111.             <label for="radio_dump_latex"><?php echo $strLaTeX; ?></label>
  112.             <br /><br />
  113.  
  114.             <!-- Excel CSV -->
  115.             <input type="radio" name="what" value="excel" id="radio_dump_excel"  onclick="if(this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> />
  116.             <label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label>
  117.             <br /><br />
  118.             <!-- General CSV -->
  119.             <input type="radio" name="what" value="csv" id="radio_dump_csv"  onclick="if(this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> />
  120.             <label for="radio_dump_csv"><?php echo $strStrucCSV;?></label>
  121.  
  122.  
  123. <?php if (!$hide_xml) { ?>
  124.             <br /><br />
  125.  
  126.             <!-- XML -->
  127.             <input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if(this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> />
  128.             <label for="radio_dump_xml"><?php echo $strXML; ?></label>  
  129. <?php } ?>
  130.             </fieldset>
  131.         </td>
  132.         <!-- Options -->
  133.         <td valign="top" id="options_td" width="400">
  134.  
  135. <?php if (!$hide_sql) { ?>
  136.             <!-- SQL options -->
  137.             <fieldset id="sql_options">
  138.                 <legend><?php echo $strSQLOptions; ?> (<a href="./Documentation.html#faqexport" target="documentation"><?php echo $strDocu; ?></a>)</legend>
  139. <?php
  140. if ($export_type == 'server') {
  141. ?>
  142.                 <!-- For databases -->
  143.                 <fieldset>
  144.                     <legend>
  145.                         <?php echo $strDatabaseExportOptions; ?>
  146.                     </legend>
  147.                     <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" <?php PMA_exportCheckboxCheck('sql_drop_database'); ?> />
  148.                     <label for="checkbox_drop_database"><?php echo $strAddDropDatabase; ?></label><br />
  149.                 </fieldset>
  150. <?php
  151. }
  152. ?>
  153. <?php if (!$hide_structure) { ?>
  154.                 <!-- For structure -->
  155.                 <fieldset>
  156.                     <legend>
  157.                         <input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if(!this.checked && !getElement('checkbox_sql_data').checked) return false; else return true;" />
  158.                         <label for="checkbox_sql_structure"><?php echo $strStructure; ?></label><br />
  159.                     </legend>
  160.  
  161.                     <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop" <?php PMA_exportCheckboxCheck('sql_drop_table'); ?> />
  162.                     <label for="checkbox_dump_drop"><?php echo $strStrucDrop; ?></label><br />
  163.                     <input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" <?php PMA_exportCheckboxCheck('sql_auto_increment'); ?> />
  164.                     <label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br />
  165.                     <input type="checkbox" name="use_backquotes" value="1" id="checkbox_dump_use_backquotes" <?php PMA_exportCheckboxCheck('sql_backquotes'); ?> />
  166.                     <label for="checkbox_dump_use_backquotes"><?php echo $strUseBackquotes; ?></label><br />
  167.                     <fieldset>
  168.                         <legend><?php echo $strAddIntoComments; ?></legend>
  169.                         <input type="checkbox" name="sql_dates" value="yes" id="checkbox_sql_dates" <?php PMA_exportCheckboxCheck('sql_dates'); ?> />
  170.                         <label for="checkbox_sql_dates"><?php echo $strCreationDates; ?></label><br />
  171. <?php
  172. if (!empty($cfgRelation['relation'])) {
  173. ?>
  174.                         <input type="checkbox" name="sql_relation" value="yes" id="checkbox_sql_use_relation" <?php PMA_exportCheckboxCheck('sql_relation'); ?> />
  175.                         <label for="checkbox_sql_use_relation"><?php echo $strRelations; ?></label><br />
  176. <?php
  177.  } // end relation
  178.  
  179. if (!empty($cfgRelation['commwork'])) {
  180. ?>
  181.                         <input type="checkbox" name="sql_comments" value="yes" id="checkbox_sql_use_comments" <?php PMA_exportCheckboxCheck('sql_comments'); ?> />
  182.                         <label for="checkbox_sql_use_comments"><?php echo $strComments; ?></label><br />
  183. <?php
  184. } // end comments
  185.  
  186. if ($cfgRelation['mimework']) {
  187.      ?>
  188.                         <input type="checkbox" name="sql_mime" value="yes" id="checkbox_sql_use_mime" <?php PMA_exportCheckboxCheck('sql_mime'); ?> />
  189.                         <label for="checkbox_sql_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  190. <?php
  191. } // end MIME
  192. ?>
  193.                      </fieldset>
  194.                 </fieldset>
  195. <?php } ?>
  196.  
  197.                 <!-- For data -->
  198.                 <fieldset>
  199.                     <legend>
  200.                         <input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?> onclick="if(!this.checked && (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" />
  201.                         <label for="checkbox_sql_data"><?php echo $strData; ?></label><br />
  202.                     </legend>
  203.                     <input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" <?php PMA_exportCheckboxCheck('sql_columns'); ?> />
  204.                     <label for="checkbox_dump_showcolumns"><?php echo $strCompleteInserts; ?></label><br />
  205.                     <input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" <?php PMA_exportCheckboxCheck('sql_extended'); ?> />
  206.                     <label for="checkbox_dump_extended_ins"><?php echo $strExtendedInserts; ?></label><br />
  207.                     <input type="checkbox" name="delayed" value="yes" id="checkbox_dump_delayed" <?php PMA_exportCheckboxCheck('sql_delayed'); ?> />
  208.                     <label for="checkbox_dump_delayed"><?php echo $strDelayedInserts; ?></label><br />
  209.  
  210.                     <label for="select_sql_type">
  211.                         <?php echo $strSQLExportType; ?>: 
  212.                     </label>
  213.                     <select name="sql_type" id="select_sql_type" />
  214.                         <option value="insert"<?php echo $cfg['Export']['sql_type'] == 'insert' ? ' selected="selected"' : ''; ?>>INSERT</option>
  215.                         <option value="update"<?php echo $cfg['Export']['sql_type'] == 'update' ? ' selected="selected"' : ''; ?>>UPDATE</option>
  216.                         <option value="replace"<?php echo $cfg['Export']['sql_type'] == 'replace' ? ' selected="selected"' : ''; ?>>REPLACE</option>
  217.                     </select>
  218.                 </fieldset>
  219.             </fieldset>
  220. <?php } ?>
  221.  
  222.              <!-- LaTeX options -->
  223.              <fieldset id="latex_options">
  224.                  <legend><?php echo $strLaTeXOptions; ?></legend>
  225.  
  226.                      <input type="checkbox" name="latex_caption" value="yes" id="checkbox_latex_show_caption" <?php PMA_exportCheckboxCheck('latex_caption'); ?> />
  227.                      <label for="checkbox_latex_show_caption"><?php echo $strLatexIncludeCaption; ?></label><br />
  228.  
  229. <?php if (!$hide_structure) { ?>
  230.                  <!-- For structure -->
  231.                  <fieldset>
  232.                      <legend>
  233.                          <input type="checkbox" name="latex_structure" value="structure" id="checkbox_latex_structure" <?php PMA_exportCheckboxCheck('latex_structure'); ?> onclick="if(!this.checked && !getElement('checkbox_latex_data').checked) return false; else return true;" />
  234.                          <label for="checkbox_latex_structure"><?php echo $strStructure; ?></label><br />
  235.                      </legend>
  236.                     <table border="0" cellspacing="1" cellpadding="0">
  237.                         <tr>
  238.                             <td>
  239.                                 <?php echo $strLatexCaption; ?> 
  240.                             </td>
  241.                             <td>
  242.                                 <input type="text" name="latex_structure_caption" size="30" value="<?php echo $strLatexStructure; ?>" class="textfield" />
  243.                             </td>
  244.                         </tr>
  245.                         <tr>
  246.                             <td>
  247.                                 <?php echo $strLatexContinuedCaption; ?> 
  248.                             </td>
  249.                             <td>
  250.                                 <input type="text" name="latex_structure_continued_caption" size="30" value="<?php echo $strLatexStructure . ' ' . $strLatexContinued; ?>" class="textfield" />
  251.                             </td>
  252.                         </tr>
  253.                         <tr>
  254.                             <td>
  255.                                 <?php echo $strLatexLabel; ?> 
  256.                             </td>
  257.                             <td>
  258.                                 <input type="text" name="latex_structure_label" size="30" value="<?php echo $cfg['Export']['latex_structure_label']; ?>" class="textfield" />
  259.                             </td>
  260.                         </tr>
  261.                     </table>
  262. <?php
  263. if (!empty($cfgRelation['relation'])) {
  264. ?>
  265.                      <input type="checkbox" name="latex_relation" value="yes" id="checkbox_latex_use_relation" <?php PMA_exportCheckboxCheck('latex_relation'); ?> />
  266.                      <label for="checkbox_latex_use_relation"><?php echo $strRelations; ?></label><br />
  267. <?php
  268.  } // end relation
  269.  
  270. if ($cfgRelation['commwork']) {
  271.      ?>
  272.                      <input type="checkbox" name="latex_comments" value="yes" id="checkbox_latex_use_comments" <?php PMA_exportCheckboxCheck('latex_comments'); ?> />
  273.                      <label for="checkbox_latex_use_comments"><?php echo $strComments; ?></label><br />
  274. <?php
  275. } // end comments
  276.  
  277. if ($cfgRelation['mimework']) {
  278.      ?>
  279.                      <input type="checkbox" name="latex_mime" value="yes" id="checkbox_latex_use_mime" <?php PMA_exportCheckboxCheck('latex_mime'); ?> />
  280.                      <label for="checkbox_latex_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  281. <?php
  282. } // end MIME
  283. ?>
  284.                  </fieldset>
  285. <?php } ?>
  286.  
  287.                  <!-- For data -->
  288.                  <fieldset>
  289.                      <legend>
  290.                          <input type="checkbox" name="latex_data" value="data" id="checkbox_latex_data" <?php PMA_exportCheckboxCheck('latex_data'); ?> onclick="if(!this.checked && (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" />
  291.                          <label for="checkbox_latex_data"><?php echo $strData; ?></label><br />
  292.                      </legend>
  293.                      <input type="checkbox" name="latex_showcolumns" value="yes" id="ch_latex_showcolumns" <?php PMA_exportCheckboxCheck('latex_columns'); ?> />
  294.                      <label for="ch_latex_showcolumns"><?php echo $strColumnNames; ?></label><br />
  295.                     <table border="0" cellspacing="1" cellpadding="0">
  296.                         <tr>
  297.                             <td>
  298.                                 <?php echo $strLatexCaption; ?> 
  299.                             </td>
  300.                             <td>
  301.                                 <input type="text" name="latex_data_caption" size="30" value="<?php echo $strLatexContent; ?>" class="textfield" />
  302.                             </td>
  303.                         </tr>
  304.                         <tr>
  305.                             <td>
  306.                                 <?php echo $strLatexContinuedCaption; ?> 
  307.                             </td>
  308.                             <td>
  309.                                 <input type="text" name="latex_data_continued_caption" size="30" value="<?php echo $strLatexContent . ' ' . $strLatexContinued; ?>" class="textfield" />
  310.                             </td>
  311.                         </tr>
  312.                         <tr>
  313.                             <td>
  314.                                 <?php echo $strLatexLabel; ?> 
  315.                             </td>
  316.                             <td>
  317.                                 <input type="text" name="latex_data_label" size="30" value="<?php echo $cfg['Export']['latex_data_label']; ?>" class="textfield" />
  318.                             </td>
  319.                         </tr>
  320.                         <tr>
  321.                             <td>
  322.                                 <?php echo $strReplaceNULLBy; ?> 
  323.                             </td>
  324.                             <td>
  325.                                 <input type="text" name="latex_replace_null" size="20" value="<?php echo $cfg['Export']['latex_null']; ?>" class="textfield" />
  326.                             </td>
  327.                         </tr>
  328.                     </table>
  329.                  </fieldset>
  330.              </fieldset>
  331.  
  332.              <!-- CSV options -->
  333.             <fieldset id="csv_options">
  334.                 <legend><?php echo $strCSVOptions; ?></legend>
  335.                 <input type="hidden" name="csv_data" value="csv_data" />
  336.                 <table border="0" cellspacing="1" cellpadding="0">
  337.                     <tr>
  338.                         <td>
  339.                             <?php echo $strFieldsTerminatedBy; ?> 
  340.                         </td>
  341.                         <td>
  342.                             <input type="text" name="separator" size="2" value="<?php echo $cfg['Export']['csv_separator']; ?>" class="textfield" />
  343.                         </td>
  344.                     </tr>
  345.                     <tr>
  346.                         <td>
  347.                             <?php echo $strFieldsEnclosedBy; ?> 
  348.                         </td>
  349.                         <td>
  350.                             <input type="text" name="enclosed" size="2" value="<?php echo $cfg['Export']['csv_enclosed']; ?>" class="textfield" />
  351.                         </td>
  352.                     </tr>
  353.                     <tr>
  354.                         <td>
  355.                             <?php echo $strFieldsEscapedBy; ?> 
  356.                         </td>
  357.                         <td>
  358.                             <input type="text" name="escaped" size="2" value="<?php echo $cfg['Export']['csv_escaped']; ?>" class="textfield" />
  359.                         </td>
  360.                     </tr>
  361.                     <tr>
  362.                         <td>
  363.                             <?php echo $strLinesTerminatedBy; ?> 
  364.                         </td>
  365.                         <td>
  366.                             <input type="text" name="add_character" size="2" value="<?php if ($cfg['Export']['csv_terminated'] == 'AUTO') echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); else echo $cfg['Export']['csv_terminated']; ?>" class="textfield" />
  367.                         </td>
  368.                     </tr>
  369.                     <tr>
  370.                         <td>
  371.                             <?php echo $strReplaceNULLBy; ?> 
  372.                         </td>
  373.                         <td>
  374.                             <input type="text" name="csv_replace_null" size="20" value="<?php echo $cfg['Export']['csv_null']; ?>" class="textfield" />
  375.                         </td>
  376.                     </tr>
  377.                 </table>
  378.                 <input type="checkbox" name="showcsvnames" value="yes" id="checkbox_dump_showcsvnames" <?php PMA_exportCheckboxCheck('csv_columns'); ?> />
  379.                 <label for="checkbox_dump_showcsvnames"><?php echo $strPutColNames; ?></label>
  380.             </fieldset>
  381.  
  382.             <!-- Excel options -->
  383.             <fieldset id="excel_options">
  384.                 <legend><?php echo $strExcelOptions; ?></legend>
  385.                 <input type="hidden" name="excel_data" value="excel_data" />
  386.                 <table border="0" cellspacing="1" cellpadding="0">
  387.                     <tr>
  388.                         <td>
  389.                             <?php echo $strReplaceNULLBy; ?> 
  390.                         </td>
  391.                         <td>
  392.                             <input type="text" name="excel_replace_null" size="20" value="<?php echo $cfg['Export']['excel_null']; ?>" class="textfield" />
  393.                         </td>
  394.                     </tr>
  395.                     <tr>
  396.                         <td colspan="2">
  397.                             <input type="checkbox" name="showexcelnames" value="yes" id="checkbox_dump_showexcelnames" <?php PMA_exportCheckboxCheck('excel_columns'); ?> />
  398.                             <label for="checkbox_dump_showexcelnames"><?php echo $strPutColNames; ?></label>
  399.                         </td>
  400.                     </tr>
  401.                     <tr>
  402.                         <td>
  403.                             <label for="select_excel_edition">
  404.                                 <?php echo $strExcelEdition; ?>: 
  405.                             </label>
  406.                         </td>
  407.                         <td>
  408.                             <select name="excel_edition" id="select_excel_edition" />
  409.                                 <option value="win"<?php echo $cfg['Export']['excel_edition'] == 'win' ? ' selected="selected"' : ''; ?>>Windows</option>
  410.                                 <option value="mac"<?php echo $cfg['Export']['excel_edition'] == 'mac' ? ' selected="selected"' : ''; ?>>Macintosh</option>
  411.                             </select>
  412.                         </td>
  413.                     </tr>
  414.                 </table>
  415.             </fieldset>
  416.  
  417.             <fieldset id="none_options">
  418.                 <legend><?php echo $strNoOptions; ?></legend>
  419.                 <input type="hidden" name="xml_data" value="xml_data" />
  420.             </fieldset>
  421.  
  422.             <script type="text/javascript">
  423.             <!--
  424.                 show_checked_option();
  425.             //-->
  426.             </script>
  427.         </td>
  428.     </tr>
  429.  
  430. <?php
  431. if (isset($table) && !empty($table) && !isset($num_tables)) {
  432. ?>
  433.     <tr>
  434.         <td colspan="2" align="center">
  435.             <fieldset>
  436.                 <?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"; ?>
  437.             </fieldset>
  438.         </td>
  439.     </tr>
  440. <?php
  441. }
  442. ?>
  443.  
  444.     <tr>
  445.         <!-- Export to screen or to file -->
  446.         <td colspan="2">
  447.             <fieldset>
  448.                 <legend>
  449.                     <input type="checkbox" name="asfile" value="sendit" id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> />
  450.                     <label for="checkbox_dump_asfile"><?php echo $strSend; ?></label>
  451.                 </legend>
  452.  
  453.                 <?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
  454.                 <input type="checkbox" name="onserver" value="saveit" id="checkbox_dump_onserver"  onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver'); ?> />
  455.                 <label for="checkbox_dump_onserver"><?php echo sprintf($strSaveOnServer, htmlspecialchars($cfg['SaveDir'])); ?></label>,
  456.                 <input type="checkbox" name="onserverover" value="saveitover" id="checkbox_dump_onserverover"  onclick="getElement('checkbox_dump_onserver').checked = true;getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
  457.                 <label for="checkbox_dump_onserverover"><?php echo $strOverwriteExisting; ?></label>
  458.                 <br />
  459.                 <?php } ?>
  460.  
  461.                 <?php echo $strFileNameTemplate; ?> :
  462.                 <input type="text" name="filename_template"
  463.                 <?php
  464.                     echo ' value="';
  465.                     if ($export_type == 'database') {
  466.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
  467.                             echo $_COOKIE['pma_db_filename_template'];
  468.                         } else {
  469.                             echo '__DB__';
  470.                         }
  471.                     } elseif ($export_type == 'table') {
  472.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
  473.                             echo $_COOKIE['pma_table_filename_template'];
  474.                         } else {
  475.                             echo '__TABLE__';
  476.                         }
  477.                     } else {
  478.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
  479.                             echo $_COOKIE['pma_server_filename_template'];
  480.                         } else {
  481.                             echo '__SERVER__';
  482.                         }
  483.                     }
  484.                     echo '" ';
  485.                 ?>
  486.                 />
  487.                 (
  488.                 <input type="checkbox" name="remember_template" id="checkbox_remember_template" <?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
  489.                 <label for="checkbox_remember_template"><?php echo $strFileNameTemplateRemember; ?></label>
  490.                 )*
  491.  
  492.                 <?php
  493.                 // charset of file
  494.                 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
  495.                     echo '<br /><label for="select_charset_of_file">' . $strCharsetOfFile . '</label>';
  496.                     echo "\n";
  497.  
  498.                     $temp_charset = reset($cfg['AvailableCharsets']);
  499.                     echo '<select id="select_charset_of_file" name="charset_of_file" size="1">' . "\n"
  500.                             . '                <option value="' . $temp_charset . '"';
  501.                     if ($temp_charset == $charset) {
  502.                         echo ' selected="selected"';
  503.                     }
  504.                     echo '>' . $temp_charset . '</option>' . "\n";
  505.                     while ($temp_charset = next($cfg['AvailableCharsets'])) {
  506.                         echo '                <option value="' . $temp_charset . '"';
  507.                         if ($temp_charset == $charset) {
  508.                             echo ' selected="selected"';
  509.                         }
  510.                         echo '>' . $temp_charset . '</option>' . "\n";
  511.                     } // end while
  512.                     echo '            </select>';
  513.                 } // end if
  514.                 echo "\n";
  515.                 ?>
  516.  
  517.                 <fieldset>
  518.                     <legend><?php echo $strCompression; ?></legend>
  519.  
  520.                     <input type="radio" name="compression" value="none" id="radio_compression_none" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'none'); ?> />
  521.                     <label for="radio_compression_none"><?php echo $strNone; ?></label> 
  522.  
  523. <?php
  524.  
  525. // zip, gzip and bzip2 encode features
  526. $is_zip  = (isset($cfg['ZipDump']) && $cfg['ZipDump'] && @function_exists('gzcompress'));
  527. $is_gzip = (isset($cfg['GZipDump']) && $cfg['GZipDump'] && @function_exists('gzencode'));
  528. $is_bzip = (isset($cfg['BZipDump']) && $cfg['BZipDump'] && @function_exists('bzcompress'));
  529. if ($is_zip || $is_gzip || $is_bzip) {
  530.     if ($is_zip) {
  531.         ?>
  532.                 <input type="radio" name="compression" value="zip" id="radio_compression_zip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'zip'); ?> />
  533.                 <label for="radio_compression_zip"><?php echo $strZip; ?></label><?php echo (($is_gzip || $is_bzip) ? ' ' : ''); ?>
  534.         <?php
  535.     }
  536.     if ($is_gzip) {
  537.         echo "\n"
  538.         ?>
  539.                 <input type="radio" name="compression" value="gzip" id="radio_compression_gzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'gzip'); ?> />
  540.                 <label for="radio_compression_gzip"><?php echo $strGzip; ?></label><?php echo ($is_bzip ? ' ' : ''); ?>
  541.         <?php
  542.     }
  543.     if ($is_bzip) {
  544.         echo "\n"
  545.         ?>
  546.                 <input type="radio" name="compression" value="bzip" id="radio_compression_bzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'bzip'); ?> />
  547.                 <label for="radio_compression_bzip"><?php echo $strBzip; ?></label>
  548.         <?php
  549.     }
  550. }
  551. echo "\n";
  552. ?>
  553.             </fieldset>
  554.         </td>
  555.     </tr>
  556.  
  557. <?php
  558. // Encoding setting form appended by Y.Kawada
  559. if (function_exists('PMA_set_enc_form')) {
  560.     ?>
  561.     <tr>
  562.         <!-- Japanese encoding setting -->
  563.         <td colspan="2" align="center">
  564.     <?php
  565.     echo PMA_set_enc_form('            ');
  566.     ?>
  567.         </td>
  568.     </tr>
  569.     <?php
  570. }
  571. echo "\n";
  572. ?>
  573.     <tr>
  574.         <td colspan="2" align="center">
  575.             <input type="submit" value="<?php echo $strGo; ?>" />
  576.         </td>
  577.     </tr>
  578.     </table>
  579. </form>
  580. <table align="center">
  581. <tr>
  582.     <td valign="top">* </td>
  583.     <td>
  584.         <?php echo sprintf($strFileNameTemplateHelp, '<a href="http://www.php.net/manual/function.strftime.php" target="documentation">', '</a>') . "\n"; ?>
  585.  
  586.     </td>
  587. </tr>
  588. </table>
  589.