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 $rappels = new Rappels
;
12 $cotisations = new Cotisations
;
16 if (!empty($_POST['save']))
18 if (!utils
::CSRF_check('new_rappel'))
20 $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
25 if (utils
::post('delai_choix') == 0)
27 elseif (utils
::post('delai_choix') > 0)
28 $delai = (int) utils
::post('delai_post');
30 $delai = -(int) utils
::post('delai_pre');
33 'sujet' => utils
::post('sujet'),
34 'texte' => utils
::post('texte'),
36 'id_cotisation' => utils
::post('id_cotisation'),
39 utils
::redirect('/admin/membres/cotisations/gestion/rappels.php');
41 catch (UserException
$e)
43 $error = $e->getMessage();
48 $tpl->assign('error', $error);
50 $tpl->assign('liste', $rappels->listByCotisation());
51 $tpl->assign('cotisations', $cotisations->listCurrent());
53 $tpl->assign('default_subject', '[#NOM_ASSO] Échéance de cotisation');
54 $tpl->assign('default_text', "Bonjour #IDENTITE,\n\nVotre cotisation arrive à échéance dans #NB_JOURS jours.\n\n"
55 . "Merci de nous contacter pour renouveler votre cotisation.\n\nCordialement.\n\n"
56 . "--\n#NOM_ASSO\n#ADRESSE_ASSO\nE-Mail : #EMAIL_ASSO\nSite web : #SITE_ASSO");
58 $tpl->display('admin/membres/cotisations/gestion/rappels.tpl');