Differences From Artifact [9afcee1910]:

To Artifact [3211b6ac5b]:


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

if (!$membre)
{
    throw new UserException("Ce membre n'existe pas.");
}

$champs = $config->get('champs_membres');
$error = false;

if (!empty($_POST['cotisation']))
{
    if (!utils::CSRF_check('cotisation_'.$id))
    {
        $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
    }
    else
    {
        try {
            $membres->updateCotisation($id, utils::post('date'));

            if ($id == $user['id'])
            {
                $membres->updateSessionData();
            }

            utils::redirect('/admin/membres/fiche.php?id='.$id);
        }
        catch (UserException $e)
        {
            $error = $e->getMessage();
        }
    }
}

$cats = new Membres_Categories;
$categorie = $cats->get($membre['id_categorie']);

$tpl->assign('categorie', $categorie);
$tpl->assign('membre', $membre);
$tpl->assign('verif_cotisation', Membres::checkCotisation($membre['date_cotisation'], $categorie['duree_cotisation']));

if (!empty($membre['date_cotisation']))
{
    $prochaine_cotisation = new \DateTime('@'.$membre['date_cotisation']);
    $prochaine_cotisation->modify('+1 year');
    $prochaine_cotisation = $prochaine_cotisation->getTimestamp();
}
else
{
    $prochaine_cotisation = time();
}
$tpl->assign('date_cotisation_defaut', date('Y-m-d', $prochaine_cotisation));

$tpl->assign('champs', $champs->getAll());

$tpl->assign('error', $error);
$tpl->assign('custom_js', array('datepickr.js'));

$tpl->display('admin/membres/fiche.tpl');

?>







<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






<
<
<
<
<
<
<
<
<
<
<
<
<



<





19
20
21
22
23
24
25

26
























27
28
29
30
31
32













33
34
35

36
37
38
39
40

if (!$membre)
{
    throw new UserException("Ce membre n'existe pas.");
}

$champs = $config->get('champs_membres');



























$cats = new Membres_Categories;
$categorie = $cats->get($membre['id_categorie']);

$tpl->assign('categorie', $categorie);
$tpl->assign('membre', $membre);














$tpl->assign('champs', $champs->getAll());


$tpl->assign('custom_js', array('datepickr.js'));

$tpl->display('admin/membres/fiche.tpl');

?>