From ffe59073e1e26ab08a19403e4279b3b752a778ab Mon Sep 17 00:00:00 2001 From: ExostFlash <120869320+ExostFlash@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:52:51 +0100 Subject: [PATCH] =?UTF-8?q?Modif=20beaut=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- migrations/Version20231127141946.php | 41 ++++++++++++ public/css/style.css | 41 ++++++++++++ src/Entity/User.php | 2 +- templates/avis/new.html.twig | 8 ++- templates/avis/show.html.twig | 46 +++++++------- templates/base.html.twig | 36 +++++++++++ templates/home/index.html.twig | 5 +- templates/menu_chef/edit.html.twig | 12 ++-- templates/menu_chef/new.html.twig | 10 ++- templates/menu_chef/show.html.twig | 68 ++++++++++---------- templates/resto_admin/edit.html.twig | 10 ++- templates/resto_admin/new.html.twig | 8 ++- templates/resto_admin/show.html.twig | 50 ++++++++------- templates/ticket_service/edit.html.twig | 10 ++- templates/ticket_service/new.html.twig | 8 ++- templates/ticket_service/show.html.twig | 58 +++++++++-------- templates/user_admin/new.html.twig | 8 ++- templates/user_admin/show.html.twig | 84 +++++++++++++------------ 18 files changed, 335 insertions(+), 170 deletions(-) create mode 100644 migrations/Version20231127141946.php diff --git a/migrations/Version20231127141946.php b/migrations/Version20231127141946.php new file mode 100644 index 0000000..03a4072 --- /dev/null +++ b/migrations/Version20231127141946.php @@ -0,0 +1,41 @@ +addSql('CREATE TABLE avis (id INT AUTO_INCREMENT NOT NULL, note INT DEFAULT NULL, com VARCHAR(255) NOT NULL, id_ticket INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE menu (id INT AUTO_INCREMENT NOT NULL, entre VARCHAR(255) DEFAULT NULL, plat VARCHAR(255) DEFAULT NULL, dessert VARCHAR(255) DEFAULT NULL, id_resto INT NOT NULL, id_users INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE resa (id INT AUTO_INCREMENT NOT NULL, id_resto INT NOT NULL, nb_user INT NOT NULL, date_heur DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE resto (id INT AUTO_INCREMENT NOT NULL, pay VARCHAR(255) NOT NULL, ville VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE ticket (id INT AUTO_INCREMENT NOT NULL, id_resto INT NOT NULL, id_users INT NOT NULL, payement VARCHAR(50) NOT NULL, id_menu INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(200) NOT NULL, fullname VARCHAR(200) NOT NULL, address VARCHAR(255) DEFAULT NULL, id_resto INT DEFAULT NULL, grade VARCHAR(50) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE avis'); + $this->addSql('DROP TABLE menu'); + $this->addSql('DROP TABLE resa'); + $this->addSql('DROP TABLE resto'); + $this->addSql('DROP TABLE ticket'); + $this->addSql('DROP TABLE user'); + } +} diff --git a/public/css/style.css b/public/css/style.css index 2821826..3091da1 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -4,3 +4,44 @@ body .center { width: 95%; font: 18px/1.5 sans-serif; } + +nav { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px; +} + +.logo-image, +.account-image { + width: 50px; /* Ajustez la taille des images */ + height: 50px; /* Ajoutez cette propriété pour maintenir la proportion */ + object-fit: cover; /* Pour ajuster l'image sans déformer la proportion */ + border-radius: 50%; /* Pour un effet de cercle */ +} + +.user-account { + position: relative; + display: inline-block; +} + +.hover-text { + display: none; + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + padding: 10px; + background-color: #18232c; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); +} + +.user-account:hover .hover-text { + display: block; +} + +.list { + display: flex; + flex-direction: column; + align-items: center; +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 69702c5..0f6588c 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -45,7 +45,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?int $id_resto = null; #[ORM\Column(length: 50, nullable: true)] - private ?string $grade = "client"; + private ?string $grade = "Client"; public function getId(): ?int { diff --git a/templates/avis/new.html.twig b/templates/avis/new.html.twig index 62f762d..2f4f012 100644 --- a/templates/avis/new.html.twig +++ b/templates/avis/new.html.twig @@ -3,9 +3,13 @@ {% block title %}New Avis{% endblock %} {% block body %} +

Create new Avis

- {{ include('avis/_form.html.twig') }} +
+ {{ include('avis/_form.html.twig') }} - back to list + back to list +
+
{% endblock %} diff --git a/templates/avis/show.html.twig b/templates/avis/show.html.twig index a4b43ed..6aacc18 100644 --- a/templates/avis/show.html.twig +++ b/templates/avis/show.html.twig @@ -3,28 +3,32 @@ {% block title %}Avis{% endblock %} {% block body %} +

Avis

- - - - - - - - - - - - - - - - - - - -
Id{{ avi.id }}
Note{{ avi.note }}
Com{{ avi.com }}
Id_ticket{{ avi.idTicket }}
+
+ + + + + + + + + + + + + + + + + + + +
Id{{ avi.id }}
Note{{ avi.note }}
Com{{ avi.com }}
Id_ticket{{ avi.idTicket }}
- back to list + back to list +
+
{% endblock %} diff --git a/templates/base.html.twig b/templates/base.html.twig index bb1d62a..65d9b17 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -14,6 +14,42 @@ {% endblock %} + + {% block body %}{% endblock %} diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 81e477a..9d65d69 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -5,10 +5,9 @@ {% block body %}
-

Bienvenue chez McDoPlus !

{% if not app.user %} -

compte utilisateur c'est ici

+

Bienvenue chez McDoPlus !

Menu par Resto :
{% else %} -

Laisser un avis ici

+

Salut {{ app.user.email }}

Réserver/Commander :