init
[garradin.git] / www / admin / mes_cotisations.php
1 <?php
2 namespace Garradin;
3
4 require_once __DIR__ . '/_inc.php';
5
6 $membre = $membres->getLoggedUser();
7
8 if (!$membre)
9 {
10 throw new UserException("Ce membre n'existe pas.");
11 }
12
13 $error = false;
14
15 $tpl->assign('membre', $membre);
16
17 $cats = new Membres_Categories;
18
19 $categorie = $cats->get($membre['id_categorie']);
20 $tpl->assign('categorie', $categorie);
21
22 $cotisations = new Cotisations_Membres;
23
24 if (!empty($categorie['id_cotisation_obligatoire']))
25 {
26 $tpl->assign('cotisation', $cotisations->isMemberUpToDate($membre['id'], $categorie['id_cotisation_obligatoire']));
27 }
28 else
29 {
30 $tpl->assign('cotisation', false);
31 }
32
33 $tpl->assign('nb_activites', $cotisations->countForMember($membre['id']));
34 $tpl->assign('cotisations', $cotisations->listForMember($membre['id']));
35 $tpl->assign('cotisations_membre', $cotisations->listSubscriptionsForMember($membre['id']));
36
37 $tpl->display('admin/mes_cotisations.tpl');
38
39 ?>