get(utils::get('id')); if (!$operation) { throw new UserException("L'opération demandée n'existe pas."); } $error = false; if (!empty($_POST['delete'])) { if (!utils::CSRF_check('compta_supprimer_'.$operation['id'])) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $journal->delete($operation['id']); utils::redirect('/admin/compta/operations/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('operation', $operation); $tpl->display('admin/compta/operations/supprimer.tpl'); ?>