' . $lang['L_IMPORT_NOTABLE'] . ''; } else { if ($_POST['import_source'] == 0) { //Import aus textbox $sql['import']['csv']=explode($sql['import']['endline'],$sql['import']['text']); } else { if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) { $aus.='' . $lang['L_FM_UPLOADFILEREQUEST'] . ''; } else { $fn=$_FILES['upfile']['tmp_name']; $sql['import']['csv']=( substr($_FILES['upfile']['name'],-3) == ".gz" ) ? gzfile($fn) : file($fn); $sql['import']['text']=implode("",$sql['import']['csv']); $aus.='' . $lang['L_SQL_UPLOADEDFILE'] . '' . $_FILES['upfile']['name'] . '   ' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . ''; } } if (is_array($sql['import']['csv'])) $aus.=DoImport(); else $aus.='
' . $lang['L_CSV_NODATA'] . ''; } } $impaus=$aus; $impaus.='
' . $nl; $impaus.=''; $impaus.='' . $lang['L_EXPORT'] . ''; $impaus.='
' . sprintf($lang['L_SQL_IMPORT'],$databases['Name'][$dbid]) . '
'; $impaus.='' . $nl; $impaus.=''; $impaus.=''; $impaus.=''; $impaus.='
' . $nl; $impaus.=$lang['L_IMPORTOPTIONS'] . '' . $lang['L_CSVOPTIONS'] . '
' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='
' . $lang['L_IMPORTTABLE'] . '
' . $lang['L_IMPORTSOURCE'] . '' . $lang['L_FROMTEXTBOX'] . '
' . $nl; $impaus.='' . $lang['L_FROMFILE'] . '
' . $lang['L_EMPTYTABLEBEFORE'] . '
' . $lang['L_CREATEAUTOINDEX'] . '
' . $nl; $impaus.='
' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='' . $nl; $impaus.='
' . $lang['L_CSV_NAMEFIRSTLINE'] . '
' . $lang['L_CSV_FIELDSEPERATE'] . '
' . $lang['L_CSV_FIELDSENCLOSED'] . '
' . $lang['L_CSV_FIELDSESCAPE'] . '
' . $lang['L_CSV_EOL'] . '
' . $lang['L_CSV_NULL'] . '
' . $nl; $impaus.='
' . $lang['L_CSV_FILEOPEN'] . ':   '; $impaus.='
' . $nl; $impaus.='

 

' . $lang['L_IMPORT'] . ':
' . $nl; $impaus.='' . $nl; echo $impaus . $nl; } else { //EXPORT $tables=0; $tblstr=""; $sql['export']['db']=$db; if (isset($_POST['f_export_submit'])) { //echo '
'.print_r($_POST,true).'

