Merge branch 'feature/Controller' into develop

This commit is contained in:
Joshua 2024-12-05 15:25:52 +01:00
commit e6135b438c
73 changed files with 2168 additions and 227 deletions

View File

@ -1,140 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241020235112 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SEQUENCE clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE commandes_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE details_commande_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE plats_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE reductions_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE reservations_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE statut_commandes_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE statut_tables_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE tables_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE utilisateurs_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE clients (id INT NOT NULL, prenom VARCHAR(255) NOT NULL, nom VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, telephone VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE clients_tables (clients_id INT NOT NULL, tables_id INT NOT NULL, PRIMARY KEY(clients_id, tables_id))');
$this->addSql('CREATE INDEX IDX_8190D6C6AB014612 ON clients_tables (clients_id)');
$this->addSql('CREATE INDEX IDX_8190D6C685405FD2 ON clients_tables (tables_id)');
$this->addSql('CREATE TABLE commandes (id INT NOT NULL, statut_commande_id INT DEFAULT NULL, date_heure TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, statut BOOLEAN NOT NULL, total DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_35D4282CFB435DFD ON commandes (statut_commande_id)');
$this->addSql('CREATE TABLE commandes_clients (commandes_id INT NOT NULL, clients_id INT NOT NULL, PRIMARY KEY(commandes_id, clients_id))');
$this->addSql('CREATE INDEX IDX_C665A6248BF5C2E6 ON commandes_clients (commandes_id)');
$this->addSql('CREATE INDEX IDX_C665A624AB014612 ON commandes_clients (clients_id)');
$this->addSql('CREATE TABLE details_commande (id INT NOT NULL, commande_id INT DEFAULT NULL, quantite INT NOT NULL, prix_unitaire DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_4BCD5F682EA2E54 ON details_commande (commande_id)');
$this->addSql('CREATE TABLE plats (id INT NOT NULL, reduction_id INT DEFAULT NULL, nom VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, prix DOUBLE PRECISION NOT NULL, categorie VARCHAR(255) NOT NULL, statut BOOLEAN NOT NULL, nb_de_commande INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_854A620AC03CB092 ON plats (reduction_id)');
$this->addSql('CREATE TABLE plats_commandes (plats_id INT NOT NULL, commandes_id INT NOT NULL, PRIMARY KEY(plats_id, commandes_id))');
$this->addSql('CREATE INDEX IDX_7F8CABAAAA14E1C8 ON plats_commandes (plats_id)');
$this->addSql('CREATE INDEX IDX_7F8CABAA8BF5C2E6 ON plats_commandes (commandes_id)');
$this->addSql('CREATE TABLE reductions (id INT NOT NULL, description VARCHAR(255) NOT NULL, prix DOUBLE PRECISION NOT NULL, pourcentage INT NOT NULL, montant_fixe VARCHAR(255) NOT NULL, date_debut TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, date_fin TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE reservations (id INT NOT NULL, tabl_id INT DEFAULT NULL, date_heure TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, nb_de_prsn INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_4DA2394DE1870D ON reservations (tabl_id)');
$this->addSql('CREATE TABLE statut_commandes (id INT NOT NULL, libelle VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE statut_tables (id INT NOT NULL, tabl_id INT DEFAULT NULL, libellé VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_33C8A3754DE1870D ON statut_tables (tabl_id)');
$this->addSql('CREATE TABLE tables (id INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE utilisateurs (id INT NOT NULL, nom VARCHAR(255) NOT NULL, prenom VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, mot_de_passe VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE utilisateurs_reservations (utilisateurs_id INT NOT NULL, reservations_id INT NOT NULL, PRIMARY KEY(utilisateurs_id, reservations_id))');
$this->addSql('CREATE INDEX IDX_995A78E71E969C5 ON utilisateurs_reservations (utilisateurs_id)');
$this->addSql('CREATE INDEX IDX_995A78E7D9A7F869 ON utilisateurs_reservations (reservations_id)');
$this->addSql('CREATE TABLE utilisateurs_tables (utilisateurs_id INT NOT NULL, tables_id INT NOT NULL, PRIMARY KEY(utilisateurs_id, tables_id))');
$this->addSql('CREATE INDEX IDX_A9A665291E969C5 ON utilisateurs_tables (utilisateurs_id)');
$this->addSql('CREATE INDEX IDX_A9A6652985405FD2 ON utilisateurs_tables (tables_id)');
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
$this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$
BEGIN
PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;');
$this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
$this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');
$this->addSql('ALTER TABLE clients_tables ADD CONSTRAINT FK_8190D6C6AB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE clients_tables ADD CONSTRAINT FK_8190D6C685405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE commandes ADD CONSTRAINT FK_35D4282CFB435DFD FOREIGN KEY (statut_commande_id) REFERENCES statut_commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE commandes_clients ADD CONSTRAINT FK_C665A6248BF5C2E6 FOREIGN KEY (commandes_id) REFERENCES commandes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE commandes_clients ADD CONSTRAINT FK_C665A624AB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE details_commande ADD CONSTRAINT FK_4BCD5F682EA2E54 FOREIGN KEY (commande_id) REFERENCES commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE plats ADD CONSTRAINT FK_854A620AC03CB092 FOREIGN KEY (reduction_id) REFERENCES reductions (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE plats_commandes ADD CONSTRAINT FK_7F8CABAAAA14E1C8 FOREIGN KEY (plats_id) REFERENCES plats (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE plats_commandes ADD CONSTRAINT FK_7F8CABAA8BF5C2E6 FOREIGN KEY (commandes_id) REFERENCES commandes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT FK_4DA2394DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A3754DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE utilisateurs_reservations ADD CONSTRAINT FK_995A78E71E969C5 FOREIGN KEY (utilisateurs_id) REFERENCES utilisateurs (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE utilisateurs_reservations ADD CONSTRAINT FK_995A78E7D9A7F869 FOREIGN KEY (reservations_id) REFERENCES reservations (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE utilisateurs_tables ADD CONSTRAINT FK_A9A665291E969C5 FOREIGN KEY (utilisateurs_id) REFERENCES utilisateurs (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE utilisateurs_tables ADD CONSTRAINT FK_A9A6652985405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP SEQUENCE clients_id_seq CASCADE');
$this->addSql('DROP SEQUENCE commandes_id_seq CASCADE');
$this->addSql('DROP SEQUENCE details_commande_id_seq CASCADE');
$this->addSql('DROP SEQUENCE plats_id_seq CASCADE');
$this->addSql('DROP SEQUENCE reductions_id_seq CASCADE');
$this->addSql('DROP SEQUENCE reservations_id_seq CASCADE');
$this->addSql('DROP SEQUENCE statut_commandes_id_seq CASCADE');
$this->addSql('DROP SEQUENCE statut_tables_id_seq CASCADE');
$this->addSql('DROP SEQUENCE tables_id_seq CASCADE');
$this->addSql('DROP SEQUENCE utilisateurs_id_seq CASCADE');
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT FK_8190D6C6AB014612');
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT FK_8190D6C685405FD2');
$this->addSql('ALTER TABLE commandes DROP CONSTRAINT FK_35D4282CFB435DFD');
$this->addSql('ALTER TABLE commandes_clients DROP CONSTRAINT FK_C665A6248BF5C2E6');
$this->addSql('ALTER TABLE commandes_clients DROP CONSTRAINT FK_C665A624AB014612');
$this->addSql('ALTER TABLE details_commande DROP CONSTRAINT FK_4BCD5F682EA2E54');
$this->addSql('ALTER TABLE plats DROP CONSTRAINT FK_854A620AC03CB092');
$this->addSql('ALTER TABLE plats_commandes DROP CONSTRAINT FK_7F8CABAAAA14E1C8');
$this->addSql('ALTER TABLE plats_commandes DROP CONSTRAINT FK_7F8CABAA8BF5C2E6');
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT FK_4DA2394DE1870D');
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A3754DE1870D');
$this->addSql('ALTER TABLE utilisateurs_reservations DROP CONSTRAINT FK_995A78E71E969C5');
$this->addSql('ALTER TABLE utilisateurs_reservations DROP CONSTRAINT FK_995A78E7D9A7F869');
$this->addSql('ALTER TABLE utilisateurs_tables DROP CONSTRAINT FK_A9A665291E969C5');
$this->addSql('ALTER TABLE utilisateurs_tables DROP CONSTRAINT FK_A9A6652985405FD2');
$this->addSql('DROP TABLE clients');
$this->addSql('DROP TABLE clients_tables');
$this->addSql('DROP TABLE commandes');
$this->addSql('DROP TABLE commandes_clients');
$this->addSql('DROP TABLE details_commande');
$this->addSql('DROP TABLE plats');
$this->addSql('DROP TABLE plats_commandes');
$this->addSql('DROP TABLE reductions');
$this->addSql('DROP TABLE reservations');
$this->addSql('DROP TABLE statut_commandes');
$this->addSql('DROP TABLE statut_tables');
$this->addSql('DROP TABLE tables');
$this->addSql('DROP TABLE utilisateurs');
$this->addSql('DROP TABLE utilisateurs_reservations');
$this->addSql('DROP TABLE utilisateurs_tables');
$this->addSql('DROP TABLE messenger_messages');
}
}

