From b51a75285a4780ae003d932837d543c2741a7537 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 14 Nov 2024 17:48:57 +0100 Subject: [PATCH 1/4] Maj de la table : Tables Changement CSS --- public/css/GestionUser.css | 65 +++++++++++++ public/css/{modal.css => Index.css} | 0 src/Entity/Clients.php | 20 ++-- src/Entity/Reservations.php | 10 +- src/Entity/StatutTables.php | 10 +- src/Entity/Tables.php | 14 +-- src/Entity/Utilisateurs.php | 18 ++-- templates/gestion_user/index.html.twig | 125 +++++-------------------- templates/index/index.html.twig | 14 +-- 9 files changed, 126 insertions(+), 150 deletions(-) create mode 100644 public/css/GestionUser.css rename public/css/{modal.css => Index.css} (100%) diff --git a/public/css/GestionUser.css b/public/css/GestionUser.css new file mode 100644 index 0000000..a2cb857 --- /dev/null +++ b/public/css/GestionUser.css @@ -0,0 +1,65 @@ +#container_gestion_user { + background-color: white; + margin-left: 20%; /* Centrage vertical */ + margin-top: 5%; + padding: 20px; + border: 1px solid black; + width: 75%; /* Largeur du contenu de la modal */ + height: 100%; /* Hauteur du contenu de la modal */ + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); + display: none; +} + +body { + width: 100%; + height: 100%; +} + +/* Style pour chaque élément d'information de l'utilisateur */ +.user-info-item { + display: flex; + padding: 10px 0; + border-bottom: 1px solid #e0e0e0; +} + +/* Dernier élément sans bordure */ +.user-info-item:last-child { + border-bottom: none; +} + +/* Style pour le label de chaque information (Nom, Prénom, etc.) */ +.user-info-label { + font-weight: bold; + color: #333; + width: 7%; +} + +/* Style pour la valeur de chaque information (la donnée de l'utilisateur) */ +.user-info-value { + color: #555; + text-align: right; + width: 65%; + word-wrap: break-word; /* Gère les débordements */ +} + +.btn-update { + margin-top: 1%; +} + + +/* Ajout d'un style pour rendre responsive */ +@media (max-width: 600px) { + #InformationUser { + padding: 15px; + } + + .user-info-item { + flex-direction: column; + padding: 8px 0; + } + + .user-info-label, .user-info-value { + width: 100%; + } +} + diff --git a/public/css/modal.css b/public/css/Index.css similarity index 100% rename from public/css/modal.css rename to public/css/Index.css diff --git a/src/Entity/Clients.php b/src/Entity/Clients.php index 35a78f3..3722d87 100644 --- a/src/Entity/Clients.php +++ b/src/Entity/Clients.php @@ -30,8 +30,8 @@ class Clients /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Client')] - private Collection $table; + #[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')] + private Collection $tables; /** * @var Collection @@ -41,7 +41,7 @@ class Clients public function __construct() { - $this->table = new ArrayCollection(); + $this->tables = new ArrayCollection(); $this->commandes = new ArrayCollection(); } @@ -101,23 +101,23 @@ class Clients /** * @return Collection */ - public function getTable(): Collection + public function getTables(): Collection { - return $this->table; + return $this->tables; } - public function addTable(Tables $table): static + public function addTable(Tables $tables): static { - if (!$this->table->contains($table)) { - $this->table->add($table); + if (!$this->tables->contains($tables)) { + $this->tables->add($tables); } return $this; } - public function removeTable(Tables $table): static + public function removeTable(Tables $tables): static { - $this->table->removeElement($table); + $this->tables->removeElement($tables); return $this; } diff --git a/src/Entity/Reservations.php b/src/Entity/Reservations.php index 8ad6096..757d358 100644 --- a/src/Entity/Reservations.php +++ b/src/Entity/Reservations.php @@ -23,7 +23,7 @@ class Reservations private ?int $Nb_de_prsn = null; #[ORM\ManyToOne(inversedBy: 'reservations')] - private ?Tables $Table = null; + private ?Tables $tables = null; /** * @var Collection @@ -65,14 +65,14 @@ class Reservations return $this; } - public function getTable(): ?Tables + public function getTables(): ?Tables { - return $this->Table; + return $this->tables; } - public function setTable(?Tables $Table): static + public function setTable(?Tables $tables): static { - $this->Table = $Table; + $this->tables = $tables; return $this; } diff --git a/src/Entity/StatutTables.php b/src/Entity/StatutTables.php index f336a5a..5b500b9 100644 --- a/src/Entity/StatutTables.php +++ b/src/Entity/StatutTables.php @@ -17,7 +17,7 @@ class StatutTables private ?string $Libellé = null; #[ORM\ManyToOne(inversedBy: 'statutTables')] - private ?Tables $Table = null; + private ?Tables $tables = null; public function getId(): ?int { @@ -36,14 +36,14 @@ class StatutTables return $this; } - public function getTable(): ?Tables + public function getTables(): ?Tables { - return $this->Table; + return $this->tables; } - public function setTable(?Tables $Table): static + public function setTable(?Tables $tables): static { - $this->Table = $Table; + $this->tables = $tables; return $this; } diff --git a/src/Entity/Tables.php b/src/Entity/Tables.php index 25d3763..1d1820a 100644 --- a/src/Entity/Tables.php +++ b/src/Entity/Tables.php @@ -18,25 +18,25 @@ class Tables /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'table')] + #[ORM\ManyToMany(targetEntity: Clients::class, inversedBy: 'tables')] private Collection $Clients; /** * @var Collection */ - #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Table')] + #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')] private Collection $reservations; /** * @var Collection */ - #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Table')] + #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')] private Collection $statutTables; /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'table')] + #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tables')] private Collection $utilisateurs; public function __construct() @@ -55,7 +55,7 @@ class Tables /** * @return Collection */ - public function getClient(): Collection + public function getClients(): Collection { return $this->Clients; } @@ -101,7 +101,7 @@ class Tables { if ($this->reservations->removeElement($reservation)) { // set the owning side to null (unless already changed) - if ($reservation->getTable() === $this) { + if ($reservation->getTables() === $this) { $reservation->setTable(null); } } @@ -131,7 +131,7 @@ class Tables { if ($this->statutTables->removeElement($statutTable)) { // set the owning side to null (unless already changed) - if ($statutTable->getTable() === $this) { + if ($statutTable->getTables() === $this) { $statutTable->setTable(null); } } diff --git a/src/Entity/Utilisateurs.php b/src/Entity/Utilisateurs.php index c4af5ea..c9a6ead 100644 --- a/src/Entity/Utilisateurs.php +++ b/src/Entity/Utilisateurs.php @@ -42,12 +42,12 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface * @var Collection */ #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')] - private Collection $table; + private Collection $tables; public function __construct() { $this->Reservation = new ArrayCollection(); - $this->table = new ArrayCollection(); + $this->tables = new ArrayCollection(); } public function getId(): ?int @@ -157,23 +157,23 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface /** * @return Collection */ - public function getTable(): Collection + public function getTables(): Collection { - return $this->table; + return $this->tables; } - public function addTable(Tables $table): static + public function addTable(Tables $tables): static { - if (!$this->table->contains($table)) { - $this->table->add($table); + if (!$this->tables->contains($tables)) { + $this->tables->add($tables); } return $this; } - public function removeTable(Tables $table): static + public function removeTable(Tables $tables): static { - $this->table->removeElement($table); + $this->tables->removeElement($tables); return $this; } diff --git a/templates/gestion_user/index.html.twig b/templates/gestion_user/index.html.twig index 21ac47f..f82de26 100644 --- a/templates/gestion_user/index.html.twig +++ b/templates/gestion_user/index.html.twig @@ -4,110 +4,31 @@ {% block body %} +
+
+ + + + -

