Exemplo n.º 1
0
 /**
  * Load fields list from database or from default values
  *
  * @return void
  */
 private function _loadFields()
 {
     //at last, we got the defaults
     $this->_fields = $this->_default_fields;
     $model = new ImportModel();
     //we go with default fields if model cannot be loaded
     if ($model->load()) {
         $this->_fields = $model->getFields();
     }
 }
Exemplo n.º 2
0
 */
use Analog\Analog;
use Galette\IO\Csv;
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();
}