View File

@ -1,34 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241024193330 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE utilisateurs ALTER role TYPE JSON USING role::json');
$this->addSql('COMMENT ON COLUMN utilisateurs.role IS NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE utilisateurs ALTER role TYPE TEXT');
$this->addSql('COMMENT ON COLUMN utilisateurs.role IS \'(DC2Type:array)\'');
}
}

View File

@ -0,0 +1,119 @@
/* Global styles */
body {
font-family: 'Arial', sans-serif;
background-color: #f9f9f9;
color: #333;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
/* Page container */
.page-container {
width: 100%;
max-width: 600px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
border: 2px solid #db5559;
}
/* Title */
.page-title {
text-align: center;
font-size: 28px;
color: #db5559;
margin-bottom: 20px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
}
/* Form styles */
form {
display: flex;
flex-direction: column;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
}
label {
font-weight: bold;
color: #db5559;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 14px;
color: #333;
transition: border-color 0.3s ease-in-out;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
border-color: #db5559;
outline: none;
}
/* Submit and Delete buttons */
button {
background-color: #db5559;
color: white;
font-weight: bold;
padding: 12px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
text-transform: uppercase;
transition: background-color 0.3s ease-in-out;
}
button:hover {
background-color: #bf494d;
}
.delete-button {
background-color: #d9534f;
margin-top: 10px;
}
.delete-button:hover {
background-color: #c9302c;
}
/* Back to list link */
.actions {
text-align: center;
margin-top: 15px;
}
.actions a {
text-decoration: none;
color: #db5559;
font-weight: bold;
transition: color 0.3s ease-in-out;
}
.actions a:hover {
color: #a02326;
}

View File

@ -0,0 +1,77 @@
/* Global styles */
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f9f9f9;
color: #333;
}
h1 {
text-align: center;
color: #db5559;
margin-bottom: 20px;
}
/* Table styles */
.table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.table th, .table td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
.table th {
background-color: #db5559;
color: white;
}
.table tr:nth-child(even) {
background-color: #f2f2f2;
}
.table tr:hover {
background-color: #ddd;
}
/* Action links */
a {
text-decoration: none;
color: #db5559;
font-weight: bold;
}
a:hover {
color: #38538e;
text-decoration: underline;
}
/* New client button */
a[href*="app_clients_new"] {
display: inline-block;
margin-top: 20px;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border-radius: 5px;
font-size: 16px;
text-align: center;
transition: background-color 0.3s ease;
}
a[href*="app_clients_new"]:hover {
background-color: #388E3C;
}
/* Empty table row message */
.table td[colspan="6"] {
text-align: center;
font-style: italic;
color: #666;
}

