$type = 'recette'; } Utils::redirect('/admin/compta/operations/saisir.php?' . $type . '&ok=' . (int) $id); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('type', $type); if ($type === null) { $tpl->assign('comptes', $comptes->listTree()); } else { $tpl->assign('moyens_paiement', $cats->listMoyensPaiement()); $tpl->assign('moyen_paiement', Utils::post('moyen_paiement') ?: 'ES'); $tpl->assign('categories', $cats->getList($type === 'dette' ? Compta\Categories::DEPENSES : $type)); $tpl->assign('comptes_bancaires', $banques->getList()); $tpl->assign('banque', Utils::post('banque')); } if (!$membres->sessionGet('compta_date')) { $exercices = new Compta\Exercices(); $exercice = $exercices->getCurrent(); if ($exercice['debut'] > time() || $exercice['fin'] < time()) { $membres->sessionStore('compta_date', date('Y-m-d', $exercice['debut'])); } else { $membres->sessionStore('compta_date', date('Y-m-d')); } } $tpl->assign('date', $membres->sessionGet('compta_date') ?: false); $tpl->assign('ok', (int) Utils::get('ok')); $tpl->display('admin/compta/operations/saisir.tpl');
<?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $e = new Compta\Exercices(); $tpl->assign('liste', $e->getList()); $tpl->assign('current', $e->getCurrent()); $tpl->display('admin/compta/exercices/index.tpl');