4 require_once __DIR__
. '/../_inc.php';
6 if ($user['droits']['membres'] < Membres
::DROIT_ECRITURE
)
8 throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
11 if (empty($_GET['id']) ||
!is_numeric($_GET['id']))
13 throw new UserException("Argument du numéro de membre manquant.");
16 $id = (int) $_GET['id'];
18 $membre = $membres->get($id);
22 throw new UserException("Ce membre n'existe pas.");
25 $champs = $config->get('champs_membres');
26 $tpl->assign('champs', $champs->getAll());
28 $cats = new Membres_Categories
;
30 $categorie = $cats->get($membre['id_categorie']);
31 $tpl->assign('categorie', $categorie);
33 $cotisations = new Cotisations_Membres
;
35 if (!empty($categorie['id_cotisation_obligatoire']))
37 $tpl->assign('cotisation', $cotisations->isMemberUpToDate($membre['id'], $categorie['id_cotisation_obligatoire']));
41 $tpl->assign('cotisation', false);
44 $tpl->assign('nb_activites', $cotisations->countForMember($membre['id']));
46 if ($user['droits']['compta'] >= Membres
::DROIT_ACCES
)
48 $journal = new Compta_Journal
;
49 $tpl->assign('nb_operations', $journal->countForMember($membre['id']));
52 $tpl->assign('membre', $membre);
54 $tpl->display('admin/membres/fiche.tpl');