Compare commits

..

No commits in common. "e6135b438c0596f7382e1be90823566c36137115" and "eaeabed512b7cbd66fe7a5e5936b11f2d3d11727" have entirely different histories.

105 changed files with 684 additions and 3192 deletions

360
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -31,14 +31,12 @@ security:
role_hierarchy: role_hierarchy:
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
ROLE_CUISINIER: ROLE_CUISINIER
ROLE_SERVEUR: ROLE_SERVEUR
access_control: access_control:
# - { path: ^/, roles: ROLE_USER } # - { path: ^/, roles: ROLE_USER }
- { path: ^/login, roles: PUBLIC_ACCESS } - { path: ^/login, roles: PUBLIC_ACCESS }
- { path: ^/logout, roles: ROLE_USER } - { path: ^/logout, roles: ROLE_USER }
- { path: ^/index, roles: [ROLE_ADMIN, ROLE_CUISINIER, ROLE_SERVEUR]} - { path: ^/index, roles: ROLE_ADMIN }
- { path: ^/user, roles: ROLE_ADMIN } - { path: ^/user, roles: ROLE_ADMIN }
#when@test: #when@test:

View File

@ -0,0 +1,140 @@
<?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

@ -0,0 +1,34 @@
<?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

@ -1,52 +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 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

@ -1,50 +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 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

@ -1,46 +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 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

@ -1,64 +0,0 @@
#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

