4 require_once __DIR__
. '/../_inc.php';
6 if ($user['droits']['compta'] < Membres
::DROIT_ADMIN
)
8 throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
11 $e = new Compta_Exercices
;
15 if (!empty($_POST['add']))
17 if (!utils
::CSRF_check('compta_ajout_exercice'))
19 $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
26 'libelle' => utils
::post('libelle'),
27 'debut' => utils
::post('debut'),
28 'fin' => utils
::post('fin'),
31 utils
::redirect('/admin/compta/exercices/');
33 catch (UserException
$e)
35 $error = $e->getMessage();
40 $tpl->assign('error', $error);
42 $tpl->display('admin/compta/exercices/ajouter.tpl');