4 require_once __DIR__
. '/../../../_inc.php';
6 if ($user['droits']['membres'] < Membres
::DROIT_ADMIN
)
8 throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
11 if (!utils
::get('id') ||
!is_numeric(utils
::get('id')))
13 throw new UserException("Argument du numéro de cotisation manquant.");
16 $cotisations = new Cotisations
;
18 $co = $cotisations->get(utils
::get('id'));
22 throw new UserException("Cette cotisation n'existe pas.");
27 if (!empty($_POST['delete']))
29 if (!utils
::CSRF_check('delete_co_' . $co['id']))
31 $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
36 $cotisations->delete($co['id']);
37 utils
::redirect('/admin/membres/cotisations/');
39 catch (UserException
$e)
41 $error = $e->getMessage();
46 $tpl->assign('error', $error);
48 $tpl->assign('cotisation', $co);
50 $tpl->display('admin/membres/cotisations/gestion/supprimer.tpl');