@ -1,68 +0,0 @@
/* 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: left;
width: 65%;
word-wrap: break-word; /* Gère les débordements */
}
.password {
display: flex;
flex-direction: column;
width: 100%;
text-align: left;
}
/* 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%;
}
}
#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);
}
a{
text-decoration: none;
}
a:visited {
color: initial;
}

View File

@ -1,119 +0,0 @@
/* 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

@ -1,77 +0,0 @@
/* 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

@ -1,126 +0,0 @@
/* 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

@ -1,10 +0,0 @@
#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

@ -1,40 +0,0 @@
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

@ -1,41 +0,0 @@
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);
});
}

38
public/js/modal.js Normal file
View File

@ -0,0 +1,38 @@
document.addEventListener('DOMContentLoaded', function() {
// Fonction pour ouvrir la modal
function openModal(modalId) {
const modal = document.getElementById(modalId);
if (modal) {
modal.style.display = "block";
}
}
// Fonction pour fermer la modal
function closeModal(modalId) {
const modal = document.getElementById(modalId);
if (modal) {
modal.style.display = "none";
}
}
// Ouvre les modals lorsqu'un bouton est cliqué
document.body.addEventListener('click', function(event) {
if (event.target.matches('span[data-modal]')) {
const modalId = event.target.getAttribute('data-modal');
openModal(modalId);
}
// Ferme la modal lorsqu'on clique sur le bouton de fermeture
if (event.target.matches('.close[data-modal]')) {
const modalId = event.target.getAttribute('data-modal');
closeModal(modalId);
}
// Ferme la modal lorsqu'on clique en dehors du contenu
document.querySelectorAll('.modal').forEach(modal => {
if (event.target === modal) {
modal.style.display = "none";
}
});
});
});

View File

@ -1,74 +0,0 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -0,0 +1,46 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -11,7 +11,7 @@ class IndexController extends AbstractController
#[Route('/index', name: 'app_index')] #[Route('/index', name: 'app_index')]
public function index(): Response public function index(): Response
{ {
return $this->render('index/admin.html.twig', [ return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController', 'controller_name' => 'IndexController',
]); ]);
} }

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/gestion.html.twig', [ return $this->render('access_denied/index.html.twig', [
'controller_name' => 'AccessDeniedController', 'controller_name' => 'AccessDeniedController',
]); ]);
} }

View File

@ -1,75 +0,0 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -1,74 +0,0 @@
<?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

@ -1,75 +0,0 @@
<?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('user/update.html.twig', [ return $this->render('gestion_user/index.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('user/gestion.html.twig'); return $this->render('gestion_user/index.html.twig');
} }
} }

View File

@ -2,13 +2,12 @@
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;
#[AllowDynamicProperties] #[ORM\Entity(repositoryClass: ClientsRepository::class)] #[ORM\Entity(repositoryClass: ClientsRepository::class)]
class Clients class Clients
{ {
#[ORM\Id] #[ORM\Id]
@ -31,8 +30,8 @@ class Clients
/** /**
* @var Collection<int, Tables> * @var Collection<int, Tables>
*/ */
#[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')] #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Client')]
public Collection $tables; private Collection $table;
/** /**
* @var Collection<int, Commandes> * @var Collection<int, Commandes>
@ -42,7 +41,7 @@ class Clients
public function __construct() public function __construct()
{ {
$this->tables = new ArrayCollection(); $this->table = new ArrayCollection();
$this->commandes = new ArrayCollection(); $this->commandes = new ArrayCollection();
} }
@ -102,23 +101,23 @@ class Clients
/** /**
* @return Collection<int, Tables> * @return Collection<int, Tables>
*/ */
public function getTables(): Collection public function getTable(): Collection
{ {
return $this->tables; return $this->table;
} }
public function addTable(Tables $tables): static public function addTable(Tables $table): static
{ {
if (!$this->tables->contains($tables)) { if (!$this->table->contains($table)) {
$this->tables->add($tables); $this->table->add($table);
} }
return $this; return $this;
} }
public function removeTable(Tables $tables): static public function removeTable(Tables $table): static
{ {
$this->tables->removeElement($tables); $this->table->removeElement($table);
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 $tables = null; private ?Tables $Table = null;
/** /**
* @var Collection<int, Utilisateurs> * @var Collection<int, Utilisateurs>
@ -65,14 +65,14 @@ class Reservations
return $this; return $this;
} }
public function getTables(): ?Tables public function getTable(): ?Tables
{ {
return $this->tables; return $this->Table;
} }
public function setTable(?Tables $tables): static public function setTable(?Tables $Table): static
{ {
$this->tables = $tables; $this->Table = $Table;
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 $Libelle = null; private ?string $Libellé = null;
#[ORM\ManyToOne(inversedBy: 'statutTables')] #[ORM\ManyToOne(inversedBy: 'statutTables')]
private ?Tables $tables = null; private ?Tables $Table = null;
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; return $this->id;
} }
public function getLibelle(): ?string public function getLibellé(): ?string
{ {
return $this->Libelle; return $this->Libellé;
} }
public function setLibelle(string $Libelle): static public function setLibellé(string $Libellé): static
{ {
$this->Libelle = $Libelle; $this->Libellé = $Libellé;
return $this; return $this;
} }
public function getTables(): ?Tables public function getTable(): ?Tables
{ {
return $this->tables; return $this->Table;
} }
public function setTable(?Tables $tables): static public function setTable(?Tables $Table): static
{ {
$this->tables = $tables; $this->Table = $Table;
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, inversedBy: 'tables')] #[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'table')]
private Collection $Clients; private Collection $Clients;
/** /**
* @var Collection<int, Reservations> * @var Collection<int, Reservations>
*/ */
#[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')] #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Table')]
private Collection $reservations; private Collection $reservations;
/** /**
* @var Collection<int, StatutTables> * @var Collection<int, StatutTables>
*/ */
#[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')] #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Table')]
private Collection $statutTables; private Collection $statutTables;
/** /**
* @var Collection<int, Utilisateurs> * @var Collection<int, Utilisateurs>
*/ */
#[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tables')] #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'table')]
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 getClients(): Collection public function getClient(): 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->getTables() === $this) { if ($reservation->getTable() === $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->getTables() === $this) { if ($statutTable->getTable() === $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 $tables; private Collection $table;
public function __construct() public function __construct()
{ {
$this->Reservation = new ArrayCollection(); $this->Reservation = new ArrayCollection();
$this->tables = new ArrayCollection(); $this->table = 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 getTables(): Collection public function getTable(): Collection
{ {
return $this->tables; return $this->table;
} }
public function addTable(Tables $tables): static public function addTable(Tables $table): static
{ {
if (!$this->tables->contains($tables)) { if (!$this->table->contains($table)) {
$this->tables->add($tables); $this->table->add($table);
} }
return $this; return $this;
} }
public function removeTable(Tables $tables): static public function removeTable(Tables $table): static
{ {
$this->tables->removeElement($tables); $this->table->removeElement($table);
return $this; return $this;
} }

View File

@ -42,8 +42,6 @@ class AddUserFormType 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,41 +0,0 @@
<?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

@ -1,47 +0,0 @@
<?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

@ -1,32 +0,0 @@
<?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,
]);
}
}

View File

@ -1,43 +0,0 @@
<?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

@ -1,34 +0,0 @@
<?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

@ -1,40 +0,0 @@
<?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

@ -1,25 +0,0 @@
<?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

@ -1,32 +0,0 @@
<?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,
]);
}
}

View File

@ -1,37 +0,0 @@
<?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,8 +39,6 @@ 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

@ -0,0 +1,58 @@
<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,8 @@
<div id="tableModal" class="modal">
<div class="modal-content">
<span class="close" data-modal="tableModal">&times;</span>
<h2>Gestion Table</h2>
<!-- Contenu de la modal Gestion Table -->
<p>Ajouter ici le formulaire ou les informations pour gérer les tables.</p>
</div>
</div>

View File

@ -0,0 +1,8 @@
<div id="userModal" class="modal">
<div class="modal-content">
<span class="close" data-modal="userModal">&times;</span>
<h2>Gestion Utilisateur</h2>
<!-- Contenu de la modal Gestion Utilisateur -->
<p>Ajouter ici le formulaire ou les informations pour gérer les utilisateurs.</p>
</div>
</div>

