Ajout page d'aide
This commit is contained in:
parent
5a9c498eee
commit
39dd23151f
11 changed files with 35 additions and 149 deletions
9
www/admin/aide.php
Normal file
9
www/admin/aide.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/aide.tpl');
|
||||
|
|
@ -46,6 +46,9 @@ elseif (f('add'))
|
|||
{
|
||||
$cotis[$field] = f($field.'_'.$num);
|
||||
}
|
||||
|
||||
$cotis['date'] = date('Y-m-d', $cotis['date']);
|
||||
$cotis['expiration'] = date('Y-m-d', $cotis['expiration']);
|
||||
|
||||
$r = $db->get('SELECT moyen_paiement, montant FROM membres_operations AS mo INNER JOIN compta_journal AS cj ON cj.id = mo.id_operation
|
||||
WHERE mo.id_cotisation = ?;', (int)$cotis['id']);
|
||||
|
|
|
|||
|
|
@ -63,9 +63,6 @@ elseif (f('add'))
|
|||
$cotis['date'] = date('Y-m-d', $cotis['date']);
|
||||
$cotis['expiration'] = date('Y-m-d', $cotis['expiration']);
|
||||
|
||||
var_export($cotis);
|
||||
// die();
|
||||
|
||||
$r = $db->get('SELECT moyen_paiement, montant FROM membres_operations AS mo INNER JOIN compta_journal AS cj ON cj.id = mo.id_operation
|
||||
WHERE mo.id_cotisation = ?;', (int)$cotis['id']);
|
||||
$r = $r[0];
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
namespace Garradin;
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ADMIN);
|
||||
|
||||
$error = false;
|
||||
|
||||
if (isset($_GET['ok']))
|
||||
{
|
||||
$error = 'OK';
|
||||
}
|
||||
|
||||
$recus = new Plugin\RecuDon\GenDon;
|
||||
|
||||
$trecus = $recus->listSimple();
|
||||
|
||||
$tpl->assign('trecus', $trecus);
|
||||
$tpl->assign('error', $error);
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/recu.tpl');
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
namespace Garradin;
|
||||
|
||||
if ($user['droits']['compta'] < Membres::DROIT_ADMIN)
|
||||
{
|
||||
throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
|
||||
}
|
||||
|
||||
$gendon = new Plugin\RecuDon\GenDon;
|
||||
|
||||
$recu = $gendon->get(Utils::get('id'));
|
||||
|
||||
if (!$recu)
|
||||
{
|
||||
throw new UserException("Le reçu demandé n'existe pas.");
|
||||
}
|
||||
|
||||
$error = false;
|
||||
|
||||
if (!empty($_POST['remove']))
|
||||
{
|
||||
if (!Utils::CSRF_check('recu_supprimer_'.$recu['id']))
|
||||
{
|
||||
$error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
$gendon->remove($recu['id']);
|
||||
Utils::redirect(PLUGIN_URL . 'recu.php');
|
||||
}
|
||||
catch (UserException $e)
|
||||
{
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpl->assign('error', $error);
|
||||
|
||||
$tpl->assign('recu', $recu);
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/supprimer.tpl');
|
||||
Loading…
Add table
Add a link
Reference in a new issue