function readImportFolder($fileprefix) { $folder = ''; $folder = readFilteredFolder(getImportDir(), $fileprefix); usort($folder, 'compareFiles'); return $folder; }
// all files in files with .sql als endung $dir = $REX[INCLUDE_PATH] . "/addons/{$page}/files"; sort($folder = readFilteredFolder($dir, ".sql")); foreach ($folder as $file) { $filec = date("d.m.Y H:i", filectime($dir . '/' . $file)); echo "<tr>\n <td class=lgrey>{$file}</td>\n <td class=lgrey>{$filec}</td>\n <td class=lgrey><a href=index.php?page={$page}&function=dbimport&impname={$file}>" . $I18N_ADDON->msg("import") . "</a></td>\n <td class=lgrey><a href=index.php?page={$page}&function=delete&impname={$file}>" . $I18N_ADDON->msg("delete") . "</a></td></tr>"; } echo "</table>"; // FILE IMPORT echo "<br><table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>\n\t<tr><td align=left colspan=2 class=lgrey>" . $I18N_ADDON->msg("files") . "</td>\n\t<form action=index.php method=post enctype='multipart/form-data'>\n\t<input type=hidden name=page value={$page}>\n\t<tr>\n\t\t<td class=lgrey><input type=file name=FORM[fileimport]></td>\n\t\t<td class=lgrey width=130><input type=submit value='" . $I18N_ADDON->msg("db_import") . "'></td>\n\t</tr>\n\t</form>\n\t</table>"; echo "<br><table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>"; echo "<tr><td align=left class=lgrey>" . $I18N_ADDON->msg("filename") . "</td><td width=60 class=lgrey>" . $I18N_ADDON->msg("createdate") . "</td><td width=60 class=lgrey> </td><td width=60 class=lgrey> </td>"; // FILE IMPORT LIST // all files in files with .tar.gz als endung $dir = $REX[INCLUDE_PATH] . "/addons/{$page}/files"; sort($folder = readFilteredFolder($dir, ".tar.gz")); foreach ($folder as $file) { $filec = date("d.m.Y H:i", filectime($dir . '/' . $file)); echo "<tr>\n <td class=lgrey>{$file}</td>\n <td class=lgrey>{$filec}</td>\n <td class=lgrey><a href=index.php?page={$page}&function=fileimport&impname={$file}>" . $I18N_ADDON->msg("import") . "</a></td>\n <td class=lgrey><a href=index.php?page={$page}&function=delete&impname={$file}>" . $I18N_ADDON->msg("delete") . "</a></td></tr>"; } echo "</table><br>"; // ----------------------------------------------------------------- /IMPORT ?> </td><td class=dgrey valign=top><?php // ----------------------------------------------------------------- EXPORT echo "<br>" . $I18N_ADDON->msg("intro_export") . "<br><br>"; echo "<table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>\n\t\n\t<form action=index.php method=post enctype='multipart/form-data'>\n\t<input type=hidden name=page value={$page}>\n\t<input type=hidden name=function value=export>\t\n\t\n\t"; $checkedsql = ""; $checkedfiles = ""; if ($exporttype == "files") { $checkedfiles = " checked";