Merge remote-tracking branch 'origin/develop' into feature/Index

This commit is contained in:
Tinka 2024-12-05 15:37:58 +01:00
commit 9965cffecc
95 changed files with 2642 additions and 378 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,52 @@
<?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 Version20241114160014 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 reservations DROP CONSTRAINT fk_4da2394de1870d');
$this->addSql('DROP INDEX idx_4da2394de1870d');
$this->addSql('ALTER TABLE reservations RENAME COLUMN tabl_id TO table_id');
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT FK_4DA239ECFF285C FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_4DA239ECFF285C ON reservations (table_id)');
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT fk_33c8a3754de1870d');
$this->addSql('DROP INDEX idx_33c8a3754de1870d');
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN tabl_id TO table_id');
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A375ECFF285C FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_33C8A375ECFF285C ON statut_tables (table_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_497B315E5126AC48 ON utilisateurs (mail)');
}
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('DROP INDEX UNIQ_497B315E5126AC48');
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A375ECFF285C');
$this->addSql('DROP INDEX IDX_33C8A375ECFF285C');
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN table_id TO tabl_id');
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT fk_33c8a3754de1870d FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_33c8a3754de1870d ON statut_tables (tabl_id)');
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT FK_4DA239ECFF285C');
$this->addSql('DROP INDEX IDX_4DA239ECFF285C');
$this->addSql('ALTER TABLE reservations RENAME COLUMN table_id TO tabl_id');
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT fk_4da2394de1870d FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_4da2394de1870d ON reservations (tabl_id)');
}
}

View File

@ -0,0 +1,50 @@
<?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 Version20241114160729 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 reservations DROP CONSTRAINT fk_4da239ecff285c');
$this->addSql('DROP INDEX idx_4da239ecff285c');
$this->addSql('ALTER TABLE reservations RENAME COLUMN table_id TO tables_id');
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT FK_4DA23985405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_4DA23985405FD2 ON reservations (tables_id)');
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT fk_33c8a375ecff285c');
$this->addSql('DROP INDEX idx_33c8a375ecff285c');
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN table_id TO tables_id');
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A37585405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_33C8A37585405FD2 ON statut_tables (tables_id)');
}
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 statut_tables DROP CONSTRAINT FK_33C8A37585405FD2');
$this->addSql('DROP INDEX IDX_33C8A37585405FD2');
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN tables_id TO table_id');
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT fk_33c8a375ecff285c FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_33c8a375ecff285c ON statut_tables (table_id)');
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT FK_4DA23985405FD2');
$this->addSql('DROP INDEX IDX_4DA23985405FD2');
$this->addSql('ALTER TABLE reservations RENAME COLUMN tables_id TO table_id');
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT fk_4da239ecff285c FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_4da239ecff285c ON reservations (table_id)');
}
}

View File

@ -0,0 +1,46 @@
<?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 Version20241114164216 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 TABLE tables_clients (tables_id INT NOT NULL, clients_id INT NOT NULL, PRIMARY KEY(tables_id, clients_id))');
$this->addSql('CREATE INDEX IDX_80F8906E85405FD2 ON tables_clients (tables_id)');
$this->addSql('CREATE INDEX IDX_80F8906EAB014612 ON tables_clients (clients_id)');
$this->addSql('ALTER TABLE tables_clients ADD CONSTRAINT FK_80F8906E85405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE tables_clients ADD CONSTRAINT FK_80F8906EAB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT fk_8190d6c6ab014612');
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT fk_8190d6c685405fd2');
$this->addSql('DROP TABLE clients_tables');
}
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('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_8190d6c685405fd2 ON clients_tables (tables_id)');
$this->addSql('CREATE INDEX idx_8190d6c6ab014612 ON clients_tables (clients_id)');
$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 tables_clients DROP CONSTRAINT FK_80F8906E85405FD2');
$this->addSql('ALTER TABLE tables_clients DROP CONSTRAINT FK_80F8906EAB014612');
$this->addSql('DROP TABLE tables_clients');
}
}

View File

@ -0,0 +1,64 @@
#container_modal {
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);
}
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%;
}
}

View File

@ -48,7 +48,7 @@
} }
} }
#container_gestion_user { #container_modal {
background-color: white; background-color: white;
margin-left: 20%; /* Centrage vertical */ margin-left: 20%; /* Centrage vertical */
margin-top: 5%; margin-top: 5%;
@ -57,7 +57,6 @@
width: 75%; /* Largeur du contenu de la modal */ width: 75%; /* Largeur du contenu de la modal */
height: 100%; /* Hauteur du contenu de la modal */ height: 100%; /* Hauteur du contenu de la modal */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
display: none;
} }
a{ a{

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,10 @@
#container_modal {
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);
}

