<?php
namespace App\Controller;
use App\Repository\NotifRepository;
use App\Repository\DossierRepository;
use App\Repository\OperationsRepository;
use App\Repository\AppelFondRepository;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class HomeController extends AbstractController
{
/**
* @Route("/", name="app_home")
*/
public function index(OperationsRepository $operationsRepository, DossierRepository $dossierRepository, AppelFondRepository $appelFondRepository, notifRepository $notifRepository): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$ope = $operationsRepository->findAll();
$doss = $dossierRepository->findAll();
$notifs = $notifRepository->findAll();;
$operations = $operationsRepository->CountByOperation();
$directions = $operationsRepository->CountByOperation();
$dossiers = $dossierRepository->countByDossier();
$afAttente = $appelFondRepository->countByAfAttente();
$afAttenteSum = $appelFondRepository->countByAfAttenteSum();
$afSum = $appelFondRepository->FindByAfRecuMaxSum();
$afRecuMax = $appelFondRepository->FindByAfRecuMax();
return $this->render('home/index.html.twig', [
'controller_name' => 'HomeController',
'appTitle' => 'Gestion des subventions',
'villeTitle' => 'ville de pantin',
'operations' => $operations,
'dossiers' => $dossiers,
'ope' => $ope,
'doss' => $doss,
'notifs' => $notifs,
'afSum' => $afSum,
'afRecuMax' => $afRecuMax,
'afAttente' => $afAttente,
'afAttenteSum' => $afAttenteSum,
]);
}
// /**
// * @Route("/", name="app_home")
// */
// public function infoVille(): Response
// {
// return $this->render('template.html.twig', [
// 'appTitle' => 'Gestion des subventions',
// ]);
// }
}