diff --git a/migrations/Version20241020235112.php b/migrations/Version20241020235112.php deleted file mode 100644 index 341fe1f..0000000 --- a/migrations/Version20241020235112.php +++ /dev/null @@ -1,140 +0,0 @@ -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'); - } -} diff --git a/migrations/Version20241024193330.php b/migrations/Version20241024193330.php deleted file mode 100644 index b929218..0000000 --- a/migrations/Version20241024193330.php +++ /dev/null @@ -1,34 +0,0 @@ -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)\''); - } -} diff --git a/migrations/Version20241114160014.php b/migrations/Version20241114160014.php new file mode 100644 index 0000000..c219157 --- /dev/null +++ b/migrations/Version20241114160014.php @@ -0,0 +1,52 @@ +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)'); + } +} diff --git a/migrations/Version20241114160729.php b/migrations/Version20241114160729.php new file mode 100644 index 0000000..8011f79 --- /dev/null +++ b/migrations/Version20241114160729.php @@ -0,0 +1,50 @@ +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)'); + } +} diff --git a/migrations/Version20241114164216.php b/migrations/Version20241114164216.php new file mode 100644 index 0000000..65df11e --- /dev/null +++ b/migrations/Version20241114164216.php @@ -0,0 +1,46 @@ +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'); + } +} diff --git a/public/css/Compte/GestionUser.css b/public/css/Compte/GestionUser.css new file mode 100644 index 0000000..5fe2b0a --- /dev/null +++ b/public/css/Compte/GestionUser.css @@ -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%; + } +} + diff --git a/public/css/compte/index.css b/public/css/Compte/index.css similarity index 96% rename from public/css/compte/index.css rename to public/css/Compte/index.css index f1b079e..37dd955 100644 --- a/public/css/compte/index.css +++ b/public/css/Compte/index.css @@ -48,7 +48,7 @@ } } -#container_gestion_user { +#container_modal { background-color: white; margin-left: 20%; /* Centrage vertical */ margin-top: 5%; @@ -57,7 +57,6 @@ width: 75%; /* Largeur du contenu de la modal */ height: 100%; /* Hauteur du contenu de la modal */ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); - display: none; } a{ diff --git a/public/css/ControllerVues/edit.css b/public/css/ControllerVues/edit.css new file mode 100644 index 0000000..e5a8e3a --- /dev/null +++ b/public/css/ControllerVues/edit.css @@ -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; +} diff --git a/public/css/ControllerVues/list.css b/public/css/ControllerVues/list.css new file mode 100644 index 0000000..c1125b4 --- /dev/null +++ b/public/css/ControllerVues/list.css @@ -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; +} diff --git a/public/css/ControllerVues/new.css b/public/css/ControllerVues/new.css new file mode 100644 index 0000000..c442783 --- /dev/null +++ b/public/css/ControllerVues/new.css @@ -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; +} + diff --git a/public/css/GestionUtilisateurs/GestionUtilisateurs.css b/public/css/GestionUtilisateurs/GestionUtilisateurs.css new file mode 100644 index 0000000..b5957a1 --- /dev/null +++ b/public/css/GestionUtilisateurs/GestionUtilisateurs.css @@ -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); +} diff --git a/public/css/modal.css b/public/css/Index/index.css similarity index 100% rename from public/css/modal.css rename to public/css/Index/index.css diff --git a/public/js/Compte/CompteModal.js b/public/js/Compte/CompteModal.js new file mode 100644 index 0000000..0cf9eac --- /dev/null +++ b/public/js/Compte/CompteModal.js @@ -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); + }); +} \ No newline at end of file diff --git a/public/js/GestionUtilisateurs/GestionUtilisateurs.js b/public/js/GestionUtilisateurs/GestionUtilisateurs.js new file mode 100644 index 0000000..b4351bb --- /dev/null +++ b/public/js/GestionUtilisateurs/GestionUtilisateurs.js @@ -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); + }); +} diff --git a/public/js/test.js b/public/js/test.js deleted file mode 100644 index 14636bd..0000000 --- a/public/js/test.js +++ /dev/null @@ -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); - }); - } -}); \ No newline at end of file diff --git a/src/Controller/ClientsController.php b/src/Controller/ClientsController.php new file mode 100644 index 0000000..2c41873 --- /dev/null +++ b/src/Controller/ClientsController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/CommandesController.php b/src/Controller/CommandesController.php new file mode 100644 index 0000000..fff6323 --- /dev/null +++ b/src/Controller/CommandesController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/CuisinierController.php b/src/Controller/CuisinierController.php deleted file mode 100644 index c2097ea..0000000 --- a/src/Controller/CuisinierController.php +++ /dev/null @@ -1,46 +0,0 @@ -createForm(CuisinierType::class, $cuisinier); - - $form->handleRequest($request); - if ($form->isSubmitted() && $form->isValid()) { - $entityManager->persist($cuisinier); - $entityManager->flush(); - - $this->addFlash('success', 'Cuisinier ajouté avec succès !'); - return $this->redirectToRoute('ajouter_cuisinier'); - } - - return $this->render('cuisinier/ajouter.html.twig', [ - 'form' => $form->createView(), - ]); - } - - #[Route('/cuisinier/supprimer/{id}', name: 'supprimer_cuisinier', methods: ['POST'])] - public function supprimer(int $id, EntityManagerInterface $entityManager): Response - { - $cuisinier = $entityManager->getRepository(Cuisinier::class)->find($id); - - if (!$cuisinier) { - throw $this->createNotFoundException('Ce cuisinier n\'existe pas'); - } - - $entityManager->remove($cuisinier); - $entityManager->flush(); - - $this->addFlash('success', 'Cuisinier supprimé avec succès !'); - return $this->redirectToRoute('ajouter_cuisinier'); - } -} \ No newline at end of file diff --git a/src/Controller/DetailsCommandeController.php b/src/Controller/DetailsCommandeController.php new file mode 100644 index 0000000..f0f8beb --- /dev/null +++ b/src/Controller/DetailsCommandeController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/LoginController.php b/src/Controller/LoginController.php index eb3d2cc..9b6ac82 100644 --- a/src/Controller/LoginController.php +++ b/src/Controller/LoginController.php @@ -31,7 +31,7 @@ class LoginController extends AbstractController #[Route('/access/denied', name: 'app_access_denied')] public function denied(): Response { - return $this->render('access_denied/index.html.twig', [ + return $this->render('access_denied/gestion.html.twig', [ 'controller_name' => 'AccessDeniedController', ]); } diff --git a/src/Controller/PlatsController.php b/src/Controller/PlatsController.php new file mode 100644 index 0000000..498590a --- /dev/null +++ b/src/Controller/PlatsController.php @@ -0,0 +1,75 @@ +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); + } +} diff --git a/src/Controller/ReductionsController.php b/src/Controller/ReductionsController.php new file mode 100644 index 0000000..da7cdeb --- /dev/null +++ b/src/Controller/ReductionsController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/ReservationsController.php b/src/Controller/ReservationsController.php new file mode 100644 index 0000000..b0287fd --- /dev/null +++ b/src/Controller/ReservationsController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/StatutCommandesController.php b/src/Controller/StatutCommandesController.php new file mode 100644 index 0000000..53d82c4 --- /dev/null +++ b/src/Controller/StatutCommandesController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/StatutTablesController.php b/src/Controller/StatutTablesController.php new file mode 100644 index 0000000..84e5c61 --- /dev/null +++ b/src/Controller/StatutTablesController.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/src/Controller/TablesController.php b/src/Controller/TablesController.php new file mode 100644 index 0000000..c1c834b --- /dev/null +++ b/src/Controller/TablesController.php @@ -0,0 +1,75 @@ +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); + } +} diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 0586fa5..c99f38c 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -69,7 +69,7 @@ class UserController extends AbstractController return $this->redirectToRoute('app_index'); } - return $this->render('gestion_user/index.html.twig', [ + return $this->render('user/update.html.twig', [ 'form' => $form, ]); } @@ -88,6 +88,6 @@ class UserController extends AbstractController #[Route('/gestion-user', name: 'gestion_user', methods: ['GET'])] public function index(): Response { - return $this->render('gestion_user/index.html.twig'); + return $this->render('user/gestion.html.twig'); } } diff --git a/src/Entity/Clients.php b/src/Entity/Clients.php index 35a78f3..7367507 100644 --- a/src/Entity/Clients.php +++ b/src/Entity/Clients.php @@ -2,12 +2,13 @@ namespace App\Entity; +use AllowDynamicProperties; use App\Repository\ClientsRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -#[ORM\Entity(repositoryClass: ClientsRepository::class)] +#[AllowDynamicProperties] #[ORM\Entity(repositoryClass: ClientsRepository::class)] class Clients { #[ORM\Id] @@ -30,8 +31,8 @@ class Clients /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Client')] - private Collection $table; + #[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')] + public Collection $tables; /** * @var Collection @@ -41,7 +42,7 @@ class Clients public function __construct() { - $this->table = new ArrayCollection(); + $this->tables = new ArrayCollection(); $this->commandes = new ArrayCollection(); } @@ -101,23 +102,23 @@ class Clients /** * @return Collection */ - public function getTable(): Collection + public function getTables(): Collection { - return $this->table; + return $this->tables; } - public function addTable(Tables $table): static + public function addTable(Tables $tables): static { - if (!$this->table->contains($table)) { - $this->table->add($table); + if (!$this->tables->contains($tables)) { + $this->tables->add($tables); } return $this; } - public function removeTable(Tables $table): static + public function removeTable(Tables $tables): static { - $this->table->removeElement($table); + $this->tables->removeElement($tables); return $this; } diff --git a/src/Entity/Reservations.php b/src/Entity/Reservations.php index 8ad6096..757d358 100644 --- a/src/Entity/Reservations.php +++ b/src/Entity/Reservations.php @@ -23,7 +23,7 @@ class Reservations private ?int $Nb_de_prsn = null; #[ORM\ManyToOne(inversedBy: 'reservations')] - private ?Tables $Table = null; + private ?Tables $tables = null; /** * @var Collection @@ -65,14 +65,14 @@ class Reservations return $this; } - public function getTable(): ?Tables + public function getTables(): ?Tables { - return $this->Table; + return $this->tables; } - public function setTable(?Tables $Table): static + public function setTable(?Tables $tables): static { - $this->Table = $Table; + $this->tables = $tables; return $this; } diff --git a/src/Entity/StatutTables.php b/src/Entity/StatutTables.php index f336a5a..1093ed5 100644 --- a/src/Entity/StatutTables.php +++ b/src/Entity/StatutTables.php @@ -14,36 +14,36 @@ class StatutTables private ?int $id = null; #[ORM\Column(length: 255)] - private ?string $Libellé = null; + private ?string $Libelle = null; #[ORM\ManyToOne(inversedBy: 'statutTables')] - private ?Tables $Table = null; + private ?Tables $tables = null; public function getId(): ?int { 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; } - public function getTable(): ?Tables + public function getTables(): ?Tables { - return $this->Table; + return $this->tables; } - public function setTable(?Tables $Table): static + public function setTable(?Tables $tables): static { - $this->Table = $Table; + $this->tables = $tables; return $this; } diff --git a/src/Entity/Tables.php b/src/Entity/Tables.php index 25d3763..1d1820a 100644 --- a/src/Entity/Tables.php +++ b/src/Entity/Tables.php @@ -18,25 +18,25 @@ class Tables /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'table')] + #[ORM\ManyToMany(targetEntity: Clients::class, inversedBy: 'tables')] private Collection $Clients; /** * @var Collection */ - #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Table')] + #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')] private Collection $reservations; /** * @var Collection */ - #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Table')] + #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')] private Collection $statutTables; /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'table')] + #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tables')] private Collection $utilisateurs; public function __construct() @@ -55,7 +55,7 @@ class Tables /** * @return Collection */ - public function getClient(): Collection + public function getClients(): Collection { return $this->Clients; } @@ -101,7 +101,7 @@ class Tables { if ($this->reservations->removeElement($reservation)) { // set the owning side to null (unless already changed) - if ($reservation->getTable() === $this) { + if ($reservation->getTables() === $this) { $reservation->setTable(null); } } @@ -131,7 +131,7 @@ class Tables { if ($this->statutTables->removeElement($statutTable)) { // set the owning side to null (unless already changed) - if ($statutTable->getTable() === $this) { + if ($statutTable->getTables() === $this) { $statutTable->setTable(null); } } diff --git a/src/Entity/Utilisateurs.php b/src/Entity/Utilisateurs.php index c4af5ea..c9a6ead 100644 --- a/src/Entity/Utilisateurs.php +++ b/src/Entity/Utilisateurs.php @@ -42,12 +42,12 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface * @var Collection */ #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')] - private Collection $table; + private Collection $tables; public function __construct() { $this->Reservation = new ArrayCollection(); - $this->table = new ArrayCollection(); + $this->tables = new ArrayCollection(); } public function getId(): ?int @@ -157,23 +157,23 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface /** * @return Collection */ - public function getTable(): Collection + public function getTables(): Collection { - return $this->table; + return $this->tables; } - public function addTable(Tables $table): static + public function addTable(Tables $tables): static { - if (!$this->table->contains($table)) { - $this->table->add($table); + if (!$this->tables->contains($tables)) { + $this->tables->add($tables); } return $this; } - public function removeTable(Tables $table): static + public function removeTable(Tables $tables): static { - $this->table->removeElement($table); + $this->tables->removeElement($tables); return $this; } diff --git a/src/Form/ClientsType.php b/src/Form/ClientsType.php new file mode 100644 index 0000000..cd01f5a --- /dev/null +++ b/src/Form/ClientsType.php @@ -0,0 +1,41 @@ +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, + ]); + } +} diff --git a/src/Form/CommandesType.php b/src/Form/CommandesType.php new file mode 100644 index 0000000..5dcc39b --- /dev/null +++ b/src/Form/CommandesType.php @@ -0,0 +1,47 @@ +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, + ]); + } +} diff --git a/src/Form/DetailsCommandeType.php b/src/Form/DetailsCommandeType.php new file mode 100644 index 0000000..3d4eba3 --- /dev/null +++ b/src/Form/DetailsCommandeType.php @@ -0,0 +1,32 @@ +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, + ]); + } +} diff --git a/src/Form/PlatsType.php b/src/Form/PlatsType.php new file mode 100644 index 0000000..068fa54 --- /dev/null +++ b/src/Form/PlatsType.php @@ -0,0 +1,43 @@ +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, + ]); + } +} diff --git a/src/Form/ReductionsType.php b/src/Form/ReductionsType.php new file mode 100644 index 0000000..ff5957e --- /dev/null +++ b/src/Form/ReductionsType.php @@ -0,0 +1,34 @@ +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, + ]); + } +} diff --git a/src/Form/ReservationsType.php b/src/Form/ReservationsType.php new file mode 100644 index 0000000..8a59b2b --- /dev/null +++ b/src/Form/ReservationsType.php @@ -0,0 +1,40 @@ +add('DateHeure', null, [ + 'widget' => 'single_text', + ]) + ->add('Nb_de_prsn') + ->add('tables', EntityType::class, [ + 'class' => Tables::class, + 'choice_label' => 'id', + ]) + ->add('utilisateurs', EntityType::class, [ + 'class' => Utilisateurs::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Reservations::class, + ]); + } +} diff --git a/src/Form/StatutCommandesType.php b/src/Form/StatutCommandesType.php new file mode 100644 index 0000000..695fee2 --- /dev/null +++ b/src/Form/StatutCommandesType.php @@ -0,0 +1,25 @@ +add('Libelle') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => StatutCommandes::class, + ]); + } +} diff --git a/src/Form/StatutTablesType.php b/src/Form/StatutTablesType.php new file mode 100644 index 0000000..70797d0 --- /dev/null +++ b/src/Form/StatutTablesType.php @@ -0,0 +1,32 @@ +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, + ]); + } +} diff --git a/src/Form/TablesType.php b/src/Form/TablesType.php new file mode 100644 index 0000000..ff62602 --- /dev/null +++ b/src/Form/TablesType.php @@ -0,0 +1,37 @@ +add('Clients', EntityType::class, [ + 'class' => Clients::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ->add('utilisateurs', EntityType::class, [ + 'class' => Utilisateurs::class, + 'choice_label' => 'id', + 'multiple' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Tables::class, + ]); + } +} diff --git a/src/Form/UpdateUserType.php b/src/Form/UpdateUserType.php index 366ec33..96e2a0f 100644 --- a/src/Form/UpdateUserType.php +++ b/src/Form/UpdateUserType.php @@ -39,6 +39,8 @@ class UpdateUserType extends AbstractType 'choices' => [ 'Admin' => 'ROLE_ADMIN', 'User' => 'ROLE_USER', + 'Cuisinier' => 'ROLE_CUISINIER', + 'Serveur' => 'ROLE_SERVEUR', ], 'expanded' => true, 'multiple' => true, diff --git a/templates/Modals/gestionCompteModal.html.twig b/templates/Modals/gestionCompteModal.html.twig deleted file mode 100644 index a5d43af..0000000 --- a/templates/Modals/gestionCompteModal.html.twig +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/templates/clients/_delete_form.html.twig b/templates/clients/_delete_form.html.twig new file mode 100644 index 0000000..60f8140 --- /dev/null +++ b/templates/clients/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/clients/_form.html.twig b/templates/clients/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/clients/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/clients/edit.html.twig b/templates/clients/edit.html.twig new file mode 100644 index 0000000..bea3e03 --- /dev/null +++ b/templates/clients/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier Client{% endblock %} + +{% block body %} +