View File

@ -0,0 +1,40 @@
document.querySelector('.btn-info-compte').addEventListener('click', function(event) {
event.preventDefault();
document.getElementById('container_modal');
fetch('/gestion-user')
.then(response => {
if (!response.ok) {
throw new Error('Erreur');
}
return response.text();
})
.then(html => {
// Insérer le HTML dans le conteneur et l'afficher
container_modal.innerHTML = html;
container_modal.style.display = 'block';
})
.catch(error => {
console.error('Erreur:', error);
});
});
function updateUser (event) {
document.getElementById('container_modal');
const userIdString = event.getAttribute('data-id');
let userId = parseInt(userIdString);
fetch(`/user/update/${userId}`)
.then(response => {
return response.text();
})
.then(html => {
// Insérer le HTML dans le conteneur et l'afficher
container_modal.innerHTML = html;
container_modal.style.display = 'block';
})
.catch(error => {
console.error('Erreur:', error);
});
}

View File

@ -0,0 +1,41 @@
document.querySelector('.btn-gestion-utilisateurs').addEventListener('click', function(event) {
event.preventDefault();
document.getElementById('container_modal');
fetch('/user/list')
.then(response => {
if (!response.ok) {
throw new Error('Erreur de chargement de la section Compte');
}
return response.text();
})
.then(html => {
// Insérer le HTML dans le conteneur et l'afficher
container_modal.innerHTML = html;
container_modal.style.display = 'block';
})
.catch(error => {
console.error('Erreur:', error);
});
});
function addUser (event) {
document.getElementById('container_modal');
fetch('/user/add')
.then(response => {
if (!response.ok) {
throw new Error('Erreur de chargement de la section Compte');
}
return response.text();
})
.then(html => {
// Insérer le HTML dans le conteneur et l'afficher
container_modal.innerHTML = html;
container_modal.style.display = 'block';
})
.catch(error => {
console.error('Erreur:', error);
});
}

View File

@ -1,29 +0,0 @@
document.querySelector('.btn-info-compte').addEventListener('click', function(event) {
event.preventDefault();
const contentContainer = document.getElementById('container-gestion-user');
// Vérifie si le contenu est déjà affiché
if (container_gestion_user.style.display === 'block') {
// Masquer la section "Compte" si elle est déjà affichée
container_gestion_user.style.display = 'none';
container_gestion_user.innerHTML = ''; // On efface le contenu pour éviter la réutilisation
} else {
// Afficher le conteneur et charger le contenu via AJAX
fetch('/gestion-user')
.then(response => {
if (!response.ok) {
throw new Error('Erreur de chargement de la section Compte');
}
return response.text();
})
.then(html => {
// Insérer le HTML dans le conteneur et l'afficher
container_gestion_user.innerHTML = html;
container_gestion_user.style.display = 'block';
})
.catch(error => {
console.error('Erreur:', error);
});
}
});

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

@ -31,7 +31,7 @@ class LoginController extends AbstractController
#[Route('/access/denied', name: 'app_access_denied')] #[Route('/access/denied', name: 'app_access_denied')]
public function denied(): Response public function denied(): Response
{ {
return $this->render('access_denied/index.html.twig', [ return $this->render('access_denied/gestion.html.twig', [
'controller_name' => 'AccessDeniedController', 'controller_name' => 'AccessDeniedController',
]); ]);
} }

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

@ -69,7 +69,7 @@ class UserController extends AbstractController
return $this->redirectToRoute('app_index'); return $this->redirectToRoute('app_index');
} }
return $this->render('gestion_user/index.html.twig', [ return $this->render('user/update.html.twig', [
'form' => $form, 'form' => $form,
]); ]);
} }
@ -88,6 +88,6 @@ class UserController extends AbstractController
#[Route('/gestion-user', name: 'gestion_user', methods: ['GET'])] #[Route('/gestion-user', name: 'gestion_user', methods: ['GET'])]
public function index(): Response public function index(): Response
{ {
return $this->render('gestion_user/index.html.twig'); return $this->render('user/gestion.html.twig');
} }
} }

View File

