Пример #1
0
use Galette\IO\CsvIn;
use Galette\IO\CsvOut;
use Galette\Entity\ImportModel;
require_once 'includes/galette.inc.php';
if (!$login->isLogged()) {
    header("location: index.php");
    die;
}
if (!$login->isAdmin()) {
    header("location: voir_adherent.php");
    die;
}
$model = new ImportModel();
$model->load();
if (isset($_POST['fields'])) {
    $model->setFields($_POST['fields']);
    $res = $model->store($zdb);
    if ($res === true) {
        $success_detected[] = _T("Import model has been successfully stored :)");
        $model->load();
    } else {
        $error_detected[] = _T("Import model has not been stored :(");
    }
}
if (isset($_GET['remove'])) {
    $model->remove($zdb);
    $model->load();
}
$csv = new CsvIn();
/** FIXME: 
 * - set fields that should not be part of import