From 7a13d53e43c7db7fe39474208ffa54ba2906d308 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 24 Jun 2025 23:57:59 +0200 Subject: =?UTF-8?q?petites=20am=C3=A9liorations=20au=20syst=C3=A8me=20de?= =?UTF-8?q?=20mot=20de=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/ajax_calendar_visitor.php | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/controller/ajax_calendar_visitor.php (limited to 'src/controller/ajax_calendar_visitor.php') diff --git a/src/controller/ajax_calendar_visitor.php b/src/controller/ajax_calendar_visitor.php new file mode 100644 index 0000000..dcdbebd --- /dev/null +++ b/src/controller/ajax_calendar_visitor.php @@ -0,0 +1,39 @@ +setTimezone(new DateTimeZone('UTC')); + $end->setTimezone(new DateTimeZone('UTC')); + + // affichage format ISO à l'heure UTC + //$date->format('Y-m-d\TH:i:s\Z'); + + // on prend les évènements se finissant après le début ou commençant avant la fin de la fourchette + $dql = 'SELECT e FROM App\Entity\Event e WHERE e.end >= :start AND e.start <= :end'; + $bulk_data = $entityManager->createQuery($dql) + ->setParameter('start', $start) + ->setParameter('end', $end) + ->getResult(); + + $events = []; + foreach($bulk_data as $one_entry){ + $event = new EventDTO($one_entry); + $events[] = $event->toArray(); + } + + header('Content-Type: application/json'); + echo json_encode($events); + die; +} \ No newline at end of file -- cgit v1.2.3