Test

- -{# {{ form_start(form) }}#} -{#
#} -{# {{ form_row(form.UserIdentifier) }}#} -{# {{ form_row(form.Password) }}#} -{# {{ form_row(form.Nom) }}#} -{# {{ form_row(form.Prenom) }}#} -{# {{ form_row(form.Roles) }}#} -{#
#} -{# {{ form_end(form) }}#} - -{# #} -{#
#} -{# #} -{# #} -{# #} -{# #} -{# #} - -{#
#} -{# #} -{#
#} -{#
#} -{# #} +
+ +
+
+ {% endblock %} diff --git a/templates/index/index.html.twig b/templates/index/index.html.twig index f363b1d..93d945c 100644 --- a/templates/index/index.html.twig +++ b/templates/index/index.html.twig @@ -10,22 +10,12 @@ {% endblock %} {% block stylesheets %} - + + {% endblock %} {% block body %} From 61adedb824f3a796cf0c270961b1e5955518e01b Mon Sep 17 00:00:00 2001 From: leroyv Date: Thu, 21 Nov 2024 14:28:29 +0100 Subject: [PATCH 2/4] Controller pour Reservations StatutCommandes,StatutTables et Tables avec le form et templates. --- src/Controller/PlatController.php | 78 ++++++++++++++++++ src/Controller/ReservationsController.php | 81 +++++++++++++++++++ src/Controller/StatutCommandesController.php | 81 +++++++++++++++++++ src/Controller/StatutTablesController.php | 81 +++++++++++++++++++ src/Controller/TablesController.php | 81 +++++++++++++++++++ src/Form/PlatType.php | 24 ++++++ src/Form/ReservationsType.php | 40 +++++++++ src/Form/StatutCommandesType.php | 25 ++++++ src/Form/StatutTablesType.php | 31 +++++++ src/Form/TablesType.php | 37 +++++++++ templates/plat/index.html.twig | 20 +++++ templates/reservations/_delete_form.html.twig | 4 + templates/reservations/_form.html.twig | 4 + templates/reservations/edit.html.twig | 13 +++ templates/reservations/index.html.twig | 37 +++++++++ templates/reservations/new.html.twig | 11 +++ templates/reservations/show.html.twig | 30 +++++++ .../statut_commandes/_delete_form.html.twig | 4 + templates/statut_commandes/_form.html.twig | 4 + templates/statut_commandes/edit.html.twig | 13 +++ templates/statut_commandes/index.html.twig | 35 ++++++++ templates/statut_commandes/new.html.twig | 11 +++ templates/statut_commandes/show.html.twig | 26 ++++++ .../statut_tables/_delete_form.html.twig | 4 + templates/statut_tables/_form.html.twig | 4 + templates/statut_tables/edit.html.twig | 13 +++ templates/statut_tables/index.html.twig | 35 ++++++++ templates/statut_tables/new.html.twig | 11 +++ templates/statut_tables/show.html.twig | 26 ++++++ templates/tables/_delete_form.html.twig | 4 + templates/tables/_form.html.twig | 4 + templates/tables/edit.html.twig | 13 +++ templates/tables/index.html.twig | 33 ++++++++ templates/tables/new.html.twig | 11 +++ templates/tables/show.html.twig | 22 +++++ 35 files changed, 951 insertions(+) create mode 100644 src/Controller/PlatController.php create mode 100644 src/Controller/ReservationsController.php create mode 100644 src/Controller/StatutCommandesController.php create mode 100644 src/Controller/StatutTablesController.php create mode 100644 src/Controller/TablesController.php create mode 100644 src/Form/PlatType.php create mode 100644 src/Form/ReservationsType.php create mode 100644 src/Form/StatutCommandesType.php create mode 100644 src/Form/StatutTablesType.php create mode 100644 src/Form/TablesType.php create mode 100644 templates/plat/index.html.twig create mode 100644 templates/reservations/_delete_form.html.twig create mode 100644 templates/reservations/_form.html.twig create mode 100644 templates/reservations/edit.html.twig create mode 100644 templates/reservations/index.html.twig create mode 100644 templates/reservations/new.html.twig create mode 100644 templates/reservations/show.html.twig create mode 100644 templates/statut_commandes/_delete_form.html.twig create mode 100644 templates/statut_commandes/_form.html.twig create mode 100644 templates/statut_commandes/edit.html.twig create mode 100644 templates/statut_commandes/index.html.twig create mode 100644 templates/statut_commandes/new.html.twig create mode 100644 templates/statut_commandes/show.html.twig create mode 100644 templates/statut_tables/_delete_form.html.twig create mode 100644 templates/statut_tables/_form.html.twig create mode 100644 templates/statut_tables/edit.html.twig create mode 100644 templates/statut_tables/index.html.twig create mode 100644 templates/statut_tables/new.html.twig create mode 100644 templates/statut_tables/show.html.twig create mode 100644 templates/tables/_delete_form.html.twig create mode 100644 templates/tables/_form.html.twig create mode 100644 templates/tables/edit.html.twig create mode 100644 templates/tables/index.html.twig create mode 100644 templates/tables/new.html.twig create mode 100644 templates/tables/show.html.twig diff --git a/src/Controller/PlatController.php b/src/Controller/PlatController.php new file mode 100644 index 0000000..d139b88 --- /dev/null +++ b/src/Controller/PlatController.php @@ -0,0 +1,78 @@ +createForm(PlatType::class, $plat); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $this->entityManager->persist($plat); + $this->entityManager->flush(); + } + + return $this->render('plat/add.html.twig', [ + 'formAdd' => $form, + ]); + } + + #[Route('/list', name: '_list')] + public function list(): Response + { + $plat = $this->platsRepository->findAll(); + return $this->render('plat/list.html.twig', [ + 'plat' => $plat, + ]); + } + + #[Route('/update/{id}', name: '_update')] + public function update(int $id, Request $request): Response + { + $plat = $this->platsRepository->find($id); + $form = $this->createForm(PlatType::class, $plat); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($plat); + $this->entityManager->flush(); + } + + return $this->render('plat/add.html.twig', [ + 'formAdd' => $form, + ]); + } + + #[Route('/delete/{id}', name: '_delete')] + public function delete(int $id): Response + { + $statutCommandes = $this->platsRepository->find($id); + $this->entityManager->remove($statutCommandes); + $this->entityManager->flush(); + + return $this->redirectToRoute('app_plat_list'); + } +} diff --git a/src/Controller/ReservationsController.php b/src/Controller/ReservationsController.php new file mode 100644 index 0000000..3098b4c --- /dev/null +++ b/src/Controller/ReservationsController.php @@ -0,0 +1,81 @@ +render('reservations/index.html.twig', [ + 'reservations' => $reservationsRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_reservations_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $reservation = new Reservations(); + $form = $this->createForm(ReservationsType::class, $reservation); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($reservation); + $entityManager->flush(); + + return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('reservations/new.html.twig', [ + 'reservation' => $reservation, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_reservations_show', methods: ['GET'])] + public function show(Reservations $reservation): Response + { + return $this->render('reservations/show.html.twig', [ + 'reservation' => $reservation, + ]); + } + + #[Route('/{id}/edit', name: 'app_reservations_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Reservations $reservation, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(ReservationsType::class, $reservation); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('reservations/edit.html.twig', [ + 'reservation' => $reservation, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_reservations_delete', methods: ['POST'])] + public function delete(Request $request, Reservations $reservation, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$reservation->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($reservation); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Controller/StatutCommandesController.php b/src/Controller/StatutCommandesController.php new file mode 100644 index 0000000..347914c --- /dev/null +++ b/src/Controller/StatutCommandesController.php @@ -0,0 +1,81 @@ +render('statut_commandes/index.html.twig', [ + 'statut_commandes' => $statutCommandesRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_statut_commandes_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $statutCommande = new StatutCommandes(); + $form = $this->createForm(StatutCommandesType::class, $statutCommande); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($statutCommande); + $entityManager->flush(); + + return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('statut_commandes/new.html.twig', [ + 'statut_commande' => $statutCommande, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_statut_commandes_show', methods: ['GET'])] + public function show(StatutCommandes $statutCommande): Response + { + return $this->render('statut_commandes/show.html.twig', [ + 'statut_commande' => $statutCommande, + ]); + } + + #[Route('/{id}/edit', name: 'app_statut_commandes_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, StatutCommandes $statutCommande, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(StatutCommandesType::class, $statutCommande); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('statut_commandes/edit.html.twig', [ + 'statut_commande' => $statutCommande, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_statut_commandes_delete', methods: ['POST'])] + public function delete(Request $request, StatutCommandes $statutCommande, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$statutCommande->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($statutCommande); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Controller/StatutTablesController.php b/src/Controller/StatutTablesController.php new file mode 100644 index 0000000..ab9f2a6 --- /dev/null +++ b/src/Controller/StatutTablesController.php @@ -0,0 +1,81 @@ +render('statut_tables/index.html.twig', [ + 'statut_tables' => $statutTablesRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_statut_tables_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $statutTable = new StatutTables(); + $form = $this->createForm(StatutTablesType::class, $statutTable); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($statutTable); + $entityManager->flush(); + + return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('statut_tables/new.html.twig', [ + 'statut_table' => $statutTable, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_statut_tables_show', methods: ['GET'])] + public function show(StatutTables $statutTable): Response + { + return $this->render('statut_tables/show.html.twig', [ + 'statut_table' => $statutTable, + ]); + } + + #[Route('/{id}/edit', name: 'app_statut_tables_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(StatutTablesType::class, $statutTable); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('statut_tables/edit.html.twig', [ + 'statut_table' => $statutTable, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_statut_tables_delete', methods: ['POST'])] + public function delete(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$statutTable->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($statutTable); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Controller/TablesController.php b/src/Controller/TablesController.php new file mode 100644 index 0000000..cb2e641 --- /dev/null +++ b/src/Controller/TablesController.php @@ -0,0 +1,81 @@ +render('tables/index.html.twig', [ + 'tables' => $tablesRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_tables_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $table = new Tables(); + $form = $this->createForm(TablesType::class, $table); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($table); + $entityManager->flush(); + + return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('tables/new.html.twig', [ + 'table' => $table, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_tables_show', methods: ['GET'])] + public function show(Tables $table): Response + { + return $this->render('tables/show.html.twig', [ + 'table' => $table, + ]); + } + + #[Route('/{id}/edit', name: 'app_tables_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Tables $table, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(TablesType::class, $table); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('tables/edit.html.twig', [ + 'table' => $table, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_tables_delete', methods: ['POST'])] + public function delete(Request $request, Tables $table, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$table->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($table); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Form/PlatType.php b/src/Form/PlatType.php new file mode 100644 index 0000000..3e3981c --- /dev/null +++ b/src/Form/PlatType.php @@ -0,0 +1,24 @@ +add('field_name') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + // Configure your form options here + ]); + } +} diff --git a/src/Form/ReservationsType.php b/src/Form/ReservationsType.php new file mode 100644 index 0000000..8a59b2b --- /dev/null +++ b/src/Form/ReservationsType.php @@ -0,0 +1,40 @@ +add('DateHeure', null, [ + 'widget' => 'single_text', + ]) + ->add('Nb_de_prsn') + ->add('tables', EntityType::class, [ + 'class' => Tables::class, + 'choice_label' => 'id', + ]) + ->add('utilisateurs', EntityType::class, [ + 'class' => Utilisateurs::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Reservations::class, + ]); + } +} diff --git a/src/Form/StatutCommandesType.php b/src/Form/StatutCommandesType.php new file mode 100644 index 0000000..695fee2 --- /dev/null +++ b/src/Form/StatutCommandesType.php @@ -0,0 +1,25 @@ +add('Libelle') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => StatutCommandes::class, + ]); + } +} diff --git a/src/Form/StatutTablesType.php b/src/Form/StatutTablesType.php new file mode 100644 index 0000000..ff6c013 --- /dev/null +++ b/src/Form/StatutTablesType.php @@ -0,0 +1,31 @@ +add('Libellé') + ->add('tables', EntityType::class, [ + 'class' => Tables::class, + 'choice_label' => 'id', + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => StatutTables::class, + ]); + } +} diff --git a/src/Form/TablesType.php b/src/Form/TablesType.php new file mode 100644 index 0000000..ff62602 --- /dev/null +++ b/src/Form/TablesType.php @@ -0,0 +1,37 @@ +add('Clients', EntityType::class, [ + 'class' => Clients::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ->add('utilisateurs', EntityType::class, [ + 'class' => Utilisateurs::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Tables::class, + ]); + } +} diff --git a/templates/plat/index.html.twig b/templates/plat/index.html.twig new file mode 100644 index 0000000..e2d1ec7 --- /dev/null +++ b/templates/plat/index.html.twig @@ -0,0 +1,20 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello PlatController!{% endblock %} + +{% block body %} + + +
+

