2022-04-29 11:01:15 +02:00
|
|
|
<?php
|
|
|
|
|
2023-09-28 13:20:36 +02:00
|
|
|
namespace Paheko;
|
2023-11-10 12:31:18 +01:00
|
|
|
session_start();
|
2022-04-29 11:01:15 +02:00
|
|
|
|
2023-09-28 13:20:36 +02:00
|
|
|
use Paheko\Plugin\RecusFiscaux\Utils;
|
2022-04-29 11:01:15 +02:00
|
|
|
|
|
|
|
// liste des années fiscales
|
|
|
|
$anneeCourante = date("Y");
|
|
|
|
$anneesFiscales = Utils::getAnneesFiscales();
|
|
|
|
if ($anneesFiscales[0] < $anneeCourante) {
|
|
|
|
array_unshift($anneesFiscales, $anneeCourante);
|
|
|
|
}
|
|
|
|
|
2023-12-23 16:36:57 +01:00
|
|
|
$csrf_key = 'acc_select_year';
|
|
|
|
$form->runIf('change', function () {
|
2022-04-29 11:01:15 +02:00
|
|
|
$_SESSION['annee_recu'] = f('annee_recu');
|
2023-12-23 16:36:57 +01:00
|
|
|
}, $csrf_key, PLUGIN_ROOT . '/admin/index.php');
|
|
|
|
|
|
|
|
$tpl->assign(compact('anneesFiscales', 'csrf_key'));
|
2022-04-29 11:01:15 +02:00
|
|
|
|
|
|
|
$tpl->assign('annee_recu', $_SESSION['annee_recu']);
|
|
|
|
|
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/choix_annee.tpl');
|