<?php
namespace App\Controller;
use App\Repository\CookieRepository;
use App\Repository\PhotoRepository;
use App\Repository\UserRepository;
use DateTime;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
/**
* @Route("/", name="home")
*/
public function index(CookieRepository $cookieRepo, PhotoRepository $photoRepo, UserRepository $userRepo): Response
{
/*$alia = $userRepo->find(2137);
$andy = $userRepo->find(2138);
$datedebut = new DateTime('2024-12-01');
$datefin = new DateTime('2025-01-31');
$resultatListAlia = array();
$resultatListAndy = array();
while ($datedebut <= $datefin) {
$dated = $datedebut->format('Y-m-d') . " 00:00:00";
$datef = $datedebut->format('Y-m-d') . " 23:59:59";
$resultatAlia = array($datedebut->format('Y-m-d') => $photoRepo->countByDate($alia, $dated, $datef)[0]["nb"]);
$resultatAndy = array($datedebut->format('Y-m-d') => $photoRepo->countByDate($andy, $dated, $datef)[0]["nb"]);
array_push($resultatListAlia, $resultatAlia);
array_push($resultatListAndy, $resultatAndy);
$datedebut->modify('+1 day');
}*/
return $this->render('home/index.html.twig', [
'cookie' => $cookieRepo->findCookie(true)/*,
'resultatListAlia' => $resultatListAlia,
'resultatListAndy' => $resultatListAndy*/
]);
}
}