Hello {{ controller_name }}! ✅

+ + This friendly message is coming from: +
    +
  • Your controller at /home/leroyv@stsio.lan/SLAM/FestinHegre/src/Controller/PlatController.php
  • +
  • Your template at /home/leroyv@stsio.lan/SLAM/FestinHegre/templates/plat/index.html.twig
  • +
+
+{% endblock %} diff --git a/templates/reservations/_delete_form.html.twig b/templates/reservations/_delete_form.html.twig new file mode 100644 index 0000000..47202e3 --- /dev/null +++ b/templates/reservations/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/reservations/_form.html.twig b/templates/reservations/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/reservations/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/reservations/edit.html.twig b/templates/reservations/edit.html.twig new file mode 100644 index 0000000..6d6ca47 --- /dev/null +++ b/templates/reservations/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Reservations{% endblock %} + +{% block body %} +

Edit Reservations

+ + {{ include('reservations/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('reservations/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/reservations/index.html.twig b/templates/reservations/index.html.twig new file mode 100644 index 0000000..573e019 --- /dev/null +++ b/templates/reservations/index.html.twig @@ -0,0 +1,37 @@ +{% extends 'base.html.twig' %} + +{% block title %}Reservations index{% endblock %} + +{% block body %} +

Reservations index

+ + + + + + + + + + + + {% for reservation in reservations %} + + + + + + + {% else %} + + + + {% endfor %} + +
IdDateHeureNb_de_prsnactions
{{ reservation.id }}{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}{{ reservation.NbDePrsn }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/reservations/new.html.twig b/templates/reservations/new.html.twig new file mode 100644 index 0000000..c7c1981 --- /dev/null +++ b/templates/reservations/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Reservations{% endblock %} + +{% block body %} +

Create new Reservations

+ + {{ include('reservations/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/reservations/show.html.twig b/templates/reservations/show.html.twig new file mode 100644 index 0000000..1e99f32 --- /dev/null +++ b/templates/reservations/show.html.twig @@ -0,0 +1,30 @@ +{% extends 'base.html.twig' %} + +{% block title %}Reservations{% endblock %} + +{% block body %} +

Reservations

+ + + + + + + + + + + + + + + + +
Id{{ reservation.id }}
DateHeure{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}
Nb_de_prsn{{ reservation.NbDePrsn }}
+ + back to list + + edit + + {{ include('reservations/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/statut_commandes/_delete_form.html.twig b/templates/statut_commandes/_delete_form.html.twig new file mode 100644 index 0000000..454d917 --- /dev/null +++ b/templates/statut_commandes/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/statut_commandes/_form.html.twig b/templates/statut_commandes/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/statut_commandes/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/statut_commandes/edit.html.twig b/templates/statut_commandes/edit.html.twig new file mode 100644 index 0000000..d9c145b --- /dev/null +++ b/templates/statut_commandes/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit StatutCommandes{% endblock %} + +{% block body %} +

Edit StatutCommandes

+ + {{ include('statut_commandes/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('statut_commandes/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/statut_commandes/index.html.twig b/templates/statut_commandes/index.html.twig new file mode 100644 index 0000000..31d2a17 --- /dev/null +++ b/templates/statut_commandes/index.html.twig @@ -0,0 +1,35 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutCommandes index{% endblock %} + +{% block body %} +

StatutCommandes index

+ + + + + + + + + + + {% for statut_commande in statut_commandes %} + + + + + + {% else %} + + + + {% endfor %} + +
IdLibelleactions
{{ statut_commande.id }}{{ statut_commande.Libelle }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/statut_commandes/new.html.twig b/templates/statut_commandes/new.html.twig new file mode 100644 index 0000000..ff46e9a --- /dev/null +++ b/templates/statut_commandes/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New StatutCommandes{% endblock %} + +{% block body %} +

Create new StatutCommandes

+ + {{ include('statut_commandes/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/statut_commandes/show.html.twig b/templates/statut_commandes/show.html.twig new file mode 100644 index 0000000..e42d6a3 --- /dev/null +++ b/templates/statut_commandes/show.html.twig @@ -0,0 +1,26 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutCommandes{% endblock %} + +{% block body %} +

StatutCommandes

+ + + + + + + + + + + + +
Id{{ statut_commande.id }}
Libelle{{ statut_commande.Libelle }}
+ + back to list + + edit + + {{ include('statut_commandes/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/statut_tables/_delete_form.html.twig b/templates/statut_tables/_delete_form.html.twig new file mode 100644 index 0000000..b87f5e4 --- /dev/null +++ b/templates/statut_tables/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/statut_tables/_form.html.twig b/templates/statut_tables/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/statut_tables/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/statut_tables/edit.html.twig b/templates/statut_tables/edit.html.twig new file mode 100644 index 0000000..b478d3a --- /dev/null +++ b/templates/statut_tables/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit StatutTables{% endblock %} + +{% block body %} +

Edit StatutTables

+ + {{ include('statut_tables/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('statut_tables/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/statut_tables/index.html.twig b/templates/statut_tables/index.html.twig new file mode 100644 index 0000000..b721a5a --- /dev/null +++ b/templates/statut_tables/index.html.twig @@ -0,0 +1,35 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutTables index{% endblock %} + +{% block body %} +

StatutTables index

+ + + + + + + + + + + {% for statut_table in statut_tables %} + + + + + + {% else %} + + + + {% endfor %} + +
IdLibelléactions
{{ statut_table.id }}{{ statut_table.Libellé }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/statut_tables/new.html.twig b/templates/statut_tables/new.html.twig new file mode 100644 index 0000000..c2a3a60 --- /dev/null +++ b/templates/statut_tables/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New StatutTables{% endblock %} + +{% block body %} +

Create new StatutTables

+ + {{ include('statut_tables/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/statut_tables/show.html.twig b/templates/statut_tables/show.html.twig new file mode 100644 index 0000000..2b395af --- /dev/null +++ b/templates/statut_tables/show.html.twig @@ -0,0 +1,26 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutTables{% endblock %} + +{% block body %} +

StatutTables

+ + + + + + + + + + + + +
Id{{ statut_table.id }}
Libellé{{ statut_table.Libellé }}
+ + back to list + + edit + + {{ include('statut_tables/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/tables/_delete_form.html.twig b/templates/tables/_delete_form.html.twig new file mode 100644 index 0000000..dad5b99 --- /dev/null +++ b/templates/tables/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/tables/_form.html.twig b/templates/tables/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/tables/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/tables/edit.html.twig b/templates/tables/edit.html.twig new file mode 100644 index 0000000..a0a1a92 --- /dev/null +++ b/templates/tables/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Tables{% endblock %} + +{% block body %} +

Edit Tables

+ + {{ include('tables/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('tables/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/tables/index.html.twig b/templates/tables/index.html.twig new file mode 100644 index 0000000..979d669 --- /dev/null +++ b/templates/tables/index.html.twig @@ -0,0 +1,33 @@ +{% extends 'base.html.twig' %} + +{% block title %}Tables index{% endblock %} + +{% block body %} +

Tables index

+ + + + + + + + + + {% for table in tables %} + + + + + {% else %} + + + + {% endfor %} + +
Idactions
{{ table.id }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/tables/new.html.twig b/templates/tables/new.html.twig new file mode 100644 index 0000000..f25965a --- /dev/null +++ b/templates/tables/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Tables{% endblock %} + +{% block body %} +

Create new Tables

+ + {{ include('tables/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/tables/show.html.twig b/templates/tables/show.html.twig new file mode 100644 index 0000000..dfe40f5 --- /dev/null +++ b/templates/tables/show.html.twig @@ -0,0 +1,22 @@ +{% extends 'base.html.twig' %} + +{% block title %}Tables{% endblock %} + +{% block body %} +

Tables

+ + + + + + + + +
Id{{ table.id }}
+ + back to list + + edit + + {{ include('tables/_delete_form.html.twig') }} +{% endblock %} From 41dbddb1f7fb24127877932463e14230591e1d7e Mon Sep 17 00:00:00 2001 From: leroyv Date: Thu, 21 Nov 2024 14:30:26 +0100 Subject: [PATCH 3/4] Controller pour Reservations StatutCommandes,StatutTables et Tables avec le form et templates. --- src/Controller/PlatController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/PlatController.php b/src/Controller/PlatController.php index d139b88..21bc50a 100644 --- a/src/Controller/PlatController.php +++ b/src/Controller/PlatController.php @@ -4,7 +4,7 @@ namespace App\Controller; use App\Entity\Plats; use App\Form\PlatType; -use App\Form\StatutCommandeType; +use App\Form\StatutCommandesType; use App\Repository\PlatsRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; From 3f4507958c12a3dc011dcd28e40a11dc64c9171b Mon Sep 17 00:00:00 2001 From: leroyv Date: Thu, 21 Nov 2024 14:58:12 +0100 Subject: [PATCH 4/4] Controller pour Plats avec le form et templates. --- src/Controller/CuisinierController.php | 46 --------------- src/Controller/PlatController.php | 78 ------------------------- src/Controller/PlatsController.php | 81 ++++++++++++++++++++++++++ src/Form/PlatType.php | 24 -------- src/Form/PlatsType.php | 42 +++++++++++++ templates/plats/_delete_form.html.twig | 4 ++ templates/plats/_form.html.twig | 4 ++ templates/plats/edit.html.twig | 13 +++++ templates/plats/index.html.twig | 45 ++++++++++++++ templates/plats/new.html.twig | 11 ++++ templates/plats/show.html.twig | 46 +++++++++++++++ 11 files changed, 246 insertions(+), 148 deletions(-) delete mode 100644 src/Controller/CuisinierController.php delete mode 100644 src/Controller/PlatController.php create mode 100644 src/Controller/PlatsController.php delete mode 100644 src/Form/PlatType.php create mode 100644 src/Form/PlatsType.php create mode 100644 templates/plats/_delete_form.html.twig create mode 100644 templates/plats/_form.html.twig create mode 100644 templates/plats/edit.html.twig create mode 100644 templates/plats/index.html.twig create mode 100644 templates/plats/new.html.twig create mode 100644 templates/plats/show.html.twig diff --git a/src/Controller/CuisinierController.php b/src/Controller/CuisinierController.php deleted file mode 100644 index c2097ea..0000000 --- a/src/Controller/CuisinierController.php +++ /dev/null @@ -1,46 +0,0 @@ -createForm(CuisinierType::class, $cuisinier); - - $form->handleRequest($request); - if ($form->isSubmitted() && $form->isValid()) { - $entityManager->persist($cuisinier); - $entityManager->flush(); - - $this->addFlash('success', 'Cuisinier ajouté avec succès !'); - return $this->redirectToRoute('ajouter_cuisinier'); - } - - return $this->render('cuisinier/ajouter.html.twig', [ - 'form' => $form->createView(), - ]); - } - - #[Route('/cuisinier/supprimer/{id}', name: 'supprimer_cuisinier', methods: ['POST'])] - public function supprimer(int $id, EntityManagerInterface $entityManager): Response - { - $cuisinier = $entityManager->getRepository(Cuisinier::class)->find($id); - - if (!$cuisinier) { - throw $this->createNotFoundException('Ce cuisinier n\'existe pas'); - } - - $entityManager->remove($cuisinier); - $entityManager->flush(); - - $this->addFlash('success', 'Cuisinier supprimé avec succès !'); - return $this->redirectToRoute('ajouter_cuisinier'); - } -} \ No newline at end of file diff --git a/src/Controller/PlatController.php b/src/Controller/PlatController.php deleted file mode 100644 index 21bc50a..0000000 --- a/src/Controller/PlatController.php +++ /dev/null @@ -1,78 +0,0 @@ -createForm(PlatType::class, $plat); - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid()) { - $this->entityManager->persist($plat); - $this->entityManager->flush(); - } - - return $this->render('plat/add.html.twig', [ - 'formAdd' => $form, - ]); - } - - #[Route('/list', name: '_list')] - public function list(): Response - { - $plat = $this->platsRepository->findAll(); - return $this->render('plat/list.html.twig', [ - 'plat' => $plat, - ]); - } - - #[Route('/update/{id}', name: '_update')] - public function update(int $id, Request $request): Response - { - $plat = $this->platsRepository->find($id); - $form = $this->createForm(PlatType::class, $plat); - $form->handleRequest($request); - - if($form->isSubmitted() && $form->isValid()) - { - $this->entityManager->persist($plat); - $this->entityManager->flush(); - } - - return $this->render('plat/add.html.twig', [ - 'formAdd' => $form, - ]); - } - - #[Route('/delete/{id}', name: '_delete')] - public function delete(int $id): Response - { - $statutCommandes = $this->platsRepository->find($id); - $this->entityManager->remove($statutCommandes); - $this->entityManager->flush(); - - return $this->redirectToRoute('app_plat_list'); - } -} diff --git a/src/Controller/PlatsController.php b/src/Controller/PlatsController.php new file mode 100644 index 0000000..e9c034d --- /dev/null +++ b/src/Controller/PlatsController.php @@ -0,0 +1,81 @@ +render('plats/index.html.twig', [ + 'plats' => $platsRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_plats_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $plat = new Plats(); + $form = $this->createForm(PlatsType::class, $plat); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($plat); + $entityManager->flush(); + + return $this->redirectToRoute('app_plats_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('plats/new.html.twig', [ + 'plat' => $plat, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_plats_show', methods: ['GET'])] + public function show(Plats $plat): Response + { + return $this->render('plats/show.html.twig', [ + 'plat' => $plat, + ]); + } + + #[Route('/{id}/edit', name: 'app_plats_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Plats $plat, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(PlatsType::class, $plat); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_plats_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('plats/edit.html.twig', [ + 'plat' => $plat, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_plats_delete', methods: ['POST'])] + public function delete(Request $request, Plats $plat, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$plat->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($plat); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_plats_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Form/PlatType.php b/src/Form/PlatType.php deleted file mode 100644 index 3e3981c..0000000 --- a/src/Form/PlatType.php +++ /dev/null @@ -1,24 +0,0 @@ -add('field_name') - ; - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - // Configure your form options here - ]); - } -} diff --git a/src/Form/PlatsType.php b/src/Form/PlatsType.php new file mode 100644 index 0000000..5946a7d --- /dev/null +++ b/src/Form/PlatsType.php @@ -0,0 +1,42 @@ +add('Nom') + ->add('Description') + ->add('Prix') + ->add('Categorie') + ->add('Statut') + ->add('Nb_de_commande') + ->add('Commande', EntityType::class, [ + 'class' => Commandes::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ->add('Reduction', EntityType::class, [ + 'class' => Reductions::class, + 'choice_label' => 'id', + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Plats::class, + ]); + } +} diff --git a/templates/plats/_delete_form.html.twig b/templates/plats/_delete_form.html.twig new file mode 100644 index 0000000..bc89faf --- /dev/null +++ b/templates/plats/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/plats/_form.html.twig b/templates/plats/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/plats/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/plats/edit.html.twig b/templates/plats/edit.html.twig new file mode 100644 index 0000000..14afd7b --- /dev/null +++ b/templates/plats/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Plats{% endblock %} + +{% block body %} +

Edit Plats

+ + {{ include('plats/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('plats/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/plats/index.html.twig b/templates/plats/index.html.twig new file mode 100644 index 0000000..cb94e30 --- /dev/null +++ b/templates/plats/index.html.twig @@ -0,0 +1,45 @@ +{% extends 'base.html.twig' %} + +{% block title %}Plats index{% endblock %} + +{% block body %} +

Plats index

+ + + + + + + + + + + + + + + + {% for plat in plats %} + + + + + + + + + + + {% else %} + + + + {% endfor %} + +
IdNomDescriptionPrixCategorieStatutNb_de_commandeactions
{{ plat.id }}{{ plat.Nom }}{{ plat.Description }}{{ plat.Prix }}{{ plat.Categorie }}{{ plat.Statut ? 'Yes' : 'No' }}{{ plat.NbDeCommande }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/plats/new.html.twig b/templates/plats/new.html.twig new file mode 100644 index 0000000..a59e66b --- /dev/null +++ b/templates/plats/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Plats{% endblock %} + +{% block body %} +

Create new Plats

+ + {{ include('plats/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/plats/show.html.twig b/templates/plats/show.html.twig new file mode 100644 index 0000000..41fa96e --- /dev/null +++ b/templates/plats/show.html.twig @@ -0,0 +1,46 @@ +{% extends 'base.html.twig' %} + +{% block title %}Plats{% endblock %} + +{% block body %} +

Plats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ plat.id }}
Nom{{ plat.Nom }}
Description{{ plat.Description }}
Prix{{ plat.Prix }}
Categorie{{ plat.Categorie }}
Statut{{ plat.Statut ? 'Yes' : 'No' }}
Nb_de_commande{{ plat.NbDeCommande }}
+ + back to list + + edit + + {{ include('plats/_delete_form.html.twig') }} +{% endblock %}