示例#1
0
$import_filename = $config['root_dir'] . "/admin/imp.csv";
$vars = get_input_vars();
switch ($vars['action']) {
    case 'do_import':
        admin_html_redirect("import_f.php?action=do_real_import", $title = 'Import...', $text = 'Import processing may take some time, please be patient');
        break;
    case 'do_real_import':
        $vars = $_SESSION['import_vars'];
        check_demo();
        do_import();
        print "<br /><strong>Import finsihed. {$total_added} records added</strong><br />\n        Please don't forget to remove import file amember/admin/imp.csv";
        break;
    case 'upload':
        check_demo();
        if ($lines = get_first_lines(20)) {
            display_confirm($lines);
            $_SESSION['import_vars'] = $vars;
            break;
        }
    case 'check_form':
        check_demo();
        if (!file_exists($import_filename)) {
            fatal_error("Please upload CSV file for import: /amember/admin/imp.csv. Please upload file and press 'Refresh' button (F5)", 0);
        }
        if (check_form()) {
            display_upload_form();
            break;
        }
    default:
        display_form();
}
示例#2
0
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>{#inupload.title}</title>
    <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
    <script type="text/javascript" src="js/inupload.js"></script>
  
</head>

<?php 
$Action = vvar("q", "none");
$upload_dir = vvar("d", "./");
$substitute_dir = vvar("s", "./");
$MinW = vvar("minw", "100");
$MaxW = vvar("maxw", "650");
if ($Action == "none") {
    display_upload_form($MinW, $MaxW);
}
if ($Action == "upload") {
    upload_content_file($upload_dir, $substitute_dir, $MinW, $MaxW);
}
function vvar($v, $def)
{
    $valor = $def;
    if (isset($_SESSION[$v])) {
        $valor = $_SESSION[$v];
    }
    if (isset($_GET[$v])) {
        $valor = $_GET[$v];
    }
    if (isset($_POST[$v]) and $_POST[$v] != "") {
        $valor = $_POST[$v];