View File

@ -0,0 +1,126 @@
/* Global styles */
body {
font-family: 'Arial', sans-serif;
background-color: #fff5f5;
color: #333;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
}
/* Page container */
.page-container {
width: 100%;
max-width: 600px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
border: 2px solid #ff4d4d;
}
/* Title */
.page-title {
text-align: center;
font-size: 28px;
color: #ff4d4d;
margin-bottom: 20px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
}
/* Form styles */
form {
display: flex;
flex-direction: column;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
}
label {
font-weight: bold;
color: #ff4d4d;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 14px;
color: #333;
transition: border-color 0.3s ease-in-out;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
border-color: #ff4d4d;
outline: none;
}
/* Submit button */
button {
background-color: #ff4d4d;
color: white;
font-weight: bold;
padding: 12px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
text-transform: uppercase;
transition: background-color 0.3s ease-in-out;
}
button:hover {
background-color: #e60000;
}
/* Links */
.actions {
text-align: center;
margin-top: 15px;
}
.actions a {
text-decoration: none;
color: #ff4d4d;
font-weight: bold;
transition: color 0.3s ease-in-out;
}
.actions a:hover {
color: #e60000;
}
/* Error messages */
.error-message {
color: #d9534f;
font-size: 14px;
margin-top: 5px;
font-style: italic;
}
/* Empty space below */
body::after {
content: '';
height: 20px;
display: block;
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\Clients;
use App\Form\ClientsType;
use App\Repository\ClientsRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/clients')]
final class ClientsController extends AbstractController
{
#[Route(name: 'app_clients_index', methods: ['GET'])]
public function index(ClientsRepository $clientsRepository): Response
{
return $this->render('clients/index.html.twig', [
'clients' => $clientsRepository->findAll(),
]);
}
#[Route('/new', name: 'app_clients_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$client = new Clients();
$form = $this->createForm(ClientsType::class, $client);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($client);
$entityManager->flush();
return $this->redirectToRoute('app_clients_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('clients/new.html.twig', [
'client' => $client,
'form' => $form,
]);
}
#[Route('/{id}/edit', name: 'app_clients_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Clients $client, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(ClientsType::class, $client);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_clients_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('clients/edit.html.twig', [
'client' => $client,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_clients_delete', methods: ['POST'])]
public function delete(Request $request, Clients $client, EntityManagerInterface $entityManager, int $id, ): Response
{
if ($this->isCsrfTokenValid('delete'.$client->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($client);
$entityManager->flush();
}
return $this->redirectToRoute('app_clients_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\Commandes;
use App\Form\CommandesType;
use App\Repository\CommandesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/commandes')]
final class CommandesController extends AbstractController
{
#[Route(name: 'app_commandes_index', methods: ['GET'])]
public function index(CommandesRepository $commandesRepository): Response
{
return $this->render('commandes/index.html.twig', [
'commandes' => $commandesRepository->findAll(),
]);
}
#[Route('/new', name: 'app_commandes_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$commande = new Commandes();
$form = $this->createForm(CommandesType::class, $commande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($commande);
$entityManager->flush();
return $this->redirectToRoute('app_commandes_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('commandes/new.html.twig', [
'commande' => $commande,
'form' => $form,
]);
}
#[Route('/{id}/edit', name: 'app_commandes_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Commandes $commande, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(CommandesType::class, $commande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_commandes_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('commandes/edit.html.twig', [
'commande' => $commande,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_commandes_delete', methods: ['POST'])]
public function delete(Request $request, Commandes $commande, EntityManagerInterface $entityManager, int $id): Response
{
if ($this->isCsrfTokenValid('delete'.$commande->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($commande);
$entityManager->flush();
}
return $this->redirectToRoute('app_commandes_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -1,46 +0,0 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class CuisinierController extends AbstractController
{
#[Route('/cuisinier/ajouter', name: 'ajouter_cuisinier')]
public function ajouter(Request $request, EntityManagerInterface $entityManager): Response
{
$cuisinier = new Cuisinier();
$form = $this->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');
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\DetailsCommande;
use App\Form\DetailsCommandeType;
use App\Repository\DetailsCommandeRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/details/commande')]
final class DetailsCommandeController extends AbstractController
{
#[Route(name: 'app_details_commande_index', methods: ['GET'])]
public function index(DetailsCommandeRepository $detailsCommandeRepository): Response
{
return $this->render('details_commande/index.html.twig', [
'details_commandes' => $detailsCommandeRepository->findAll(),
]);
}
#[Route('/new', name: 'app_details_commande_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$detailsCommande = new DetailsCommande();
$form = $this->createForm(DetailsCommandeType::class, $detailsCommande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($detailsCommande);
$entityManager->flush();
return $this->redirectToRoute('app_details_commande_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('details_commande/new.html.twig', [
'details_commande' => $detailsCommande,
'form' => $form,
]);
}
#[Route('/{id}/edit', name: 'app_details_commande_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, DetailsCommande $detailsCommande, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(DetailsCommandeType::class, $detailsCommande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_details_commande_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('details_commande/edit.html.twig', [
'details_commande' => $detailsCommande,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_details_commande_delete', methods: ['POST'])]
public function delete(Request $request, DetailsCommande $detailsCommande, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$detailsCommande->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($detailsCommande);
$entityManager->flush();
}
return $this->redirectToRoute('app_details_commande_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,75 @@
<?php
namespace App\Controller;
use App\Entity\Plats;
use App\Form\PlatsType;
use App\Repository\PlatsRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/plats')]
final class PlatsController extends AbstractController
{
#[Route(name: 'app_plats_index', methods: ['GET'])]
public function index(PlatsRepository $platsRepository): Response
{
return $this->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}/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);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\Reductions;
use App\Form\ReductionsType;
use App\Repository\ReductionsRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/reductions')]
final class ReductionsController extends AbstractController
{
#[Route(name: 'app_reductions_index', methods: ['GET'])]
public function index(ReductionsRepository $reductionsRepository): Response
{
return $this->render('reductions/index.html.twig', [
'reductions' => $reductionsRepository->findAll(),
]);
}
#[Route('/new', name: 'app_reductions_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$reduction = new Reductions();
$form = $this->createForm(ReductionsType::class, $reduction);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($reduction);
$entityManager->flush();
return $this->redirectToRoute('app_reductions_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('reductions/new.html.twig', [
'reduction' => $reduction,
'form' => $form,
]);
}
#[Route('/{id}/edit', name: 'app_reductions_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Reductions $reduction, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(ReductionsType::class, $reduction);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_reductions_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('reductions/edit.html.twig', [
'reduction' => $reduction,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_reductions_delete', methods: ['POST'])]
public function delete(Request $request, Reductions $reduction, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$reduction->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($reduction);
$entityManager->flush();
}
return $this->redirectToRoute('app_reductions_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\Reservations;
use App\Form\ReservationsType;
use App\Repository\ReservationsRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/reservations')]
final class ReservationsController extends AbstractController
{
#[Route(name: 'app_reservations_index', methods: ['GET'])]
public function index(ReservationsRepository $reservationsRepository): Response
{
return $this->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}/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);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\StatutCommandes;
use App\Form\StatutCommandesType;
use App\Repository\StatutCommandesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/statut/commandes')]
final class StatutCommandesController extends AbstractController
{
#[Route(name: 'app_statut_commandes_index', methods: ['GET'])]
public function index(StatutCommandesRepository $statutCommandesRepository): Response
{
return $this->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}/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);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Controller;
use App\Entity\StatutTables;
use App\Form\StatutTablesType;
use App\Repository\StatutTablesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/statut/tables')]
final class StatutTablesController extends AbstractController
{
#[Route(name: 'app_statut_tables_index', methods: ['GET'])]
public function index(StatutTablesRepository $statutTablesRepository): Response
{
return $this->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}/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);
}
}

View File

@ -0,0 +1,75 @@
<?php
namespace App\Controller;
use App\Entity\Tables;
use App\Form\TablesType;
use App\Repository\TablesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/tables')]
final class TablesController extends AbstractController
{
#[Route(name: 'app_tables_index', methods: ['GET'])]
public function index(TablesRepository $tablesRepository): Response
{
return $this->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}/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);
}
}

View File

@ -2,12 +2,13 @@
namespace App\Entity;
use AllowDynamicProperties;
use App\Repository\ClientsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ClientsRepository::class)]
#[AllowDynamicProperties] #[ORM\Entity(repositoryClass: ClientsRepository::class)]
class Clients
{
#[ORM\Id]
@ -31,7 +32,7 @@ class Clients
* @var Collection<int, Tables>
*/
#[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')]
private Collection $tables;
public Collection $tables;
/**
* @var Collection<int, Commandes>

View File

@ -14,7 +14,7 @@ class StatutTables
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Libellé = null;
private ?string $Libelle = null;
#[ORM\ManyToOne(inversedBy: 'statutTables')]
private ?Tables $tables = null;
@ -24,14 +24,14 @@ class StatutTables
return $this->id;
}
public function getLibellé(): ?string
public function getLibelle(): ?string
{
return $this->Libellé;
return $this->Libelle;
}
public function setLibellé(string $Libellé): static
public function setLibelle(string $Libelle): static
{
$this->Libellé = $Libellé;
$this->Libelle = $Libelle;
return $this;
}

41
src/Form/ClientsType.php Normal file
View File

@ -0,0 +1,41 @@
<?php
namespace App\Form;
use App\Entity\Clients;
use App\Entity\Commandes;
use App\Entity\Tables;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ClientsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Prenom')
->add('Nom')
->add('Email')
->add('Telephone')
->add('Tables', EntityType::class, [
'class' => Tables::class,
'choice_label' => 'id',
'multiple' => true,
])
->add('Commandes', EntityType::class, [
'class' => Commandes::class,
'choice_label' => 'id',
'multiple' => true,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Clients::class,
]);
}
}

View File

@ -0,0 +1,47 @@
<?php
namespace App\Form;
use App\Entity\Clients;
use App\Entity\Commandes;
use App\Entity\Plats;
use App\Entity\StatutCommandes;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CommandesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('DateHeure', null, [
'widget' => 'single_text',
])
->add('Statut')
->add('Total')
->add('Client', EntityType::class, [
'class' => Clients::class,
'choice_label' => 'id',
'multiple' => true,
])
->add('plats', EntityType::class, [
'class' => Plats::class,
'choice_label' => 'id',
'multiple' => true,
])
->add('StatutCommande', EntityType::class, [
'class' => StatutCommandes::class,
'choice_label' => 'id',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Commandes::class,
]);
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Form;
use App\Entity\Commandes;
use App\Entity\DetailsCommande;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class DetailsCommandeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Quantite')
->add('PrixUnitaire')
->add('Commande', EntityType::class, [
'class' => Commandes::class,
'choice_label' => 'id',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => DetailsCommande::class,
]);
}
}

43
src/Form/PlatsType.php Normal file
View File

@ -0,0 +1,43 @@
<?php
namespace App\Form;
use App\Entity\Commandes;
use App\Entity\Plats;
use App\Entity\Reductions;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PlatsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->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,
'expanded' => true,
])
->add('Reduction', EntityType::class, [
'class' => Reductions::class,
'choice_label' => 'description',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Plats::class,
]);
}
}

View File

@ -0,0 +1,34 @@
<?php
namespace App\Form;
use App\Entity\Reductions;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ReductionsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Description')
->add('Prix')
->add('Pourcentage')
->add('MontantFixe')
->add('DateDebut', null, [
'widget' => 'single_text',
])
->add('DateFin', null, [
'widget' => 'single_text',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Reductions::class,
]);
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Form;
use App\Entity\Reservations;
use App\Entity\Tables;
use App\Entity\Utilisateurs;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ReservationsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->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,
]);
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Form;
use App\Entity\StatutCommandes;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class StatutCommandesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Libelle')
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => StatutCommandes::class,
]);
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Form;
use App\Entity\StatutTables;
use App\Entity\Tables;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class StatutTablesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Libelle')
->add('tables', EntityType::class, [
'class' => Tables::class,
'choice_label' => 'id',
'mapped' => false,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => StatutTables::class,
]);
}
}

37
src/Form/TablesType.php Normal file
View File

@ -0,0 +1,37 @@
<?php
namespace App\Form;
use App\Entity\Clients;
use App\Entity\Tables;
use App\Entity\Utilisateurs;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class TablesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->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,
]);
}
}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_clients_delete', {'id': client.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ client.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier Client{% endblock %}
{% block body %}
<h1>Modifier Client</h1>
{{ include('clients/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<a href="{{ path('app_clients_index') }}">Retour à la liste</a>
{{ include('clients/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,47 @@
{% extends 'base.html.twig' %}
{% block title %}Clients index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Clients index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Prenom</th>
<th>Nom</th>
<th>Email</th>
<th>Telephone</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for client in clients %}
<tr>
<td>{{ client.id }}</td>
<td>{{ client.Prenom }}</td>
<td>{{ client.Nom }}</td>
<td>{{ client.Email }}</td>
<td>{{ client.Telephone }}</td>
<td>
<form method="post" action="{{ path('app_clients_delete', {'id': client.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ client.id) }}">
{{ include('clients/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_clients_edit', {'id': client.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_clients_new') }}">Créer un nouveau client</a>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}Nouveau client{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer un client</h1>
{{ include('clients/_form.html.twig') }}
<a href="{{ path('app_clients_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_commandes_delete', {'id': commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ commande.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier Commande{% endblock %}
{% block body %}
<h1>Modifier Commande</h1>
{{ include('commandes/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<a href="{{ path('app_commandes_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends 'base.html.twig' %}
{% block title %}Commandes index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Commandes index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>DateHeure</th>
<th>Statut</th>
<th>Total</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for commande in commandes %}
<tr>
<td>{{ commande.id }}</td>
<td>{{ commande.DateHeure ? commande.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ commande.Statut ? 'Yes' : 'No' }}</td>
<td>{{ commande.Total }}</td>
<td>
<form method="post" action="{{ path('app_commandes_delete', {'id': commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ commande.id) }}">
{{ include('commandes/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_commandes_edit', {'id': commande.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">pas de commande crée</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_commandes_new') }}">Créer une nouvelle commande</a>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends 'base.html.twig' %}
{% block title %}Nouvelle commande{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer une commande</h1>
{{ include('commandes/_form.html.twig') }}
<a href="{{ path('app_commandes_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_details_commande_delete', {'id': details_commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ details_commande.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier détail commande{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier détail commande</h1>
{{ include('details_commande/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_details_commande_index') }}">Retour à la liste</a>
</div>
{{ include('details_commande/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,44 @@
{% extends 'base.html.twig' %}
{% block title %}DetailsCommande index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}">
{% endblock %}
{% block body %}
<h1>DetailsCommande index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Quantite</th>
<th>PrixUnitaire</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for details_commande in details_commandes %}
<tr>
<td>{{ details_commande.id }}</td>
<td>{{ details_commande.Quantite }}</td>
<td>{{ details_commande.PrixUnitaire }}</td>
<td>
<form method="post" action="{{ path('app_details_commande_delete', {'id': details_commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ details_commande.id) }}">
{{ include('details_commande/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_details_commande_edit', {'id': details_commande.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_details_commande_new') }}">Créer le détail d'une commande</a>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends 'base.html.twig' %}
{% block title %}Nouveau detail commande{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer un détail commande</h1>
{{ include('details_commande/_form.html.twig') }}
<a href="{{ path('app_details_commande_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_plats_delete', {'id': plat.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ plat.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier Plat{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier Plat</h1>
{{ include('plats/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_plats_index') }}">Retour à la liste</a>
</div>
{{ include('plats/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,51 @@
{% extends 'base.html.twig' %}
{% block title %}Plats index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Plats index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Description</th>
<th>Prix</th>
<th>Categorie</th>
<th>Statut</th>
<th>Nb_de_commande</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for plat in plats %}
<tr>
<td>{{ plat.id }}</td>
<td>{{ plat.Nom }}</td>
<td>{{ plat.Description }}</td>
<td>{{ plat.Prix }}</td>
<td>{{ plat.Categorie }}</td>
<td>{{ plat.Statut ? 'Yes' : 'No' }}</td>
<td>{{ plat.NbDeCommande }}</td>
<td>
<form method="post" action="{{ path('app_plats_delete', {'id': plat.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ plat.id) }}">
{{ include('plats/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_plats_edit', {'id': plat.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_plats_new') }}">Créer un nouveau plat</a>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}New Plats{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer un nouveau plat</h1>
{{ include('plats/_form.html.twig') }}
<a href="{{ path('app_plats_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_reductions_delete', {'id': reduction.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reduction.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier Réductions{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier une réduction</h1>
{{ include('reductions/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_reductions_index') }}">Retour à la liste</a>
</div>
{{ include('reductions/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,51 @@
{% extends 'base.html.twig' %}
{% block title %}Reductions index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Reductions index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Description</th>
<th>Prix</th>
<th>Pourcentage</th>
<th>MontantFixe</th>
<th>DateDebut</th>
<th>DateFin</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for reduction in reductions %}
<tr>
<td>{{ reduction.id }}</td>
<td>{{ reduction.Description }}</td>
<td>{{ reduction.Prix }}</td>
<td>{{ reduction.Pourcentage }}</td>
<td>{{ reduction.MontantFixe }}</td>
<td>{{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }}</td>
<td>
<form method="post" action="{{ path('app_reductions_delete', {'id': reduction.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reduction.id) }}">
{{ include('reductions/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_reductions_edit', {'id': reduction.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_reductions_new') }}">Créer une réduction</a>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}Nouvelle reduction{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer une Reduction</h1>
{{ include('reductions/_form.html.twig') }}
<a href="{{ path('app_reductions_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_reservations_delete', {'id': reservation.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reservation.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Modifier Réservation{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier Réservation</h1>
{{ include('reservations/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_reservations_index') }}">Retour à la liste</a>
</div>
{{ include('reservations/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,43 @@
{% extends 'base.html.twig' %}
{% block title %}Reservations index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Reservations index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>DateHeure</th>
<th>Nb_de_prsn</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for reservation in reservations %}
<tr>
<td>{{ reservation.id }}</td>
<td>{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ reservation.NbDePrsn }}</td>
<td>
<form method="post" action="{{ path('app_reservations_delete', {'id': reservation.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reservation.id) }}">
{{ include('reservations/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_reservations_edit', {'id': reservation.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_reservations_new') }}">Créer une réservation</a>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}New Reservations{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer une reservation</h1>
{{ include('reservations/_form.html.twig') }}
<a href="{{ path('app_reservations_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_statut_commandes_delete', {'id': statut_commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_commande.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Statut commandes{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier Statut commandes</h1>
{{ include('statut_commandes/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_statut_commandes_index') }}">Retour à la liste</a>
</div>
{{ include('statut_commandes/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,42 @@
{% extends 'base.html.twig' %}
{% block title %}StatutCommandes index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>StatutCommandes index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Libelle</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for statut_commande in statut_commandes %}
<tr>
<td>{{ statut_commande.id }}</td>
<td>{{ statut_commande.Libelle }}</td>
<td>
<form method="post" action="{{ path('app_statut_commandes_delete', {'id': statut_commande.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_commande.id) }}">
{{ include('statut_commandes/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_statut_commandes_edit', {'id': statut_commande.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_statut_commandes_new') }}">Créer un nouveau statut</a>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}Nouveau StatutCommandes{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer nouveau StatutCommandes</h1>
{{ include('statut_commandes/_form.html.twig') }}
<a href="{{ path('app_statut_commandes_index') }}">Retour à la liste</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_statut_tables_delete', {'id': statut_table.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_table.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,23 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Statut tables{% endblock %}
{% block stylesheets %}
<div class="page-container">
<h1 class="page-title">Modifier Statut tables</h1>
{{ include('statut_tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
{{ include('statut_tables/_delete_form.html.twig') }}
<br>
<a href="{{ path('app_statut_tables_index') }}">Retour à la liste</a>
</div>
</div>
{% endblock %}
{% block body %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}

View File

@ -0,0 +1,41 @@
{% extends 'base.html.twig' %}
{% block title %}StatutTables index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>StatutTables index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Libellé</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for statut_table in statut_tables %}
<tr>
<td>{{ statut_table.id }}</td>
<td>{{ statut_table.Libelle}}</td>
<td>
<form method="post" action="{{ path('app_statut_tables_delete', {'id': statut_table.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_table.id) }}">
{{ include('statut_tables/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_statut_tables_edit', {'id': statut_table.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_statut_tables_new') }}">Créer un nouveau</a>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends 'base.html.twig' %}
{% block title %}Créer un nouveau StatutTables{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Créer un nouveau StatutTables</h1>
{{ include('statut_tables/_form.html.twig') }}
<div class="actions">
<a href="{{ path('app_statut_tables_index') }}">Retour à la liste</a>
</div>
{% endblock %}

View File

@ -0,0 +1,29 @@
{% extends 'base.html.twig' %}
{% block title %}StatutTables{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/show.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>StatutTables</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ statut_table.id }}</td>
</tr>
<tr>
<th>Libellé</th>
<td>{{ statut_table.Libelle }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_statut_tables_index') }}">back to list</a>
<a href="{{ path('app_statut_tables_edit', {'id': statut_table.id}) }}">edit</a>
{{ include('statut_tables/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_tables_delete', {'id': table.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ table.id) }}">
<button class="btn">Supprimer</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Sauvegarder') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Tables{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}">
{% endblock %}
{% block body %}
<div class="page-container">
<h1 class="page-title">Modifier Tables</h1>
{{ include('tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }}
<div class="actions">
<a href="{{ path('app_tables_index') }}">Retour à la liste</a>
</div>
{{ include('tables/_delete_form.html.twig') }}
</div>
{% endblock %}

View File

@ -0,0 +1,39 @@
{% extends 'base.html.twig' %}
{% block title %}Tables index{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<h1>Tables index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for table in tables %}
<tr>
<td>{{ table.id }}</td>
<td>
<form method="post" action="{{ path('app_tables_delete', {'id': table.id}) }}" onsubmit="return confirm('Es-tu sur de vouloir le supprimer ?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ table.id) }}">
{{ include('tables/_delete_form.html.twig') }}
</form>
<a href="{{ path('app_tables_edit', {'id': table.id}) }}">Modifier</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="2">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_tables_new') }}">Créer une nouvelle table</a>
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'base.html.twig' %}
{% block title %}Create New Table{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/list.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/ControllerVues/new.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<div class="container">
<h1 class="page-title">Créer une nouvelle Table</h1>
<div class="form-container">
{{ include('tables/_form.html.twig') }}
</div>
<div class="navigation">
<a href="{{ path('app_tables_index') }}" class="btn btn-secondary">Retour à la liste</a>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'base.html.twig' %}
{% block title %}Tables{% endblock %}
{% block body %}
<h1>Tables</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ table.id }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_tables_index') }}">Retour à la liste</a>
<a href="{{ path('app_tables_edit', {'id': table.id}) }}">Modifier</a>
{{ include('tables/_delete_form.html.twig') }}
{% endblock %}