'; $sql['export']['header_sent']=""; $sql['export']['lines']=0; $sql['export']['format']=$_POST['f_export_format']; $sql['export']['ztrenn']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvztrenn']) : $_POST['f_export_csvztrenn']; $sql['endline']['ztrenn']=$sql['export']['ztrenn']; if ($sql['export']['format'] == 0) { //CSV $format=0; $sql['export']['trenn']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvtrenn']) : $_POST['f_export_csvtrenn']; $sql['export']['enc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvenc']) : $_POST['f_export_csvenc']; $sql['export']['esc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvesc']) : $_POST['f_export_csvesc']; if (empty($sql['export']['endline'])) { $sql['export']['endline']=$nl; } else { $sql['export']['endline']=str_replace('\\r',"\015",$sql['export']['endline']); $sql['export']['endline']=str_replace('\\n',"\012",$sql['export']['endline']); $sql['export']['endline']=str_replace('\\t',"\011",$sql['export']['endline']); } $sql['export']['endline']=str_replace('\\t',"\011",$sql['export']['endline']); } elseif ($sql['export']['format'] == 1) { //EXCEL $format=1; $sql['export']['trenn']=","; $sql['export']['enc']='"'; $sql['export']['esc']='"'; $sql['export']['endline']="\015\012"; } elseif ($sql['export']['format'] == 3) { //EXCEL 2003 $format=1; $sql['export']['trenn']=";"; $sql['export']['enc']='"'; $sql['export']['esc']='"'; $sql['export']['endline']="\015\012"; } elseif ($sql['export']['format'] == 4) { //XML $format=4; CheckcsvOptions(); } elseif ($sql['export']['format'] == 5) { //HTML $format=5; CheckcsvOptions(); } if ($format < 3) $sql['export']['null']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvnull' . $format]) : $_POST['f_export_csvnull' . $format]; $sql['export']['namefirstline']=( isset($_POST['f_export_namefirstline' . $format]) ) ? $_POST['f_export_namefirstline' . $format] : 0; $sql['export']['sendfile']=$_POST['f_export_sendresult']; $sql['export']['compressed']=( isset($_POST['f_export_compressed']) ) ? $_POST['f_export_compressed'] : 0; $sql['export']['exportfile']=""; $sql['export']['xmlstructure']=( isset($_POST['f_export_xmlstructure']) ) ? $_POST['f_export_xmlstructure'] : 0; $sql['export']['htmlstructure']=( isset($_POST['f_export_htmlstructure']) ) ? $_POST['f_export_htmlstructure'] : 0; //ausgewählte Tabellen if (isset($_POST['f_export_tables'])) { $sql['export']['tables']=$_POST['f_export_tables']; } } else CheckcsvOptions(); //Tabellenliste $sqlt="SHOW TABLE STATUS FROM `$db`"; $res=MSD_query($sqlt); if ($res) { $sql['export']['tablecount']=mysqli_num_rows($res); $sql['export']['recordcount']=0; for ($i=0; $i < $sql['export']['tablecount']; $i++) { $row=mysqli_fetch_array($res); $tblstr.='' . "\n"; $sql['export']['recordcount']+=$row['Rows']; } } $exaus=$aus . '

' . sprintf($lang['L_SQL_EXPORT'],$databases['Name'][$dbid]) . '

'; $exaus.='
' . $nl; $exaus.='' . $lang['L_IMPORT'] . ''; $exaus.='
' . sprintf($lang['L_SQL_EXPORT'],$databases['Name'][$dbid]) . '
'; $exaus.='' . $nl; $exaus.=''; $exaus.=''; $exaus.=''; $exaus.='
' . $lang['L_TABLES'] . '' . $lang['L_EXPORTOPTIONS'] . '' . $lang['L_EXPORT'] . '
' . $sql['export']['tablecount'] . ' ' . $lang['L_TABLES'] . ', ' . $sql['export']['recordcount'] . ' ' . $lang['L_RECORDS'] . ''; $exaus.='   ' . $lang['L_ALL'] . '  ' . $lang['L_NONE'] . '' . $nl; $exaus.='

' . $nl; $exaus.='
' . $nl; $exaus.='' . $nl; $exaus.='' . "CSV" . '   ' . $nl; $exaus.='' . "Excel" . '   ' . $nl; $exaus.='' . $lang['L_EXCEL2003'] . '
' . $nl; $exaus.='' . "XML" . '   ' . $nl; $exaus.='' . "HTML" . '

' . $nl; $exaus.='
CSV-Optionen' . $nl; $exaus.='' . $nl; $exaus.='' . $nl; $exaus.='' . $nl; $exaus.='' . $nl; $exaus.='' . $nl; $exaus.='
' . $nl; $exaus.='' . $lang['L_CSV_NAMEFIRSTLINE'] . '
' . $lang['L_CSV_FIELDSEPERATE'] . '
' . $lang['L_CSV_FIELDSENCLOSED'] . '
' . $lang['L_CSV_FIELDSESCAPE'] . '
' . $lang['L_CSV_EOL'] . '
' . $lang['L_CSV_NULL'] . '
' . $nl; $exaus.='
Excel-Optionen' . $nl; $exaus.='' . $nl; $exaus.='
'; $exaus.='' . $lang['L_CSV_NAMEFIRSTLINE'] . '
' . $lang['L_CSV_NULL'] . '
' . $nl; $exaus.='
XML-Optionen'; $exaus.=''; $exaus.='
mit Struktur
' . $nl; $exaus.='
HTML-Optionen'; $exaus.=''; $exaus.='
mit Struktur
' . $nl; $exaus.='
' . $nl; $exaus.='' . $lang['L_SHOWRESULT'] . '
' . $nl; $exaus.='' . $lang['L_SENDRESULTASFILE'] . '
' . $nl; $exaus.='
' . $lang['L_COMPRESSED'] . '

' . $nl; $exaus.='
' . $nl; $exaus.='
' . $nl; $exaus.='' . $nl; if (!$download) echo $exaus . $nl; if (isset($_POST['f_export_submit']) && isset($sql['export']['tables'])) { if (!$download) echo '

' . $lang['L_EXPORT'] . ':zeige in neuem Fenster

' . $nl; echo '' . $lang['L_EXPORTFINISHED'] . '  ' . sprintf($lang['L_EXPORTLINES'],$sql['export']['lines']) . $nl; } else { exit(); } } } ?>