File src/www/admin/membres/cotisations/gestion/rappel_supprimer.php artifact 91fa0c34f6 part of check-in 1265a6da44


<?php
namespace Garradin;

require_once __DIR__ . '/../../_inc.php';

$session->requireAccess('membres', Membres::DROIT_ADMIN);

if (!qg('id') || !is_numeric(qg('id')))
{
    throw new UserException("Argument du numéro de rappel manquant.");
}

$rappels = new Rappels;

$rappel = $rappels->get(qg('id'));

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

if (f('delete') && $form->check('delete_rappel_' . $rappel->id))
{
    try {
        $rappels->delete($rappel->id, (bool) f('delete_history'));
        Utils::redirect(ADMIN_URL . 'membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('rappel', $rappel);

$tpl->display('admin/membres/cotisations/gestion/rappel_supprimer.tpl');