Documentation TYPO3 par Ameos |
00001 <?php 00002 /* $Id: ldi_table.php,v 2.3 2003/12/13 13:20:06 lem9 Exp $ */ 00003 // vim: expandtab sw=4 ts=4 sts=4: 00004 00005 00010 require_once('./libraries/grab_globals.lib.php'); 00011 00012 // Check parameters 00013 require_once('./libraries/common.lib.php'); 00014 PMA_checkParameters(array('db', 'table')); 00015 00016 00020 require('./tbl_properties_common.php'); 00021 $err_url = 'ldi_table.php' . $err_url; 00022 $url_query .= '&goto=ldi_table.php&back=ldi_table.php'; 00023 require('./tbl_properties_table_info.php'); 00024 00028 ?> 00029 <form action="ldi_check.php" method="post" enctype="multipart/form-data"> 00030 <table cellpadding="5" border="2"> 00031 <tr> 00032 <td><?php echo $strLocationTextfile; ?></td> 00033 <td colspan="2"><input type="file" name="textfile" /> 00034 <?php 00035 echo PMA_displayMaximumUploadSize($max_upload_size); 00036 // some browsers should respect this :) 00037 echo ' ' . PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; 00038 00039 if (!empty($cfg['UploadDir'])) { 00040 if (substr($cfg['UploadDir'], -1) != '/') { 00041 $cfg['UploadDir'] .= '/'; 00042 } 00043 if ($handle = @opendir($cfg['UploadDir'])) { 00044 $is_first = 0; 00045 while ($file = @readdir($handle)) { 00046 if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.csv') { 00047 if ($is_first == 0) { 00048 $is_upload_dir = true; 00049 echo "<br />\n"; 00050 echo ' <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . ' : ' . "\n"; 00051 echo ' <div style="margin-bottom: 5px">' . "\n"; 00052 echo ' <select size="1" name="local_textfile">' . "\n"; 00053 echo ' <option value="" selected="selected"></option>' . "\n"; 00054 } // end if (is_first) 00055 echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n"; 00056 $is_first++; 00057 } // end if (is_file) 00058 } // end while 00059 if ($is_first > 0) { 00060 echo ' </select>' . "\n" 00061 . ' </div>' . "\n\n"; 00062 } // end if (isfirst > 0) 00063 @closedir($handle); 00064 } else { 00065 echo ' <div style="margin-bottom: 5px">' . "\n"; 00066 echo ' <font color="red">' . $strError . '</font><br />' . "\n"; 00067 echo ' ' . $strWebServerUploadDirectoryError . "\n"; 00068 echo ' </div>' . "\n"; 00069 } 00070 } // end if (web-server upload directory) 00071 echo "\n"; 00072 ?> 00073 </td> 00074 </tr> 00075 00076 <?php 00077 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) { 00078 $temp_charset = reset($cfg['AvailableCharsets']); 00079 echo ' <tr>' . "\n" 00080 . ' <td>' . $strCharsetOfFile . '</td>' . "\n" 00081 . ' <td colspan="2">' . "\n" 00082 . ' <select name="charset_of_file" size="1">' . "\n" 00083 . ' <option value="' . $temp_charset . '"'; 00084 if ($temp_charset == $charset) { 00085 echo ' selected="selected"'; 00086 } 00087 echo '>' . $temp_charset . '</option>' . "\n"; 00088 while ($temp_charset = next($cfg['AvailableCharsets'])) { 00089 echo ' <option value="' . $temp_charset . '"'; 00090 if ($temp_charset == $charset) { 00091 echo ' selected="selected"'; 00092 } 00093 echo '>' . $temp_charset . '</option>' . "\n"; 00094 } // end while 00095 echo ' </select>' . "\n"; 00096 echo ' </td>' . "\n"; 00097 echo ' </tr>'; 00098 } // end if 00099 echo "\n"; 00100 ?> 00101 <tr> 00102 <td><?php echo $strReplaceTable; ?></td> 00103 <td><input type="checkbox" name="replace" value="REPLACE" id="checkbox_replace" /><?php echo $strReplace; ?></td> 00104 <td><label for="checkbox_replace"><?php echo $strTheContents; ?></label></td> 00105 </tr> 00106 <tr> 00107 <td><?php echo $strFieldsTerminatedBy; ?></td> 00108 <td><input type="text" name="field_terminater" size="2" maxlength="2" value=";" /></td> 00109 <td><?php echo $strTheTerminator; ?></td> 00110 </tr> 00111 <tr> 00112 <td><?php echo $strFieldsEnclosedBy; ?></td> 00113 <td> 00114 <input type="text" name="enclosed" size="1" maxlength="1" value=""" /> 00115 <input type="checkbox" name="enclose_option" value="OPTIONALLY" id="checkbox_enclose_option" /> 00116 <label for="checkbox_enclose_option"><?php echo $strOptionally; ?></label> 00117 </td> 00118 <td><?php echo $strOftenQuotation; ?></td> 00119 </tr> 00120 <tr> 00121 <td><?php echo $strFieldsEscapedBy; ?></td> 00122 <td><input type="text" name="escaped" size="2" maxlength="2" value="\" /></td> 00123 <td><?php echo $strOptionalControls; ?></td> 00124 </tr> 00125 <tr> 00126 <td><?php echo $strLinesTerminatedBy; ?></td> 00127 <td><input type="text" name="line_terminator" size="8" maxlength="8" value="<?php echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); ?>" /></td> 00128 <td><?php echo $strCarriage; ?><br /><?php echo $strLineFeed; ?></td> 00129 </tr> 00130 <tr> 00131 <td><?php echo $strColumnNames; ?></td> 00132 <td><input type="text" name="column_name" /></td> 00133 <td><?php echo $strIfYouWish; ?></td> 00134 </tr> 00135 <?php 00136 // 2002/2/22 appended by Y.Kawada: Kanji encoding convert controls 00137 if (function_exists('PMA_set_enc_form')) { 00138 echo ' <tr>' . "\n" 00139 . ' <td>' . $strKanjiEncodConvert . '</td>' . "\n" 00140 . ' <td colspan=2>' . "\n" 00141 . PMA_set_enc_form(' ') 00142 . ' </td>' . "\n" 00143 . ' </tr>' . "\n"; 00144 } // end if 00145 00146 00147 // Check if we should check the LOCAL radio button by default 00148 $local_option_selected = FALSE; 00149 00150 if (PMA_MYSQL_INT_VERSION < 32349) { 00151 $local_option_selected = TRUE; 00152 } 00153 00154 if (PMA_MYSQL_INT_VERSION > 40003) { 00155 $tmp_query = "SHOW VARIABLES LIKE 'local\\_infile'"; 00156 $result = PMA_mysql_query($tmp_query); 00157 if ($result != FALSE && mysql_num_rows($result) > 0) { 00158 $tmp = PMA_mysql_fetch_row($result); 00159 if ($tmp[1] == 'ON') { 00160 $local_option_selected = TRUE; 00161 } 00162 } 00163 mysql_free_result($result); 00164 } 00165 00166 ?> 00167 <tr> 00168 <td><?php echo $strLoadMethod; ?> 00169 </td> 00170 <td> 00171 <input type="radio" id="radio_local_option_0" name="local_option" value="0" <?php echo (!$local_option_selected ? ' checked="checked" ' : ''); ?>/><label for="radio_local_option_0">...DATA</label><br /> 00172 <input type="radio" id="radio_local_option_1" name="local_option" value="1" <?php echo ($local_option_selected ? ' checked="checked" ' : ''); ?>/><label for="radio_local_option_1">...DATA LOCAL</label> 00173 </td> 00174 <td><?php echo $strLoadExplanation; ?> 00175 </td> 00176 </tr> 00177 <tr> 00178 <td colspan="3" align="center"><?php print PMA_showMySQLDocu('Reference', 'LOAD_DATA'); ?></td> 00179 </tr> 00180 <tr> 00181 <td colspan="3" align="center"> 00182 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?> 00183 <input type="hidden" name="zero_rows" value="<?php echo $strTheContent; ?>" /> 00184 <input type="hidden" name="goto" value="tbl_properties.php" /> 00185 <input type="hidden" name="back" value="ldi_table.php" /> 00186 <input type="hidden" name="into_table" value="<?php echo htmlspecialchars($table); ?>" /> 00187 <input type="submit" name="btnLDI" value="<?php echo $strSubmit; ?>" /> 00188 <input type="reset" value="<?php echo $strReset; ?>" /> 00189 </td> 00190 </tr> 00191 </table> 00192 </form> 00193 00194 00195 <?php 00199 require_once('./footer.inc.php'); 00200 ?>