Example #1
0
        // $_FILES verwenden.
        $uploadfile = basename($_FILES['userfile']['name']);
        $uploadpath = $mediaPath . $uploadfile;
        if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadpath)) {
            //View::debug( "Datei ist valide und wurde erfolgreich hochgeladen.", 0 );
            error_reporting(E_ALL ^ E_NOTICE);
            $excel = new Excel($uploadpath);
            $tableErrors = array();
            $tableWarnings = array();
            $tableValid = tableValidator($tableErrors, $tableWarnings, $excel);
            $mapping = History::getLastMapping(basename($excel->getSource()));
            // leads to 'transformation'
            // show only first three rows of excel table
            View::mapFields($mapping, $excel, 3, $filesystemValid, $filesystemErrors, $tableValid, $tableErrors, $tableWarnings);
        } else {
            View::debug("Beim Hochladen der Datei ist ein Fehler aufgetreten.\n");
        }
        include '../../../include/footer.php';
        break;
    default:
        include '../../../include/header.php';
        $conflictsMap = array();
        $uploadsMap = getUploadsMap($conflictsMap);
        $filesystemErrors = array();
        $filesystemWarnings = array();
        $filesystemValid = filesystemValidator($filesystemErrors, $filesystemWarnings, $conflictsMap);
        // leads to 'xls_upload'
        View::chooseXLS($filesystemValid, $filesystemErrors);
        include '../../../include/footer.php';
        break;
}