2026-01-19 21:08:04 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Controller;
|
|
|
|
|
|
|
|
|
|
use App\Entity\Account;
|
|
|
|
|
use App\Entity\AccountResetPasswordRequest;
|
|
|
|
|
use App\Form\RequestPasswordConfirmType;
|
|
|
|
|
use App\Form\RequestPasswordRequestType;
|
|
|
|
|
use App\Logger\AppLogger;
|
2026-01-20 13:22:01 +01:00
|
|
|
use App\Repository\ProductRepository;
|
|
|
|
|
use App\Service\Mailer\Mailer;
|
2026-01-19 21:08:04 +01:00
|
|
|
use App\Service\ResetPassword\Event\ResetPasswordConfirmEvent;
|
|
|
|
|
use App\Service\ResetPassword\Event\ResetPasswordEvent;
|
|
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
2026-01-20 11:20:28 +01:00
|
|
|
use Fkrzski\RobotsTxt\RobotsTxt;
|
2026-01-19 21:08:04 +01:00
|
|
|
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
|
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
2026-01-20 13:22:01 +01:00
|
|
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
2026-01-19 21:08:04 +01:00
|
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
2026-01-20 13:22:01 +01:00
|
|
|
use Symfony\Component\Mailer\MailerInterface;
|
2026-01-19 21:08:04 +01:00
|
|
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|
|
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
|
|
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
|
|
|
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReserverController extends AbstractController
|
|
|
|
|
{
|
|
|
|
|
|
2026-01-20 11:20:28 +01:00
|
|
|
#[Route('/robots.txt', name: 'robots_txt', defaults: ['_format' => 'txt'])]
|
|
|
|
|
public function index(Request $request): Response
|
|
|
|
|
{
|
|
|
|
|
$robots = new RobotsTxt();
|
|
|
|
|
$robots->disallow('/signature');
|
|
|
|
|
$robots->disallow('/payment');
|
|
|
|
|
$robots->crawlDelay(60);
|
|
|
|
|
$robots->allow('/reservation');
|
|
|
|
|
$robots->sitemap($request->getSchemeAndHttpHost().$this->generateUrl('PrestaSitemapBundle_index',['_format' => 'xml']));
|
|
|
|
|
|
|
|
|
|
return new Response($robots->toString(),Response::HTTP_OK,[
|
|
|
|
|
'Content-Type' => 'text/plain'
|
|
|
|
|
]);
|
|
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation', name: 'reservation')]
|
2026-01-20 13:22:01 +01:00
|
|
|
public function revervation(ProductRepository $productRepository): Response
|
2026-01-19 21:08:04 +01:00
|
|
|
{
|
2026-01-20 13:22:01 +01:00
|
|
|
$products =$productRepository->findBy([], ['updatedAt' => 'DESC']);
|
|
|
|
|
return $this->render('revervation/home.twig',[
|
|
|
|
|
'products' => $products
|
|
|
|
|
]);
|
2026-01-20 13:51:23 +01:00
|
|
|
}
|
|
|
|
|
#[Route('/reservation/catalogue', name: 'reservation_catalogue')]
|
|
|
|
|
public function revervationCatalogue(ProductRepository $productRepository): Response
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return $this->render('revervation/catalogue.twig',[
|
|
|
|
|
'products' => $productRepository->findAll(),
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
#[Route('/reservation/produit/{id}', name: 'reservation_product_show')]
|
|
|
|
|
public function revervationShowProduct(ProductRepository $productRepository): Response
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
2026-01-19 21:08:04 +01:00
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/contact', name: 'reservation_contact')]
|
2026-01-20 13:22:01 +01:00
|
|
|
public function revervationContact(Request $request, Mailer $mailer): Response
|
2026-01-19 21:08:04 +01:00
|
|
|
{
|
2026-01-20 13:22:01 +01:00
|
|
|
$form = $this->createFormBuilder()
|
|
|
|
|
->add('name', TextType::class, [
|
|
|
|
|
'label' => 'Nom',
|
|
|
|
|
'required' => true,
|
|
|
|
|
])
|
|
|
|
|
->add('surname', TextType::class, [
|
|
|
|
|
'label' => 'Prenom',
|
|
|
|
|
'required' => true,
|
|
|
|
|
])
|
|
|
|
|
->add('email', EmailType::class, [
|
|
|
|
|
'label' => 'Email',
|
|
|
|
|
'required' => true,
|
|
|
|
|
])
|
|
|
|
|
->add('phone', TextType::class, [
|
|
|
|
|
'label' => 'Telephone',
|
|
|
|
|
'required' => true,
|
|
|
|
|
])
|
|
|
|
|
->add('message', TextareaType::class, [
|
|
|
|
|
'label' => 'Message',
|
|
|
|
|
'required' => true,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$formObject = $form->getForm();
|
|
|
|
|
$formObject->handleRequest($request);
|
|
|
|
|
|
|
|
|
|
if ($formObject->isSubmitted() && $formObject->isValid()) {
|
|
|
|
|
$data = $formObject->getData();
|
|
|
|
|
|
|
|
|
|
$mailer->send(
|
|
|
|
|
'lilian@ludikevent.fr',
|
|
|
|
|
"Ludikevent",
|
|
|
|
|
"[Ludikevent] - Demande de contact via la plateforme de reservation",
|
|
|
|
|
"mails/reserve/contact.twig",
|
|
|
|
|
$data
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Ajout du message flash de succès
|
|
|
|
|
$this->addFlash('success', 'Votre message a bien été envoyé ! Notre équipe vous répondra dans les plus brefs délais.');
|
|
|
|
|
|
|
|
|
|
return $this->redirectToRoute('reservation_contact');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->render('revervation/contact.twig', [
|
|
|
|
|
'form' => $formObject->createView()
|
|
|
|
|
]);
|
2026-01-19 21:08:04 +01:00
|
|
|
}
|
2026-01-20 11:20:28 +01:00
|
|
|
#[Route('/reservation/recherche', name: 'reservation_search')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function recherche()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/mentions-legal', name: 'reservation_mentions-legal')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function revervationLegal()
|
|
|
|
|
{
|
|
|
|
|
return $this->render('revervation/legal.twig');
|
|
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/rgpd', name: 'reservation_rgpd')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function revervationRgpd()
|
|
|
|
|
{
|
|
|
|
|
return $this->render('revervation/rgpd.twig');
|
|
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/cookies', name: 'reservation_cookies')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function revervationCookies()
|
|
|
|
|
{
|
|
|
|
|
return $this->render('revervation/cookies.twig');
|
|
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/cgv', name: 'reservation_cgv')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function revervationCgv()
|
|
|
|
|
{
|
|
|
|
|
return $this->render('revervation/cgv.twig');
|
|
|
|
|
}
|
2026-01-20 11:58:29 +01:00
|
|
|
#[Route('/reservation/hosting', name: 'reservation_hosting')]
|
2026-01-19 21:08:04 +01:00
|
|
|
public function revervationHosting()
|
|
|
|
|
{
|
|
|
|
|
return $this->render('revervation/hosting.twig');
|
|
|
|
|
}
|
|
|
|
|
}
|