@ -2,12 +2,13 @@
namespace App\Entity; namespace App\Entity;
use AllowDynamicProperties;
use App\Repository\ClientsRepository; use App\Repository\ClientsRepository;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ClientsRepository::class)] #[AllowDynamicProperties] #[ORM\Entity(repositoryClass: ClientsRepository::class)]
class Clients class Clients
{ {
#[ORM\Id] #[ORM\Id]
@ -30,8 +31,8 @@ class Clients
/** /**
* @var Collection<int, Tables> * @var Collection<int, Tables>
*/ */
#[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Client')] #[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')]
private Collection $table; public Collection $tables;
/** /**
* @var Collection<int, Commandes> * @var Collection<int, Commandes>
@ -41,7 +42,7 @@ class Clients
public function __construct() public function __construct()
{ {
$this->table = new ArrayCollection(); $this->tables = new ArrayCollection();
$this->commandes = new ArrayCollection(); $this->commandes = new ArrayCollection();
} }
@ -101,23 +102,23 @@ class Clients
/** /**
* @return Collection<int, Tables> * @return Collection<int, Tables>
*/ */
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)) { if (!$this->tables->contains($tables)) {
$this->table->add($table); $this->tables->add($tables);
} }
return $this; return $this;
} }
public function removeTable(Tables $table): static public function removeTable(Tables $tables): static
{ {
$this->table->removeElement($table); $this->tables->removeElement($tables);
return $this; return $this;
} }

View File

