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 $journal = new Compta_Journal
;
13 $operation = $journal->get(utils
::get('id'));
17 throw new UserException("L'opération demandée n'existe pas.");
22 if (!empty($_POST['delete']))
24 if (!utils
::CSRF_check('compta_supprimer_'.$operation['id']))
26 $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
32 $journal->delete($operation['id']);
33 utils
::redirect('/admin/compta/operations/');
35 catch (UserException
$e)
37 $error = $e->getMessage();
42 $tpl->assign('error', $error);
44 $tpl->assign('operation', $operation);
46 $tpl->display('admin/compta/operations/supprimer.tpl');