Modifier Client

+ + {{ include('clients/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + Retour à la liste + + {{ include('clients/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/clients/index.html.twig b/templates/clients/index.html.twig new file mode 100644 index 0000000..9eeb216 --- /dev/null +++ b/templates/clients/index.html.twig @@ -0,0 +1,47 @@ +{% extends 'base.html.twig' %} + +{% block title %}Clients index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Clients index

+ + + + + + + + + + + + + + {% for client in clients %} + + + + + + + + + {% else %} + + + + {% endfor %} + +
IdPrenomNomEmailTelephoneactions
{{ client.id }}{{ client.Prenom }}{{ client.Nom }}{{ client.Email }}{{ client.Telephone }} +
+ + {{ include('clients/_delete_form.html.twig') }} +
+ Modifier +
no records found
+ + Créer un nouveau client +{% endblock %} diff --git a/templates/clients/new.html.twig b/templates/clients/new.html.twig new file mode 100644 index 0000000..16b0079 --- /dev/null +++ b/templates/clients/new.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}Nouveau client{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer un client

+ + {{ include('clients/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/commandes/_delete_form.html.twig b/templates/commandes/_delete_form.html.twig new file mode 100644 index 0000000..60f1723 --- /dev/null +++ b/templates/commandes/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/commandes/_form.html.twig b/templates/commandes/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/commandes/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/commandes/edit.html.twig b/templates/commandes/edit.html.twig new file mode 100644 index 0000000..104ce92 --- /dev/null +++ b/templates/commandes/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier Commande{% endblock %} + +{% block body %} +

Modifier Commande

+ + {{ include('commandes/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + Retour à la liste + + +{% endblock %} diff --git a/templates/commandes/index.html.twig b/templates/commandes/index.html.twig new file mode 100644 index 0000000..38ce9b9 --- /dev/null +++ b/templates/commandes/index.html.twig @@ -0,0 +1,46 @@ +{% extends 'base.html.twig' %} + +{% block title %}Commandes index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Commandes index

+ + + + + + + + + + + + + {% for commande in commandes %} + + + + + + + + {% else %} + + + + {% endfor %} + +
IdDateHeureStatutTotalactions
{{ commande.id }}{{ commande.DateHeure ? commande.DateHeure|date('Y-m-d H:i:s') : '' }}{{ commande.Statut ? 'Yes' : 'No' }}{{ commande.Total }} +
+ + {{ include('commandes/_delete_form.html.twig') }} +
+ + Modifier +
pas de commande crée
+ + Créer une nouvelle commande +{% endblock %} diff --git a/templates/commandes/new.html.twig b/templates/commandes/new.html.twig new file mode 100644 index 0000000..fb9b259 --- /dev/null +++ b/templates/commandes/new.html.twig @@ -0,0 +1,15 @@ +{% extends 'base.html.twig' %} + +{% block title %}Nouvelle commande{% endblock %} +{% block stylesheets %} + + +{% endblock %} + +{% block body %} +

Créer une commande

+ + {{ include('commandes/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/details_commande/_delete_form.html.twig b/templates/details_commande/_delete_form.html.twig new file mode 100644 index 0000000..1c08667 --- /dev/null +++ b/templates/details_commande/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/details_commande/_form.html.twig b/templates/details_commande/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/details_commande/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/details_commande/edit.html.twig b/templates/details_commande/edit.html.twig new file mode 100644 index 0000000..0cc6cf2 --- /dev/null +++ b/templates/details_commande/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier détail commande{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
+

Modifier détail commande

+ + {{ include('details_commande/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('details_commande/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/details_commande/index.html.twig b/templates/details_commande/index.html.twig new file mode 100644 index 0000000..7441277 --- /dev/null +++ b/templates/details_commande/index.html.twig @@ -0,0 +1,44 @@ +{% extends 'base.html.twig' %} + +{% block title %}DetailsCommande index{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +

DetailsCommande index

+ + + + + + + + + + + + {% for details_commande in details_commandes %} + + + + + + + {% else %} + + + + {% endfor %} + +
IdQuantitePrixUnitaireactions
{{ details_commande.id }}{{ details_commande.Quantite }}{{ details_commande.PrixUnitaire }} +
+ + {{ include('details_commande/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer le détail d'une commande +{% endblock %} diff --git a/templates/details_commande/new.html.twig b/templates/details_commande/new.html.twig new file mode 100644 index 0000000..306fc33 --- /dev/null +++ b/templates/details_commande/new.html.twig @@ -0,0 +1,15 @@ +{% extends 'base.html.twig' %} + +{% block title %}Nouveau detail commande{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} + +

Créer un détail commande

+ + {{ include('details_commande/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/index/admin.html.twig b/templates/index/admin.html.twig index c6a8bed..9c6d107 100644 --- a/templates/index/admin.html.twig +++ b/templates/index/admin.html.twig @@ -10,8 +10,9 @@ {% endblock %} {% block stylesheets %} - - + + + {% endblock %} {% block body %} @@ -34,10 +35,10 @@ -
+
@@ -126,10 +127,10 @@ - {% include 'Modals/gestionCompteModal.html.twig' %} {% endblock %} {% block javascripts %} - + + {% endblock %} \ No newline at end of file diff --git a/templates/plats/_delete_form.html.twig b/templates/plats/_delete_form.html.twig new file mode 100644 index 0000000..4a6fd3b --- /dev/null +++ b/templates/plats/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/plats/_form.html.twig b/templates/plats/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/plats/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/plats/edit.html.twig b/templates/plats/edit.html.twig new file mode 100644 index 0000000..b763493 --- /dev/null +++ b/templates/plats/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier Plat{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
+

Modifier Plat

+ + {{ include('plats/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('plats/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/plats/index.html.twig b/templates/plats/index.html.twig new file mode 100644 index 0000000..d6777bb --- /dev/null +++ b/templates/plats/index.html.twig @@ -0,0 +1,51 @@ +{% extends 'base.html.twig' %} + +{% block title %}Plats index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Plats index

+ + + + + + + + + + + + + + + + {% for plat in plats %} + + + + + + + + + + + {% else %} + + + + {% endfor %} + +
IdNomDescriptionPrixCategorieStatutNb_de_commandeactions
{{ plat.id }}{{ plat.Nom }}{{ plat.Description }}{{ plat.Prix }}{{ plat.Categorie }}{{ plat.Statut ? 'Yes' : 'No' }}{{ plat.NbDeCommande }} +
+ + {{ include('plats/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer un nouveau plat +{% endblock %} diff --git a/templates/plats/new.html.twig b/templates/plats/new.html.twig new file mode 100644 index 0000000..7c091ad --- /dev/null +++ b/templates/plats/new.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Plats{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer un nouveau plat

+ + {{ include('plats/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/reductions/_delete_form.html.twig b/templates/reductions/_delete_form.html.twig new file mode 100644 index 0000000..dca093b --- /dev/null +++ b/templates/reductions/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/reductions/_form.html.twig b/templates/reductions/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/reductions/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/reductions/edit.html.twig b/templates/reductions/edit.html.twig new file mode 100644 index 0000000..bab0c4d --- /dev/null +++ b/templates/reductions/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier Réductions{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
+

Modifier une réduction

+ + {{ include('reductions/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('reductions/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/reductions/index.html.twig b/templates/reductions/index.html.twig new file mode 100644 index 0000000..9eef75b --- /dev/null +++ b/templates/reductions/index.html.twig @@ -0,0 +1,51 @@ +{% extends 'base.html.twig' %} + +{% block title %}Reductions index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Reductions index

+ + + + + + + + + + + + + + + + {% for reduction in reductions %} + + + + + + + + + + + {% else %} + + + + {% endfor %} + +
IdDescriptionPrixPourcentageMontantFixeDateDebutDateFinactions
{{ reduction.id }}{{ reduction.Description }}{{ reduction.Prix }}{{ reduction.Pourcentage }}{{ reduction.MontantFixe }}{{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }}{{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }} +
+ + {{ include('reductions/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer une réduction +{% endblock %} diff --git a/templates/reductions/new.html.twig b/templates/reductions/new.html.twig new file mode 100644 index 0000000..13723a3 --- /dev/null +++ b/templates/reductions/new.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}Nouvelle reduction{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer une Reduction

+ + {{ include('reductions/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/reservations/_delete_form.html.twig b/templates/reservations/_delete_form.html.twig new file mode 100644 index 0000000..65bbb49 --- /dev/null +++ b/templates/reservations/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/reservations/_form.html.twig b/templates/reservations/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/reservations/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/reservations/edit.html.twig b/templates/reservations/edit.html.twig new file mode 100644 index 0000000..320a151 --- /dev/null +++ b/templates/reservations/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block title %}Modifier Réservation{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
+

Modifier Réservation

+ + {{ include('reservations/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('reservations/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/reservations/index.html.twig b/templates/reservations/index.html.twig new file mode 100644 index 0000000..c2be21a --- /dev/null +++ b/templates/reservations/index.html.twig @@ -0,0 +1,43 @@ +{% extends 'base.html.twig' %} + +{% block title %}Reservations index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Reservations index

+ + + + + + + + + + + + {% for reservation in reservations %} + + + + + + + {% else %} + + + + {% endfor %} + +
IdDateHeureNb_de_prsnactions
{{ reservation.id }}{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}{{ reservation.NbDePrsn }} +
+ + {{ include('reservations/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer une réservation +{% endblock %} diff --git a/templates/reservations/new.html.twig b/templates/reservations/new.html.twig new file mode 100644 index 0000000..f33c62a --- /dev/null +++ b/templates/reservations/new.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Reservations{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer une reservation

+ + {{ include('reservations/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/statut_commandes/_delete_form.html.twig b/templates/statut_commandes/_delete_form.html.twig new file mode 100644 index 0000000..fd54597 --- /dev/null +++ b/templates/statut_commandes/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/statut_commandes/_form.html.twig b/templates/statut_commandes/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/statut_commandes/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/statut_commandes/edit.html.twig b/templates/statut_commandes/edit.html.twig new file mode 100644 index 0000000..8dcccbd --- /dev/null +++ b/templates/statut_commandes/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Statut commandes{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
+

Modifier Statut commandes

+ + {{ include('statut_commandes/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('statut_commandes/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/statut_commandes/index.html.twig b/templates/statut_commandes/index.html.twig new file mode 100644 index 0000000..9d5e324 --- /dev/null +++ b/templates/statut_commandes/index.html.twig @@ -0,0 +1,42 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutCommandes index{% endblock %} + +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

StatutCommandes index

+ + + + + + + + + + + {% for statut_commande in statut_commandes %} + + + + + + {% else %} + + + + {% endfor %} + +
IdLibelleactions
{{ statut_commande.id }}{{ statut_commande.Libelle }} +
+ + {{ include('statut_commandes/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer un nouveau statut +{% endblock %} diff --git a/templates/statut_commandes/new.html.twig b/templates/statut_commandes/new.html.twig new file mode 100644 index 0000000..479f987 --- /dev/null +++ b/templates/statut_commandes/new.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}Nouveau StatutCommandes{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer nouveau StatutCommandes

+ + {{ include('statut_commandes/_form.html.twig') }} + + Retour à la liste +{% endblock %} diff --git a/templates/statut_tables/_delete_form.html.twig b/templates/statut_tables/_delete_form.html.twig new file mode 100644 index 0000000..b61d6a1 --- /dev/null +++ b/templates/statut_tables/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/statut_tables/_form.html.twig b/templates/statut_tables/_form.html.twig new file mode 100644 index 0000000..7fe26a6 --- /dev/null +++ b/templates/statut_tables/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/statut_tables/edit.html.twig b/templates/statut_tables/edit.html.twig new file mode 100644 index 0000000..2a212cd --- /dev/null +++ b/templates/statut_tables/edit.html.twig @@ -0,0 +1,23 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Statut tables{% endblock %} + +{% block stylesheets %} +
+

Modifier Statut tables

+ + {{ include('statut_tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + +
+ {{ include('statut_tables/_delete_form.html.twig') }} +
+ Retour à la liste +
+ + +
+{% endblock %} + +{% block body %} + +{% endblock %} diff --git a/templates/statut_tables/index.html.twig b/templates/statut_tables/index.html.twig new file mode 100644 index 0000000..fb1dbd7 --- /dev/null +++ b/templates/statut_tables/index.html.twig @@ -0,0 +1,41 @@ +{% extends 'base.html.twig' %} + +{% block title %}StatutTables index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

StatutTables index

+ + + + + + + + + + + {% for statut_table in statut_tables %} + + + + + + {% else %} + + + + {% endfor %} + +
IdLibelléactions
{{ statut_table.id }}{{ statut_table.Libelle}} +
+ + {{ include('statut_tables/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer un nouveau +{% endblock %} diff --git a/templates/statut_tables/new.html.twig b/templates/statut_tables/new.html.twig new file mode 100644 index 0000000..9369705 --- /dev/null +++ b/templates/statut_tables/new.html.twig @@ -0,0 +1,15 @@ +{% extends 'base.html.twig' %} + +{% block title %}Créer un nouveau StatutTables{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Créer un nouveau StatutTables

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

StatutTables

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

Modifier Tables

+ + {{ include('tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('tables/_delete_form.html.twig') }} +
+{% endblock %} diff --git a/templates/tables/index.html.twig b/templates/tables/index.html.twig new file mode 100644 index 0000000..48fe8b8 --- /dev/null +++ b/templates/tables/index.html.twig @@ -0,0 +1,39 @@ +{% extends 'base.html.twig' %} + +{% block title %}Tables index{% endblock %} +{% block stylesheets %} + + +{% endblock %} +{% block body %} +

Tables index

+ + + + + + + + + + {% for table in tables %} + + + + + {% else %} + + + + {% endfor %} + +
Idactions
{{ table.id }} +
+ + {{ include('tables/_delete_form.html.twig') }} +
+ Modifier +
Aucun enregistrement trouvé
+ + Créer une nouvelle table +{% endblock %} diff --git a/templates/tables/new.html.twig b/templates/tables/new.html.twig new file mode 100644 index 0000000..c3f5994 --- /dev/null +++ b/templates/tables/new.html.twig @@ -0,0 +1,22 @@ +{% extends 'base.html.twig' %} + +{% block title %}Create New Table{% endblock %} + +{% block stylesheets %} + + +{% endblock %} + +{% block body %} +
+

Créer une nouvelle Table

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

Tables

+ + + + + + + + +
Id{{ table.id }}
+ + Retour à la liste + + Modifier + + {{ include('tables/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/user/add.html.twig b/templates/user/add.html.twig index b13bd8c..d349e1d 100644 --- a/templates/user/add.html.twig +++ b/templates/user/add.html.twig @@ -97,9 +97,5 @@
{{ form_end(registrationForm) }} - - {% endblock %} diff --git a/templates/gestion_user/index.html.twig b/templates/user/gestion.html.twig similarity index 80% rename from templates/gestion_user/index.html.twig rename to templates/user/gestion.html.twig index 00d94ba..9227329 100644 --- a/templates/gestion_user/index.html.twig +++ b/templates/user/gestion.html.twig @@ -4,12 +4,8 @@ {% block body %} +
- -
- -
+
+ +
+ +{% endblock %} + +{% block javascripts %} + {% endblock %} diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig index e1f9e9b..0a88997 100644 --- a/templates/user/list.html.twig +++ b/templates/user/list.html.twig @@ -68,7 +68,7 @@ {{ utilisateur.nom }} {{ utilisateur.prenom }} {{ utilisateur.UserIdentifier }} - {{ utilisateur.roles|join }} + {{ utilisateur.RolesAsString }} {% else %} @@ -78,7 +78,11 @@
- Ajouter un Utilisateur +
{% endblock %} + +{% block javascripts %} + +{% endblock %} diff --git a/templates/user/update.html.twig b/templates/user/update.html.twig new file mode 100644 index 0000000..df18571 --- /dev/null +++ b/templates/user/update.html.twig @@ -0,0 +1,105 @@ +{% extends 'base.html.twig' %} + +{% block stylesheets %} + +{% endblock %} + +{% block title %}Nouvelle Utilisateur{% endblock %} + +{% block body %} +
+

Modifier Utilisateurs ! ✅

+ + {{ form_start(form) }} + {{ form_errors(form) }} + +
+ {{ form_row(form.Nom, {'attr': {'class': 'form-input'}, 'label': 'Nom'}) }} +
+
+ {{ form_row(form.Prenom, {'attr': {'class': 'form-input'}, 'label': 'Prénom'}) }} +
+
+ {{ form_row(form.UserIdentifier, {'attr': {'class': 'form-input'}, 'label': 'Email'}) }} +
+
+ {{ form_row(form.Password, {'attr': {'class': 'form-input'}, 'label': 'Password'}) }} +
+
+ {{ form_row(form.Roles, {'attr': {'class': 'form-input'}, 'label': 'Roles'}) }} +
+
+ {{ form_row(form.Modifier, {'attr': {'class': 'btn-save'}, 'label': 'Enregistrer'}) }} +
+ + {{ form_end(form) }} + +
+ Annuler +
+
+{% endblock %}