@ -23,7 +23,7 @@ class Reservations
private ?int $Nb_de_prsn = null; private ?int $Nb_de_prsn = null;
#[ORM\ManyToOne(inversedBy: 'reservations')] #[ORM\ManyToOne(inversedBy: 'reservations')]
private ?Tables $Table = null; private ?Tables $tables = null;
/** /**
* @var Collection<int, Utilisateurs> * @var Collection<int, Utilisateurs>
@ -65,14 +65,14 @@ class Reservations
return $this; 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; return $this;
} }

View File

@ -14,36 +14,36 @@ class StatutTables
private ?int $id = null; private ?int $id = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
private ?string $Libellé = null; private ?string $Libelle = null;
#[ORM\ManyToOne(inversedBy: 'statutTables')] #[ORM\ManyToOne(inversedBy: 'statutTables')]
private ?Tables $Table = null; private ?Tables $tables = null;
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; 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; 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; return $this;
} }

View File

@ -18,25 +18,25 @@ class Tables
/** /**
* @var Collection<int, Clients> * @var Collection<int, Clients>
*/ */
#[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'table')] #[ORM\ManyToMany(targetEntity: Clients::class, inversedBy: 'tables')]
private Collection $Clients; private Collection $Clients;
/** /**
* @var Collection<int, Reservations> * @var Collection<int, Reservations>
*/ */
#[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Table')] #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')]
private Collection $reservations; private Collection $reservations;
/** /**
* @var Collection<int, StatutTables> * @var Collection<int, StatutTables>
*/ */
#[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Table')] #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')]
private Collection $statutTables; private Collection $statutTables;
/** /**
* @var Collection<int, Utilisateurs> * @var Collection<int, Utilisateurs>
*/ */
#[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'table')] #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tables')]
private Collection $utilisateurs; private Collection $utilisateurs;
public function __construct() public function __construct()
@ -55,7 +55,7 @@ class Tables
/** /**
* @return Collection<int, Clients> * @return Collection<int, Clients>
*/ */
public function getClient(): Collection public function getClients(): Collection
{ {
return $this->Clients; return $this->Clients;
} }
@ -101,7 +101,7 @@ class Tables
{ {
if ($this->reservations->removeElement($reservation)) { if ($this->reservations->removeElement($reservation)) {
// set the owning side to null (unless already changed) // set the owning side to null (unless already changed)
if ($reservation->getTable() === $this) { if ($reservation->getTables() === $this) {
$reservation->setTable(null); $reservation->setTable(null);
} }
} }
@ -131,7 +131,7 @@ class Tables
{ {
if ($this->statutTables->removeElement($statutTable)) { if ($this->statutTables->removeElement($statutTable)) {
// set the owning side to null (unless already changed) // set the owning side to null (unless already changed)
if ($statutTable->getTable() === $this) { if ($statutTable->getTables() === $this) {
$statutTable->setTable(null); $statutTable->setTable(null);
} }
} }

View File

@ -42,12 +42,12 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface
* @var Collection<int, Tables> * @var Collection<int, Tables>
*/ */
#[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')] #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')]
private Collection $table; private Collection $tables;
public function __construct() public function __construct()
{ {
$this->Reservation = new ArrayCollection(); $this->Reservation = new ArrayCollection();
$this->table = new ArrayCollection(); $this->tables = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@ -157,23 +157,23 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface
/** /**
* @return Collection<int, Tables> * @return Collection<int, Tables>
*/ */
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)) { if (!$this->tables->contains($tables)) {
$this->table->add($table); $this->tables->add($tables);
} }
return $this; return $this;
} }
public function removeTable(Tables $table): static public function removeTable(Tables $tables): static
{ {
$this->table->removeElement($table); $this->tables->removeElement($tables);
return $this; 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

@ -39,6 +39,8 @@ class UpdateUserType extends AbstractType
'choices' => [ 'choices' => [
'Admin' => 'ROLE_ADMIN', 'Admin' => 'ROLE_ADMIN',
'User' => 'ROLE_USER', 'User' => 'ROLE_USER',
'Cuisinier' => 'ROLE_CUISINIER',
'Serveur' => 'ROLE_SERVEUR',
], ],
'expanded' => true, 'expanded' => true,
'multiple' => true, 'multiple' => true,

View File

@ -1,58 +0,0 @@
<div id="compteModal" class="modal" tabindex="-1" aria-labelledby="compteModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<span class="close" data-modal="compteModal">&times;</span>
<h2 class="modal-header" id="compteModalLabel">Gestion Compte</h2>
<div class="modal-body">
<!-- Contenu de la modal Gestion Utilisateur -->
<div id="InformationUser">
<div id="NomUser">
<span>Nom : {{ app.user.nom }}</span>
</div>
<div id="NomUser">
<span>Prenom : {{ app.user.prenom }}</span>
</div>
<div id="NomUser">
<span>Email : {{ app.user.userIdentifier }}</span>
</div>
<div id="NomUser">
<span>Roles : {{ app.user.getRolesAsString() }}</span>
</div>
<div class="btn-custom icon-container" data-bs-toggle="modal" data-bs-target="#modifModal">
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
<span>Modifier</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal de Modification des Informations Utilisateur -->
<div id="modifModal" class="modal" tabindex="-1" aria-labelledby="modifModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modifModalLabel">Modifier Informations Utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="newEmail" class="form-label">Nouvel Email</label>
<input type="email" class="form-control" id="newEmail" placeholder="Entrez votre nouvel email">
</div>
<div class="mb-3">
<label for="newNom" class="form-label">Nouveau Nom</label>
<input type="text" class="form-control" id="newNom" placeholder="Entrez votre nouveau nom">
</div>
<div class="mb-3">
<label for="newPrenom" class="form-label">Nouveau Prenom</label>
<input type="text" class="form-control" id="newPrenom" placeholder="Entrez votre nouveau prenom">
</div>
<button type="submit" class="btn btn-primary">Confirmer</button>
</form>
</div>
</div>
</div>
</div>

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

@ -10,8 +10,9 @@
{% endblock %} {% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/modal.css') }}"> <!-- Ajout du fichier CSS --> <link rel="stylesheet" href="{{ asset('css/Index/index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/compte/index.css') }}"> <!-- Ajout du fichier CSS --> <link rel="stylesheet" href="{{ asset('css/Compte/index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/GestionUtilisateurs/GestionUtilisateurs.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %} {% endblock %}
{% block body %} {% block body %}
@ -34,10 +35,10 @@
<div class="nav-bar"> <div class="nav-bar">
<ul> <ul>
<li> <li>
<div class="btn-custom icon-container"> <div class="btn-custom btn-gestion-utilisateurs icon-container" >
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i> <i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
<span>Gérer Utilisateur</span> <span>Gérer Utilisateur</span>
</div> </div>
</li> </li>
<li> <li>
<div class="btn-custom icon-container"> <div class="btn-custom icon-container">
@ -117,7 +118,7 @@
</div> </div>
</div> </div>
<div id="container_gestion_user"> <div id="container_modal">
<!-- Contenu par défaut, ou vous pouvez laisser vide --> <!-- Contenu par défaut, ou vous pouvez laisser vide -->
</div> </div>
@ -126,10 +127,10 @@
</script> </script>
<!-- Include modals --> <!-- Include modals -->
{% include 'Modals/gestionCompteModal.html.twig' %}
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="{{ asset('js/test.js') }}" defer></script> <script src="{{ asset('js/Compte/CompteModal.js') }}" defer></script>
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
{% endblock %} {% 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 %}

View File

@ -97,9 +97,5 @@
</div> </div>
{{ form_end(registrationForm) }} {{ form_end(registrationForm) }}
<div class="btn-container">
<a href="{{ path('list_user') }}" class="btn-list btn-primary">Liste des Utilisateur</a>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -4,12 +4,8 @@
{% block body %} {% block body %}
<style> <style>
</style> </style>
<form id="UpdateUser" action="{{ path('update-user', { 'id': app.user.id }) }}" method="post"> <form id="UpdateUser" action="{{ path('update-user', { 'id': app.user.id }) }}" method="post">
<div id="InformationUser"> <div id="InformationUser">
<div class="user-info-item"> <div class="user-info-item">
@ -28,11 +24,15 @@
<span class="user-info-label">Roles :</span> <span class="user-info-label">Roles :</span>
<span class="user-info-value">{{ app.user.getRolesAsString() }}</span> <span class="user-info-value">{{ app.user.getRolesAsString() }}</span>
</div> </div>
<div class="btn">
<button type="submit" class="submit-button">Mettre à jour</button>
</div>
</div> </div>
</form> </form>
<div class="btn-update">
<button onclick="updateUser(this)" data-id="{{ app.user.id }}" class="btn-update">Modifier</button>
</div>
{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/Compte/CompteModal.js') }}" defer></script>
{% endblock %} {% endblock %}

View File

@ -68,7 +68,7 @@
<td>{{ utilisateur.nom }}</td> <td>{{ utilisateur.nom }}</td>
<td>{{ utilisateur.prenom }}</td> <td>{{ utilisateur.prenom }}</td>
<td>{{ utilisateur.UserIdentifier }}</td> <td>{{ utilisateur.UserIdentifier }}</td>
<td>{{ utilisateur.roles|join }}</td> <td>{{ utilisateur.RolesAsString }}</td>
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
@ -78,7 +78,11 @@
</tbody> </tbody>
</table> </table>
<div class="btn-container"> <div class="btn-container">
<a href="{{ path('add_user') }}" class="btn btn-primary">Ajouter un Utilisateur</a> <button onclick="addUser(this)" id="btn-add-user" class="btn btn-add-user btn-primary">Ajouter un Utilisateur</button>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block javascripts %}
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
{% endblock %}

View File

@ -0,0 +1,105 @@
{% extends 'base.html.twig' %}
{% block stylesheets %}
<style>
.form-container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
font-family: sans-serif;
}
.form-container h1 {
text-align: center;
margin-bottom: 20px;
font-size: 24px;
}
.form-group {
margin-bottom: 15px;
}
.form-input {
display: flex;
justify-content: center;
margin-bottom: 20px;
width: 95%;
padding: 10px;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 16px;
}
.form-input:focus {
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
outline: none;
}
.btn-container {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.btn-save {
padding: 5px 10px;
text-decoration: none;
color: white;
background-color: #007bff;
border-radius: 5px;
font-weight: bold;
margin-top: 25px;
}
.btn-list {
padding: 5px 10px;
text-decoration: none;
color: white;
background-color: red;
border-radius: 5px;
font-weight: bold;
}
</style>
{% endblock %}
{% block title %}Nouvelle Utilisateur{% endblock %}
{% block body %}
<div class="form-container">
<h1>Modifier Utilisateurs ! ✅</h1>
{{ form_start(form) }}
{{ form_errors(form) }}
<div class="form-group">
{{ form_row(form.Nom, {'attr': {'class': 'form-input'}, 'label': 'Nom'}) }}
</div>
<div class="form-group">
{{ form_row(form.Prenom, {'attr': {'class': 'form-input'}, 'label': 'Prénom'}) }}
</div>
<div class="form-group">
{{ form_row(form.UserIdentifier, {'attr': {'class': 'form-input'}, 'label': 'Email'}) }}
</div>
<div class="form-group">
{{ form_row(form.Password, {'attr': {'class': 'form-input'}, 'label': 'Password'}) }}
</div>
<div class="form-group">
{{ form_row(form.Roles, {'attr': {'class': 'form-input'}, 'label': 'Roles'}) }}
</div>
<div class="btn-container">
{{ form_row(form.Modifier, {'attr': {'class': 'btn-save'}, 'label': 'Enregistrer'}) }}
</div>
{{ form_end(form) }}
<div class="btn-container">
<a href="{{ path('app_index') }}" class="btn-list btn-primary">Annuler</a>
</div>
</div>
{% endblock %}