View File

@ -23,6 +23,6 @@
<div class="container"> <div class="container">
<h1>Accès Refusé</h1> <h1>Accès Refusé</h1>
<p>Vous n'avez pas les permissions nécessaires pour accéder à cette page.</p> <p>Vous n'avez pas les permissions nécessaires pour accéder à cette page.</p>
<a href="{{ path('app_login') }}" class="btn btn-primary">Se connecter</a> <a href="{{ path('app_login') }}" class="btn btn-primary">Ce connecter</a>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,4 +0,0 @@
<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

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

View File

@ -1,13 +0,0 @@
{% 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

@ -1,47 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,13 +0,0 @@
{% 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

@ -1,46 +0,0 @@
{% 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

@ -1,15 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,44 +0,0 @@
{% 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

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

View File

@ -0,0 +1,113 @@
{% extends 'base.html.twig' %}
{% block title %}Gestion User{% endblock %}
{% block body %}
<style>
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: left;
width: 65%;
word-wrap: break-word; /* Gère les débordements */
}
.password {
display: flex;
flex-direction: column;
width: 100%;
text-align: left;
}
/* 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%;
}
}
</style>
<p>Test</p>
{# {{ form_start(form) }}#}
{# <div> #}
{# {{ form_row(form.UserIdentifier) }}#}
{# {{ form_row(form.Password) }}#}
{# {{ form_row(form.Nom) }}#}
{# {{ form_row(form.Prenom) }}#}
{# {{ form_row(form.Roles) }}#}
{# </div>#}
{# {{ form_end(form) }}#}
{# <form id="UpdateUser" action="{{ path('update-user', { 'id': app.user.id }) }}" method="post">#}
{# <div id="InformationUser">#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Nom :</span>#}
{# <span class="user-info-value">{{ app.user.nom }}</span>#}
{# <input type="text" id="nom" name="nom" value="{{ app.user.nom }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Prénom :</span>#}
{# <span class="user-info-value">{{ app.user.prenom }}</span>#}
{# <input type="text" id="prenom" name="prenom" value="{{ app.user.prenom }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Email :</span>#}
{# <span class="user-info-value">{{ app.user.userIdentifier }}</span>#}
{# <input type="text" id="email" name="email" value="{{ app.user.userIdentifier }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <div id="passwordConfirmDiv" class="password-confirm-div">#}
{# <label for="confirm_password" class="user-info-label">Confirmer ou modifier le mot de passe :</label>#}
{# <input type="password" id="confirm_password" name="confirm_password" class="user-info-input" placeholder="Mot de passe">#}
{# </div>#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Roles :</span>#}
{# <span class="user-info-value">{{ app.user.getRolesAsString() }}</span>#}
{# <input type="checkbox" id="roles" name="roles" value="{{ app.user.getRolesAsString() }}" class="user-info-input" readonly>#}
{# </div>#}
{# <div class="btn">#}
{# <button type="submit" class="submit-button">Mettre à jour</button>#}
{# </div>#}
{# </div>#}
{# </form>#}
{% endblock %}

View File

@ -1,136 +0,0 @@
{% extends 'base.html.twig' %}
{% block head %}
<head>
<meta charset="UTF-8">
<title>{% block title %}Accueil{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
</head>
{% endblock %}
{% block stylesheets %}
<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/GestionUtilisateurs/GestionUtilisateurs.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<style>
</style>
<!-- Top Bar -->
<div class="top-bar">
<div>
Bonjour, {{ app.user.prenom }}
</div>
</div>
<!-- Left Menu -->
<div class="left-background">
<img class="LogoHegre" src="{{ asset('asset/image/LogoHegre.png') }}">
{% if is_granted('ROLE_ADMIN') %}
<div class="nav-bar">
<ul>
<li>
<div class="btn-custom btn-gestion-utilisateurs icon-container" >
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
<span>Gérer Utilisateur</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
<span>Gérer Table</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('bx:food-menu') }}</i>
<span>Gestion Menu</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('lsicon:badge-promotion-outline') }}</i>
<span>Gestion Promotion</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
<span>Voir tendances</span>
</div>
</li>
</ul>
</div>
{% elseif is_granted('ROLE_CUISINIER') %}
<div class="nav-bar">
<ul>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('icon-park-outline:view-list') }}</i>
<span>Liste des commandes</span>
</div>
</li>
</ul>
<ul>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
<span>Je sais pas encore</span>
</div>
</li>
</ul>
</div>
{% elseif is_granted('ROLE_SERVEUR') %}
<div class="nav-bar">
<ul>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('fluent-mdl2:reservation-orders') }}</i>
<span>Réservation</span>
</div>
</li>
</ul>
<ul>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('icon-park-outline:view-list') }}</i>
<span>Commande</span>
</div>
</li>
</ul>
</div>
{% endif %}
<div class="Information-perso">
<div class="btn-info-compte icon-container">
<i class="icon-medium"> {{ ux_icon('ph:user-circle-fill') }}</i>
<span>Compte</span>
</div>
<div class="btn-info-exit icon-container">
<a href="{{ path('app_logout') }}" class="icon-medium">
{{ ux_icon('iconamoon:exit-bold') }}
</a>
</div>
</div>
</div>
<div id="container_modal">
<!-- Contenu par défaut, ou vous pouvez laisser vide -->
</div>
<script>
</script>
<!-- Include modals -->
{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/Compte/CompteModal.js') }}" defer></script>
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
{% endblock %}

View File

@ -1,128 +0,0 @@
{% extends 'base.html.twig' %}
{% block head %}
<head>
<meta charset="UTF-8">
<title>{% block title %}Index FestinHegre!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
</head>
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/GestionUser.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<style>
</style>
<!-- Top Bar -->
<div class="top-bar">
<div>
Bonjour, {{ app.user.prenom }}
</div>
<div class="user-role">
Rôle : {{ app.user.getRolesAsString() }}
</div>
</div>
<!-- Left Menu -->
<div class="left-background">
<img class="LogoHegre" src="{{ asset('asset/image/LogoHegre.png') }}">
<div class="nav-bar">
<ul>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
<span data-modal="userModal">Gérer Utilisateur</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
<span data-modal="tableModal">Gérer Table</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('bx:food-menu') }}</i>
<span>Gestion Menu</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('lsicon:badge-promotion-outline') }}</i>
<span>Gestion Promotion</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
<span>Voir tendances</span>
</div>
</li>
</ul>
</div>
<div class="Information-perso">
<div class="btn-info-compte icon-container">
<i class="icon-medium"> {{ ux_icon('ph:user-circle-fill') }}</i>
<span>Compte</span>
</div>
<div class="btn-info-exit icon-container">
<a href="{{ path('app_logout') }}" class="icon-medium">
{{ ux_icon('iconamoon:exit-bold') }}
</a>
</div>
</div>
</div>
<div id="container_gestion_user">
<!-- Contenu par défaut, ou vous pouvez laisser vide -->
</div>
<script>
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);
});
}
});
</script>
<!-- Include modals -->
{% include 'Modals/gestionUtilisateurModal.html.twig' %}
{% include 'Modals/gestionTableModal.html.twig' %}
{% include 'Modals/gestionCompteModal.html.twig' %}
{% include 'Modals/gestionUtilisateurModal.html.twig' %}
{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/modal.js') }}"></script> <!-- Ajout du fichier JS -->
{% endblock %}

View File

@ -3,14 +3,14 @@
{% block head %} {% block head %}
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{% block title %}Cuisine{% endblock %}</title> <title>{% block title %}Index FestinHegre!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>"> <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet"> <link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
</head> </head>
{% endblock %} {% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/index.css') }}"> <!-- Ajout du fichier CSS --> <link rel="stylesheet" href="{{ asset('css/modal.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %} {% endblock %}
{% block body %} {% block body %}
@ -26,15 +26,6 @@
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
display: none; display: none;
} }
a{
text-decoration: none;
}
a:visited {
color: initial;
}
</style> </style>
<!-- Top Bar --> <!-- Top Bar -->
@ -103,7 +94,7 @@
</div> </div>
<script> <script>
document.querySelector('.btn-info-Compte').addEventListener('click', function(event) { document.querySelector('.btn-info-compte').addEventListener('click', function(event) {
event.preventDefault(); event.preventDefault();
const contentContainer = document.getElementById('container-gestion-user'); const contentContainer = document.getElementById('container-gestion-user');
@ -135,7 +126,10 @@
</script> </script>
<!-- Include modals --> <!-- Include modals -->
{% include 'Modals/gestionUtilisateurModal.html.twig' %}
{% include 'Modals/gestionTableModal.html.twig' %}
{% include 'Modals/gestionCompteModal.html.twig' %} {% include 'Modals/gestionCompteModal.html.twig' %}
{% include 'Modals/gestionUtilisateurModal.html.twig' %}
{% endblock %} {% endblock %}

View File

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,51 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,51 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,43 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,42 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,23 +0,0 @@
{% 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

@ -1,41 +0,0 @@
{% 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

@ -1,15 +0,0 @@
{% 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

@ -1,29 +0,0 @@
{% 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

@ -1,4 +0,0 @@
<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

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

View File

@ -1,21 +0,0 @@
{% 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

@ -1,39 +0,0 @@
{% 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

@ -1,22 +0,0 @@
{% 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 %}

Some files were not shown because too many files have changed in this diff Show More